Answer to Question #165375 in Assembler for Anna

Question #165375

Write an assembly program for add of two eight bit no. at

4000H=2CH and 4001H=30H and save result at 4002H



1
Expert's answer
2021-02-21T19:50:41-0500
    ; 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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS