hexadecimal values in masm starting with a letter [duplicate]

空扰寡人 提交于 2019-12-24 10:48:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!