| Command | Meaning | Explanation |
|---|---|---|
| load <val> | Load constant into zp | Puts a value from data ROM into zp. |
| set ar1 | Move zp to ar1 | Copies zp into ar1. |
| set ar2 | Move zp to ar2 | Copies zp into ar2. |
| set ra | Set the current RAM address to zp | Selects memory cell for RAM operations. |
| set ram | Store zp into current RAM address | Saves zp into RAM at ra. |
| set zpe | Set zpe register to zp | Copies zp into zpe (loop counter, temp storage). |
| get ram | Load zp from current RAM | Reads RAM at ra into zp. |
| get zpe | Load zp from zpe | Copies zpe into zp. |
| get input | Read user input into zp | Main input channel. |
| get count | Get the program counter | Reads the current instruction pointer into zp. |
| Command | Meaning | Explanation |
|---|---|---|
| add | ar1 + ar2 → zp | Adds ar1 and ar2, stores in zp. |
| sub | ar1 - ar2 → zp | Subtracts ar2 from ar1, result goes into zp. |
| Command | Meaning | Explanation |
|---|---|---|
| and | Bitwise AND | Logical AND of ar1 and ar2 → zp. |
| or | Bitwise OR | Logical OR of ar1 and ar2 → zp. |
| xor | Bitwise XOR | Logical XOR of ar1 and ar2 → zp. |
| Command | Meaning | Explanation |
|---|---|---|
| comp | Jump if ar1 == ar2 | Compares ar1 and ar2; jumps to zp if equal. |
| ar2_gt_ar1 | Jump if ar2 > ar1 | Jump to zp if ar2 > ar1. |
| ar1_gt_ar2 | Jump if ar1 > ar2 | Jump to zp if ar1 > ar2. |
| Command | Meaning | Explanation |
|---|---|---|
| jump <addr> | Jump to address | Moves execution to specified address; counts as 2 instructions. |
| jumpzp | Jump to zp | Jump to address stored in zp (dynamic jump). |
| Command | Meaning | Explanation |
|---|---|---|
| output | Print zp | Outputs zp to main output. |
| output2 | Print zp to secondary output | Outputs zp to a second channel. |
| output3 | Print zp to third output | Outputs zp to a third channel. |
| output4 | Print zp to fourth output | Outputs zp to a fourth channel. |
SR (Sector Register): selects active Program or Data ROM sector. Each sector holds 255 instructions. When a sector ends, the CPU automatically jumps to the next sector. Use set sr to select a sector and get sr to read it.
Program Counter: get count reads the current instruction pointer into zp.
Extra Inputs: get input2, get input3, get input4 read additional inputs independently into zp.
Extra Outputs: output2, output3, output4 write zp values to multiple output channels.
Jump Instructions: jump <addr> counts as 2 instructions. jumpzp jumps to the address stored in zp.
| Command | Description | External Data Needed? |
|---|---|---|
| load <val> | Load constant into zp | Yes (from data ROM) |
| set ar1 | Move zp to ar1 | No |
| set ar2 | Move zp to ar2 | No |
| set ra | Set RAM address | No |
| set ram | Set current RAM to zp | No |
| set zpe | Set zpe to zp | No |
| get ram | Set zp to RAM | No |
| get zpe | Set zp to zpe | No |
| get input | Set zp to user input | No |
| get input2 | Set zp to user input 2 | No |
| get input3 | Set zp to user input 3 | No |
| get input4 | Set zp to user input 4 | No |
| get count | Get the current address (program counter) | No |
| get sr | Get active ROM sector | No |
| set sr | Set active ROM sector | No |
| add | Add ar1 + ar2 → zp | No |
| sub | Subtract ar1 - ar2 → zp | No |
| and | Bitwise AND | No |
| or | Bitwise OR | No |
| xor | Bitwise XOR | No |
| comp | Jump if ar1 == ar2 | No |
| ar2_gt_ar1 | Compare ar2 > ar1 | No |
| ar1_gt_ar2 | Compare ar1 > ar2 | No |
| output | Output zp | No |
| output2 | Output2 zp | No |
| output3 | Output3 zp | No |
| output4 | Output4 zp | No |
| jump <addr> | Jump to address | Yes (address), counts as 2 instructions |
| jumpzp | Jump to value stored in zp | No |
This example demonstrates a basic program flow:
; Step 1: Select data ROM sector
load 0
set sr
; Step 2: Load values into registers
load 10
set ar1
load 5
set ar2
; Step 3: Perform arithmetic
add
; Step 4: Output the result
output
Explanation:
load <val>: Reads value from data ROM into zp.set ar1, set ar2: Store values in registers for arithmetic.add: Adds ar1 + ar2, result goes into zp.output: Prints the result stored in zp.