EOL word drop\r
; immediate\r
\r
+\ 1 echo ! \ Uncomment this line to echo Forth code while compiling.\r
+\r
\ *********************************************************************\r
\ This is another style of comment that is common in Forth.\r
\ pFORTH - Portable Forth System\r
0 swap !\r
;\r
\r
-\ size of data items\r
-\ FIXME - move these into 'C' code for portability ????\r
-: CELL ( -- size_of_stack_item ) 4 ;\r
-\r
: CELL+ ( n -- n+cell ) cell + ;\r
: CELL- ( n -- n+cell ) cell - ;\r
-: CELLS ( n -- n*cell ) 2 lshift ;\r
+: CELL* ( n -- n*cell ) cells ;
\r
: CHAR+ ( n -- n+size_of_char ) 1+ ;\r
: CHARS ( n -- n*size_of_char , don't do anything) ; immediate\r
;\r
\r
: N>LINK ( nfa -- lfa )\r
- 8 -\r
+ 2 CELLS -\r
;\r
\r
: >BODY ( xt -- pfa )\r
;\r
\r
: D2* ( d -- d*2 )\r
- 2* over 31 rshift or swap\r
+ 2* over
+ cell 8 * 1- rshift or swap\r
2* swap\r
;\r
\r
drop ." Could not find file " $type cr abort\r
ELSE ( -- $filename good-fid )\r
swap include.mark.start\r
- dup >r \ save fid for close-file\r
depth >r\r
- include-file\r
+ include-file \ will also close the file\r
depth 1+ r> -\r
IF\r
." Warning: stack depth changed during include!" cr\r
.s cr\r
0sp\r
THEN\r
- r> close-file drop\r
include.mark.end\r
THEN\r
trace-include @\r
THEN\r
;\r
\r
-\ load remainder of dictionary\r
+\ Now that we can load from files, load remainder of dictionary.\r
\r
trace-include on\r
trace-stack on\r
.( Dictionary compiled, save in "pforth.dic".) cr\r
c" pforth.dic" save-forth\r
\r
+\ Save the dictionary in "pfdicdat.h" file so pForth can be compiled for standalone mode.\r
SDAD\r