南邮汇编实验1(仅供参考)
程序员文章站
2022-06-20 20:25:06
...
(实验1.2)
DATA SEGMENT
SUM DB ?,?
MESG DB '25+9='
DB 0,0,'$'
N1 DB 9,0F0H
N2 DW 25
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
BEG:MOV AX,DATA
MOV DS,AX
MOV BX,OFFSET SUM
MOV AH,N1
MOV AL,BYTE PTR N2
ADD AH,AL
MOV BYTE PTR [BX],AH
MOV SI,OFFSET MESG
CALL CHANG
MOV AH,9
MOV DX,OFFSET MESG
INT 21H
MOV AH,4CH
INT 21H
CHANG PROC
LAST:CMP BYTE PTR [BX],10
JC NEXT
SUB BYTE PTR [BX],10
INC BYTE PTR [SI+5]
JMP LAST
NEXT:MOV AH,BYTE PTR [BX]
ADD BYTE PTR [SI+6],AH
ADD BYTE PTR [SI+5],30H
ADD BYTE PTR [SI+6],30H
RET
CHANG ENDP
CODE ENDS
END BEG