From 808d3ab4714c2bf393b0befddafe2a7ea7897289 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Tue, 22 May 2018 18:35:05 +0200 Subject: [PATCH] Fix for 8x16 multiplication if operants are swapped. --- libsrc/runtime/mul.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/runtime/mul.s b/libsrc/runtime/mul.s index a9b53293b..769cf9d8e 100644 --- a/libsrc/runtime/mul.s +++ b/libsrc/runtime/mul.s @@ -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 -- 2.39.5