rewrite, its now a vm for a shitty subset of assembly

This commit is contained in:
2026-09-09 00:45:52 -05:00
parent d261a49213
commit a71d73e19d
76 changed files with 703 additions and 99 deletions
+38
View File
@@ -0,0 +1,38 @@
:: Registers
Accumulator (A-Register)
X, Y registers
Memory (8kb)
:: Flags
Z; Zero
:: Helpers
NVAR <name>, <value>; Sets new a variable and its value
RVAR <name>; Removes a variable
SVAR <name>, <newval>; Sets a variables value
:: Commands (Memory)
LDA <address>; Loads a memory value into ram
STA <address>; Seeks to a memory value into the accumulator
LDX; Loads accumulator into X
LDY; Loads accumulator into Y
STX; Stores X into accumulator
STY; Stores Y into accumulator
SEA <value>; Sets accumulator
:: Commands (Arithmetic)
ADD; Adds X + Y then stores in Accumulator
SUB; Subtracts X - Y then stores in Accumulator
MUL; Multiplies X * Y then stores in Accumulator
DIV; Divides X / Y then stores in Accumulator
:: Commands (flow control)
JZE <pointer>; Jumps to a pointer in the program on zero flag
JMP <pointer>; Jumps to a pointer in the program
SFG <flag>; Sets a flag to true
RFG <flag; Sets a flag to false
:: Commands (Debug)
PRA; Prints accumulator
PRX; Prints X
PRY; Prints Y
PRM <address>; Prints value of memory address