[DUG] Assembler

Jolyon Smith jsmith at deltics.co.nz
Thu Sep 23 15:51:42 NZST 2010


This is still the *Delphi* list, right ?  <takes a look around>  LOL

(just kidding, this is fascinating stuff - keep it up)  :)


-----Original Message-----
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of Todd
Sent: Thursday, 23 September 2010 14:32
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] Assembler

Hi

I guess the thing that's throwing me here, is the use of [EAX].TSparseList
Is it casting the register as a pointer to a TSparseList instance, in 
order to get the offset to the FList field?
I'm wondering what the equivalent is in AT&T.

Todd.

> Hi all
>
>    
>> The following code appears in Grids.pas
>>
>> { Jump to TSparsePointerArray.ForAll so that it looks like it
>> was called
>>    from our caller, so that the BP trick works. }
>>
>> function TSparseList.ForAll(ApplyFunction: Pointer {TSPAApply}):
>> Integer; assembler;
>> asm
>>          MOV     EAX,[EAX].TSparseList.FList
>>          JMP     TSparsePointerArray.ForAll
>> end;
>>
>> Does anyone know what the first line does?
>>      
> It's using a BASM extension to calculate an offset per the
> TSparseList.Flist member and deference and load EAX from there. So given
> that EAX points to a TSparseList, afterwards EAX will point to the TList
> instance via the FList member.
>
>    
>> More importantly, does anyone know how to convert the Intel
>> style assembler code to AT&T?
>>      
> It's a non-trival change. The parameter order to instructions is often
> different and the sizing is all explicit.
>
> http://www.redhat.com/docs/manuals/enterprise/RHEL-3-Manual/gnu-assemble
> r/i386-syntax.html
>
> Cheers,
>    Paul.
>    

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
unsubscribe



More information about the Delphi mailing list