在A、B单元起各有10个压缩型BCD数,求其和存于C单元起的地址中。_百度知...
发布网友
发布时间:2024-10-22 02:26
我来回答
共1个回答
热心网友
时间:2024-11-17 19:26
【答案】:DATA SEGMENT
A DB 11h,22h,33h,44h,55h,66h,77h,88h,99h,38h
B DB 12h,23h,34h,45h,56h,67h,78h,89h,90h,91h
C DB 11DUP(0)
N EQU 10
DATA ENDS
CODES SEGMENT
ASSUME CS: CODE,DS: DATA
START: MOV AX,DATA
MOV DS,AX
LEA SI,A ;置数据区地址指针
LEA DI,B
LEA BX,C ;置结果地址指针
MOV CX,N ;置计数初值
CLC
NEXT: MOV AL,[SI] ;取加数
ADC AL,[DI]
DAA
MOV [BX],AL ;存结果
INC SI ;调整指针
INC DI
INC BX
LOOP NEXT
MOV AL,0 ;存进位
ADC AL,0
MOV [BX],AL
MOV AH,4CH
INT 21H
CODE ENDS
END START