From b96f436aa006ef1da7e9e67ea545675cbbe080f8 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Sun, 10 Apr 2016 12:03:33 +1200 Subject: [PATCH] Moving further away from julia --- src/forth.jl | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/forth.jl b/src/forth.jl index 67dd77d..60646ff 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -1,11 +1,16 @@ module forth -RS = Array{Int, 1}() -DS = Array{Int, 1}() + +RS = Array{Int64, 1}(1024) +RSP = 1 + +PS = Array{Int64, 1}(1024) +PSP = 1 IP = 0 W = 0 X = 0 + jmp = nothing primitives = Array{Expr,1}() @@ -38,10 +43,15 @@ EXIT = addPrim("exit", :(begin jmp = NEXT end)) + + + # VM loop -#jmp = NEXT -#while true -# eval(jmp) -#end +jmp = NEXT +function runVM() + while true + eval(jmp) + end +end end -- 2.20.1