From d9e26d4467fcb3c027f4868bd1f9bf72eae05843 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 22 Mar 2024 21:10:33 -0500 Subject: [PATCH] Small optimizations related to 8/16-bit register switching. --- signal.asm | 5 ++--- string.asm | 49 ++++++++++++++++++++++++------------------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/signal.asm b/signal.asm index 93222e5..82b1d91 100644 --- a/signal.asm +++ b/signal.asm @@ -107,9 +107,8 @@ lb2 asl A get the signal handler address tay lda >subABRT-2,X bmi lb3 skip if it is SIG_DFL or SIG_IGN - short M set up the call address - sta >jsl+3 - long M + xba set up the call address + sta >jsl+2 tya sta >jsl+1 ph2 return NULL - ldx #0 +lb2 ldx #0 no match found -> return NULL txy + long I,M bra lb4 lb3 long I,M increment s by Y and load the value tya - and #$00FF clc adc s tay @@ -1266,10 +1265,10 @@ lb1 lda [str],Y lb2 ldy #-1 no match found -> return -1 -lb3 long M - pld remove parameters from the stack - lda 2,S - sta 8,S +lb3 pld remove parameters from the stack + lda 3,S + sta 9,S + long M pla sta 5,S pla @@ -1377,10 +1376,10 @@ lb2 cmp #0 iny bpl lb1 -lb3 long M - pld remove parameters from the stack - lda 2,S - sta 8,S +lb3 pld remove parameters from the stack + lda 3,S + sta 9,S + long M pla sta 5,S pla