--- gforth/cross.fs 1999/07/24 13:07:18 1.80 +++ gforth/cross.fs 2001/06/16 22:53:36 1.99 @@ -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] @@ -474,27 +474,17 @@ Create tfile 0 c, 255 chars allot THEN ; : compact.. ( adr len -- adr2 len2 ) -\ deletes phrases like "xy/.." out of our directory name 2dec97jaw - over >r -1 >r - BEGIN dup WHILE - over c@ pathsep? - IF r@ -1 = - IF r> drop dup >r - ELSE 2dup 1 /string - 3 min s" ../" compare - 0= - IF r@ over - ( diff ) - 2 pick swap - ( dest-adr ) - >r 3 /string r> swap 2dup >r >r - move r> r> - ELSE r> drop dup >r - THEN - THEN - THEN - 1 /string - REPEAT - r> drop - drop r> tuck - ; + \ deletes phrases like "xy/.." out of our directory name 2dec97jaw + over swap + BEGIN dup WHILE + dup >r '/ scan 2dup 4 min s" /../" compare 0= + IF + dup r> - >r 4 /string over r> + 4 - + swap 2dup + >r move dup r> over - + ELSE + rdrop dup 1 min /string + THEN + REPEAT drop over - ; : reworkdir ( -- ) remove~+ @@ -666,27 +656,95 @@ hex 4713 Constant 4714 Constant 4715 Constant -\ iForth makes only immediate directly after create -\ make atonce trick! ? +\ Compiler States -Variable atonce atonce off +Variable comp-state +0 Constant interpreting +1 Constant compiling +2 Constant resolving +3 Constant assembling -: NoExec true ABORT" CROSS: Don't execute ghost, or immediate target word" ; +Defer lit, ( n -- ) +Defer alit, ( n -- ) + +Defer branch, ( target-addr -- ) \ compiles a branch +Defer ?branch, ( target-addr -- ) \ compiles a ?branch +Defer branchmark, ( -- branch-addr ) \ reserves room for a branch +Defer ?branchmark, ( -- branch-addr ) \ reserves room for a ?branch +Defer ?domark, ( -- branch-addr ) \ reserves room for a ?do branch +Defer branchto, ( -- ) \ actual program position is target of a branch (do e.g. alignment) +Defer branchtoresolve, ( branch-addr -- ) \ resolves a forward reference from branchmark +Defer branchfrom, ( -- ) \ ?! +Defer branchtomark, ( -- target-addr ) \ marks a branch destination + +Defer colon, ( tcfa -- ) \ compiles call to tcfa at current position +Defer prim, ( tcfa -- ) \ compiles a primitive invocation + \ at current position +Defer colonmark, ( -- addr ) \ marks a colon call +Defer colon-resolve ( tcfa addr -- ) + +Defer addr-resolve ( target-addr addr -- ) +Defer doer-resolve ( ghost res-pnt target-addr addr -- ghost res-pnt ) + +Defer do, ( -- do-token ) +Defer ?do, ( -- ?do-token ) +Defer for, ( -- for-token ) +Defer loop, ( do-token / ?do-token -- ) +Defer +loop, ( do-token / ?do-token -- ) +Defer next, ( for-token ) + +[IFUNDEF] ca>native +defer ca>native +[THEN] -: GhostHeader , 0 , ['] NoExec , ; +\ ghost structure : >magic ; \ type of ghost : >link cell+ ; \ pointer where ghost is in target, or if unresolved \ points to the where we have to resolve (linked-list) : >exec cell+ cell+ ; \ execution symantics (while target compiling) of ghost -: >end 3 cells + ; \ room for additional tags +: >comp 3 cells + ; \ compilation semantics +: >end 4 cells + ; \ room for additional tags \ for builder (create, variable...) words the \ execution symantics of words built are placed here +\ resolve structure + +: >next ; \ link to next field +: >tag cell+ ; \ indecates type of reference: 0: call, 1: address, 2: doer +: >taddr cell+ cell+ ; +: >ghost 3 cells + ; +: >file 4 cells + ; +: >line 5 cells + ; + +\ refer variables + Variable executed-ghost \ last executed ghost, needed in tcreate and gdoes> Variable last-ghost \ last ghost that is created Variable last-header-ghost \ last ghost definitions with header +: (refered) ( ghost addr tag -- ) +\G creates a reference to ghost at address taddr + rot >r here r@ >link @ , r> >link ! + ( taddr tag ) , + ( taddr ) , + last-header-ghost @ , + loadfile , + sourceline# , + ; + +\ iForth makes only immediate directly after create +\ make atonce trick! ? + +Variable atonce atonce off + +: NoExec true ABORT" CROSS: Don't execute ghost, or immediate target word" ; + +: is-forward ( ghost -- ) + colonmark, 0 (refered) ; \ compile space for call + +: GhostHeader , 0 , ['] NoExec , ['] is-forward , ; + : Make-Ghost ( "name" -- ghost ) >in @ GhostName swap >in ! ) ghost noop ghost (.") ghost (S") ghost (ABORT") 2drop drop ghost ' drop ghost :docol ghost :doesjump ghost :dodoes 2drop drop -ghost :dovar drop +ghost :dovar ghost :dodefer ghost :dofield 2drop drop ghost over ghost = ghost drop 2drop drop -ghost - drop +ghost call ghost useraddr ghost execute 2drop drop +ghost + ghost - ghost @ 2drop drop ghost 2drop drop ghost 2dup drop @@ -787,7 +846,7 @@ VARIABLE env-current \ save information >ENVIRON get-order get-current swap 1+ set-order true SetValue compiler -true SetValue cross +true SetValue cross true SetValue standard-threading >TARGET previous @@ -812,6 +871,8 @@ false DefaultValue dcomps false DefaultValue hash false DefaultValue xconds false DefaultValue header +false DefaultValue backtrace +false DefaultValue new-input [THEN] true DefaultValue interpreter @@ -864,7 +925,7 @@ float Constant tfloat bits/byte Constant tbits/byte [THEN] H -tbits/byte bits/byte / Constant tbyte +tbits/char bits/byte / Constant tbyte \ Variables 06oct92py @@ -1180,8 +1241,19 @@ CREATE Bittable 80 c, 40 c, 20 c, 10 c, : +bit ( addr n -- ) >bit over c@ or swap c! ; : -bit ( addr n -- ) >bit invert over c@ and swap c! ; -: (relon) ( taddr -- ) bit$ @ swap cell/ +bit ; -: (reloff) ( taddr -- ) bit$ @ swap cell/ -bit ; +: (relon) ( taddr -- ) + [ [IFDEF] fd-relocation-table ] + s" +" fd-relocation-table write-file throw + dup s>d <# #s #> fd-relocation-table write-line throw + [ [THEN] ] + bit$ @ swap cell/ +bit ; + +: (reloff) ( taddr -- ) + [ [IFDEF] fd-relocation-table ] + s" -" fd-relocation-table write-file throw + dup s>d <# #s #> fd-relocation-table write-line throw + [ [THEN] ] + bit$ @ swap cell/ -bit ; : (>image) ( taddr -- absaddr ) image @ + ; @@ -1222,7 +1294,7 @@ T has? relocate H : c@ ( taddr -- char ) >image Sc@ ; : c! ( char taddr -- ) >image Sc! ; : 2@ ( taddr -- x1 x2 ) T dup cell+ @ swap @ H ; -: 2! ( x1 x2 taddr -- ) T swap over ! cell+ ! H ; +: 2! ( x1 x2 taddr -- ) T tuck ! cell+ ! H ; \ Target compilation primitives 06oct92py \ included A! 16may93jaw @@ -1265,45 +1337,6 @@ previous \ \ -------------------- Compiler Plug Ins 01aug97jaw -\ Compiler States - -Variable comp-state -0 Constant interpreting -1 Constant compiling -2 Constant resolving -3 Constant assembling - -Defer lit, ( n -- ) -Defer alit, ( n -- ) - -Defer branch, ( target-addr -- ) \ compiles a branch -Defer ?branch, ( target-addr -- ) \ compiles a ?branch -Defer branchmark, ( -- branch-addr ) \ reserves room for a branch -Defer ?branchmark, ( -- branch-addr ) \ reserves room for a ?branch -Defer ?domark, ( -- branch-addr ) \ reserves room for a ?do branch -Defer branchto, ( -- ) \ actual program position is target of a branch (do e.g. alignment) -Defer branchtoresolve, ( branch-addr -- ) \ resolves a forward reference from branchmark -Defer branchfrom, ( -- ) \ ?! -Defer branchtomark, ( -- target-addr ) \ marks a branch destination - -Defer colon, ( tcfa -- ) \ compiles call to tcfa at current position -Defer colonmark, ( -- addr ) \ marks a colon call -Defer colon-resolve ( tcfa addr -- ) - -Defer addr-resolve ( target-addr addr -- ) -Defer doer-resolve ( ghost res-pnt target-addr addr -- ghost res-pnt ) - -Defer do, ( -- do-token ) -Defer ?do, ( -- ?do-token ) -Defer for, ( -- for-token ) -Defer loop, ( do-token / ?do-token -- ) -Defer +loop, ( do-token / ?do-token -- ) -Defer next, ( for-token ) - -[IFUNDEF] ca>native -defer ca>native -[THEN] - >TARGET DEFER >body \ we need the system >body \ and the target >body @@ -1319,9 +1352,9 @@ DEFER dodoes, DEFER ]comp \ starts compilation DEFER comp[ \ ends compilation -: (cc) T a, H ; ' (cc) IS colon, +: (prim) T a, H ; ' (prim) IS prim, -: (cr) >tempdp ]comp colon, comp[ tempdp> ; ' (cr) IS colon-resolve +: (cr) >tempdp ]comp prim, comp[ tempdp> ; ' (cr) IS colon-resolve : (ar) T ! H ; ' (ar) IS addr-resolve : (dr) ( ghost res-pnt target-addr addr ) >tempdp drop over @@ -1333,31 +1366,12 @@ DEFER comp[ \ ends compilation : (cm) ( -- addr ) T here align H - -1 colon, ; ' (cm) IS colonmark, + -1 prim, ; ' (cm) IS colonmark, >TARGET -: compile, colon, ; +: compile, prim, ; >CROSS -\ resolve structure - -: >next ; \ link to next field -: >tag cell+ ; \ indecates type of reference: 0: call, 1: address, 2: doer -: >taddr cell+ cell+ ; -: >ghost 3 cells + ; -: >file 4 cells + ; -: >line 5 cells + ; - -: (refered) ( ghost addr tag -- ) -\G creates a reference to ghost at address taddr - rot >r here r@ >link @ , r> >link ! - ( taddr tag ) , - ( taddr ) , - last-header-ghost @ , - loadfile , - sourceline# , - ; - : refered ( ghost tag -- ) \G creates a resolve structure T here aligned H swap (refered) @@ -1427,6 +1441,11 @@ Exists-Warnings on ELSE true abort" CROSS: Ghostnames inconsistent " THEN ; +: colon-resolved ( ghost -- ) + >link @ colon, ; \ compile-call +: prim-resolved ( ghost -- ) + >link @ prim, ; + : resolve ( ghost tcfa -- ) \G resolve referencies to ghost with tcfa \ is ghost resolved?, second resolve means another definition with the @@ -1436,6 +1455,8 @@ Exists-Warnings on swap >r r@ >link @ swap \ ( list tcfa R: ghost ) \ mark ghost as resolved dup r@ >link ! r@ >magic ! + r@ >comp @ ['] is-forward = IF + ['] prim-resolved r@ >comp ! THEN \ loop through forward referencies r> -rot comp-state @ >r Resolving comp-state ! @@ -1447,17 +1468,11 @@ Exists-Warnings on \ gexecute ghost, 01nov92py -: is-forward ( ghost -- ) - colonmark, 0 (refered) ; \ compile space for call - -: is-resolved ( ghost -- ) - >link @ colon, ; \ compile-call - : gexecute ( ghost -- ) - dup @ = IF is-forward ELSE is-resolved THEN ; + dup >comp @ execute ; : addr, ( ghost -- ) - dup @ = IF 1 refered 0 T a, H ELSE >link @ T a, H THEN ; + dup forward? IF 1 refered 0 T a, H ELSE >link @ T a, H THEN ; \ !! : ghost, ghost gexecute ; @@ -1514,16 +1529,22 @@ 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 40 flag! +: immediate immediate-mask flag! ^imm @ @ dup = IF drop EXIT THEN <> ABORT" CROSS: Cannot immediate a unresolved word" ^imm @ ! ; -: restrict 20 flag! ; +: restrict restrict-mask flag! ; : isdoer \G define a forth word as doer, this makes obviously only sence on @@ -1535,8 +1556,10 @@ 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 ; + 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 ; +: name, ( "name" -- ) bl word count T lstring, cfalign H ; : view, ( -- ) ( dummy ) ; >CROSS @@ -1556,8 +1579,7 @@ Variable to-doc to-doc on IF s" " doc-file-id write-line throw s" make-doc " doc-file-id write-file throw - - tlast @ >image count 1F and doc-file-id write-file throw + Last-Header-Ghost @ >ghostname doc-file-id write-file throw >in @ [char] ( parse 2drop [char] ) parse doc-file-id write-file throw @@ -1651,7 +1673,9 @@ NoHeaderFlag off base @ >r hex 0 swap <# 0 ?DO # LOOP #> type r> base ! ; -: .sym + +: .sym ( adr len -- ) +\G escapes / and \ to produce sed output bounds DO I c@ dup CASE [char] / OF drop ." \/" ENDOF @@ -1674,16 +1698,22 @@ NoHeaderFlag off >in @ T name, H >in ! THEN T cfalign here H tlastcfa ! - \ Symbol table + \ Old Symbol table sed-script \ >in @ cr ." sym:s/CFA=" there 4 0.r ." /" bl word count .sym ." /g" cr >in ! ghost + \ output symbol table to extra file + [ [IFDEF] fd-symbol-table ] + base @ hex there s>d <# 8 0 DO # LOOP #> fd-symbol-table write-file throw base ! + s" :" fd-symbol-table write-file throw + dup >ghostname fd-symbol-table write-line throw + [ [THEN] ] dup Last-Header-Ghost ! dup >magic ^imm ! \ a pointer for immediate Already @ IF dup >end tdoes ! ELSE 0 tdoes ! THEN - 80 flag! + alias-mask flag! cross-doc-entry cross-tag-entry ; VARIABLE ;Resolve 1 cells allot @@ -1700,7 +1730,7 @@ VARIABLE ;Resolve 1 cells allot IF .sourcepos ." needs prim: " >in @ bl word count type >in ! cr THEN - (THeader over resolve T A, H 80 flag! ; + (THeader over resolve T A, H alias-mask flag! ; : Alias: ( cfa -- ) \ name >in @ skip? IF 2drop EXIT THEN >in ! dup 0< s" prims" T $has? H 0= and @@ -1746,6 +1776,12 @@ Comment ( Comment \ ELSE postpone literal postpone gexecute THEN ; immediate +T has? peephole H [IF] +: (cc) compile call T >body a, H ; ' (cc) IS colon, +[ELSE] + ' (prim) IS colon, +[THEN] + : [G'] \G ticks a ghost and returns its address bl word gfind 0= ABORT" CROSS: Ghost don't exists" @@ -1779,7 +1815,7 @@ Cond: ['] T ' H alit, ;Cond : (>body) ( cfa -- pfa ) xt>body + ; ' (>body) T IS >body H -: (doer,) ( ghost -- ) ]comp gexecute comp[ 1 fillcfa ; ' (doer,) IS doer, +: (doer,) ( ghost -- ) ]comp addr, comp[ 1 fillcfa ; ' (doer,) IS doer, : (docol,) ( -- ) [G'] :docol doer, ; ' (docol,) IS docol, @@ -1797,7 +1833,9 @@ Cond: ['] T ' H alit, ;Cond : (lit,) ( n -- ) compile lit T , H ; ' (lit,) IS lit, \ if we dont produce relocatable code alit, defaults to lit, jaw -has? relocate +\ this is just for convenience, so we don't have to define alit, +\ seperately for embedded systems.... +T has? relocate H [IF] : (alit,) ( n -- ) compile lit T a, H ; ' (alit,) IS alit, [ELSE] @@ -1847,33 +1885,27 @@ Cond: [Char] ( "" -- ) restrict \ some special literals 27jan97jaw \ !! Known Bug: Special Literals and plug-ins work only correct -\ on 16 and 32 Bit Targets and 32 Bit Hosts! +\ on targets with char = 8 bit Cond: MAXU restrict? - tcell 1 cells u> - IF compile lit tcell 0 ?DO FF T c, H LOOP - ELSE ffffffff lit, THEN + compile lit tcell 0 ?DO FF T c, H LOOP ;Cond Cond: MINI restrict? - tcell 1 cells u> - IF compile lit bigendian - IF 80 T c, H tcell 1 ?DO 0 T c, H LOOP - ELSE tcell 1 ?DO 0 T c, H LOOP 80 T c, H - THEN - ELSE tcell 2 = IF 8000 ELSE 80000000 THEN lit, THEN + compile lit bigendian + IF 80 T c, H tcell 1 ?DO 0 T c, H LOOP + ELSE tcell 1 ?DO 0 T c, H LOOP 80 T c, H + THEN ;Cond Cond: MAXI restrict? - tcell 1 cells u> - IF compile lit bigendian - IF 7F T c, H tcell 1 ?DO FF T c, H LOOP - ELSE tcell 1 ?DO FF T c, H LOOP 7F T c, H - THEN - ELSE tcell 2 = IF 7fff ELSE 7fffffff THEN lit, THEN + compile lit bigendian + IF 7F T c, H tcell 1 ?DO FF T c, H LOOP + ELSE tcell 1 ?DO FF T c, H LOOP 7F T c, H + THEN ;Cond >CROSS @@ -1946,7 +1978,8 @@ Cond: ; ( -- ) restrict? comp[ state off ;Resolve @ - IF ;Resolve @ ;Resolve cell+ @ resolve THEN + IF ;Resolve @ ;Resolve cell+ @ resolve + ['] colon-resolved ;Resolve @ >comp ! THEN Interpreting comp-state ! ;Cond Cond: [ restrict? state off Interpreting comp-state ! ;Cond @@ -1964,11 +1997,17 @@ Create GhostDummy ghostheader GhostDummy >link ! GhostDummy tlastcfa @ >tempdp dodoes, tempdp> ; +: g>body ( ghost -- body ) + >link @ T >body H ; +: does-resolved ( ghost -- ) + dup g>body alit, >end @ g>body colon, ; + >TARGET Cond: DOES> restrict? compile (does>) doeshandler, \ resolve words made by builders - tdoes @ ?dup IF @ T here H resolve THEN + tdoes @ ?dup IF @ dup T here H resolve + ['] prim-resolved swap >comp ! THEN ;Cond : DOES> switchrom doeshandler, T here H !does depth T ] H ; @@ -1977,17 +2016,15 @@ Cond: DOES> restrict? \ Builder 11may93jaw -: Builder ( Create-xt do:-xt "name" -- ) +: Builder ( Create-xt do-ghost "name" -- ) \ builds up a builder in current vocabulary \ create-xt is executed when word is interpreted \ do:-xt is executet when the created word from builder is executed \ for do:-xt an additional entry after the normal ghost-enrys is used - Make-Ghost ( Create-xt do:-xt ghost ) - rot swap ( do:-xt Create-xt ghost ) + Make-Ghost ( Create-xt do-ghost ghost ) + rot swap ( do-ghost Create-xt ghost ) >exec ! , ; -\ rot swap >exec dup @ ['] NoExec <> -\ IF 2drop ELSE ! THEN , ; : gdoes, ( ghost -- ) \ makes the codefield for a word that is built @@ -2009,12 +2046,13 @@ Cond: DOES> restrict? executed-ghost @ create-forward-warn IF ['] reswarn-forward IS resolve-warning THEN - Theader >r dup gdoes, + Theader >r dup , dup gdoes, \ stores execution semantic in the built word \ if the word already has a semantic (concerns S", IS, .", DOES>) \ then keep it - >end @ >exec @ r> >exec dup @ ['] NoExec = - IF ! ELSE 2drop THEN ; + >end @ + dup >exec @ r@ >exec dup @ ['] NoExec = IF ! ELSE 2drop THEN + >comp @ r> >comp ! ; : RTCreate ( -- ) \ creates a new word with code-field in ram @@ -2022,7 +2060,7 @@ Cond: DOES> restrict? create-forward-warn IF ['] reswarn-forward IS resolve-warning THEN \ make Alias - (THeader there 0 T a, H 80 flag! ( S executed-ghost new-ghost ) + (THeader there 0 T a, H alias-mask flag! ( S executed-ghost new-ghost ) \ store poiter to code-field switchram T cfalign H there swap T ! H @@ -2049,24 +2087,35 @@ Cond: DOES> restrict? : gdoes> ( ghost -- addr flag ) executed-ghost @ state @ IF gexecute true EXIT THEN - >link @ T >body H false ; + g>body false ; \ DO: ;DO 11may93jaw \ changed to ?EXIT 10may93jaw -: DO: ( -- addr [xt] [colon-sys] ) +: DO: ( -- ghost [xt] [colon-sys] ) here ghostheader :noname postpone gdoes> postpone ?EXIT ; -: by: ( -- addr [xt] [colon-sys] ) \ name +: by: ( -- ghost [xt] [colon-sys] ) \ name ghost :noname postpone gdoes> postpone ?EXIT ; -: ;DO ( addr [xt] [colon-sys] -- addr ) +: ;DO ( ghost [xt] [colon-sys] -- ghost ) postpone ; ( S addr xt ) over >exec ! ; immediate -: by ( -- addr ) \ Name +T has? peephole H [IF] +: compile: ( ghost -- ghost [xt] [colon-sys] ) + :noname postpone g>body ; +: ;compile ( ghost [xt] [colon-sys] -- ghost ) + postpone ; over >comp ! ; immediate +[ELSE] +: compile: ( ghost -- ghost xt colon-sys ) :noname ; +: ;compile ( ghost xt colon-sys -- ghost ) + postpone ; drop ['] prim-resolved over >comp ! ; immediate +[THEN] + +: by ( -- ghost ) \ Name ghost >end @ ; >TARGET @@ -2074,6 +2123,7 @@ Cond: DOES> restrict? Build: ( n -- ) ; by: :docon ( ghost -- n ) T @ H ;DO +compile: alit, compile @ ;compile Builder (Constant) Build: ( n -- ) T , H ; @@ -2090,6 +2140,7 @@ Builder 2Constant BuildSmart: ; by: :dovar ( ghost -- addr ) ;DO +\ compile: alit, ;compile Builder Create T has? rom H [IF] @@ -2099,6 +2150,7 @@ Builder Variable [ELSE] Build: T 0 , H ; by Create +\ compile: alit, ;compile Builder Variable [THEN] @@ -2109,6 +2161,7 @@ Builder 2Variable [ELSE] Build: T 0 , 0 , H ; by Create +\ compile: alit, ;compile Builder 2Variable [THEN] @@ -2119,6 +2172,7 @@ Builder AVariable [ELSE] Build: T 0 A, H ; by Create +\ compile: alit, ;compile Builder AVariable [THEN] @@ -2141,6 +2195,7 @@ Variable tudp 0 tudp ! Build: 0 u, X , ; by: :douser ( ghost -- up-addr ) X @ tup @ + ;DO +compile: compile useraddr T @ , H ;compile Builder User Build: 0 u, X , 0 u, drop ; @@ -2161,6 +2216,7 @@ Builder AValue BuildSmart: ( -- ) [T'] noop T A, H ; by: :dodefer ( ghost -- ) ABORT" CROSS: Don't execute" ;DO +compile: alit, compile @ compile execute ;compile Builder Defer Build: ( inter comp -- ) swap T immediate A, A, H ; @@ -2177,6 +2233,7 @@ Builder interpret/compile: Build: ; by: :dofield T @ H + ;DO +compile: T @ H lit, compile + ;compile Builder (Field) Build: ( align1 offset1 align size "name" -- align2 offset2 ) @@ -2191,6 +2248,14 @@ 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 @@ -2633,6 +2698,10 @@ previous : .s .s ; : bye bye ; +\ dummy + +: group source >in ! drop ; + \ turnkey direction : H forth ; immediate : T minimal ; immediate