mirror of
https://github.com/cc65/cc65.git
synced 2024-12-22 12:30:41 +00:00
Tiny optimizations for multiplication.
This commit is contained in:
parent
5158ee2092
commit
f54e01781b
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user