DATA SEGMENT BUF1 DB 94H BUF2 DB 23H SUM DB 00H DATA ENDS CODE SEGMENT ASSUME CS:CODE,DS:DATA START:MOV AX,DATA MOV DS,AX MOV AL,BUF1 ADD AL,BUF2 MOV AH,4CH INT 21H CODE ENDS END START改写成压缩bcd码的计算
时间: 2023-12-27 14:03:04 浏览: 115
DATA SEGMENT
DATA SEGMENT
BUF1 DB 94H
BUF2 DB 23H
SUM DB 00H
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA
START:
MOV AX,DATA
MOV DS,AX
; 压缩BUF1和BUF2中的BCD码并将结果存入SUM
MOV AL,BUF1
DAA ; 压缩BCD码
ADD AL,BUF2
DAA ; 压缩BCD码
MOV SUM,AL
; 调用DOS的退出程序中断
MOV AH,4CH
INT 21H
CODE ENDS
END START
阅读全文