vm: added noop instruction, various other improvements
This commit is contained in:
@@ -25,6 +25,7 @@ type instr =
|
||||
| Jump of int
|
||||
| JumpF of int (* jump if false. *)
|
||||
| End
|
||||
| NOOP
|
||||
|
||||
type vm_state = {
|
||||
mutable i : int;
|
||||
|
||||
+2
-1
@@ -57,5 +57,6 @@ and interpret state =
|
||||
(match (pop_one state) with
|
||||
| Nil -> state.i <- target
|
||||
| _ -> ()); interpret state
|
||||
| End -> ())
|
||||
| End -> ()
|
||||
| NOOP -> interpret state)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user