Skip to content
๐Ÿ”ข Numeric Literal Notation

๐Ÿ”ข Numeric Literal Notation

๐Ÿ“ Common Suffixes (Intelโ€‘Style)

SuffixBase / MeaningExampleDecimal ValueNotes
hHexadecimal (baseโ€‘16)4Ah74Add a leading 0 if starting with Aโ€“F โ†’ 0Ah
bBinary (baseโ€‘2)1010b10Rare in older docs, common in MASM/NASM
o or qOctal (baseโ€‘8)77o / 77q63o and q depend on assembler
(none)Decimal (baseโ€‘10)4242Default unless specified

๐Ÿ’ก Prefix Alternatives

PrefixMeaning / Syntax OriginExampleDecimal Value
0xHex (Cโ€‘style)0x4A74
$Hex (GAS/AT&T style)$4A74
%Binary (GAS style)%101010

๐Ÿ›  Assembler Quirks

  • MASM/TASM: Strict h, b, o usage; needs a leading 0 if 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), no h suffix.

Last updated on