mirror of
https://github.com/cc65/cc65.git
synced 2024-06-07 23:29:39 +00:00
Optimize a negation in signed division.
This commit is contained in:
parent
0d21a2b5a4
commit
2bec637637
|
@ -29,19 +29,18 @@ idiv32by16r16:
|
||||||
stx ptr3+1
|
stx ptr3+1
|
||||||
|
|
||||||
lda ptr2+1
|
lda ptr2+1
|
||||||
|
cmp #$80
|
||||||
eor tmp1
|
eor tmp1
|
||||||
sta tmp1
|
sta tmp1
|
||||||
bit ptr2+1
|
bcc @L3
|
||||||
bpl @L3
|
|
||||||
|
|
||||||
; Negate the value in ptr1:ptr2
|
; Negate the value in ptr1:ptr2
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
ldy #4
|
ldy #4
|
||||||
sec
|
; sec
|
||||||
@L2: lda ptr1,x
|
@L2: lda #$00
|
||||||
eor #$FF
|
sbc ptr1,x
|
||||||
adc #$00
|
|
||||||
sta ptr1,x
|
sta ptr1,x
|
||||||
inx
|
inx
|
||||||
dey
|
dey
|
||||||
|
|
Loading…
Reference in New Issue
Block a user