On Wed, 30 Mar 2016, Graeme Geldenhuys wrote:

On 2016-03-30 11:58, Michael Van Canneyt wrote:
The code is there to differentiate between the windows ABI and other ABIS,
which specify in what register the AValue parameter is passed.

Ah okay. One could possibly write it in a less ambiguous way, as
follows? No IFDEF's needed.

function SwapEndian(const AValue: DWord): DWord; assembler; nostackframe;
asm
 movl AValue, %eax
 bswap %eax
end;

I am not proficient enough in the assembler parts of the compiler to comment
on this. Maybe one of the compiler people knows why it is the way it is...

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to