--- gforth/prim 2001/02/28 22:31:43 1.77 +++ gforth/prim 2002/01/05 22:58:59 1.90 @@ -74,6 +74,10 @@ \ xt.* XT \ f83name.* F83Name * +\E stack data-stack sp Cell +\E stack fp-stack fp Float +\E stack return-stack rp Cell +\E \E get-current prefixes set-current \E \E s" Bool" single data-stack type-prefix f @@ -126,6 +130,9 @@ \ these m4 macros would collide with identifiers undefine(`index') undefine(`shift') +undefine(`symbols') + +\g control noop ( -- ) gforth : @@ -174,6 +181,7 @@ $1 ( `#'ndisp $2 ) $3 $4 SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; $5 \+glocals @@ -183,6 +191,7 @@ $4 lp += nlocals; SET_IP((Xt *)(((Cell)(IP-2))+ndisp)); TAIL; } +SUPER_CONTINUE; \+ ) @@ -209,6 +218,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}."" @@ -221,6 +231,7 @@ if (f!=0) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); NEXT; } +SUPER_CONTINUE; \+ \f[THEN] @@ -302,6 +313,7 @@ if (nstart == nlimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : 2dup = IF r> swap rot >r >r @@ -317,6 +329,7 @@ if (nstart >= nlimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -332,6 +345,7 @@ if (ustart >= ulimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -347,6 +361,7 @@ if (nstart <= nlimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -362,6 +377,7 @@ if (ustart <= ulimit) { SET_IP((Xt *)(((Cell)(IP-1))+ndisp)); TAIL; } +SUPER_CONTINUE; : swap 2dup r> swap >r swap >r @@ -404,6 +420,8 @@ k ( R:n R:d1 R:d2 -- n R:n R:d1 R:d2 ) \ digit is high-level: 0/0% +\g strings + move ( c_from c_to ucount -- ) core ""Copy the contents of @i{ucount} aus at @i{c-from} to @i{c-to}. @code{move} works correctly even if the two areas overlap."" @@ -513,6 +531,8 @@ u2 = u1-n; : tuck - >r + r> dup 0< IF - 0 THEN ; +\g arith + + ( n1 n2 -- n ) core plus n = n1+n2; @@ -910,6 +930,8 @@ f = FLAG(u1-u2 < u3-u2); : over - >r - r> u< ; +\g internal + sp@ ( -- a_addr ) gforth sp_fetch a_addr = sp+1; @@ -937,6 +959,8 @@ fp = f_addr; ""The primitive compiled by @code{EXIT}."" SET_IP((Xt *)w); +\g stack + >r ( w -- R:w ) core to_r : (>r) ; @@ -1376,6 +1400,8 @@ n=1; \f[THEN] +\g hostos + key-file ( wfileid -- n ) gforth paren_key_file #ifdef HAS_FILE fflush(stdout); @@ -1449,7 +1475,7 @@ c_addr2 = getenv(cstr(c_addr1,u1,1)); u2 = (c_addr2 == NULL ? 0 : strlen(c_addr2)); open-pipe ( c_addr u wfam -- wfileid wior ) gforth open_pipe -wfileid=(Cell)popen(cstr(c_addr,u,1),fileattr[wfam]); /* ~ expansion of 1st arg? */ +wfileid=(Cell)popen(cstr(c_addr,u,1),pfileattr[wfam]); /* ~ expansion of 1st arg? */ wior = IOR(wfileid==0); /* !! the man page says that errno is not set reliably */ close-pipe ( wfileid -- wretval wior ) gforth close_pipe @@ -1591,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