From: Tim Vaughan Date: Mon, 2 May 2016 01:32:00 +0000 (+1200) Subject: Added UNUSED, made VM mem sizes more sensible. X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=commitdiff_plain;h=68255a6a4e53c795c746157d0e870b49248907c5 Added UNUSED, made VM mem sizes more sensible. --- 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 @ - ;