(back home)

kip kmx20 assembler

Syntax

Tokens

Tokens are generally split by whitespace.

Colours

A token has a type, or ‘colour’ based on its first character.

Char Description
{ Comment. All text until the next } is ignored.
" String literal. This is included in the resultant binary literally. (e.g. “meow” puts the string “meow” in the output binary)
# Hexadecimal literal. The amount of bytes included in the output binary is either 1, 2, or 4 based on length. Numbers are big-endian. (e.g. #00 outputs a byte, #0000 half a word, and #00000000 a full word)
: Label definition
@ 32-bit reference to label (e.g. pw @label ju would jump to the label defined by :label)
^ 8-bit relative reference to label (e.g. pr ^label ju would jump to the label defined by :label)
! Macro definition. words that follow are included in macro until ; (e.g. !meow #0000 ;)
` Macro reference. (e.g. meow (from above) will now output 2 bytes of 0s)
- Assembler built-in. these can take some amount of arguments.

Without colour, it is treated as an instruction. See kmx20 for ISA documentation. Instructions can additionally have the following prefixes, which may affect the resulting opcode.

Builtins