--- gforth/prim 2001/12/01 20:33:14 1.84 +++ gforth/prim 2002/06/02 10:31:28 1.93 @@ -53,15 +53,18 @@ \ your code does not fall through, the results are not stored into the \ stack. Use different names on both sides of the '--', if you change a \ value (some stores to the stack are optimized away). -\ -\ +\ +\ For superinstructions the syntax is: +\ +\ forth-name [/ c-name] = forth-name forth-name ... +\ \ \ The stack variables have the following types: \ \ name matches type \ f.* Bool \ c.* Char -\ [nw].* Cell +\ [nw].* Cell \ u.* UCell \ d.* DCell \ ud.* UDCell @@ -181,6 +184,7 @@ $1 ( `#'ndisp $2 ) $3 $4 SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; $5 \+glocals @@ -190,6 +194,7 @@ $4 lp += nlocals; SET_IP((Xt *)(((Cell)(IP-2))+ndisp)); TAIL; } +SUPER_CONTINUE; \+ ) @@ -216,6 +221,7 @@ if (f==0) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; ?dup-0=-?branch ( #ndisp f -- ) new question_dupe_zero_equals_question_branch ""The run-time procedure compiled by @code{?DUP-0=-IF}."" @@ -228,6 +234,7 @@ if (f!=0) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); NEXT; } +SUPER_CONTINUE; \+ \f[THEN] @@ -309,6 +316,7 @@ if (nstart == nlimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : 2dup = IF r> swap rot >r >r @@ -324,6 +332,7 @@ if (nstart >= nlimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -339,6 +348,7 @@ if (ustart >= ulimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -354,6 +364,7 @@ if (nstart <= nlimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -369,6 +380,7 @@ if (ustart <= ulimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -1347,7 +1359,6 @@ a_addr = (Cell *)DOES_CODE(xt); code-address! ( c_addr xt -- ) gforth code_address_store ""Create a code field with code address @i{c-addr} at @i{xt}."" MAKE_CF(xt, c_addr); -CACHE_FLUSH(xt,(size_t)PFA(0)); : ! ; @@ -1355,7 +1366,6 @@ does-code! ( a_addr xt -- ) gforth does ""Create a code field at @i{xt} for a child of a @code{DOES>}-word; @i{a-addr} is the start of the Forth code after @code{DOES>}."" MAKE_DOES_CF(xt, a_addr); -CACHE_FLUSH(xt,(size_t)PFA(0)); : dodoes: over ! cell+ ! ; @@ -1363,7 +1373,6 @@ does-handler! ( a_addr -- ) gforth does_ ""Create a @code{DOES>}-handler at address @i{a-addr}. Normally, @i{a-addr} points just behind a @code{DOES>}."" MAKE_DOES_HANDLER(a_addr); -CACHE_FLUSH((caddr_t)a_addr,DOES_HANDLER_SIZE); : drop ; @@ -1608,7 +1617,7 @@ if (wior) clearerr((FILE *)wfileid); read-line ( c_addr u1 wfileid -- u2 flag wior ) file read_line -""this is only for backward compatibility"" +/* this may one day be replaced with : read-line (read-line) nip ; */ Cell c; flag=-1; for(u2=0; u2