1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 22:30:12 +00:00

Tiny optimizations for multiplication.

This commit is contained in:
IrgendwerA8 2020-08-29 16:21:45 +02:00 committed by Oliver Schmidt
parent 5158ee2092
commit f54e01781b
2 changed files with 5 additions and 6 deletions

View File

@ -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

View File

@ -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