I am really confused about this one thing. I was following the book assembly programming for x86 processors and i was reading about the mov instructions and how it works. So, the author said that the following instruction is valid mov mem,reg.....basically moving a register value to a memory address.
Now this what i tried and i keep getting this error called invalid operand. Can someone please explain me what exactly is the error.
#fasm#
mov ax,[var] ;the value 67 is moved to the ax register works perfect
mov myvar,ax ; my aim is to move the value 67 to the memory location of ;myvar but then i keep getting this error - Invalid operand? why is that?
var: dw 67
myvar: dw ?
Can you try this:
myvar
is a constant holding the address of the memory allocated for the variable.[myvar]
instructs to fetch/store a value in memory at the address pointed bymyvar
So: