From fa599be775abaaa92c701e1e56d6844dbb759d34 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 4 Jan 2023 19:52:56 -0800 Subject: [PATCH] wip fix --- mandel.s | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mandel.s b/mandel.s index 9b569e2..487ceb1 100644 --- a/mandel.s +++ b/mandel.s @@ -32,7 +32,8 @@ FRX = $ec ; inner loop for imul16 ; 24 to 44 cycles .macro bitmul16 arg1, arg2, result, bitnum - .local next + .local one + .local zero ; does 16-bit adds ; arg1 must be 0 or positive @@ -49,8 +50,9 @@ FRX = $ec lda arg1 + 1 ; 3 cyc and #(1 << (bitnum - 8)) ; 2 cyc .endif - beq next ; 2 cyc + beq zero ; 2 cyc +one: ; 16-bit add on the top bits lda result + 2 ; 3 cyc adc arg2 ; 3 cyc @@ -59,11 +61,13 @@ FRX = $ec adc arg2 + 1 ; 3 cyc ror a ; 2 cyc - get a jump on the shift sta result + 3 ; 3 cyc - + jmp oneb ; 3 cyc + ; Shift the 32-bit result down by one bit, ; saving the previous carry. +zero: ror result + 3 ; 5 cyc -next: +oneb: ror result + 2 ; 5 cyc ror result + 1 ; 5 cyc .if bitnum >= 8