From 85a0b87da36a7aa0fe17a40f8261339e75a45d7d Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 14 Jun 2020 10:12:56 -0400 Subject: [PATCH] z80: reorder compiledWord and doesWord, saving ourselves a jump --- blk/302 | 28 ++++++++++++++-------------- blk/303 | 16 ++++++++++++++++ blk/304 | 16 ---------------- emul/forth.bin | Bin 6190 -> 6188 bytes 4 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 blk/303 delete mode 100644 blk/304 diff --git a/blk/302 b/blk/302 index 0aad349..8fa1aa4 100644 --- a/blk/302 +++ b/blk/302 @@ -1,16 +1,16 @@ -L1 BSET 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), +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 PUSHqq, IY POPqq, ( --> IP ) - JR, L3 BWR ( execute-B301 ) - - - + HL INCss, + E (HL) LDrr, + HL INCss, + D (HL) LDrr, + ( continue to compiledWord ) diff --git a/blk/303 b/blk/303 new file mode 100644 index 0000000..46a5967 --- /dev/null +++ b/blk/303 @@ -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 ) + + + + diff --git a/blk/304 b/blk/304 deleted file mode 100644 index 87bbec8..0000000 --- a/blk/304 +++ /dev/null @@ -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 ) - diff --git a/emul/forth.bin b/emul/forth.bin index 7d6cb269b339d12b938c73197ec8856e9cbff45d..39751d961c90663dccd23625f32e5e9bb978dfd5 100644 GIT binary patch literal 6188 zcma)Ae{9oddVjw^Y$tZ&I1VHbX!$w`#3l(%a%F32a1uKXcsO>j4TMFI<5wt0nnVdL zZLddj+1SLj8h@NR{@5RhZg*OTV3XKNOQ#`qDVsVPl%56>=v>H2DX=Wuj!wPKcWL(d zysr)1PMSu9{XWn8JkR_5exKJ z!ha#KocbHk@%yjTccdqp7Q(EUUMA)iXQwKKfB#6p4aDMJvA9!PTuD?baHYalG5f}Q z{=19Si`78lpMPLzXgE+V>=l`3g=J)()iNhU=JGezROW=1xx8fkL#9sst@zhqa;?xS zW~WPq;%yEl-NLB&jF|aH*ksTPD(V8N=48+X5%kE#Fudc=!i*vKn z-`03qH9WuK=Qn*{llSJ#it~}4NO(s&@@wI!_-y)$w&I_YiL?{0nEmV{fY;})z}}7> z-5#QVn4|rzKrn6+fjDVIb|e$sULvth?P~8X9_k+%8W;#Xjfl^7bUk04-cwh%@B#46JZKp+geNsa73ULjsY$A_ z1d)X>0<|e80U@3z)E@6BlEy)=@BU=y^&cN5Hj!j1NM*nK-q7oRFOfZoWZ5Iq^Fyzn zlh}A7EwSK#<2|Icr5RTsq0TEbB|s)fLlHpa+Z7FA;R);AM9`zqBy32J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