]> git.sur5r.net Git - cc65/commitdiff
Optimize deceaxy.
authorPiotr Fusik <fox@scene.pl>
Wed, 7 Mar 2018 19:45:50 +0000 (20:45 +0100)
committerPiotr Fusik <fox@scene.pl>
Wed, 7 Mar 2018 19:45:50 +0000 (20:45 +0100)
libsrc/runtime/ldec.s

index 53b60095daa4f37fd4bddccd5fd1ee48a6de9c80..ee7ed3fd4947c55ab57556c57e9657748ba8c7c9 100644 (file)
@@ -1,5 +1,6 @@
 ;
-; Ullrich von Bassewitz, 29.12.1999
+; Piotr Fusik, 07.03.2018
+; originally by Ullrich von Bassewitz
 ;
 ; CC65 runtime: Decrement eax by value in Y
 ;
@@ -11,16 +12,13 @@ deceaxy:
         sty     tmp1
         sec
         sbc     tmp1
-        sta     tmp1
-        txa
-        sbc     #0
-        tax
-        lda     sreg
-        sbc     #0
-        sta     sreg
-        lda     sreg+1
-        sbc     #0
-        sta     sreg+1
-        lda     tmp1
-        rts
+        bcs     @L9
+        dex
+        cpx     #$ff
+        bne     @L9
+        dec     sreg
+        cpx     sreg
+        bne     @L9
+        dec     sreg+1
+@L9:    rts