rewrite, its now a vm for a shitty subset of assembly
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user