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:
9131cbd
)
Added UNUSED, made VM mem sizes more sensible.
author
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 2 May 2016 01:32:00 +0000
(13:32 +1200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Mon, 2 May 2016 01:32:00 +0000
(13:32 +1200)
src/forth.jl
patch
|
blob
|
history
src/lib.4th
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
a52b675
..
c1ca1a0
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-1,12
+1,12
@@
module forth
# VM mem size
module forth
# VM mem size
-size_mem =
640*1024
+size_mem =
1000000 # 1 mega-int
# Buffer sizes
# Buffer sizes
-size_RS = 10
24
# Return stack size
-size_PS = 10
24
# Parameter stack size
-size_TIB = 10
96
# Terminal input buffer size
+size_RS = 10
00
# Return stack size
+size_PS = 10
00
# Parameter stack size
+size_TIB = 10
00
# Terminal input buffer size
# The mem array constitutes the memory of the VM. It has the following geography:
#
# The mem array constitutes the memory of the VM. It has the following geography:
#
@@
-231,13
+231,12
@@
defConst("DOCON", DOCON)
defConst("DOVAR", DOVAR)
defConst("DICT", DICT)
defConst("DOVAR", DOVAR)
defConst("DICT", DICT)
+defConst("MEMSIZE", size_mem)
F_IMMED = defConst("F_IMMED", 128)
F_HIDDEN = defConst("F_HIDDEN", 256)
F_LENMASK = defConst("F_LENMASK", 127)
F_IMMED = defConst("F_IMMED", 128)
F_HIDDEN = defConst("F_HIDDEN", 256)
F_LENMASK = defConst("F_LENMASK", 127)
-
-
# Basic forth primitives
DROP = defPrimWord("DROP", () -> begin
# Basic forth primitives
DROP = defPrimWord("DROP", () -> begin
diff --git
a/src/lib.4th
b/src/lib.4th
index
6b2d8ae
..
28aa451
100644
(file)
--- a/
src/lib.4th
+++ b/
src/lib.4th
@@
-723,3
+723,8
@@
2DROP ( restore stack )
;
2DROP ( restore stack )
;
+
+( MEMORY ------------------------------------------------------------------ )
+
+: UNUSED ( -- cells )
+ MEMSIZE HERE @ - ;