Inline Assembler Problems

Mon, 09 Jun 1997 22:01:42 +0800



I am -trying- to port a program to GPC which uses some inline INTEL
assembler. Its protected mode already so it should be easy to port... Well,
that what I thought!!!

I've hit a little snag - I cant convert one type of Intel instruction to the
AT&T format. Take a look at the example below:

    Var
       TheArray : Array[0..99] Of LongInt; {32-bit}
    Begin
        Asm
            ... Code ...
            mov esi,Index
            mov eax,[TheArray+esi*4]  { THIS is the offending opcode }
            ... Code ...
        End;
    End.

I couldnt figure out how to code the memory reference! I cannot move the
address of 'TheArray' into a register and use that because I dont have any
available registers - the code is already written (not by me) and I DO NOT
want to rewrite it.

The current code copiles OK using TMT Pascal (ugh). So Im positive that its
not an illegal memory reference.

Could somebody please help me... Thanks
 ________________________
|  _)        | |             e-mail: bernie@icenet.com.au
|___)ernhard |_|schirren             ptschirrenb@cc.curtin.edu.au
                             www:    www.geocities.com/CollegePark/Quad/8070/


Bernhard Tschirren (bernie@icenet.com.au)

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