Re: Problem with "mov" in GNU GAS



In message <87abkmra5y.fsf@xxxxxxxxxxxxxxxxxxxx>, Phil Carmody
<thefatphil_demunged@xxxxxxxxxxx> wrote:

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.

No that loads 0xf1234 or whatever happens to be at var into %ecx. THe bug
must be elsewhere.


.



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)
  • Memory Managers for Beginners 5
    ... mov ecx, ... function GrowAllocArray(var AllocArray: PAllocTypeArray; var AllocArraySize ...
    (borland.public.delphi.language.basm)
  • Re: Problem with "mov" in GNU GAS
    ... with mov command. ... but I'm assuming the var is in a ".data" ... var's address into ecx, i.e., 0xf1234. ... data16 - operand size override ...
    (comp.lang.asm.x86)
  • Re: Problem with "mov" in GNU GAS
    ... with mov command. ... but I'm assuming the var is in a ".data" ... var's address into ecx, i.e., 0xf1234. ... data16  - operand size override ...
    (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)