version 1.140, 2003/08/20 13:29:19
|
version 1.146, 2003/10/09 20:25:59
|
Line 136
|
Line 136
|
\ throw execute, cfa and NEXT1 out? |
\ throw execute, cfa and NEXT1 out? |
\ macroize *ip, ip++, *ip++ (pipelining)? |
\ macroize *ip, ip++, *ip++ (pipelining)? |
|
|
|
\ Stack caching setup |
|
|
|
\E register IPTOS Cell |
|
\E register spa Cell |
|
\E register spb Cell |
|
\E register spc Cell |
|
\E register spd Cell |
|
|
|
\E create IPregs IPTOS , |
|
\E create regs spc , spb , spa , |
|
|
|
\E IPregs 1 0 stack-state IPss1 |
|
\E regs 3 cells + 0 0 stack-state ss0 |
|
\E regs 2 cells + 1 0 stack-state ss1 |
|
\E regs 1 cells + 2 1 stack-state ss2 |
|
\E regs 0 cells + 3 2 stack-state ss3 |
|
|
|
\ the first of these is the default state |
|
\E state S0 |
|
\E state S1 |
|
\E state S2 |
|
\E state S3 |
|
|
|
\E ss0 data-stack S0 set-ss |
|
\E ss1 data-stack S1 set-ss |
|
\E ss2 data-stack S2 set-ss |
|
\E ss3 data-stack S3 set-ss |
|
|
|
\E IPss1 inst-stream S0 set-ss |
|
\E IPss1 inst-stream S1 set-ss |
|
\E IPss1 inst-stream S2 set-ss |
|
\E IPss1 inst-stream S3 set-ss |
|
|
|
\E data-stack to cache-stack |
|
\E here 4 cache-states 2! s0 , s1 , s2 , s3 , |
|
|
|
\ !! the following should be automatic |
|
\E S0 to state-default |
|
\E state-default to state-in |
|
\E state-default to state-out |
|
|
\ these m4 macros would collide with identifiers |
\ these m4 macros would collide with identifiers |
undefine(`index') |
undefine(`index') |
undefine(`shift') |
undefine(`shift') |
Line 148 undefine(`symbols')
|
Line 189 undefine(`symbols')
|
|
|
(docol) ( -- R:a_retaddr ) gforth-internal paren_docol |
(docol) ( -- R:a_retaddr ) gforth-internal paren_docol |
""run-time routine for colon definitions"" |
""run-time routine for colon definitions"" |
a_retaddr = (Cell *)ip; |
a_retaddr = (Cell *)IP; |
SET_IP((Xt *)PFA(CFA)); |
SET_IP((Xt *)PFA(CFA)); |
|
|
(docon) ( -- w ) gforth-internal paren_docon |
(docon) ( -- w ) gforth-internal paren_docon |
Line 165 a_user = (Cell *)(up+*(Cell *)PFA(CFA));
|
Line 206 a_user = (Cell *)(up+*(Cell *)PFA(CFA));
|
|
|
(dodefer) ( -- ) gforth-internal paren_dodefer |
(dodefer) ( -- ) gforth-internal paren_dodefer |
""run-time routine for deferred words"" |
""run-time routine for deferred words"" |
SUPER_END; |
ip=IP; /* undo any ip updating that may have been performed by NEXT_P0 */ |
|
SUPER_END; /* !! probably unnecessary and may lead to measurement errors */ |
EXEC(*(Xt *)PFA(CFA)); |
EXEC(*(Xt *)PFA(CFA)); |
|
|
(dofield) ( n1 -- n2 ) gforth-internal paren_field |
(dofield) ( n1 -- n2 ) gforth-internal paren_field |
Line 174 n2 = n1 + *(Cell *)PFA(CFA);
|
Line 216 n2 = n1 + *(Cell *)PFA(CFA);
|
|
|
(dodoes) ( -- a_body R:a_retaddr ) gforth-internal paren_dodoes |
(dodoes) ( -- a_body R:a_retaddr ) gforth-internal paren_dodoes |
""run-time routine for @code{does>}-defined words"" |
""run-time routine for @code{does>}-defined words"" |
a_retaddr = (Cell *)ip; |
a_retaddr = (Cell *)IP; |
a_body = PFA(CFA); |
a_body = PFA(CFA); |
SET_IP(DOES_CODE1(CFA)); |
SET_IP(DOES_CODE1(CFA)); |
|
|
Line 637 n = compare(c_addr1, u1, c_addr2, u2);
|
Line 679 n = compare(c_addr1, u1, c_addr2, u2);
|
: |
: |
rot 2dup swap - >r min swap -text dup |
rot 2dup swap - >r min swap -text dup |
IF rdrop ELSE drop r> sgn THEN ; |
IF rdrop ELSE drop r> sgn THEN ; |
|
: -text ( c_addr1 u c_addr2 -- n ) |
|
swap bounds |
|
?DO dup c@ I c@ = WHILE 1+ LOOP drop 0 |
|
ELSE c@ I c@ - unloop THEN sgn ; |
: sgn ( n -- -1/0/1 ) |
: sgn ( n -- -1/0/1 ) |
dup 0= IF EXIT THEN 0< 2* 1+ ; |
dup 0= IF EXIT THEN 0< 2* 1+ ; |
|
|
Line 1395 longname2=listlfind(c_addr, u, longname1
|
Line 1441 longname2=listlfind(c_addr, u, longname1
|
REPEAT THEN nip nip ; |
REPEAT THEN nip nip ; |
: (findl-samelen) ( u longname1 -- u longname2/0 ) |
: (findl-samelen) ( u longname1 -- u longname2/0 ) |
BEGIN 2dup cell+ @ lcount-mask and <> WHILE @ dup 0= UNTIL THEN ; |
BEGIN 2dup cell+ @ lcount-mask and <> WHILE @ dup 0= UNTIL THEN ; |
|
: capscomp ( c_addr1 u c_addr2 -- n ) |
|
swap bounds |
|
?DO dup c@ I c@ <> |
|
IF dup c@ toupper I c@ toupper = |
|
ELSE true THEN WHILE 1+ LOOP drop 0 |
|
ELSE c@ toupper I c@ toupper - unloop THEN sgn ; |
|
: sgn ( n -- -1/0/1 ) |
|
dup 0= IF EXIT THEN 0< 2* 1+ ; |
|
|
\+hash |
\+hash |
|
|
Line 2266 u3 = 0;
|
Line 2320 u3 = 0;
|
# endif |
# endif |
#endif |
#endif |
|
|
|
wcall ( u -- ) gforth |
|
IF_fpTOS(fp[0]=fpTOS); |
|
FP=fp; |
|
sp=(Cell*)(SYSCALL(Cell*(*)(Cell *, void *))u)(sp, &FP); |
|
fp=FP; |
|
IF_spTOS(spTOS=sp[0];) |
|
IF_fpTOS(fpTOS=fp[0]); |
|
|
\+FFCALL |
\+FFCALL |
|
|
av-start-void ( c_addr -- ) gforth av_start_void |
av-start-void ( c_addr -- ) gforth av_start_void |
Line 2415 va-return-double ( r -- ) gforth va_retu
|
Line 2477 va-return-double ( r -- ) gforth va_retu
|
va_return_double(clist, r); |
va_return_double(clist, r); |
return 0; |
return 0; |
|
|
\- |
\+ |
|
|
|
\+OLDCALL |
|
|
define(`uploop', |
define(`uploop', |
`pushdef(`$1', `$2')_uploop(`$1', `$2', `$3', `$4', `$5')`'popdef(`$1')') |
`pushdef(`$1', `$2')_uploop(`$1', `$2', `$3', `$4', `$5')`'popdef(`$1')') |
Line 2456 fcall(20)
|
Line 2520 fcall(20)
|
\+ |
\+ |
\+ |
\+ |
|
|
wcall ( u -- ) gforth |
\g peephole |
IF_fpTOS(fp[0]=fpTOS); |
|
FP=fp; |
|
sp=(Cell*)(SYSCALL(Cell*(*)(Cell *, void *))u)(sp, &FP); |
|
fp=FP; |
|
IF_spTOS(spTOS=sp[0];) |
|
IF_fpTOS(fpTOS=fp[0]); |
|
|
|
\+peephole |
\+peephole |
|
|
\g peephole |
|
|
|
compile-prim1 ( a_prim -- ) gforth compile_prim1 |
compile-prim1 ( a_prim -- ) gforth compile_prim1 |
""compile prim (incl. immargs) at @var{a_prim}"" |
""compile prim (incl. immargs) at @var{a_prim}"" |
compile_prim1(a_prim); |
compile_prim1(a_prim); |