SSM - 1( Scratch Stack Machine 1) is a stack based virtual machine (with some registers) on scratch that is Turing complete! EXAMPLE CODE: Hello World in SSM-1: push Hello World! :-) print run program Addition Calculator in SSM-1: input input add print
set - pops last item in stack and moves it into register load - pushes value of register to stack push - pushes next item to stack add - pops top 2 items of stack, adds them, and pushes result sub - same as add but subtracts mult - same as add but multiplies div - same as add but divides rem - same as add but finds remainder print - pops top of stack, prints it input - gets input from user, pushes input to stack retr - pops top value of stack, gets value from stack at that location and pushes to stack jump - sets program counter to top popped value of stack RUN PROGRAM - exits editor and runs program UNDO LAST LINE - un does last line