z80: remove layers of indirection of find calls

This commit is contained in:
Virgil Dupras 2020-06-18 07:40:20 -04:00
parent 76e698157c
commit 42818d25be
9 changed files with 21 additions and 37 deletions

View File

@ -1,4 +1,5 @@
VARIABLE lblofl VARIABLE lblpushRS VARIABLE lblexec
VARIABLE lblfind
1 53 LOADR+

View File

@ -1,5 +1,5 @@
H@ ORG !
0 JPnn, ( 00, main ) 0 JPnn, ( 03, find )
0 JPnn, ( 00, main ) NOP, NOP, NOP, ( 03, unused )
NOP, NOP, ( 06, unused ) NOP, NOP, ( 08, LATEST )
NOP, NOP, NOP, NOP, NOP, NOP, NOP, ( 0a, unused )
0 JPnn, ( 11, pushRS ) 0 JPnn, ( 14, popRS )

16
blk/289
View File

@ -1,16 +0,0 @@
( Name of BOOT word )
L1 BSET 4 A, 'B' A, 'O' A, 'O' A, 'T' A,
PC ORG @ 1 + ! ( main )
( STACK OVERFLOW PROTECTION: See B76 )
SP PS_ADDR LDddnn,
IX RS_ADDR LDddnn,
( HERE begins at RAMEND )
HL RAMSTART 0x80 + LDddnn,
RAMSTART 0x04 + LD(nn)HL, ( RAM+04 == HERE )
( LATEST is a label to the latest entry of the dict. It is
written at offset 0x08 by the process or person building
Forth. )
BIN( @ 0x08 + LDHL(nn),
RAMSTART 0x02 + LD(nn)HL, ( RAM+02 == CURRENT cont. )

16
blk/290
View File

@ -1,16 +0,0 @@
EXDEHL,
HL L1 @ LDddnn,
0x03 BCALL, ( 03 == find )
0x33 BJP, ( 33 == execute )

View File

@ -1,4 +1,4 @@
PC ORG @ 4 + ! ( find )
lblfind BSET
( Find the entry corresponding to word name where (HL) points
to in dictionary having its tip at DE and sets DE to point
to that entry. Z if found, NZ if not. )

View File

@ -2,7 +2,7 @@
lblofl BSET ( abortUnderflow )
HL PC 7 - LDddnn,
DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT )
0x03 BCALL, ( find )
lblfind @ CALLnn,
0x33 BJP, ( 33 == execute )

16
blk/299
View File

@ -0,0 +1,16 @@
L1 BSET 4 A, 'B' A, 'O' A, 'O' A, 'T' A,
PC ORG @ 1 + ! ( main )
( STACK OVERFLOW PROTECTION: See B76 )
SP PS_ADDR LDddnn, IX RS_ADDR LDddnn,
( HERE begins at RAMEND )
HL RAMSTART 0x80 + LDddnn,
RAMSTART 0x04 + LD(nn)HL, ( RAM+04 == HERE )
( LATEST is a label to the latest entry of the dict. It is
written at offset 0x08 by the process or person building
Forth. )
BIN( @ 0x08 + LDHL(nn),
RAMSTART 0x02 ( CURRENT ) + LD(nn)HL,
EXDEHL,
HL L1 @ LDddnn,
lblfind @ CALLnn,
0x33 BJP, ( 33 == execute )

View File

@ -2,8 +2,7 @@ CODE _find ( cur w -- a f )
HL POPqq, ( w )
DE POPqq, ( cur )
chkPS,
( 3 == find )
3 BCALL,
lblfind @ CALLnn,
IFNZ,
( not found )
HL PUSHqq,

Binary file not shown.