Probably related to Bug 1173. void main() { int x; asm { mov x, x.max; } } The above code compiles. However, if you replace "x.max" with "int.max", DMD complains about "ptr expected". Replace it with "typeof(x).max" or add brackets around the expression and DMD complains about "nops expected". This can be worked around by using a temporary or constant.
Added to DStress as http://dstress.kuehne.cn/run/a/asm_05_A.d http://dstress.kuehne.cn/run/a/asm_05_B.d
*** Bug 1614 has been marked as a duplicate of this bug. ***
Using the .ptr property of an array doesn't work either. Neither does &arr.
Currently it's not specified but can be supported since asm operands with dot exp must be evaluable by CTFE to a const. Changing importance from reject-valid to enhancement.
@Basile-z created dlang/dmd pull request #10069 "fix issue 1252 - Inline assembler could support BasicType properties" fixing this issue: - fix issue 1252 - Inline assembler could support BasicType properties https://github.com/dlang/dmd/pull/10069
dlang/dmd pull request #10069 "fix issue 1252 - Inline assembler could support BasicType properties" was merged into master: - 997492ea7eacd22777d0e689baf37f6e82810ffa by Basile Burg: fix issue 1252 - Inline assembler could support BasicType properties https://github.com/dlang/dmd/pull/10069