https://issues.dlang.org/show_bug.cgi?id=12891
--- Comment #5 from Martin Nowak <c...@dawg.eu> --- (In reply to Jonathan Dunlap from comment #4) Depending on the size of mod you need to use a smaller register. static if (V1.sizeof == 1) asm { mov AL, mod; } static if (V1.sizeof == 2) asm { mov AX, mod; } static if (V1.sizeof == 4) asm { mov EAX, mod; } static if (V1.sizeof == 8) asm { mov RAX, mod; } Likewise you need to load the pointer (ref) into a fitting register. mov EDX, val; // x86 mov RDX, val; // x86_64 --