--- gforth/cross.fs 2000/06/17 20:18:15 1.85 +++ gforth/cross.fs 2001/09/04 11:09:59 1.102 @@ -1,7 +1,7 @@ \ CROSS.FS The Cross-Compiler 06oct92py \ Idea and implementation: Bernd Paysan (py) -\ Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc. +\ Copyright (C) 1995,1996,1997,1998,1999,2000 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -17,7 +17,7 @@ \ You should have received a copy of the GNU General Public License \ along with this program; if not, write to the Free Software -\ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. 0 [IF] @@ -1515,7 +1515,9 @@ variable ResolveFlag >CROSS \ Header states 12dec92py -: flag! ( 8b -- ) tlast @ dup >r T c@ xor r> c! H ; +\ : flag! ( 8b -- ) tlast @ dup >r T c@ xor r> c! H ; +bigendian [IF] 0 [ELSE] tcell 1- [THEN] Constant flag+ +: flag! ( w -- ) tlast @ flag+ + dup >r T c@ xor r> c! H ; VARIABLE ^imm @@ -1537,7 +1539,11 @@ VARIABLE ^imm >TARGET : string, ( addr count -- ) dup T c, H bounds ?DO I c@ T c, H LOOP ; -: name, ( "name" -- ) bl word count T string, cfalign H ; + +: lstring, ( addr count -- ) + dup T , H bounds ?DO I c@ T c, H LOOP ; + +: name, ( "name" -- ) bl word count T lstring, cfalign H ; : view, ( -- ) ( dummy ) ; >CROSS @@ -2202,6 +2208,17 @@ Builder Field : cell% ( n -- size align ) T 1 cells H dup ; + +Build: ( m v -- m' v ) dup T , cell+ H ; +DO: abort" Not in cross mode" ;DO +Builder input-method + +Build: ( m v size -- m v' ) over T , H + ; +DO: abort" Not in cross mode" ;DO +Builder input-var + + + \ structural conditionals 17dec92py >CROSS @@ -2394,6 +2411,13 @@ Cond: postpone ( -- ) restrict? \ name ELSE dup >magic @ = IF gexecute ELSE compile (compile) addr, THEN THEN ;Cond + +Cond: [compile] ( -- ) restrict? \ name + bl word gfind dup 0= ABORT" CROSS: Can't compile" + 0> IF gexecute + ELSE dup >magic @ = + IF gexecute + ELSE compile (compile) addr, THEN THEN ;Cond \ save-cross 17mar93py @@ -2571,6 +2595,10 @@ bigendian Constant bigendian : tempdp> tempdp> ; : const constflag on ; : warnings name 3 = 0= twarnings ! drop ; +: redefinitions-start twarnings off ; +: redefinitions-end twarnings on ; +: group 0 word drop ; + : | ; \ : | NoHeaderFlag on ; \ This is broken (damages the last word)