[DUG] Assembler
Todd
todd.martin.nz at gmail.com
Thu Sep 23 15:05:37 NZST 2010
Hi Paul
>> 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.
>>
> Well, there are no casts in assembler per se - it's just a useful
> shorthand for calculating a member offset that will stay correct even if
> you rearrange the TSparseList class declaration which is a very nice
> BASM feature.
>
> So, assuming the offset to the FList member from the start of a
> TSparseList instance is 12 bytes (for arguments sakes), in AT&T syntax
> that would be:
>
> movl 12(%eax), %eax
So I could do something like this?
i := integer(@TSparseList(nil).FList);
movl i(%eax), %eax
> Purely out of curiousity, but why do you want the AT&T syntax
> equivalent? Is this for part of a Lazarus port?
>
You got it in one.
> Also, I gather Freepascal will translate intel BASM syntax to AT&T
> syntax before passing it down the GNU toolchain. Maybe you could capture
> the intermediate result?
>
>
The x86_64 version of FPC doesn't seem to like the BASM syntax,
otherwise I wouldn't touch it. Or at least I can't figure out how to
force FPC to compile it. The directive {$asmmode intel} doesn't seem to
work.
> 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