From 69232b6d531d8480e30bc8afddc642a90a4b75ca Mon Sep 17 00:00:00 2001 From: hugova Date: Fri, 16 May 2025 18:36:10 +0200 Subject: [PATCH] optimize general multiplication, less cpu cykels in most cases --- wip-hugo/routines/arithmatic/mult.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wip-hugo/routines/arithmatic/mult.s b/wip-hugo/routines/arithmatic/mult.s index b0c7056..86473c2 100644 --- a/wip-hugo/routines/arithmatic/mult.s +++ b/wip-hugo/routines/arithmatic/mult.s @@ -12,15 +12,15 @@ .include "arithmatic.inc" LDA #$00 + JMP start loop: ASL VAL_B +start: ROR VAL_A; add to awnser if VAL_A is odd BCC loop - - LSR VAL_B + CLC ADC VAL_B; add val_b because val_a was odd. - ASL VAL_B - + LDX VAL_B BNE loop endloop: RTS