3

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
UmNyobe
  • 22,539
  • 9
  • 61
  • 90

1 Answers1

6

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.

Michael
  • 57,169
  • 9
  • 80
  • 125