Inline Assembler Problems_(re)

Thu, 12 Jun 1997 23:01:44 +0200 (MET DST)


According to PredatorZeta:
> 
> I receive the same invalid 386 instruction error message.
> Mmmh...I investigate on this. I have found this (probably) bug in the
> "as":
> 
> movl $_TheArray(,%%esi,4), %%eax
> 
> and
> 
> movl %%eax, _TheArray(,%%esi,4)
> 
> is accepted from the assembler without any problems. But sadly:
> 
> movl %%eax, $_TheArray(,%%esi,4)
> 
> is refused. If this isn't a bug, anyone know the reasons?

I do not really know, but I guess that it's the following:
The `$' denotes a constant value, something without a `$' denotes
a memory reference.  It is okay to move the constant `$_TheArray'
(i.e. the ADDRESS of `_TheArray') into a register, whereas it is
not possible to store the value of the %%eax register in the
constant `$_TheArray'.  But if it is so, I have problems to imagine
what "movl $_TheArray(,%%esi,4), %%eax" means ... except if the
`movl' is silently translated to a `leal'.

Could please somebody check it out?

    Peter

 Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970510] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es