Answer to Question #260838 in Assembler for yuuhij

Question #260838

write a program emu8086 take four digit number and write it to next memory address. Consider which memory address you should be using according to the answer of the first question.


1
Expert's answer
2021-11-04T00:24:54-0400
data segment

   x    dw  1234h

   y    dw  ?

ends

 

code segment

start:

; set segment registers:

    mov ax, data

    mov ds, ax

 

    lea si, x         ; address of four digit number

    mov ax, [si]  ; ax = four digit number

    add si, 2       ; next address

    mov [si], ax  ; save four digit number to next memory address

 

    mov ax, 4c00h ; exit to operating system.

    int 21h   

ends

 

end start ; set entry point and stop the assembler.

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