1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-05 08:50:56 +11:00

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 This programs allows cross compilation of boot binary and
icore. Run "262 LOAD" right before your cross compilation 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. This redefines defining words to achieve cross compilation.
The goal is two-fold: The goal is two-fold:
@ -10,7 +13,4 @@ The goal is two-fold:
1. Add an offset to all word references in definitions. 1. Add an offset to all word references in definitions.
2. Don't shadow important words we need right now. 2. Don't shadow important words we need right now.
Words overrides like ":", "IMMEDIATE" and "CODE" are not (cont.)
automatically shadowed to allow the harmless inclusion of
this unit. This shadowing has to take place in your xcomp
configuration. (cont.)

View File

@ -1,6 +1,9 @@
(cont.) Words overrides like ":", "IMMEDIATE" and "CODE" are not
See example in /emul/forth/xcomp.fs 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 Why limit ourselves to icore? Oh, I've tried cross-compiling
the whole shebang. I tried. And failed. Too dynamic. the whole shebang. I tried. And failed. Too dynamic.

View File

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

View File

@ -4,7 +4,7 @@
XCURRENT @ SWAP ( xcur w ) _find ( a f ) XCURRENT @ SWAP ( xcur w ) _find ( a f )
IF ( a ) IF ( a )
DUP IMMED? IF ABORT THEN DUP IMMED? IF ABORT THEN
DUP XOFF @ > IF XOFF @ - THEN , DUP ORG @ > IF ORG @ - BIN( @ + THEN ,
ELSE ( w ) ELSE ( w )
0x02 RAM+ @ SWAP ( cur w ) _find ( a f ) 0x02 RAM+ @ SWAP ( cur w ) _find ( a f )
IF DUP IMMED? NOT IF ABORT THEN EXECUTE IF DUP IMMED? NOT IF ABORT THEN EXECUTE

View File

@ -10,12 +10,11 @@
CURRENT @ XCURRENT ! CURRENT @ XCURRENT !
H@ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!
H@ XOFF !
282 LOAD ( boot.z80 ) 282 LOAD ( boot.z80 )
393 LOAD ( icore ) 393 LOAD ( icore )
(entry) _ (entry) _
( Update LATEST ) ( Update LATEST )
H@ XOFF @ - XOFF @ 8 + ! PC ORG @ 8 + !
," CURRENT @ HERE ! " ," CURRENT @ HERE ! "
," : EMIT 0 PC! ; " ," : EMIT 0 PC! ; "
," : KEY 0 PC@ ; " ," : KEY 0 PC@ ; "

View File

@ -16,14 +16,13 @@ RAMSTART 0x70 + CONSTANT ACIA_MEM
CURRENT @ XCURRENT ! CURRENT @ XCURRENT !
H@ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!
H@ XOFF !
282 LOAD ( boot.z80 ) 282 LOAD ( boot.z80 )
352 LOAD ( acia.z80 ) 352 LOAD ( acia.z80 )
372 LOAD ( sdc.z80 ) 372 LOAD ( sdc.z80 )
393 LOAD ( icore ) 393 LOAD ( icore )
(entry) _ (entry) _
( Update LATEST ) ( Update LATEST )
H@ XOFF @ - XOFF @ 8 + ! PC ORG @ 8 + !
422 441 XPACKR ( core cmp ) 422 441 XPACKR ( core cmp )
446 452 XPACKR ( parse ) 446 452 XPACKR ( parse )
358 360 XPACKR ( acia.fs ) 358 360 XPACKR ( acia.fs )

View File

@ -10,14 +10,13 @@
CURRENT @ XCURRENT ! CURRENT @ XCURRENT !
H@ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!
H@ XOFF !
0x3000 BIN( ! 0x3000 BIN( !
282 LOAD ( boot.z80 ) 282 LOAD ( boot.z80 )
162 LOAD ( trs80.z80 ) 162 LOAD ( trs80.z80 )
393 LOAD ( icore ) 393 LOAD ( icore )
(entry) _ (entry) _
( Update LATEST ) ( Update LATEST )
PC XOFF @ 8 + ! PC ORG @ 8 + !
422 463 XPACKR ( core cmp print parse readln fmt ) 422 463 XPACKR ( core cmp print parse readln fmt )
," : _ RDLN$ (ok) ; _ " ," : _ RDLN$ (ok) ; _ "
H@ 256 /MOD 2 PC! 2 PC! H@ 256 /MOD 2 PC! 2 PC!