From 31095bc04d498ba8e584c166ddd57a5c91e92152 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 14 Jun 2020 09:29:34 -0400 Subject: [PATCH] z80: remove call indirections in tight spots --- blk/216 | 2 +- blk/297 | 2 +- blk/299 | 2 +- blk/300 | 2 +- blk/302 | 2 +- emul/forth.bin | Bin 6189 -> 6189 bytes 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/blk/216 b/blk/216 index 2197800..908ab79 100644 --- a/blk/216 +++ b/blk/216 @@ -1,7 +1,7 @@ : OP1 CREATE C, DOES> C@ A, ; 0xf3 OP1 DI, 0xfb OP1 EI, 0xeb OP1 EXDEHL, 0xd9 OP1 EXX, -0x08 OP1 EXAFAF', +0x08 OP1 EXAFAF', 0xe3 OP1 EX(SP)HL, 0x76 OP1 HALT, 0xe9 OP1 JP(HL), 0x12 OP1 LD(DE)A, 0x1a OP1 LDA(DE), 0x02 OP1 LD(BC)A, 0x0a OP1 LDA(BC), diff --git a/blk/297 b/blk/297 index fe22480..0c9ec79 100644 --- a/blk/297 +++ b/blk/297 @@ -1,4 +1,4 @@ -PC ORG @ 0x12 + ! ( pushRS ) +L4 BSET PC ORG @ 0x12 + ! ( pushRS ) IX INCss, IX INCss, 0 IX+ L LDIXYr, diff --git a/blk/299 b/blk/299 index 92fc981..d0246db 100644 --- a/blk/299 +++ b/blk/299 @@ -1,4 +1,4 @@ -PC ORG @ 0x1e + ! ( chkPS ) +L1 BSET PC ORG @ 0x1e + ! ( chkPS ) ( Note that you only need to call this in words that push back to PSP. If they don't, calling chkPS is redundant with check in next ) diff --git a/blk/300 b/blk/300 index 31a3c52..517be4c 100644 --- a/blk/300 +++ b/blk/300 @@ -3,7 +3,7 @@ PC ORG @ 0x1b + ! ( next ) we jump to current IP, but we also take care of increasing it by 2 before jumping. ) ( Before we continue: are stacks within bounds? ) - 0x1d BCALL, ( chkPS ) + L1 @ ( chkPS ) BCALL, ( check RS ) IX PUSHqq, HL POPqq, DE RS_ADDR LDddnn, diff --git a/blk/302 b/blk/302 index e4e90ef..0aad349 100644 --- a/blk/302 +++ b/blk/302 @@ -3,7 +3,7 @@ L1 BSET PC ORG @ 0x0f + ! ( compiledWord ) 2. Set new IP to the second atom of the list 3. Execute the first atom of the list. ) IY PUSHqq, HL POPqq, ( <-- IP ) - 0x11 BCALL, ( 11 == pushRS ) + L4 @ ( pushRS ) BCALL, EXDEHL, ( HL points to PFA ) ( While we inc, dereference into DE for execute call later. ) LDDE(HL), diff --git a/emul/forth.bin b/emul/forth.bin index 437c3e6978b948a37801436499dde452438bdfa1..a8d3ae16b24628bf0b0018e3ae78c73c5f6b1632 100644 GIT binary patch delta 22 ecmZ2$u-0J1G)AT_#>q1n6_^qjH}7IB76SlU#|Je4 delta 22 ecmZ2$u-0J1G)5*_hRHJ+6_^AWHt%9A76SlMl?HbJ