[fpc-devel] Successful implementation of inline supportforpureassembler routines on x86

Marģers . margers.roked at inbox.lv
Sun Mar 17 23:47:43 CET 2019


 

----- Reply to message -----
Subject: Re: [fpc-devel] Successful implementation
of inline supportforpureassembler routines on x86
Date: 2019. gada 18. marts 00:28:10
From:  J. Gareth Moreton <gareth at moreton-family.com>
To:  FPC developers' list
<fpc-devel at lists.freepascal.org>

>   To use the integer clamp function as an
example (if x < 0 then x := 0):

> { Microsoft x64 calling convention... X is in ECX }
> function ClampInt(X: LongInt): LongInt;
assembler; nostackframe; inline;
> asm
>   XOR EAX, EAX
>   TEST ECX, ECX
>   CMOVG EAX, ECX
> end;

try code:
y:=0;
if x < 0 then x:=y;




More information about the fpc-devel mailing list