From 61b2e02351899bacbe3e471751c95cad63ebab08 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 28 Apr 2020 09:15:17 -0400 Subject: [PATCH] xcomp: remove XOFF and use ORG and BIN( instead --- blk/260 | 10 +++++----- blk/261 | 9 ++++++--- blk/263 | 1 - blk/265 | 2 +- emul/xcomp.fs | 3 +-- recipes/rc2014/xcomp.fs | 3 +-- recipes/trs80/xcomp.fs | 3 +-- 7 files changed, 15 insertions(+), 16 deletions(-) diff --git a/blk/260 b/blk/260 index b48149b..f593c76 100644 --- a/blk/260 +++ b/blk/260 @@ -2,7 +2,10 @@ Cross compilation program This programs allows cross compilation of boot binary and icore. Run "262 LOAD" right before your cross compilation and -then set XCURRENT to CURRENT and XCOFF to H@. +then set XCURRENT to CURRENT. + +This unit depends on a properly initialized z80a with ORG and +BIN( set. That is how we determine compilation offsets. This redefines defining words to achieve cross compilation. The goal is two-fold: @@ -10,7 +13,4 @@ The goal is two-fold: 1. Add an offset to all word references in definitions. 2. Don't shadow important words we need right now. -Words overrides like ":", "IMMEDIATE" and "CODE" are not -automatically shadowed to allow the harmless inclusion of -this unit. This shadowing has to take place in your xcomp -configuration. (cont.) + (cont.) diff --git a/blk/261 b/blk/261 index 11eebe6..e84e1be 100644 --- a/blk/261 +++ b/blk/261 @@ -1,6 +1,9 @@ -(cont.) -See example in /emul/forth/xcomp.fs +Words overrides like ":", "IMMEDIATE" and "CODE" are not +automatically shadowed to allow the harmless inclusion of +this unit. This shadowing has to take place in your xcomp +configuration. + +See example in /emul/xcomp.fs Why limit ourselves to icore? Oh, I've tried cross-compiling the whole shebang. I tried. And failed. Too dynamic. - diff --git a/blk/263 b/blk/263 index 5e1ec75..370a121 100644 --- a/blk/263 +++ b/blk/263 @@ -1,5 +1,4 @@ VARIABLE XCURRENT -VARIABLE XOFF : XCON XCURRENT CURRENT* ! ; : XCOFF 0x02 RAM+ CURRENT* ! ; diff --git a/blk/265 b/blk/265 index d43278b..857f079 100644 --- a/blk/265 +++ b/blk/265 @@ -4,7 +4,7 @@ XCURRENT @ SWAP ( xcur w ) _find ( a f ) IF ( a ) DUP IMMED? IF ABORT THEN - DUP XOFF @ > IF XOFF @ - THEN , + DUP ORG @ > IF ORG @ - BIN( @ + THEN , ELSE ( w ) 0x02 RAM+ @ SWAP ( cur w ) _find ( a f ) IF DUP IMMED? NOT IF ABORT THEN EXECUTE diff --git a/emul/xcomp.fs b/emul/xcomp.fs index cb05a61..2067a6d 100644 --- a/emul/xcomp.fs +++ b/emul/xcomp.fs @@ -10,12 +10,11 @@ CURRENT @ XCURRENT ! H@ 256 /MOD 2 PC! 2 PC! -H@ XOFF ! 282 LOAD ( boot.z80 ) 393 LOAD ( icore ) (entry) _ ( Update LATEST ) -H@ XOFF @ - XOFF @ 8 + ! +PC ORG @ 8 + ! ," CURRENT @ HERE ! " ," : EMIT 0 PC! ; " ," : KEY 0 PC@ ; " diff --git a/recipes/rc2014/xcomp.fs b/recipes/rc2014/xcomp.fs index fd67798..d45d569 100644 --- a/recipes/rc2014/xcomp.fs +++ b/recipes/rc2014/xcomp.fs @@ -16,14 +16,13 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM CURRENT @ XCURRENT ! H@ 256 /MOD 2 PC! 2 PC! -H@ XOFF ! 282 LOAD ( boot.z80 ) 352 LOAD ( acia.z80 ) 372 LOAD ( sdc.z80 ) 393 LOAD ( icore ) (entry) _ ( Update LATEST ) -H@ XOFF @ - XOFF @ 8 + ! +PC ORG @ 8 + ! 422 441 XPACKR ( core cmp ) 446 452 XPACKR ( parse ) 358 360 XPACKR ( acia.fs ) diff --git a/recipes/trs80/xcomp.fs b/recipes/trs80/xcomp.fs index 2cbeeee..9304893 100644 --- a/recipes/trs80/xcomp.fs +++ b/recipes/trs80/xcomp.fs @@ -10,14 +10,13 @@ CURRENT @ XCURRENT ! H@ 256 /MOD 2 PC! 2 PC! -H@ XOFF ! 0x3000 BIN( ! 282 LOAD ( boot.z80 ) 162 LOAD ( trs80.z80 ) 393 LOAD ( icore ) (entry) _ ( Update LATEST ) -PC XOFF @ 8 + ! +PC ORG @ 8 + ! 422 463 XPACKR ( core cmp print parse readln fmt ) ," : _ RDLN$ (ok) ; _ " H@ 256 /MOD 2 PC! 2 PC!