why is this

Posts 1–4 of 4 · Page 1 of 1
why is this
Code:
mov [from], [ofs]
gives compiler error, no matter how i cast the variables
can i not "mov" with operands as variables?
You can't do that.

Code:
mov [from], [ofs] ;wrong you can't move memory to memory.

You can do
mov eax, [ofs]
mov [from],eax
or 
push [ofs]
pop [from]
that's what i thought. thank's for confirming it
Quote Originally Posted by kibbles18 View Post
that's what i thought. thank's for confirming it
There's a way to move memory to memory, the movs (movsb/movsb) can do that:

movs takes two operands in (e)si and (e)di it then moves the contents from esi to edi:

Code:
mov esi, 401000h
mov edi, 401100h
movsw                  // moves a word (2 bytes) from [esi] to [edi]
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us