xcomp: remove XOFF and use ORG and BIN( instead

This commit is contained in:
Virgil Dupras 2020-04-28 09:15:17 -04:00
parent 838548843e
commit 61b2e02351
7 changed files with 15 additions and 16 deletions

10
blk/260
View File

@ -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.)

View File

@ -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.

View File

@ -1,5 +1,4 @@
VARIABLE XCURRENT
VARIABLE XOFF
: XCON XCURRENT CURRENT* ! ;
: XCOFF 0x02 RAM+ CURRENT* ! ;

View File

@ -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

View File

@ -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@ ; "

View File

@ -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 )

View File

@ -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!