Write an assembly program for add of two eight bit no. at
4000H=2CH and 4001H=30H and save result at 4002H
; Writing two numbers into the adresses 4000H=2CH and 4001H=30H
mov bx, 0x4000
mov byte ptr [bx], 2CH
mov bx, 0x4001
mov byte ptr [bx], 30H
; Initializing the accumulator to save the sum
mov ax, 0
; Adding the first number
mov bx, 0x4000
mov al, byte ptr [bx]
; Adding the second number
mov bx, 0x4001
add al, byte ptr [bx]
; Saving the result at 4002H
mov bx, 0x4002
mov byte ptr [bx], al
Comments
Leave a comment