MASM numeric constants can be any of following:
Radix constants are numeric constants that also specify the radix of the value. They consist of one or more digits, 0 through 9, followed by a radix indicator. The radix indicators of MASM numeric constants define them as decimal (D), hexadecimal (H), octal (O), or binary (B). If the current radix is hexadecimal, the letters B and D are interpreted as digits. In this case, T specifies a decimal radix, and Y specifies a binary radix. See MASM Radix Indicators table below.
Radix indicators are not case-sensitive.
See the Radix Indicator Directive section for more information about how to specify a radix.
Integer constants in the current radix consist of one or more digits, 0 through 9, A through F. If the current radix is not hexadecimal, the characters A through F are not applicable.
Floating-point constants have the same syntax as in C. See the C Numeric Constants section.
MASM Radix Indicators |
|
Radix |
Radix Indicator Suffix |
Decimal |
D (d), or T (t) when the current radix is hex |
Hexadecimal |
H (h) |
Octal |
O (o) or Q (q) |
Binary |
B (b), or Y (y) when the current radix is hex |
The following formal grammar summarizes the rules for the MASM numeric constants:
MASM-constant: |