z80: reorder compiledWord and doesWord, saving ourselves a jump

This commit is contained in:
Virgil Dupras 2020-06-14 10:12:56 -04:00
parent 38d5a9f303
commit 85a0b87da3
4 changed files with 30 additions and 30 deletions

28
blk/302
View File

@ -1,16 +1,16 @@
L1 BSET PC ORG @ 0x0f + ! ( compiledWord ) PC ORG @ 0x2c + ! ( doesWord )
( 1. Push current IP to RS ( The word was spawned from a definition word that has a
2. Set new IP to the second atom of the list DOES>. PFA+2 (right after the actual cell) is a link to the
3. Execute the first atom of the list. ) slot right after that DOES>. Therefore, what we need to do
IY PUSHqq, HL POPqq, ( <-- IP ) push the cell addr like a regular cell, then follow the
L4 @ ( pushRS ) BCALL, linkfrom the PFA, and then continue as a regular
EXDEHL, ( HL points to PFA ) compiledWord. )
( While we inc, dereference into DE for execute call later. ) DE PUSHqq, ( like a regular cell )
LDDE(HL), EXDEHL,
HL INCss, HL INCss,
HL PUSHqq, IY POPqq, ( --> IP ) HL INCss,
JR, L3 BWR ( execute-B301 ) E (HL) LDrr,
HL INCss,
D (HL) LDrr,
( continue to compiledWord )

16
blk/303 Normal file
View File

@ -0,0 +1,16 @@
PC ORG @ 0x0f + ! ( compiledWord )
( 1. Push current IP to RS
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 ) BCALL,
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 )

16
blk/304
View File

@ -1,16 +0,0 @@
PC ORG @ 0x2c + ! ( doesWord )
( 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. )
DE PUSHqq, ( like a regular cell )
EXDEHL,
HL INCss,
HL INCss,
E (HL) LDrr,
HL INCss,
D (HL) LDrr,
JR, L1 BWR ( compiledWord-B302 )

Binary file not shown.