From 42818d25be5c75cd37108057e92700723a7bd20f Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 18 Jun 2020 07:40:20 -0400 Subject: [PATCH] z80: remove layers of indirection of find calls --- blk/282 | 1 + blk/283 | 2 +- blk/289 | 16 ---------------- blk/290 | 16 ---------------- blk/291 | 2 +- blk/298 | 2 +- blk/299 | 16 ++++++++++++++++ blk/330 | 3 +-- emul/forth.bin | Bin 6188 -> 6188 bytes 9 files changed, 21 insertions(+), 37 deletions(-) delete mode 100644 blk/289 delete mode 100644 blk/290 diff --git a/blk/282 b/blk/282 index 77ff6a2..47c129e 100644 --- a/blk/282 +++ b/blk/282 @@ -1,4 +1,5 @@ VARIABLE lblofl VARIABLE lblpushRS VARIABLE lblexec +VARIABLE lblfind 1 53 LOADR+ diff --git a/blk/283 b/blk/283 index 9a18688..0f3cbbd 100644 --- a/blk/283 +++ b/blk/283 @@ -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 ) diff --git a/blk/289 b/blk/289 deleted file mode 100644 index 6682eb9..0000000 --- a/blk/289 +++ /dev/null @@ -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. ) - diff --git a/blk/290 b/blk/290 deleted file mode 100644 index 8f73fef..0000000 --- a/blk/290 +++ /dev/null @@ -1,16 +0,0 @@ - EXDEHL, - HL L1 @ LDddnn, - 0x03 BCALL, ( 03 == find ) - 0x33 BJP, ( 33 == execute ) - - - - - - - - - - - - diff --git a/blk/291 b/blk/291 index d5c30d3..f80912b 100644 --- a/blk/291 +++ b/blk/291 @@ -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. ) diff --git a/blk/298 b/blk/298 index 480bce6..667e816 100644 --- a/blk/298 +++ b/blk/298 @@ -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 ) diff --git a/blk/299 b/blk/299 index e69de29..5de7479 100644 --- a/blk/299 +++ b/blk/299 @@ -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 ) diff --git a/blk/330 b/blk/330 index 67eaa2f..d542038 100644 --- a/blk/330 +++ b/blk/330 @@ -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, diff --git a/emul/forth.bin b/emul/forth.bin index 6bc28a4d116a6bec81e5372c03a75d9788525ab0..34ebba9fb8f8eb37cc938d8d1564360951a6380d 100644 GIT binary patch delta 125 zcmZ2uu*N{_a0Md+2z(a@Qw$7;JsA&&OceV$*^n`UJD%}vG}DW-{EUZXRmD9SU&kqjDL?)DP~zrI#UCI=H!nyuO@6{S UnK5m11(Q4z6F=kTnJklq0oxNW#sB~S delta 147 zcmZ2uu*N{_un6N}Lq-OM@8S#)a5$UsaM?t$pNcF_{{A6`zy9Ab-DlNmcUS1`#lF)=f2p2;#<7y!OBJ68Yz