Bug 1173 – Inline assembler: cannot use global scope operator

Status
RESOLVED
Resolution
WONTFIX
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2007-04-21T09:57:29Z
Last change time
2019-07-13T11:07:45Z
Keywords
iasm, rejects-valid
Assigned to
No Owner
Creator
Matti Niemenmaa

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2007-04-21T09:57:29Z
int x; int main() { asm { mov EAX, .x; } } The above code fails with the error "nops expected". Ways to work around this: removing the leading period from the x (doesn't work if there's a local x, of course), creating an alias to x and using that instead, or using a module declaration and referring to x by way of the module name.
Comment #1 by thomas-dloop — 2007-04-23T12:55:17Z
Comment #2 by clugdbug — 2012-04-11T01:00:15Z
Now writes bug.d(4): 1 operands found for mov instead of the expected 2 Which is still wrong, but not as silly as the old error message.
Comment #3 by razvan.nitu1305 — 2019-07-13T11:07:45Z
Closing on the same grounds as https://issues.dlang.org/show_bug.cgi?id=1172