mirror of
https://github.com/irmen/prog8.git
synced 2024-11-03 13:07:54 +00:00
Optimize strcmp_mem
This commit is contained in:
parent
7c70c79a84
commit
49d37c016e
@ -1121,17 +1121,15 @@ strcmp_mem .proc
|
|||||||
; Returns -1,0,1 in A, depeding on the ordering. Clobbers Y.
|
; Returns -1,0,1 in A, depeding on the ordering. Clobbers Y.
|
||||||
sta P8ZP_SCRATCH_W1
|
sta P8ZP_SCRATCH_W1
|
||||||
sty P8ZP_SCRATCH_W1+1
|
sty P8ZP_SCRATCH_W1+1
|
||||||
_loop ldy #0
|
ldy #0
|
||||||
lda (P8ZP_SCRATCH_W1),y
|
_loop lda (P8ZP_SCRATCH_W1),y
|
||||||
bne +
|
bne +
|
||||||
lda (P8ZP_SCRATCH_W2),y
|
lda (P8ZP_SCRATCH_W2),y
|
||||||
bne _return_minusone
|
bne _return_minusone
|
||||||
beq _return
|
beq _return
|
||||||
+ lda (P8ZP_SCRATCH_W2),y
|
+ cmp (P8ZP_SCRATCH_W2),y
|
||||||
sec
|
bcc _return_minusone
|
||||||
sbc (P8ZP_SCRATCH_W1),y
|
bne _return_one
|
||||||
bmi _return_one
|
|
||||||
bne _return_minusone
|
|
||||||
inc P8ZP_SCRATCH_W1
|
inc P8ZP_SCRATCH_W1
|
||||||
bne +
|
bne +
|
||||||
inc P8ZP_SCRATCH_W1+1
|
inc P8ZP_SCRATCH_W1+1
|
||||||
|
Loading…
Reference in New Issue
Block a user