]> git.sur5r.net Git - cc65/commitdiff
Removed optimizations which break the compiler ones. 657/head
authorIrgendwerA8 <c.krueger.b@web.de>
Tue, 22 May 2018 17:10:07 +0000 (19:10 +0200)
committerIrgendwerA8 <c.krueger.b@web.de>
Tue, 22 May 2018 17:10:07 +0000 (19:10 +0200)
libsrc/runtime/mulax3.s
libsrc/runtime/mulax5.s
libsrc/runtime/mulax7.s
libsrc/runtime/mulax9.s

index 82cc033c37694a6675788f7cde1b1c41549024c4..472bc60ec5da17826a3669906aa930ba91fac259 100644 (file)
         rol     ptr1+1
         clc
         adc     ptr1
-        tay
+        pha
         txa
         adc     ptr1+1
         tax
-        tya
+        pla
         rts
 
 .endproc
index bf5eaefe8fdc455138cd63002a40fe89028fe406..99f0ffce06cf743c91845deb59402c3ab4ef9a40 100644 (file)
@@ -3,6 +3,7 @@
 ;
 ; CC65 runtime: Multiply the primary register by 5
 ;
+; Don't touch the Y-register here, the optimizer relies on it!
 
         .export         mulax5
         .importzp       ptr1
         rol     ptr1+1
         clc
         adc     ptr1
-        tay
+        pha
         txa
         adc     ptr1+1
         tax
-        tya
+        pla
         rts
 
 .endproc
index 3414ebc9e87801b56616da69de48dca8b68b259f..6f2b2bf610588de197fe8df6344888a3c62232aa 100644 (file)
@@ -4,6 +4,7 @@
 ;
 ; CC65 runtime: Multiply the primary register by 7
 ;
+; Don't touch the Y-register here, the optimizer relies on it!
 
         .export         mulax7
         .importzp       ptr1
         rol     ptr1+1                  ; * 8
         sec
         sbc     ptr1
-        tay
+        pha
         txa
         eor     #$ff
         adc     ptr1+1                  ; * (8 - 1)
         tax
-        tya
+        pla
         rts
 
 .endproc
index d175d55aa5e7b6fa8647bd560cc818b317c17e11..064eb458bc75d024f7f8b05f44c084644748dfcc 100644 (file)
@@ -4,6 +4,7 @@
 ;
 ; CC65 runtime: Multiply the primary register by 9
 ;
+; Don't touch the Y-register here, the optimizer relies on it!
 
         .export         mulax9
         .importzp       ptr1
         rol     ptr1+1                  ; * 8
         clc
         adc     ptr1                    ; * (8+1)
-        tay
+        pha
         txa
         adc     ptr1+1
         tax
-        tya
+        pla
         rts
 
 .endproc