D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1173 - Inline assembler: cannot use global scope operator
Summary: Inline assembler: cannot use global scope operator
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 All
: P2 normal
Assignee: No Owner
URL:
Keywords: iasm, rejects-valid
Depends on:
Blocks:
 
Reported: 2007-04-21 09:57 UTC by Matti Niemenmaa
Modified: 2019-07-13 11:07 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Matti Niemenmaa 2007-04-21 09:57:29 UTC
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 2 Don 2012-04-11 01:00:15 UTC
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 RazvanN 2019-07-13 11:07:45 UTC
Closing on the same grounds as https://issues.dlang.org/show_bug.cgi?id=1172