From f54e01781b6d0daa9ba51a642c5a2e4d0bb21d22 Mon Sep 17 00:00:00 2001 From: IrgendwerA8 Date: Sat, 29 Aug 2020 16:21:45 +0200 Subject: [PATCH] Tiny optimizations for multiplication. --- libsrc/runtime/lmul.s | 4 ++-- libsrc/runtime/umul8x16r24.s | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/libsrc/runtime/lmul.s b/libsrc/runtime/lmul.s index 860d58cba..d3c34637c 100644 --- a/libsrc/runtime/lmul.s +++ b/libsrc/runtime/lmul.s @@ -63,7 +63,7 @@ L0: lsr tmp4 bcc L1 clc adc ptr3 - pha + tax lda ptr3+1 adc tmp2 sta tmp2 @@ -73,7 +73,7 @@ L0: lsr tmp4 lda ptr4+1 adc tmp4 sta tmp4 - pla + txa L1: dey bpl L0 lda ptr1 ; Load the low result word diff --git a/libsrc/runtime/umul8x16r24.s b/libsrc/runtime/umul8x16r24.s index c006082a4..54d730558 100644 --- a/libsrc/runtime/umul8x16r24.s +++ b/libsrc/runtime/umul8x16r24.s @@ -41,20 +41,19 @@ umul8x16r16m: .endif ldy #8 ; Number of bits - ldx ptr3 ; Get into register for speed lda ptr1 ror a ; Get next bit into carry @L0: bcc @L1 clc - pha - txa + tax + lda ptr3 adc ptr1+1 sta ptr1+1 lda ptr3+1 adc sreg sta sreg - pla + txa @L1: ror sreg ror ptr1+1