optimize general multiplication, less cpu cykels in most cases
This commit is contained in:
parent
3211f6d441
commit
69232b6d53
1 changed files with 4 additions and 4 deletions
|
@ -12,15 +12,15 @@
|
||||||
.include "arithmatic.inc"
|
.include "arithmatic.inc"
|
||||||
|
|
||||||
LDA #$00
|
LDA #$00
|
||||||
|
JMP start
|
||||||
loop:
|
loop:
|
||||||
ASL VAL_B
|
ASL VAL_B
|
||||||
|
start:
|
||||||
ROR VAL_A; add to awnser if VAL_A is odd
|
ROR VAL_A; add to awnser if VAL_A is odd
|
||||||
BCC loop
|
BCC loop
|
||||||
|
CLC
|
||||||
LSR VAL_B
|
|
||||||
ADC VAL_B; add val_b because val_a was odd.
|
ADC VAL_B; add val_b because val_a was odd.
|
||||||
ASL VAL_B
|
LDX VAL_B
|
||||||
|
|
||||||
BNE loop
|
BNE loop
|
||||||
endloop:
|
endloop:
|
||||||
RTS
|
RTS
|
||||||
|
|
Loading…
Add table
Reference in a new issue