Interpreter almost works!!!
authorTim Vaughan <tgvaughan@gmail.com>
Sat, 23 Apr 2016 02:11:24 +0000 (14:11 +1200)
committerTim Vaughan <tgvaughan@gmail.com>
Sat, 23 Apr 2016 02:11:24 +0000 (14:11 +1200)
src/forth.jl

index d6a10e6..27f9dc3 100644 (file)
@@ -842,6 +842,11 @@ end)
 
 #### VM loop ####
 function runVM()
+    # Start with IP pointing to first instruction of outer interpreter
+    reg.IP = QUIT + 1
+
+    # Primitive processing loop.
+    # Everyting else is simply a consequence of this loop!
     jmp = mem[NEXT]
     while (jmp = callPrim(jmp)) != 0 end
 end