Posted 18 January 2016 - 08:13 PM
I'm working on a VM…
Sneak peak:
Dunno if I should release it… Anyone interested?
If you want to know the current commands for it, comment :)/>
Suggest any commands? Comment :)/>
Sneak peak:
Dunno if I should release it… Anyone interested?
Commands
;Adds two numbers from the stack and pushes result on top of stack
ADD
SUB
MUL
DIV
LT ;Less Than pushes 1 [ true ] else 0 [ false ]
MT ;More Than pushes 1 [ true ] else 0 [ false ]
EQ ;Equals pushes 1 [ true ] else 0 [ false ]
JMP ;Gets a number from the stack and jumps to that position
GOTO <pos> ;jumps to that position
JMPT <pos> ;if the top of the stack has 1 in it, go to that position
JMPF <pos> ;if the top of the stack has 0 in it, go to that position
CONST <value> ;pushes a value to the top of stack
LOAD <name> ;loads a value with that name
STORE <name> ;stores a value with that name
PRINT ;Prints a value from the top of the stack
POP ;removes a value form the top of the stack
CALL <name> <number of arguments> ;goes to the position. gets the number of arguments from the top of the stack
LCALL <number of name def> <number of arguments> ;Calls a Lua function
RET ;pushes a value to the top of the stack and returns to the called position
HLT ;Exits the program
Edited on 22 January 2016 - 08:22 PM