Inline assembly question

Guillaume Piolat contact at spam.com
Mon Nov 13 20:18:07 UTC 2017


On Monday, 13 November 2017 at 18:40:42 UTC, Basile B. wrote:
> TBH I wonder if this is not worth a enhancement (or even a DIP)
> to have in asm blocks a special alias syntax...
>
> {
>     asm
>     {
>         version(...)
>         {
>            alias First = RDI;
>            alias Second = RSI;
>            // ...
>         }
>         else
>         {
>            alias First = RCX;
>            alias Second = RDX;
>         }
>         mov First, Second;
>         call aFunctionWithOneParam; // called with 2nd parent 
> param as 1st param
>     }
> }

Something that happen quite frequently is duplicating very 
similar blocks of assembly between x86 32-bit and 64-bit. However 
in almost all cases the differences are small and if "version" 
blocks would be accepted, it would be enough.


More information about the Digitalmars-d-learn mailing list