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.
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.
Comments
Leave a comment