问题
Do hexadecimal values in masm have to start with a number? If I use
.const
_mmx_cons QWORD f000000000000000h
I get a build error :
test.asm(26): error A2006: undefined symbol : f000000000000000h
But if I add a leading 0
.const
_mmx_cons QWORD 0f000000000000000h
The error vanish. Why is that? Am I sure that it represents the 64 bit value 0xf000000000000000
?
回答1:
Hex numbers using the h
suffix must start with a decimal digit, otherwise they would be mistaken for label names. That's why you add a leading zero if the most significant hex digit is A
..F
.
Leading zeroes do not affect the value or storage size requirement of the immediate. For example, it's perfectly ok to write MOV AL, 00000001h
, because 00000001h
is exactly the same as 1
.
来源:https://stackoverflow.com/questions/19934064/hexadecimal-values-in-masm-starting-with-a-letter