Where is there documentation on how to write inline asm?

pineapple meapineapple at gmail.com
Thu Nov 15 21:54:53 UTC 2018


On Thursday, 15 November 2018 at 21:48:46 UTC, kinke wrote:
> The MS docs are complete IIRC. The pointer to the pre-allocated 
> result of your 16-bytes struct is passed in RCX.
> If unsure, just reverse-engineer what you need: type it down in 
> normal D and analyze the generated assembly. You can even do so 
> online via run.dlang.io (https://run.dlang.io/is/rhsDBF); just 
> select LDC and add `-mtriple=x86_64-pc-windows-msvc` to 
> generate Win64 assembly.
> Note that run.dlang.io displays AT&T-style asm, not the Intel 
> one. You can use LDC offline via `-output-s 
> -x86-asm-syntax=intel` to generate a .s file with Intel syntax.

When I tested by writing to the pointer given by RCX, the program 
didn't crash but I did get different values every time and never 
the ones I wanted.



More information about the Digitalmars-d-learn mailing list