1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-12-28 08:28:06 +11:00

z80: use named labels for boot routines

The usage of numerotated labels for this was becoming severly
confusing.
This commit is contained in:
Virgil Dupras 2020-06-18 07:16:40 -04:00
parent eed817b517
commit eba83fa9a9
10 changed files with 14 additions and 19 deletions

View File

@ -3,10 +3,9 @@
: BJP, BIN( @ + JPnn, ;
: BJPcc, BIN( @ + JPccnn, ;
VARIABLE lblchkPS
: chkPS, lblchkPS @ CALLnn, ; ( chkPS, B305 )
: JPNEXT, 26 BJP, ; ( 26 == next )
: chkPS, L4 @ CALLnn, ; ( chkPS, B305 )
: CODE ( same as CREATE, but with native word )
(entry) 0 C, ( 0 == native ) ;
: ;CODE JPNEXT, ;

View File

@ -1,3 +1,4 @@
VARIABLE lblofl VARIABLE lblpushRS VARIABLE lblexec
1 53 LOADR+
@ -9,8 +10,3 @@

View File

@ -1,4 +1,4 @@
L4 BSET PC ORG @ 0x12 + ! ( pushRS )
lblpushRS BSET PC ORG @ 0x12 + ! ( pushRS )
IX INCss,
IX INCss,
0 IX+ L LDIXYr,

View File

@ -1,5 +1,5 @@
6 A, '(' A, 'u' A, 'f' A, 'l' A, 'w' A, ')' A,
L2 BSET ( abortUnderflow )
lblofl BSET ( abortUnderflow )
HL PC 7 - LDddnn,
DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT )
0x03 BCALL, ( find )

View File

@ -5,11 +5,11 @@ PC ORG @ 0x1b + ! ( next )
( Before we continue: are stacks within bounds? )
( PS ) HL PS_ADDR LDddnn,
SP SUBHLss,
JRC, L2 BWR ( abortUnderflow-B298 )
JRC, lblofl BWR ( abortUnderflow-B298 )
( RS ) IX PUSHqq, HL POPqq,
DE RS_ADDR LDddnn,
DE SUBHLss,
JRC, L2 BWR ( IX < RS_ADDR? abortUnderflow-B298 )
JRC, lblofl BWR ( IX < RS_ADDR? abortUnderflow-B298 )
E 0 IY+ LDrIXY,
D 1 IY+ LDrIXY,
IY INCss, IY INCss,

View File

@ -1,4 +1,4 @@
L3 BSET PC ORG @ 0x34 + ! ( execute. DE -> wordref )
lblexec BSET PC ORG @ 0x34 + ! ( execute. DE -> wordref )
( We don't apply BIN( reliably on stable ABI stuff, we
might need to adjust addr. Ugly, but well... )
BIN( @ [IF]

View File

@ -3,13 +3,13 @@
2. Set new IP to the second atom of the list
3. Execute the first atom of the list. )
IY PUSHqq, HL POPqq, ( <-- IP )
L4 @ ( pushRS ) CALLnn,
lblpushRS @ ( pushRS ) CALLnn,
EXDEHL, ( HL points to PFA )
( While we inc, dereference into DE for execute call later. )
LDDE(HL),
HL INCss,
HL PUSHqq, IY POPqq, ( --> IP )
JR, L3 BWR ( execute-B301 )
JR, lblexec BWR ( execute-B301 )

View File

@ -1,4 +1,4 @@
L4 BSET ( chkPS )
lblchkPS BSET ( chkPS )
( Note that you only need to call this in words that push
back to PSP. If they don't, calling chkPS is redundant with
check in next )
@ -9,7 +9,7 @@ L4 BSET ( chkPS )
SP SUBHLss,
EXX,
CNC RETcc, ( PS_ADDR >= SP? good )
JR, L2 BWR ( abortUnderflow-B298 )
JR, lblofl BWR ( abortUnderflow-B298 )

View File

@ -5,7 +5,7 @@
CODE EXECUTE
DE POPqq,
chkPS,
JR, L3 BWR ( execute-B301 )
JR, lblexec BWR ( execute-B301 )
( a b c -- b c a )
CODE ROT

View File

@ -10,7 +10,7 @@ CODE PICK
EXDEHL,
HL PS_ADDR LDddnn,
DE SUBHLss,
CC L2 @ JPccnn, ( abortUnderflow-B298 )
CC lblofl @ JPccnn, ( abortUnderflow-B298 )
BC PUSHqq,
;CODE