Super Lean Instruction Machine Emulator

To use the emulator, type your code into the area below and hit "Load" on the SLIME window. If your program has syntax errors, a window will appear listing them.

Next, hit "Run" to start your program. If a run-time error occurs, the OK indicator will change to Exception and the status line will show the exception. You can click on the indicator to clear the exception. ("Reset" will do so as well.)

If you hit the "Quit" button, the SLIME window will disappear, and the indicator below will change from Running to Stopped. Clicking on the indicator will restart SLIME.

Example Program

allocate-registers loop done
allocate-registers n max fact one temp

read max 
li fact, 1
li n, 1
li one, 1
li done, done_label
li loop, loop_label

loop_label: 
mul fact, fact, n       ; fact(n) = fact(n-1) * n
sub temp, n, max        ; test whether n == max
jeqz temp, done         ; if so, exit
add n, n, one           ; n++
j loop

done_label:
write fact
halt