Assembler



              

- 2


0000 0005[ NUMBER_ONE DB NUMBER_LENGTH DUP (?)
??
]
0005 0005[ NUMBER_TWO DB NUMBER_LENGTH DUP (?)
??
]
;----------------------------------------
;
; (NUMBER_ONE NUMBER_TWO)
; NUMBER_TWO.
;----------------------------------------
 
000A START_ADD:
000A B9 0005 MOV CX, NUMBER_LENGTH ;
 
;-----
 
000D 8D 36 0004 R LEA SI, NUMBER_ONE + NUMBER_LENGTH - 1
0011 8D 3E 0009 R LEA DI, NUMBER_TWO + NUMBER_LENGTH - 1
 
0015 F8 CLC ;
 
0016 ADD_LOOP:
0016 8A 04 MOV AL, [SI] ;
0018 12 05 ADC AL, [DI] ;
001A 27 DAA ;
001B 88 05 MOV [DI], AL ;
001D 9C PUSHF ; (CF)
001E 4E DEC SI ;
001F 4F DEC DI ;
0020 9D POPF ;
0021 E2 F3 LOOP ADD_LOOP ;
 
0023 CODE ENDS
END
 
. 4.31 BCD
 

STD CLD. CLD ,
,
. STD ,

.