The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc72871
)
Moving further away from julia
author
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 10 Apr 2016 00:03:33 +0000
(12:03 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sun, 10 Apr 2016 00:03:33 +0000
(12:03 +1200)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
67dd77d
..
60646ff
100644
(file)
--- 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