z80: make boot binary a 2-part process

Previously, recipes that began spitting binary contents before
loading block 282 would end up with VARIABLE code in their binary,
thus breaking them. We fix this by making this loading process
2-part.
This commit is contained in:
Virgil Dupras 2020-06-26 21:41:17 -04:00
parent 891e4f861a
commit 1312817117
8 changed files with 26 additions and 19 deletions

View File

@ -9,4 +9,7 @@ esses. The rest of the Collapse OS code depend on it. In fact,
up until 0x67, the (?br) wordref, pretty much everything has up until 0x67, the (?br) wordref, pretty much everything has
to stay put. to stay put.
To assemble, run "282 LOAD". The boot binary is loaded in 2 parts. The first part, "decla-
rations", are loaded after xcomp, before xcomp overrides, with
"282 LOAD". The rest, after xcomp overrides, with "283 335
LOADR".

View File

@ -1,3 +1,2 @@
VARIABLE lblofl VARIABLE lblpushRS VARIABLE lblexec VARIABLE lblofl VARIABLE lblpushRS VARIABLE lblexec
VARIABLE lblfind VARIABLE lblfind
1 53 LOADR+

View File

@ -5,9 +5,9 @@
5 CONSTANT SDC_CSLOW 6 CONSTANT SDC_CSHIGH 5 CONSTANT SDC_CSLOW 6 CONSTANT SDC_CSHIGH
RAMSTART 0x70 + CONSTANT ACIA_MEM RAMSTART 0x70 + CONSTANT ACIA_MEM
212 LOAD ( z80 assembler ) 212 LOAD ( z80 assembler )
262 LOAD ( xcomp ) 270 LOAD ( xcomp overrides ) 262 LOAD ( xcomp ) 282 LOAD ( boot.z80.decl )
282 LOAD ( boot.z80 ) 353 LOAD ( xcomp core low ) 270 LOAD ( xcomp overrides ) 283 335 LOADR ( boot.z80 )
582 LOAD ( acia ) 353 LOAD ( xcomp core low ) 582 LOAD ( acia )
380 LOAD ( xcomp core high ) 380 LOAD ( xcomp core high )
(entry) _ (entry) _
( Update LATEST ) ( Update LATEST )

View File

@ -3,9 +3,9 @@
0xfffa CONSTANT PS_ADDR 0xfffa CONSTANT PS_ADDR
212 LOAD ( z80 assembler ) 212 LOAD ( z80 assembler )
262 LOAD ( xcomp ) 262 LOAD ( xcomp )
282 LOAD ( boot.z80.decl )
270 LOAD ( xcomp overrides ) 270 LOAD ( xcomp overrides )
283 335 LOADR ( boot.z80 )
282 LOAD ( boot.z80 )
353 LOAD ( xcomp core low ) 353 LOAD ( xcomp core low )
: (emit) 0 PC! ; : (emit) 0 PC! ;
: (key) 0 PC@ ; : (key) 0 PC@ ;

View File

@ -15,6 +15,7 @@ RAMSTART 0x72 + CONSTANT PAD_MEM
: ZFILL, ( u ) 0 DO 0 A, LOOP ; : ZFILL, ( u ) 0 DO 0 A, LOOP ;
262 LOAD ( xcomp ) 262 LOAD ( xcomp )
524 LOAD ( font compiler ) 524 LOAD ( font compiler )
282 LOAD ( boot.z80.decl )
270 LOAD ( xcomp overrides ) 270 LOAD ( xcomp overrides )
0x100 JPnn, 0x63 ZFILL, ( 0x66 ) 0x100 JPnn, 0x63 ZFILL, ( 0x66 )
@ -22,7 +23,7 @@ RETN, 0x98 ZFILL, ( 0x100 )
( All set, carry on! ) ( All set, carry on! )
CURRENT @ XCURRENT ! CURRENT @ XCURRENT !
0x100 BIN( ! 0x100 BIN( !
282 LOAD ( boot.z80 ) 283 335 LOADR ( boot.z80 )
353 LOAD ( xcomp core low ) 353 LOAD ( xcomp core low )
CREATE ~FNT CPFNT7x7 CREATE ~FNT CPFNT7x7
623 628 LOADR ( VDP ) 623 628 LOADR ( VDP )

View File

@ -8,6 +8,7 @@ RAMSTART 0x72 + CONSTANT KBD_MEM
: ZFILL, ( u ) 0 DO 0 A, LOOP ; : ZFILL, ( u ) 0 DO 0 A, LOOP ;
262 LOAD ( xcomp ) 262 LOAD ( xcomp )
522 LOAD ( font compiler ) 522 LOAD ( font compiler )
282 LOAD ( boot.z80.decl )
270 LOAD ( xcomp overrides ) 270 LOAD ( xcomp overrides )
( TI-84+ requires specific code at specific offsets which ( TI-84+ requires specific code at specific offsets which
@ -59,7 +60,7 @@ HALT,
CURRENT @ XCURRENT ! CURRENT @ XCURRENT !
0x100 BIN( ! 0x100 BIN( !
282 LOAD ( boot.z80 ) 283 335 LOADR ( boot.z80 )
353 LOAD ( xcomp core low ) 353 LOAD ( xcomp core low )
CREATE ~FNT CPFNT3x5 CREATE ~FNT CPFNT3x5
555 560 LOADR ( LCD low ) 555 560 LOADR ( LCD low )

View File

@ -1,15 +1,15 @@
0xff00 CONSTANT RS_ADDR 0xff00 CONSTANT RS_ADDR
0xfffa CONSTANT PS_ADDR 0xfffa CONSTANT PS_ADDR
RS_ADDR 0x80 - CONSTANT RAMSTART RS_ADDR 0x80 - CONSTANT RAMSTART
212 LOAD ( z80 assembler ) 212 LOAD ( z80 assembler )
262 LOAD ( xcomp ) 262 LOAD ( xcomp )
270 LOAD ( xcomp overrides ) 282 LOAD ( boot.z80.decl )
270 LOAD ( xcomp overrides )
0x3000 BIN( ! 0x3000 BIN( !
282 LOAD ( boot.z80 ) 283 335 LOADR ( boot.z80 )
353 LOAD ( xcomp core low ) 353 LOAD ( xcomp core low )
492 LOAD ( trs80 ) 492 LOAD ( trs80 )
380 LOAD ( xcomp core high ) 380 LOAD ( xcomp core high )
(entry) _ (entry) _
( Update LATEST ) ( Update LATEST )
PC ORG @ 8 + ! PC ORG @ 8 + !

View File

@ -1,8 +1,11 @@
0xff00 CONSTANT RS_ADDR 0xfffa CONSTANT PS_ADDR 0xff00 CONSTANT RS_ADDR 0xfffa CONSTANT PS_ADDR
RS_ADDR 0x80 - CONSTANT RAMSTART RS_ADDR 0x80 - CONSTANT RAMSTART
212 LOAD ( z80 assembler ) 212 LOAD ( z80 assembler )
262 LOAD ( xcomp ) 270 LOAD ( xcomp overrides ) 262 LOAD ( xcomp )
282 LOAD ( boot.z80 ) 353 LOAD ( xcomp core low ) 282 LOAD ( boot.z80.decl )
270 LOAD ( xcomp overrides )
283 335 LOADR ( boot.z80 )
353 LOAD ( xcomp core low )
CODE (emit) CODE (emit)
A 1 LDrn, 1 OUTnA, HL POPqq, A L LDrr, 0 OUTnA, A 1 LDrn, 1 OUTnA, HL POPqq, A L LDrr, 0 OUTnA,
;CODE ;CODE