Inline Assembler Problems_(re)

Sun, 4 May 1997 06:19:33 +0200


Hello, Bernhard Tschirren 
You wrote:

> 
> >     Var
> >        TheArray : Array[0..99] Of Integer; {32-bit}
> >     Begin
> >         Asm("
> >             ... Code ...
> >             movl  _Index, %esi                    (*you must double %
if
> you use Ext. Asm*)
> >             movl  $_TheArray(,esi,4), %eax
> >             ... Code ...
> >         ");
> >     End.
> 
> DOHHH! I am an idiot! In my code I had the two operands switched around!
The
> assembler was telling me that I was using an invalid 386 instruction. Is
the
> following really illegal?
> 
>    movl %eax,$_TheArray(,esi,4)

First of all: ESI must be preceding by an "%" symbol __ALSO__ if it is
between the brackets (have you get my doc?). Without this the assembler
always
will tell you that you was using an invalid 386 instruction. Are you sure
that 
your variables are __static__, too?

BTW I found a new real problem. With:

movl %%eax, $_TheArray(,%%esi,4)

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 LOVE the inline assembler, except for the 15 local label limit. I know
I
> can prefix locals with an 'L' except when the compiler inlines the
codeit
> creates duplicate labels. Is there any way around that?

In my doc i wrote that the labels can be from 0 to f only because I don't
use more
than 15 local labels at time. But of course, if you want, you can use for
example "16:" or "19:" for indicate a local label, and this work fine.

That's all folks!!

Cya, PrZ.
-- 
[<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<]
|  Codename: PrEdAtOr~Z;   Sex: Male;     Status: Free coder |
*              E-mail: predatorzeta@geocities.com                      *
|    URL: http://www.geocities.com/SiliconValley/Vista/6573      |
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]



PredatorZeta (predatorzeta@geocities.com)

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