]> git.sur5r.net Git - cc65/commitdiff
Fix for 8x16 multiplication if operants are swapped.
authorIrgendwerA8 <c.krueger.b@web.de>
Tue, 22 May 2018 16:35:05 +0000 (18:35 +0200)
committerIrgendwerA8 <c.krueger.b@web.de>
Tue, 22 May 2018 16:35:05 +0000 (18:35 +0200)
libsrc/runtime/mul.s

index a9b53293be6ec2d73260b85dcf866f5fdc036096..769cf9d8e9274c7c2e9f50063dfe7f707a7f4af0 100644 (file)
@@ -62,7 +62,8 @@ tosumulax:
 @L4:    ldy     ptr1            ; Save right operand (8 bit)
         ldx     ptr4            ; Copy left 16 bit operand to right
         stx     ptr1
-        ldx     ptr4+1          ; Don't store, this is done later
+        ldx     ptr4+1          ; swap high-byte too
+        stx     ptr1+1
         sty     ptr4            ; Copy low 8 bit of right op to left
         ldy     #8
         jmp     mul8x16a