8085 Programming : Adding 2 Hexa-Decimal nos with carry
![8085 Programming 8085 Programming](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNJqxG7jvcj0CSjWEVB0Q_IspgxU3r3DpD4F71TFLC5f2g7FwS3F9Q9FmYfvMz1kPP_8gVWO_wc6FfIxtFm_1M4Iz1OmaAzJHb2z9z2SYemNRju98YC_kCXYtIUEJJgYbrklz5zDIIBUE/s1600/8085.jpg)
LDA 2200H
MOV C,A ; Initialize counter
LXI H, 2201H ; Initialize pointer
SUB A ; Sum low = 0
MOV B,A ; Sumhigh = 0
BACK: ADD M ; Sum = sum + data
JNC SKIP
INR B ; Add carry to MSB of SUM
SKIP: INX H ; Increment pointer
DCR C ; Decrement counter
JNZ BACK ; Check if counter 0 repeat
STA 2300H
MOV A,B ; Store lower byte
STA 2301H ; Store higher byte
HLT ; Terminate program execution
Comments
Post a Comment