From: Alex M. <ale...@us...> - 2005-08-16 00:01:13
|
Update of /cvsroot/win32forth/win32forth/src/kernel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18056/src/kernel Modified Files: fkernext.f meta-compiler.f Log Message: arm: remove meta MACRO word, use standard macro: word; tidy up of meta-compiler source Index: meta-compiler.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/meta-compiler.f,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** meta-compiler.f 14 Jul 2005 20:32:03 -0000 1.6 --- meta-compiler.f 16 Aug 2005 00:01:05 -0000 1.7 *************** *** 168,175 **** ' TCODE-ALIGN ASSEMBLER ASM-HIDDEN IS CODE-ALIGN META - \ ASSEMBLER MACROS - : MACRO ASSEMBLER DEFINITIONS : ; - : END-MACRO POSTPONE ; META DEFINITIONS ; IMMEDIATE - \ ====================================================================== \ Define Meta Branching Constructs --- 168,171 ---- *************** *** 181,185 **** : ?>RESOLVE ( f addr -- ) t-here CELL+ SWAP t-! ?CONDITION ; ! : ?<RESOLVE ( f addr -- ) t-, ?CONDITION ; \ ====================================================================== --- 177,181 ---- : ?>RESOLVE ( f addr -- ) t-here CELL+ SWAP t-! ?CONDITION ; ! : ?<RESOLVE ( f addr -- ) t-, ?CONDITION ; \ ====================================================================== *************** *** 335,341 **** 2dup THREAD DUP @ tsys-here ROT ! tsys-, \ LFA 0 tsys-, \ CFA-PTR - \ IN-SYS-T? NOT DUP IF IN-SYSTEM THEN \ desperately needs >tapp, tapp> - \ [FORWARD] <COMPILE,> - \ IF IN-APPLICATION THEN BFA_VFA_PRESENT tsys-c, \ BFA (VFA only) tsys-here LAST-H ! \ remember nfa --- 331,334 ---- *************** *** 534,542 **** T: [COMPILE] 'T EXECUTE T; - : >BODY-T CELL+ ; - FORWARD: <(IS)> T: IS [FORWARD] <(IS)> T; ! : IS 'T >BODY @ >BODY-T 2DUP t-! 8 + t-! ; ( patches both current and default value of deferred word ) --- 527,533 ---- T: [COMPILE] 'T EXECUTE T; FORWARD: <(IS)> T: IS [FORWARD] <(IS)> T; ! : IS 'T >BODY @ >body 2DUP t-! 8 + t-! ; ( patches both current and default value of deferred word ) *************** *** 572,576 **** : .UNRESOLVED ( -- f ) 0 TO #UNRESOLVED ! FORWARD-LINK BEGIN @ DUP WHILE DUP 2 CELLS - RESOLVED? 0= --- 563,567 ---- : .UNRESOLVED ( -- f ) 0 TO #UNRESOLVED ! FORWARD-LINK CR BEGIN @ DUP WHILE DUP 2 CELLS - RESOLVED? 0= *************** *** 578,582 **** 1 +TO #UNRESOLVED THEN - START/STOP REPEAT DROP #UNRESOLVED --- 569,572 ---- *************** *** 585,591 **** THEN DEPTH 0<> IF ! 1 TO #UNRESOLVED ! CR ." *** Stack was not clean on exit ***" ! ELSE CR ." Stack clean on exit" THEN #UNRESOLVED IF 3 0 DO BEEP 300 MS LOOP THEN --- 575,581 ---- THEN DEPTH 0<> IF ! 1 TO #UNRESOLVED CR ! ." *** Stack was not clean on exit ***" ! ELSE ." Stack clean on exit" THEN #UNRESOLVED IF 3 0 DO BEEP 300 MS LOOP THEN *************** *** 669,673 **** META DEFINITIONS ! : ALIAS ( xt -- ) TARGET-DEFINE ; --- 659,663 ---- META DEFINITIONS ! : ALIAS ( xt -- ) TARGET-DEFINE ; *************** *** 750,760 **** \ ====================================================================== \ Identify numbers (single numbers only) ! (( ! : NUMBER? ( addr -- n f ) ! count OVER C@ [CHAR] - = \ leading minus sign? ! DUP >R IF 1 /STRING THEN ! 0 0 2SWAP >NUMBER 0= NIP NIP ( -- u f ) ! R> IF SWAP NEGATE SWAP THEN ; ! )) : meta-number? ( ^str -- d n ) \ an extensible version of NUMBER count temp$ place --- 740,744 ---- \ ====================================================================== \ Identify numbers (single numbers only) ! : meta-number? ( ^str -- d n ) \ an extensible version of NUMBER count temp$ place *************** *** 806,810 **** : ALLOT t-allot ; : ," t-string, ; - : >BODY >BODY-T ; : ! t-! ; : ALIGN t-align ; --- 790,793 ---- Index: fkernext.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/fkernext.f,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fkernext.f 21 Dec 2004 00:19:10 -0000 1.1 --- fkernext.f 16 Aug 2005 00:01:05 -0000 1.2 *************** *** 40,88 **** )) ! macro: exec-fixed \ macro for fixed loadpoint exec jmp [eax] endm ! macro: next-fixed \ macro for fixed next mov eax, 0 [esi] add esi, # 4 jmp [eax] endm ! macro: branch-fixed \ macro to take a branch mov esi, 0 [esi] mov eax, -4 [esi] jmp [eax] endm - - \ is meta vocab undefined? [undefined] META [IF] \ in ASMWIN32.F cr .( Loading NEXT/EXEC ASM Support) - macro: exec ( assemble code to execute the cfa in eax ) - ( -- ) - /set-prefix >r - exec-fixed - r> reset-syntax - endm - - macro: next ( assemble the code to do a next ) - ( -- ) - /set-prefix >r - a; resolve-ofa \ resolve the optimizer field address - next-fixed - r> reset-syntax - endm - - macro: br-next ( assemble the code to do a branch to next ) - ( -- ) - /set-prefix >r - a; resolve-ofa \ resolve the optimizer field address - branch-fixed - r> reset-syntax - endm - macro: fcall ( a macro to assemble a call to callf ) xchg esp, ebp --- 40,75 ---- )) ! macro: exec ( assemble code to execute the cfa in eax ) ! ( -- ) ! /set-prefix >r jmp [eax] + r> reset-syntax endm ! macro: next ( assemble the code to do a next ) ! ( -- ) ! /set-prefix >r ! a; resolve-ofa \ resolve the optimizer field address mov eax, 0 [esi] add esi, # 4 jmp [eax] + r> reset-syntax endm ! macro: br-next ( assemble the code to do a branch to next ) ! ( -- ) ! /set-prefix >r ! a; resolve-ofa \ resolve the optimizer field address mov esi, 0 [esi] mov eax, -4 [esi] jmp [eax] + r> reset-syntax endm [undefined] META [IF] \ in ASMWIN32.F + \ is meta vocab undefined? cr .( Loading NEXT/EXEC ASM Support) macro: fcall ( a macro to assemble a call to callf ) xchg esp, ebp *************** *** 98,123 **** cr .( Loading META NEXT/EXEC ASM Support) ! MACRO NEXT ( -- ) \ Inner interpreter ! RESOLVE-OFA \ save size of code definition ! next-fixed ! END-MACRO ! ! MACRO EXEC ( -- ) \ execute absolutee cfa in eax ! NO-OFA \ reset OFA usage ! exec-fixed ! END-MACRO ! ! MACRO BR-NEXT ( -- ) \ take branch ! NO-OFA \ reset OFA usage ! branch-fixed ! END-MACRO ! ! ! MACRO FCALL ( a macro to assemble a call to callf ) ! xchg esp, ebp ! mov eax, # ' \ set eax to word ! s" call callf a;" evaluate ! xchg esp, ebp ! END-MACRO [THEN] \ end of META.F --- 85,94 ---- cr .( Loading META NEXT/EXEC ASM Support) ! macro: fcall ( a macro to assemble a call to callf ) ! xchg esp, ebp ! mov eax, # ' \ set eax to word ! s" call callf a;" evaluate ! xchg esp, ebp ! endm [THEN] \ end of META.F |