From 92286748673eef69e62933bfaf066a2cd3f6a1b0 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Mon, 16 Jun 2025 16:27:35 +0100 Subject: [PATCH] Add Assembler --- Assembler.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Assembler.md diff --git a/Assembler.md b/Assembler.md new file mode 100644 index 0000000..2299e6e --- /dev/null +++ b/Assembler.md @@ -0,0 +1,16 @@ +# Pseudo Instructions Reference + +| Mnemonic | Args | Description | +|----------|------|-------------| +| DB | name, u8[..] | Takes a comma separated list of bytes and inserts them into the binary at a location addressable by 'name' | +| DH | name, u16[..] | Takes a comma separated list of 16-bit values and inserts them into the binary at a location addressable by 'name' | +| DW | name, u32[..] | Takes a comma separated list of 32-bit values and inserts them into the binary at a location addressable by 'name' | +| RESB | name, size | Reserves space for 'size' 8-bit values at a location addressable by 'name' | +| RESH | name, size | Reserves space for 'size' 16-bit values at a location addressable by 'name' | +| RESW | name, size | Reserves space for 'size' 32-bit values at a location addressable by 'name' | +| PUSH | reg | Pushes the value in 'reg' to the stack. Equivalent to: `INC SPR` then `STW register, SPR` | +| POP | reg | Pops the top value in the stack to 'reg'. Equivalent to: `LDW SPR, register` then `DEC SPR` | +| LDB | name, reg | Loads the 8-bit value at the address referenced by name into reg. Equivalent to: `LLI varname, reg`, `LUI varname, reg`, `LDB reg, reg` | +| LDH | name, reg | Loads the top 16-bits of the value at the address referenced by name into reg. Equivalent to: `LLI varname, reg`, `LUI varname, reg`, `LDH (0)reg, reg` | +| LDW | name, reg | Loads the 32-bit value at the address referenced by name into reg. Equivalent to: `LLI varname, reg`, `LUI varname, reg`, `LDW reg, reg` | +| LWI | name, reg | Loads the address of 'name' into reg. Equivalent to: `LLI name, reg`, `LUI name, reg` | \ No newline at end of file