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

enter image description here

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

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -