diff --git a/blk/412 b/blk/412 index 11f255d..abb2c23 100644 --- a/blk/412 +++ b/blk/412 @@ -4,13 +4,13 @@ : H@ HERE @ ; : IMMEDIATE CURRENT @ 1- - DUP C@ 128 OR SWAP C! -; + DUP C@ 128 OR SWAP C! ; +: IMMED? 1- C@ 0x80 AND ; : +! SWAP OVER @ + SWAP ! ; : -^ SWAP - ; : / /MOD SWAP DROP ; : MOD /MOD DROP ; - : ALLOT HERE +! ; : CREATE (entry) 11 ( 11 == cellWord ) C, ; +: VARIABLE CREATE 2 ALLOT ; : LEAVE R> R> DROP I 1- >R >R ; diff --git a/blk/434 b/blk/434 index db838a0..0819e39 100644 --- a/blk/434 +++ b/blk/434 @@ -2,3 +2,7 @@ ( b1 b2 -- ) : LOADR 1+ SWAP DO I DUP . NL LOAD LOOP ; : LOADR+ BLK> @ + SWAP BLK> @ + SWAP LOADR ; +( Now we have "as late as possible" stuff ) +: DO COMPILE 2>R H@ ; IMMEDIATE +: LOOP COMPILE (loop) H@ - , ; IMMEDIATE +( LEAVE is implemented in low xcomp ) diff --git a/blk/435 b/blk/435 index 60f0030..325af37 100644 --- a/blk/435 +++ b/blk/435 @@ -1,9 +1,5 @@ -( LITN has to be defined after the last immediate usage of - it to avoid bootstrapping issues ) : LITN 32 , , ( 32 == NUMBER ) ; -: IMMED? 1- C@ 0x80 AND ; - ( ';' can't have its name right away because, when created, it is not an IMMEDIATE yet and will not be treated properly by xcomp. ) diff --git a/blk/444 b/blk/444 index 4bd8e56..6bad060 100644 --- a/blk/444 +++ b/blk/444 @@ -11,4 +11,5 @@ ( We're done. Because we've popped RS, we'll exit parent definition ) ; +: CONSTANT CREATE , DOES> @ ; diff --git a/blk/445 b/blk/445 deleted file mode 100644 index 415ab82..0000000 --- a/blk/445 +++ /dev/null @@ -1,8 +0,0 @@ -: VARIABLE CREATE 2 ALLOT ; -: CONSTANT CREATE , DOES> @ ; - -( In addition to pushing H@ this compiles 2>R so that loop - variables are sent to PS at runtime ) -: DO COMPILE 2>R H@ ; IMMEDIATE -: LOOP COMPILE (loop) H@ - , ; IMMEDIATE -( LEAVE is implemented in xcomp ) diff --git a/emul/forth.bin b/emul/forth.bin index 26cbbc6..e71fa19 100644 Binary files a/emul/forth.bin and b/emul/forth.bin differ diff --git a/emul/xcomp.fs b/emul/xcomp.fs index 4b0d727..9a2f5b7 100644 --- a/emul/xcomp.fs +++ b/emul/xcomp.fs @@ -14,7 +14,7 @@ ( Update LATEST ) PC ORG @ 8 + ! ," CURRENT @ HERE ! " -440 445 XPACKR +440 444 XPACKR ," ' (key) 12 RAM+ ! " ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC! diff --git a/recipes/rc2014/xcomp.fs b/recipes/rc2014/xcomp.fs index 28c62cb..0e18143 100644 --- a/recipes/rc2014/xcomp.fs +++ b/recipes/rc2014/xcomp.fs @@ -18,7 +18,7 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -440 445 XPACKR ( core ) +440 444 XPACKR ( core ) 123 132 XPACKR ( linker ) ," : _ ACIA$ RDLN$ (ok) ; _ " ORG @ 256 /MOD 2 PC! 2 PC! diff --git a/recipes/ti84/xcomp.fs b/recipes/ti84/xcomp.fs index 45a5ae4..b133a31 100644 --- a/recipes/ti84/xcomp.fs +++ b/recipes/ti84/xcomp.fs @@ -68,7 +68,7 @@ CREATE ~FNT CPFNT3x5 (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -440 445 XPACKR ( core ) +440 444 XPACKR ( core ) ," : _ LCD$ KBD$ (ok) RDLN$ ; _ " ORG @ 0x100 - 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC! diff --git a/recipes/trs80/xcomp.fs b/recipes/trs80/xcomp.fs index cf82d63..338b405 100644 --- a/recipes/trs80/xcomp.fs +++ b/recipes/trs80/xcomp.fs @@ -14,7 +14,7 @@ RS_ADDR 0x80 - CONSTANT RAMSTART ( Update LATEST ) PC ORG @ 8 + ! ," CURRENT @ HERE ! " -440 445 XPACKR ( core ) +440 444 XPACKR ( core ) 499 500 XPACKR ( trs80.fs ) ( 0x0a == NLPTR. TRS-80 wants CR-only newlines ) ," : _ ['] CR 0x0a RAM+ ! BLK$ FD$ (ok) RDLN$ ; _ "