Find the memory location of variables using assembly language -
hello m new assembly language. trying memory location variables m using dosbox , masm compilor here code
.model small .stack 100h .data vara byte 10 ;address ds:xxxx varb byte 0bh ;address ds:xxxx+1 varc word ? vard sbyte ? vare dword ? arr byte 20 dup(?) varf sword 010b arrb word 10 dup(?) varz byte 0 .code main proc mov ax,@data mov ds,ax mov ax,offset vara mov ah,09 int 21h mov ax,offset varb mov ah,09 int 21h mov ax,offset varc mov ah,09 int 21h mov ax,offset vard mov ah,09 int 21h mov ax,offset vare mov ah,09 int 21h mov ax,offset arr mov ah,09 int 21h mov ax,offset varf mov ah,09 int 21h mov ax,offset arrb mov ah,09 int 21h mov ax,offset varz mov ah,09 int 21h mov ah,4ch int 21h main endp end main
how can find memory address these variables? u can see error in image
use offset
modifier, eg:
mov ax, offset vara
to load address of vara
ax
register. can use lea
instruction achieve same thing:
lea ax, vara
Comments
Post a Comment