The Lambda Lab
/
projects
/
forth.jl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Fixed 2swap bug, added ?do, fixed +loop.
[forth.jl.git]
/
src
/
forth.jl
diff --git
a/src/forth.jl
b/src/forth.jl
index
fba2375
..
e7faf97
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-284,8
+284,17
@@
TWOSWAP = defPrimWord("2SWAP", () -> begin
d = popPS()
pushPS(b)
pushPS(a)
- pushPS(c)
pushPS(d)
+ pushPS(c)
+ return NEXT
+end)
+
+TWOOVER = defPrimWord("2OVER", () -> begin
+ ensurePSDepth(4)
+ a = mem[reg.PSP-3]
+ b = mem[reg.PSP-2]
+ pushPS(a)
+ pushPS(b)
return NEXT
end)