It includes the standard operator of a generic stack based VM. It accept a one liner program, composed by
the stack is LIFO
INT
orFLOAT
: put the value into stackADD
: to perform addition of the latest two values insertedSUB
: to perform subtractionMUL
: to perform multiplicationDIV
: to perform divisionDUP
: to duplicate the latest value on the stackPOP
: to remove the latest inserted value on the stack<
: to perform a comparison between the latest two values on the stack it put on the stack the boolean result.[x,y]
: it perform an IF using the boolean result from a comparison returning on the stack x if true, y if false.{z}
: put on the stack the program Z in order to be executed later, i.e.:{DUP,MUL}
, with the commandEXE
..
: print out on the screen the latest value in the stack
5 4 7 4 ADD . SUB MUL . 10 < [20,30] . {DUP,MUL} EXE .