Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Opcodes

An opcode is a 1-byte FixedUInt that tells the reader what the next expression represents and how the bytes that follow should be interpreted.

The meanings of each opcode are organized loosely by their high and low nibbles.

High nibbleLow nibbleMeaning
0x0_ to 0x3_0-FE-expression, opcode is the address
0x4_0-7E-expression, opcode is the address
8-FE-expression with extended address
0x5_0-7Symbols with symbol address
8-9Annotations
AReserved
BTagless-element List
CTagless-element S-expression
D-FReserved
0x6_0-8Integers from 0 to 8 bytes wide
9Reserved
A-DFloats
E-FBooleans
0x7_0-FDecimals
0x8_0-CShort-form timestamps
DReserved
Enull.null
FTyped nulls
0x9_0-FStrings
0xA_0-FSymbols with inline text
0xB_0-FLists
0xC_0-FS-expressions
0xD_0Empty struct
1Reserved
2-FStructs
0xE_0Ion version marker
1-7Directives
8-ATemplate placeholders
BAbsent Argument
C-DNOP
EStruct switch modes (SID ↔ FlexSym)
FDelimited container end
0xF_0Delimited list start
1Delimited S-expression start
2Delimited struct start (SID Mode)
3Delimited struct start (FlexSym Mode)
4E-expression with FlexUInt macro address followed by FlexUInt length prefix
5Integer with FlexUInt length prefix
6Decimal with FlexUInt length prefix
7Timestamp with FlexUInt length prefix
8String with FlexUInt length prefix
9Symbol with FlexUInt length prefix and inline text
AList with FlexUInt length prefix
BS-expression with FlexUInt length prefix
CStruct with FlexUInt length prefix (SID Mode)
DStruct with FlexUInt length prefix (FlexSym Mode)
EBlob with FlexUInt length prefix
FClob with FlexUInt length prefix

In addition, some opcodes have different meanings when used as tagless types.

High nibbleLow nibbleMeaning
0x6_0FlexInt integer value
0xE_0FlexUInt integer value
1-8FixedUInt integer values from 1 to 8 bytes wide
ASymbol value with FlexUInt symbol address
ESymbol FlexSym