DATAS SEGMENT
X DB 1AH,0BAH,23H,45H,67H,89H,0AH,0BAH
COUNT EQU $ - X
Y DB 2DH,0EFH,09H,87H,65H,43H,2DH,0EFH
Z DB COUNT DUP (0)
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES, DS:DATAS
START:
MOV AX, DATAS
MOV DS, AX
;---------------------------
;兩個多位16進位制數相加
;樓主所要求的,就是下面這些:
MOV BX, 0
MOV CX, COUNT
CLC
AGAIN:
MOV AL, X[BX]
ADC AL, Y[BX]
MOV Z[BX], AL
INC BX
LOOP AGAIN
EXTI: ;結束程式
MOV AH, 4CH
INT 21H
CODES ENDS
END START
DATAS SEGMENT
X DB 1AH,0BAH,23H,45H,67H,89H,0AH,0BAH
COUNT EQU $ - X
Y DB 2DH,0EFH,09H,87H,65H,43H,2DH,0EFH
Z DB COUNT DUP (0)
DATAS ENDS
CODES SEGMENT
ASSUME CS:CODES, DS:DATAS
START:
MOV AX, DATAS
MOV DS, AX
;---------------------------
;兩個多位16進位制數相加
;樓主所要求的,就是下面這些:
MOV BX, 0
MOV CX, COUNT
CLC
AGAIN:
MOV AL, X[BX]
ADC AL, Y[BX]
MOV Z[BX], AL
INC BX
LOOP AGAIN
;---------------------------
EXTI: ;結束程式
MOV AH, 4CH
INT 21H
CODES ENDS
END START