标签:hello int tar 微机 hex star tac fse add
STACK1 SEGMENT STACK
DW 256 DUP(?)
STACK1 ENDS
DATA SEGMENT
MES DB ‘Press any key to exit!‘,0AH,0DH,0AH,0DH,‘$‘
MES1 DB ‘SHOW A AS HEX:‘,0AH,0DH,‘$‘
SD DB ‘a‘
DATA ENDS
CODE SRGMENT
ASSUME CS:CODE,DS:DATA
START:MOVE AX,DATA
MOV DS,AX
MOV DX,OFFSET MES
MOV AH,09H
INT 21H
MOV DX,OFFSET MES1
MOV AH,09H
INT 21H
MOV SI,OFFSET SD
MOV AL,DS:[SI]
AND AL,0F0H
MOV CL,4
SHR AL,CL
CMP AL,0AH
JB C2
ADD AL,07H
C2:ADD AL,30H
MOV DL,AL
MOV AH,02H
INT 21H
MOV AL,DL:[SI]
AND AL,0FH
CMP AL,0AH
JB C3
ADD AL,07H
C3:ADD AL,30H
MOV DL,AL
MOV AH,02H
INT 21H
KEY:MOV AH,1
INT 16H
JZ KEY
MOV AX,4C00H
INT 21H
CODE ENDS
END START
DATA SEGMENT
MSR DB "HELLO,WORLD!$"
LEN EQU $- MSR
DATA ENDS
EXDA SEGMENT
MSD DB LEN DUP(?)
EXDA ENDS
MYSTACK SEGMENT STACK
DW 20 DUP(?)
MYSTACK ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:EXDA
START: MOV AX,DATA
MOV DS,AX
MOV AX,EXDA
MOV ES,AX
MOV SI,OFFSET MSR
MOV DI,OFFSET MSD
MOV CX,LEN
NEXT: MOV AL,[SI]
MOV ES:[DI],AL
INC SI
INC DI
DEC CX
JNZ NEXT
PUSH ES
POP DS
MOV DX,OFFSET MSD
MOV AH,9
INT 21H
KEY: MOV AH,1
INT 16H
JZ KEY
MOV AX,4C00H
INT 21H
CODE ENDS
END START
标签:hello int tar 微机 hex star tac fse add
原文地址:http://www.cnblogs.com/s1104119631/p/7881587.html