From 62dbbcc4b68f160bfd00b08d69e18b1d3aebb8aa Mon Sep 17 00:00:00 2001 From: cuz Date: Mon, 5 May 2003 17:05:22 +0000 Subject: [PATCH] Small optimization git-svn-id: svn://svn.cc65.org/cc65/trunk@2149 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/common/strcat.s | 8 +++----- libsrc/common/strcpy.s | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/libsrc/common/strcat.s b/libsrc/common/strcat.s index 7297579bb..8640626f3 100644 --- a/libsrc/common/strcat.s +++ b/libsrc/common/strcat.s @@ -6,7 +6,7 @@ .export _strcat .import popax - .importzp ptr1, ptr2, ptr3 + .importzp ptr1, ptr2, tmp3 _strcat: sta ptr1 ; Save src @@ -14,8 +14,7 @@ _strcat: jsr popax ; Get dest sta ptr2 stx ptr2+1 - sta ptr3 ; Remember for function return - stx ptr3+1 + sta tmp3 ; Remember for function return ldy #0 ; find end of dest @@ -50,8 +49,7 @@ sc4: lda (ptr1),y ; done, return pointer to dest -sc5: lda ptr3 - ldx ptr3+1 +sc5: lda tmp3 ; X does still contain high byte rts diff --git a/libsrc/common/strcpy.s b/libsrc/common/strcpy.s index a0194db9c..649424def 100644 --- a/libsrc/common/strcpy.s +++ b/libsrc/common/strcpy.s @@ -6,7 +6,7 @@ .export _strcpy .import popax - .importzp ptr1, ptr2, ptr3 + .importzp ptr1, ptr2, tmp3 _strcpy: sta ptr1 ; Save src @@ -14,8 +14,7 @@ _strcpy: jsr popax ; Get dest sta ptr2 stx ptr2+1 - sta ptr3 ; remember for function return - stx ptr3+1 + sta tmp3 ; remember for function return ldy #$00 L1: lda (ptr1),y @@ -27,7 +26,6 @@ L1: lda (ptr1),y inc ptr2+1 bne L1 -L9: lda ptr3 - ldx ptr3+1 +L9: lda tmp3 ; X still contains high byte rts -- 2.39.5