--- gforth/cross.fs 1997/02/09 21:51:38 1.44 +++ gforth/cross.fs 1997/04/10 21:32:08 1.47 @@ -100,6 +100,7 @@ also Forth definitions [IFDEF] asm-include asm-include [THEN] previous +hex >CROSS @@ -245,6 +246,7 @@ VARIABLE VocTemp : previous VocTemp @ set-current ; +hex 4711 Constant 4712 Constant 4713 Constant 4714 Constant @@ -528,6 +530,7 @@ ghost (does>) ghost noop ghost (.") ghost (S") ghost (ABORT") 2drop drop ghost ' drop ghost :docol ghost :doesjump ghost :dodoes 2drop drop +ghost over ghost = ghost drop 2drop drop \ compile 10may93jaw @@ -542,7 +545,7 @@ ghost :docol ghost :doesjump ghost :d \ generic threading modell : docol, ( -- ) compile :docol T 0 , H ; -: dodoes, ( -- ) compile :doesjump T 0 , H ; +: dodoes, ( -- ) T cfalign H compile :doesjump T 0 , H ; [IFUNDEF] (code) Defer (code) @@ -552,7 +555,9 @@ Defer (end-code) >TARGET : Code (THeader there resolve - there 2 T cells H + T a, 0 , H + [ has-prims 0= [IF] ITC [ELSE] true [THEN] ] [IF] + there 2 T cells H + T a, 0 , H + [THEN] depth (code) ; : Code: @@ -647,7 +652,7 @@ Cond: MAXI docol, depth T ] H ; : :noname ( -- colon-sys ) - T align H there docol, depth T ] H ; + T cfalign H there docol, depth T ] H ; Cond: EXIT ( -- ) restrict? compile ;S ;Cond @@ -668,7 +673,7 @@ Cond: [ restrict? state off ;Cond >TARGET Cond: DOES> restrict? - compile (does>) dodoes, tdoes @ ?dup IF @ T here H resolve THEN + compile (does>) dodoes, tdoes @ ?dup IF @ T here H resolve THEN ;Cond : DOES> dodoes, T here H !does depth T ] H ; @@ -779,11 +784,11 @@ Build: ( d -- ) T , , H ; DO: ( ghost -- d ) T dup cell+ @ swap @ H ;DO Builder 2Constant -Build: T 0 , H ; +Build: T , H ; by (Constant) Builder Value -Build: T 0 A, H ; +Build: T A, H ; by (Constant) Builder AValue @@ -864,6 +869,12 @@ Cond: AGAIN restrict? sys? compile b Cond: UNTIL restrict? sys? compile ?branch r compile over compile = compile IF compile drop + r> ;Cond +Cond: ENDOF restrict? >r compile ELSE r> ;Cond +Cond: ENDCASE restrict? compile drop 0 ?DO compile THEN LOOP ;Cond + \ Structural Conditionals 12dec92py Cond: DO restrict? compile (do) T here H ;Cond @@ -1031,6 +1042,7 @@ mach-file count included : undef-words ['] defined? IS skip? ; : \ postpone \ ; immediate +: \G T-\G ; immediate : ( postpone ( ; immediate : include bl word count included ; : .( [char] ) parse type ;