๐ข Numeric Literal Notation
๐ Common Suffixes (IntelโStyle)
| Suffix | Base / Meaning | Example | Decimal Value | Notes |
|---|---|---|---|---|
h | Hexadecimal (baseโ16) | 4Ah | 74 | Add a leading 0 if starting with AโF โ 0Ah |
b | Binary (baseโ2) | 1010b | 10 | Rare in older docs, common in MASM/NASM |
o or q | Octal (baseโ8) | 77o / 77q | 63 | o and q depend on assembler |
| (none) | Decimal (baseโ10) | 42 | 42 | Default unless specified |
๐ก Prefix Alternatives
| Prefix | Meaning / Syntax Origin | Example | Decimal Value |
|---|---|---|---|
0x | Hex (Cโstyle) | 0x4A | 74 |
$ | Hex (GAS/AT&T style) | $4A | 74 |
% | Binary (GAS style) | %1010 | 10 |
๐ Assembler Quirks
- MASM/TASM: Strict
h,b,ousage; needs a leading0if the hex value starts with a letter. - NASM/FASM: Accepts both suffix (
h) and Cโstyle (0x) notations. - GAS (GNU Assembler): Prefers
$for constants (AT&T style), nohsuffix.
Last updated on