Re: Problem with "mov" in GNU GAS



junkoi <spamtrap@xxxxxxxxxx> writes:
Hello everybody,

I am writing a simple ASM code with GNU GAS. I am having some problems
with mov command. Please could anybody tell me why 2 lines (*) and
(**) are not equivalent?? (currently my code works as expected with
(**), but not with (*)

(My program is in 16bit mode)

---
var:
.long 0xf1234

So var is an address. At that address is reserved space for a
long, which is to be initialised to 0xf1234.

.code16gcc
movl var, %ecx // (*)

Here ecx now holds the address where the 0xf1234 above is stored.

movl $0xf1234, %ecx // (**)

But here ecx is set to the constant value 0xf1234.

Phil
--
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration

.



Relevant Pages

  • Re: Problem with "mov" in GNU GAS
    ... I am writing a simple ASM code with GNU GAS. ... with mov command. ... So var is an address. ... Here ecx now holds the address where the 0xf1234 above is stored. ...
    (comp.lang.asm.x86)
  • Re: Single multiplication
    ... > faster than the Asm code. ... > I move in scalar mode because ECX and EDX are 32 bits. ...
    (borland.public.delphi.language.basm)
  • Problem with "mov" in GNU GAS
    ... I am writing a simple ASM code with GNU GAS. ... with mov command. ...
    (comp.lang.asm.x86)
  • RE: problem using delphi dll in vc++
    ... That asm code is not solution for your problem. ... DWORD returnAdd; ... mov returnAdd, ecx ...
    (microsoft.public.vc.mfc)