Assembly program for Simple 2 16bit number addition using registers

; 16 BIT ADDITION
ORG 0000H      ;
; SAY R7 HAS LOWER BYTE 34
; R6 HAS HIGHER BYTE 24
; MAKING NUMBER 2434
MOV R7, #34H   ;
MOV R6, #24H   ;
; ANOTHER NUMBER SAY 3345
; WITH R5 LOWER BYTE 45
; R4 HIGHER BYTE 33
MOV R5,#45H    ;
MOV R4, #33H   ;
; NOW ADDING
MOV A, R5      ;
; ADDING LOWER BYTE
ADD A , R7     ;
MOV R3, A      ;
; R3 BEING LOWER BYTE OF ANSWER
MOV A, R6      ;
; NOW ADD WITH CARRY
ADDC A, R4     ;
MOV R2,A       ;
END

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s