add documentation for current addressing modes to instructions.toml

Signed-off-by: Ava Affine <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2025-08-07 21:26:23 +00:00
parent 3bc256dab2
commit 4fb7e78c2a
2 changed files with 37 additions and 0 deletions

View file

@ -1,6 +1,41 @@
# NOTE: keep libc out of this, thats what trap vector is for
# NOTE: to programmers: only registers allow mutable acess
[[addressing_modes]]
name = "expr"
mutable = true
symbol = "$expr"
example = "inc $expr"
description = "The expression register is used as a default output, or input by many instructions."
[[addressing_modes]]
name = "operand"
mutable = true
symbol = "$oper<N>"
example = "add $oper1, $oper2"
description = "There are four operand registers N=(0, 1, 2, 3, and 4). They are for storing mutable data."
[[addressing_modes]]
name = "stack"
mutable = false
symbol = "%N"
example = "dupl %0, $expr"
description = "Stack addressing mode takes an index in to the stack to read from."
[[addressing_modes]]
name = "instruction"
mutable = false
symbol = "@N"
example = "jmp @100"
description = "Instruction addressing mode indexes by instruction into the program."
[[addressing_modes]]
name = "numeric"
mutable = false
symbol = "N"
example = "const $expr, 100"
description = "Numeric addressing mode provides read only integer constants to instructions"
[[instructions]]
name = "trap"
args = ["index"]