X-Git-Url: http://git.subgeniuskitty.com/pforth/.git/blobdiff_plain/bb6b2dcdd9acffabfd373c4c3f6b64a9cc43f335..0befde02a8926cd653dde3732969ab4f16704281:/fth/system.fth diff --git a/fth/system.fth b/fth/system.fth index c83136d..5cf36f8 100644 --- a/fth/system.fth +++ b/fth/system.fth @@ -18,6 +18,8 @@ EOL word drop ; immediate +\ 1 echo ! \ Uncomment this line to echo Forth code while compiling. + \ ********************************************************************* \ This is another style of comment that is common in Forth. \ pFORTH - Portable Forth System @@ -46,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 @@ -172,7 +170,7 @@ ; : N>LINK ( nfa -- lfa ) - 8 - + 2 CELLS - ; : >BODY ( xt -- pfa ) @@ -229,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 @@ -356,7 +355,8 @@ ; : D2* ( d -- d*2 ) - 2* over 31 rshift or swap + 2* over + cell 8 * 1- rshift or swap 2* swap ; @@ -739,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 @ @@ -809,10 +807,11 @@ auto.init THEN ; -\ load remainder of dictionary +\ 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 @@ -823,5 +822,3 @@ FREEZE \ prevent forgetting below this point .( Dictionary compiled, save in "pforth.dic".) cr c" pforth.dic" save-forth - -SDAD