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:
b6b53f9
)
Added HIDE, IMMEDIATE
author
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 18 Apr 2016 19:32:39 +0000
(07:32 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 18 Apr 2016 19:32:39 +0000
(07:32 +1200)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
cdfe88d
..
8c5c3de
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-700,6
+700,12
@@
HIDDEN = defPrim("HIDDEN", () -> begin
reurn mem[NEXT]
end)
reurn mem[NEXT]
end)
+HIDE = defWord("HIDE",
+ [WORD,
+ FIND,
+ HIDDEN,
+ EXIT])
+
COLON = defWord(":",
[WORD,
CREATE,
COLON = defWord(":",
[WORD,
CREATE,
@@
-714,6
+720,12
@@
SEMICOLON = defWord(";",
LBRAC,
EXIT], flags=F_IMMEDIATE)
LBRAC,
EXIT], flags=F_IMMEDIATE)
+IMMEDIATE = defPrim("IMMEDIATE", () -> begin
+ lenAndFlagsAddr = mem[LATEST] + 1
+ mem[lenAndFlagsAddr] = mem[lenAndFlagsAddr] $ F_IMMEDIATE
+ return mem[NEXT]
+end, flags=F_IMMEDIATE)
+
#### VM loop ####
function runVM()
jmp = NEXT
#### VM loop ####
function runVM()
jmp = NEXT