X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/970d32b553a44051cedd2caf34267b7b1cdbab78..2da0395e27e0cff42fb0a1a680ee6105f6e353e5:/fth/system.fth diff --git a/fth/system.fth b/fth/system.fth index 01b779d..5cf36f8 100644 --- a/fth/system.fth +++ b/fth/system.fth @@ -17,8 +17,8 @@ : \ ( -- , comment out rest of line ) EOL word drop ; immediate - -\ 1 echo ! \ Uncomment this line to echo Forth code while compiling. + +\ 1 echo ! \ Uncomment this line to echo Forth code while compiling. \ ********************************************************************* \ This is another style of comment that is common in Forth. @@ -48,13 +48,9 @@ 0 swap ! ; -\ size of data items -\ FIXME - move these into 'C' code for portability ???? -: CELL ( -- size_of_stack_item ) 4 ; - : CELL+ ( n -- n+cell ) cell + ; : CELL- ( n -- n+cell ) cell - ; -: CELLS ( n -- n*cell ) 2 lshift ; +: CELL* ( n -- n*cell ) cells ; : CHAR+ ( n -- n+size_of_char ) 1+ ; : CHARS ( n -- n*size_of_char , don't do anything) ; immediate @@ -174,7 +170,7 @@ ; : N>LINK ( nfa -- lfa ) - 8 - + 2 CELLS - ; : >BODY ( xt -- pfa ) @@ -231,6 +227,7 @@ \ Error codes defined in ANSI Exception word set. : ERR_ABORT -1 ; \ general abort +: ERR_ABORTQ -2 ; \ for abort" : ERR_EXECUTING -14 ; \ compile time word while not compiling : ERR_PAIRS -22 ; \ mismatch in conditional : ERR_DEFER -258 ; \ not a deferred word @@ -358,7 +355,8 @@ ; : D2* ( d -- d*2 ) - 2* over 31 rshift or swap + 2* over + cell 8 * 1- rshift or swap 2* swap ; @@ -741,16 +739,14 @@ variable TRACE-INCLUDE drop ." Could not find file " $type cr abort ELSE ( -- $filename good-fid ) swap include.mark.start - dup >r \ save fid for close-file depth >r - include-file + include-file \ will also close the file depth 1+ r> - IF ." Warning: stack depth changed during include!" cr .s cr 0sp THEN - r> close-file drop include.mark.end THEN trace-include @ @@ -814,7 +810,8 @@ auto.init \ Now that we can load from files, load remainder of dictionary. trace-include on -trace-stack on +\ Turn this OFF if you do not want to see the contents of the stack after each entry. +trace-stack off include loadp4th.fth @@ -825,6 +822,3 @@ FREEZE \ prevent forgetting below this point .( Dictionary compiled, save in "pforth.dic".) cr c" pforth.dic" save-forth - -\ Save the dictionary in "pfdicdat.h" file so pForth can be compiled for standalone mode. -SDAD