1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 19:48:06 +11:00

z80: make exec routine a wee bit tighter

1 whole byte!
This commit is contained in:
Virgil Dupras 2020-10-28 13:28:27 -04:00
parent 788453b89c
commit a82db0739a
3 changed files with 7 additions and 20 deletions

11
blk/287
View File

@ -1,8 +1,9 @@
lblexec BSET L1 FSET ( B284 ) L2 FSET ( B286 ) lblexec BSET L1 FSET ( B284 ) L2 FSET ( B286 )
( DE -> wordref ) ( DE -> wordref )
LDA(DE), DE INCd, LDA(DE), DE INCd, EXDEHL, ( HL points to PFA )
A ORr, IFZ, EXDEHL, JP(HL), THEN, A ORr, IFZ, JP(HL), THEN,
A DECr, JRZ, L1 FWR ( compiled B289 ) A DECr, ( compiled? ) IFNZ, ( no )
( cell or does. push PFA ) DE PUSH, ( cell or does. push PFA ) HL PUSH,
A DECr, JRZ, lblnext BWR ( cell ) A DECr, JRZ, lblnext BWR ( cell )
( continue to does ) HL INCd, HL INCd, LDDE(HL), EXDEHL, ( does )
THEN, ( continue to compiledWord )

12
blk/288
View File

@ -1,12 +0,0 @@
( does. The word was spawned from a definition word that has a
DOES>. PFA+2 (right after the actual cell) is a link to the
slot right after that DOES>. Therefore, what we need to do
push the cell addr like a regular cell, then follow the
linkfrom the PFA, and then continue as a regular
compiledWord. )
EXDEHL,
HL INCd, HL INCd,
E (HL) LDrr,
HL INCd,
D (HL) LDrr,
( continue to compiledWord )

View File

@ -1,13 +1,11 @@
( compiled word ) L1 FSET ( execute B301 )
( 1. Push current IP to RS ( 1. Push current IP to RS
2. Set new IP to the second atom of the list 2. Set new IP to the second atom of the list
3. Execute the first atom of the list. ) 3. Execute the first atom of the list. )
IX INCd, IX INCd, IX INCd, IX INCd,
0 IX+ C LDIXYr, 0 IX+ C LDIXYr,
1 IX+ B LDIXYr, 1 IX+ B LDIXYr,
EXDEHL, ( HL points to PFA )
( While we inc, dereference into DE for execute call later. ) ( While we inc, dereference into DE for execute call later. )
LDDE(HL), LDDE(HL),
HL INCd, HL INCd,
B H LDrr, C L LDrr, ( --> IP ) B H LDrr, C L LDrr, ( --> IP )
JR, lblexec BWR ( execute-B287 ) JR, lblexec BWR ( execute-B287 )