From e6bac985fa0b2e046d9f702b172cb1fe02989ecf Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 14 May 2020 10:17:38 -0400 Subject: [PATCH] Cross-compiles in a single stage! Finally got rid of the XPACKed core and managed to cross-compile all core words, which greatly simplifies the bootstrapping process. --- blk/420 | 2 +- blk/439 | 19 +++++++++---------- blk/440 | 19 ++++++++++--------- emul/forth.bin | Bin 5875 -> 5875 bytes emul/xcomp.fs | 1 - recipes/rc2014/xcomp.fs | 2 -- recipes/ti84/xcomp.fs | 1 - recipes/trs80/xcomp.fs | 1 - 8 files changed, 20 insertions(+), 25 deletions(-) diff --git a/blk/420 b/blk/420 index 1cc934d..171c335 100644 --- a/blk/420 +++ b/blk/420 @@ -1 +1 @@ -1 19 LOADR+ ( xcomp core high ) +1 20 LOADR+ ( xcomp core high ) diff --git a/blk/439 b/blk/439 index 1296f6f..0f2a5e5 100644 --- a/blk/439 +++ b/blk/439 @@ -1,10 +1,9 @@ -( ';' can't have its name right away because, when created, it - is not an IMMEDIATE yet and will not be treated properly by - xcomp. ) -: _ - ['] EXIT , - R> DROP ( exit : ) -; IMMEDIATE -';' XCURRENT @ 4 - C! -':' X' _ 4 - C! ( give : its name ) -'(' X' _ 4 - C! +: BEGIN H@ ; IMMEDIATE +: AGAIN COMPILE (br) H@ - , ; IMMEDIATE +: UNTIL COMPILE (?br) H@ - , ; IMMEDIATE +: [ INTERPRET ; IMMEDIATE +: ] R> DROP ; +: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE +: LITA 36 , , ; +: COMPILE ' LITA ['] , , ; IMMEDIATE +: [COMPILE] ' , ; IMMEDIATE diff --git a/blk/440 b/blk/440 index 8fea4c3..8a6db82 100644 --- a/blk/440 +++ b/blk/440 @@ -1,10 +1,11 @@ -: [ INTERPRET ; IMMEDIATE -: ] R> DROP ; -: LIT< WORD 34 , SCPY 0 C, ; IMMEDIATE -: LITA 36 , , ; +( ';' can't have its name right away because, when created, it + is not an IMMEDIATE yet and will not be treated properly by + xcomp. ) +: _ + ['] EXIT , + R> DROP ( exit : ) +; IMMEDIATE : ['] ' LITA ; IMMEDIATE -: COMPILE ' LITA ['] , , ; IMMEDIATE -: [COMPILE] ' , ; IMMEDIATE -: BEGIN H@ ; IMMEDIATE -: AGAIN COMPILE (br) H@ - , ; IMMEDIATE -: UNTIL COMPILE (?br) H@ - , ; IMMEDIATE +';' X' _ 4 - C! ( give ; its name ) +':' X' _ 4 - C! ( give : its name ) +'(' X' _ 4 - C! diff --git a/emul/forth.bin b/emul/forth.bin index 167c0ff94cc4ae5936cc13b728ec638e4f823b53..1003b0d8eb7a200545bce4a310985f72c188282d 100644 GIT binary patch delta 115 zcmeyY`&oBGg(#botGlP4(qs-XQ>JKv$^D`>fzJNE0iHgtLJaME8QjlARTv~WB{`iK zqM_okVho)?36PLA2SX#D3WF0+#W@C1CZHPiSOJD+ur?=#cn$_eSGQmXmdO=jvXkS* GrT_q(%o{`i delta 92 zcmeyY`&oBGg{Zi-977|Y3WF1aBQ6?vbcs>TkXvWD~MQx;`)noY>n)x!g4~RN3 uIQ#nsc>1{VF|>mOCjS?eVRLeI_w?hLTqkPE>gpEkAUwH3Om=d-*c1RrCKxsV diff --git a/emul/xcomp.fs b/emul/xcomp.fs index 9a2f5b7..400a9cc 100644 --- a/emul/xcomp.fs +++ b/emul/xcomp.fs @@ -14,7 +14,6 @@ ( Update LATEST ) PC ORG @ 8 + ! ," CURRENT @ HERE ! " -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 0e18143..a3b648c 100644 --- a/recipes/rc2014/xcomp.fs +++ b/recipes/rc2014/xcomp.fs @@ -18,8 +18,6 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -440 444 XPACKR ( core ) -123 132 XPACKR ( linker ) ," : _ ACIA$ RDLN$ (ok) ; _ " ORG @ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC! diff --git a/recipes/ti84/xcomp.fs b/recipes/ti84/xcomp.fs index b133a31..c73a2a2 100644 --- a/recipes/ti84/xcomp.fs +++ b/recipes/ti84/xcomp.fs @@ -68,7 +68,6 @@ CREATE ~FNT CPFNT3x5 (entry) _ ( Update LATEST ) PC ORG @ 8 + ! -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 338b405..4abc0ab 100644 --- a/recipes/trs80/xcomp.fs +++ b/recipes/trs80/xcomp.fs @@ -14,7 +14,6 @@ RS_ADDR 0x80 - CONSTANT RAMSTART ( Update LATEST ) PC ORG @ 8 + ! ," CURRENT @ HERE ! " -440 444 XPACKR ( core ) 499 500 XPACKR ( trs80.fs ) ( 0x0a == NLPTR. TRS-80 wants CR-only newlines ) ," : _ ['] CR 0x0a RAM+ ! BLK$ FD$ (ok) RDLN$ ; _ "