From: Alex M. <ale...@us...> - 2005-04-13 00:09:39
|
Update of /cvsroot/win32forth/win32forth/src/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28909/src/kernel Modified Files: fkernel.f Log Message: arm: redefine ?loading in terms of source-id; correct ?winerror and remove call to save-input Index: fkernel.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/fkernel.f,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** fkernel.f 5 Apr 2005 22:25:46 -0000 1.6 --- fkernel.f 13 Apr 2005 00:09:27 -0000 1.7 *************** *** 2032,2039 **** VARIABLE LOADLINE - VARIABLE ?LOADING VARIABLE >IN \ offset in to input stream 0 VALUE SOURCE-ID MAXSTRING 2 + ALIGNED EQU TIBLEN --- 2032,2041 ---- VARIABLE LOADLINE VARIABLE >IN \ offset in to input stream 0 VALUE SOURCE-ID + : ?loading ( -- flag ) \ are we loading? + source-id -1 0 between 0= ; + MAXSTRING 2 + ALIGNED EQU TIBLEN *************** *** 3019,3023 **** 0 DP-LINK ! - \ CREATE TDP 0 , 0 , 0 , DP-LINK LINK, ," +TRANS" \ transient, work in progress CREATE SDP 0 , 0 , 0 , DP-LINK LINK, ," SYS" \ system CREATE ADP 0 , 0 , 0 , DP-LINK LINK, ," APP" \ application --- 3021,3024 ---- *************** *** 3267,3271 **** : ," ( -<string">- ) \ compile string" at here ! [CHAR] " PARSE HERE >R ", 0 C, ALIGN R> COUNT \N->CRLF ; --- 3268,3272 ---- : ," ( -<string">- ) \ compile string" at here ! HERE [CHAR] " PARSE ", 0 C, ALIGN COUNT \N->CRLF ; *************** *** 3275,3279 **** : Z," ( -<string">- ) \ compile string" at here ! [CHAR] " PARSE HERE >R Z", 0 C, ALIGN R> ZCOUNT \N->CRLF ; --- 3276,3280 ---- : Z," ( -<string">- ) \ compile string" at here ! HERE [CHAR] " PARSE Z", 0 C, ALIGN ZCOUNT \N->CRLF ; *************** *** 4196,4200 **** |: _HEADER-OPT ( -- ) \ optional fields ! ?LOADING @ IF \ if loading... LOADFILE \ file LOADLINE @ \ line number --- 4197,4201 ---- |: _HEADER-OPT ( -- ) \ optional fields ! ?LOADING IF \ if loading... LOADFILE \ file LOADLINE @ \ line number *************** *** 4733,4737 **** \ September 23rd, 2003 - dbu : LINKFILE ( a1 -- ) \ link name a1 as current file IF LOADING ONLY !! ! ?LOADING @ IF MAXCOUNTED _LOCALALLOC \ alloc local path buffer --- 4734,4738 ---- \ September 23rd, 2003 - dbu : LINKFILE ( a1 -- ) \ link name a1 as current file IF LOADING ONLY !! ! ?LOADING IF MAXCOUNTED _LOCALALLOC \ alloc local path buffer *************** *** 4763,4776 **** \ -------------------- save/restore file input ------------------------------ ! : SAVE-INPUT ( -- ... 7 ) \ save input LOADFILE - ?LOADING @ LOADLINE @ >IN @ SOURCE-ID SOURCE ! 7 ; ! : RESTORE-INPUT ( ... 7 -- flag ) \ restore input DROP (SOURCE) 2! --- 4764,4776 ---- \ -------------------- save/restore file input ------------------------------ ! : SAVE-INPUT ( -- ... 6 ) \ save input LOADFILE LOADLINE @ >IN @ SOURCE-ID SOURCE ! 6 ; ! : RESTORE-INPUT ( ... 6 -- flag ) \ restore input DROP (SOURCE) 2! *************** *** 4778,4784 **** >IN ! LOADLINE ! - ?LOADING ! TO LOADFILE ! ?LOADING @ IF LOADFILE COUNT CUR-FILE PLACE \ make current again --- 4778,4783 ---- >IN ! LOADLINE ! TO LOADFILE ! ?LOADING IF LOADFILE COUNT CUR-FILE PLACE \ make current again *************** *** 4786,4792 **** FALSE ; ! | CODE (SAVE-INPUT) ( ... 7 -- R: ... 7 ) \ save input to rstack ! mov -8 CELLS [ebp], ebx ! pop -7 CELLS [ebp] pop -6 CELLS [ebp] pop -5 CELLS [ebp] --- 4785,4790 ---- FALSE ; ! | CODE (SAVE-INPUT) ( ... 6 -- R: ... 6 ) \ save input to rstack ! mov -7 CELLS [ebp], ebx pop -6 CELLS [ebp] pop -5 CELLS [ebp] *************** *** 4795,4805 **** pop -2 CELLS [ebp] pop -1 CELLS [ebp] ! sub ebp, # 32 pop ebx next c; ! | CODE (RESTORE-INPUT) ( R: ... 7 -- ... 7 ) \ save input to stack push ebx - push 7 CELLS [ebp] push 6 CELLS [ebp] push 5 CELLS [ebp] --- 4793,4802 ---- pop -2 CELLS [ebp] pop -1 CELLS [ebp] ! sub ebp, # 28 pop ebx next c; ! | CODE (RESTORE-INPUT) ( R: ... 6 -- ... 6 ) \ save input to stack push ebx push 6 CELLS [ebp] push 5 CELLS [ebp] *************** *** 4809,4813 **** push 1 CELLS [ebp] mov ebx, 0 CELLS [ebp] ! add ebp, # 32 next c; --- 4806,4810 ---- push 1 CELLS [ebp] mov ebx, 0 CELLS [ebp] ! add ebp, # 28 next c; *************** *** 4833,4837 **** SAVE-INPUT (SAVE-INPUT) \ save source to rstack ( fileid ) TO SOURCE-ID - ?LOADING ON \ mark as loading a file POCKET LINKFILE \ create a filename link LOADLINE OFF \ clear the loadline counter --- 4830,4833 ---- *************** *** 5236,5240 **** |: (TYPEMSG) ( n addr len -- ) ! ?LOADING @ IF CR SOURCE TYPE THEN \ print source line if loading CR >IN @ DUP (SOURCE) @ < + \ adjust if not at end of line POCKET C@ DUP>R - SPACES \ spaces --- 5232,5236 ---- |: (TYPEMSG) ( n addr len -- ) ! ?LOADING IF CR SOURCE TYPE THEN \ print source line if loading CR >IN @ DUP (SOURCE) @ < + \ adjust if not at end of line POCKET C@ DUP>R - SPACES \ spaces *************** *** 5252,5256 **** IF 2 CELLS+ ?TYPE PTRNULL THEN \ print the message, set ptr 2 null to stop loop REPEAT ! ?LOADING @ IF ." in file " LOADFILE ?TYPE ." at line " LOADLINE @ . --- 5248,5252 ---- IF 2 CELLS+ ?TYPE PTRNULL THEN \ print the message, set ptr 2 null to stop loop REPEAT ! ?LOADING IF ." in file " LOADFILE ?TYPE ." at line " LOADLINE @ . *************** *** 5265,5269 **** DUP 1+ IF \ only do this for real errors, not -1 throw S" Error" (TYPEMSG) \ mark the source line in error, error ! ?LOADING @ IF EDIT-ERROR THEN \ edit if loading else drop THEN ; --- 5261,5265 ---- DUP 1+ IF \ only do this for real errors, not -1 throw S" Error" (TYPEMSG) \ mark the source line in error, error ! ?LOADING IF EDIT-ERROR THEN \ edit if loading else drop THEN ; *************** *** 5277,5282 **** RP0 @ RP! BEGIN [COMPILE] [ - ?LOADING OFF - BEGIN CR ['] QUERY-INTERPRET CATCH ?DUP 0= WHILE STATE @ 0= --- 5273,5276 ---- |