The following works, though I couldn't get Self to work either, so maybe that's a shortcoming of the AT&T reader.
procedure TTest.GetHi(var A: LongInt); assembler;
asm
mov TTest.Hi(%eax), %eax
mov %eax, A
end;
That code compliles ok, but it doesn't run correctly for me (this is my older 32bit Windows computer with fpc 2.6.0). It does not transfer the correct value to the "var A" variable.
I'm not 100% certain, but I think that the line "mov %eax, A" actually just does the same as "mov %eax, %edx". That is, a register to register move instead of register to memory.
Hmm, right... Dang it... Probably the AT&T reader would deserve some extensions as well...
That code compliles ok, but it doesn't run correctly for me (this is my older 32bit Windows computer with fpc 2.6.0). It does not transfer the correct value to the "var A" variable.
I'm not 100% certain, but I think that the line "mov %eax, A" actually just does the same as "mov %eax, %edx". That is, a register to register move instead of register to memory.
If () is analog of [] in AT&T syntax, then I expect "mov %eax,(A)" to work, but it looks like, that AT&T implementation is even less compatible with Delphi, than Intel one.
Of course it's less compatible, because Delphi does not support the AT&T syntax
at all. So the implementation of such things is completely up to us and probably wasn't that needed. I'll need to check the readers of the other platforms if they allow for more already and if those could be used for the x86 one as well...