--- gforth/cross.fs 2001/01/29 11:39:43 1.91 +++ gforth/cross.fs 2001/09/04 11:09:59 1.102 @@ -802,7 +802,6 @@ false DefaultValue dcomps false DefaultValue hash false DefaultValue xconds false DefaultValue header -false DefaultValue new-input [THEN] true DefaultValue interpreter @@ -1516,22 +1515,18 @@ variable ResolveFlag >CROSS \ Header states 12dec92py +\ : 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 -\ !! should be target wordsize specific -$80 constant alias-mask -$40 constant immediate-mask -$20 constant restrict-mask - >TARGET -: immediate immediate-mask flag! +: immediate 40 flag! ^imm @ @ dup = IF drop EXIT THEN <> ABORT" CROSS: Cannot immediate a unresolved word" ^imm @ ! ; -: restrict restrict-mask flag! ; +: restrict 20 flag! ; : isdoer \G define a forth word as doer, this makes obviously only sence on @@ -1543,9 +1538,11 @@ $20 constant restrict-mask >TARGET : string, ( addr count -- ) - dup T c, H bounds ?DO I c@ T c, H LOOP ; + dup T c, H bounds ?DO I c@ T c, H LOOP ; + : lstring, ( addr count -- ) - dup T , H bounds ?DO I c@ T c, H LOOP ; + dup T , H bounds ?DO I c@ T c, H LOOP ; + : name, ( "name" -- ) bl word count T lstring, cfalign H ; : view, ( -- ) ( dummy ) ; >CROSS @@ -1701,7 +1698,7 @@ NoHeaderFlag off IF dup >end tdoes ! ELSE 0 tdoes ! THEN - alias-mask flag! + 80 flag! cross-doc-entry cross-tag-entry ; VARIABLE ;Resolve 1 cells allot @@ -1718,7 +1715,7 @@ VARIABLE ;Resolve 1 cells allot IF .sourcepos ." needs prim: " >in @ bl word count type >in ! cr THEN - (THeader over resolve T A, H alias-mask flag! ; + (THeader over resolve T A, H 80 flag! ; : Alias: ( cfa -- ) \ name >in @ skip? IF 2drop EXIT THEN >in ! dup 0< s" prims" T $has? H 0= and @@ -2042,7 +2039,7 @@ Cond: DOES> restrict? create-forward-warn IF ['] reswarn-forward IS resolve-warning THEN \ make Alias - (THeader there 0 T a, H alias-mask flag! ( S executed-ghost new-ghost ) + (THeader there 0 T a, H 80 flag! ( S executed-ghost new-ghost ) \ store poiter to code-field switchram T cfalign H there swap T ! H @@ -2211,6 +2208,7 @@ 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 @@ -2219,6 +2217,8 @@ Build: ( m v size -- m v' ) over T , H DO: abort" Not in cross mode" ;DO Builder input-var + + \ structural conditionals 17dec92py >CROSS @@ -2411,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 @@ -2588,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)