]> git.sur5r.net Git - cc65/commitdiff
Optimization
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 31 Oct 2000 18:53:38 +0000 (18:53 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 31 Oct 2000 18:53:38 +0000 (18:53 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@422 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/runtime/ldeax.s

index 9912a521131d0718987136542cf6eb1dd510b1ec..2213e9af457eebdca5f27d600ecfc0aebb93b807 100644 (file)
@@ -7,6 +7,7 @@
        .export         ldeax
        .importzp       sreg, ptr4
 
+       .macpack        generic
 
 ldeax: pla                     ; Low byte of return address
        sta     ptr4
@@ -24,15 +25,13 @@ ldeax:      pla                     ; Low byte of return address
        dey
        lda     (ptr4),y
        tay                     ; Save low byte
-       clc
-       lda     #4
-       adc     ptr4
-       sta     ptr4
-       lda     ptr4+1
-       adc     #$00
-       pha                     ; High byte of new return address
-       lda     ptr4
-       pha                     ; Low byte of new return address
-       tya                     ; Low byte of fetched value
-       rts
 
+; Calculate the return address (remember: RTS address is one low) and 
+; jump to it
+
+       lda     ptr4
+       add     #5
+       sta     ptr4
+       bcc     @L9
+       inc     ptr4+1
+@L9:   jmp     (ptr4)