From 68255a6a4e53c795c746157d0e870b49248907c5 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Mon, 2 May 2016 13:32:00 +1200 Subject: [PATCH] Added UNUSED, made VM mem sizes more sensible. --- src/forth.jl | 11 +++++------ src/lib.4th | 5 +++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/forth.jl b/src/forth.jl index a52b675..c1ca1a0 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -1,12 +1,12 @@ module forth # VM mem size -size_mem = 640*1024 +size_mem = 1000000 # 1 mega-int # Buffer sizes -size_RS = 1024 # Return stack size -size_PS = 1024 # Parameter stack size -size_TIB = 1096 # Terminal input buffer size +size_RS = 1000 # Return stack size +size_PS = 1000 # Parameter stack size +size_TIB = 1000 # Terminal input buffer size # 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("MEMSIZE", size_mem) 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 diff --git a/src/lib.4th b/src/lib.4th index 6b2d8ae..28aa451 100644 --- a/src/lib.4th +++ b/src/lib.4th @@ -723,3 +723,8 @@ 2DROP ( restore stack ) ; + +( MEMORY ------------------------------------------------------------------ ) + +: UNUSED ( -- cells ) + MEMSIZE HERE @ - ; -- 2.20.1