mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +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.
|
||||
sta P8ZP_SCRATCH_W1
|
||||
sty P8ZP_SCRATCH_W1+1
|
||||
_loop ldy #0
|
||||
lda (P8ZP_SCRATCH_W1),y
|
||||
ldy #0
|
||||
_loop lda (P8ZP_SCRATCH_W1),y
|
||||
bne +
|
||||
lda (P8ZP_SCRATCH_W2),y
|
||||
bne _return_minusone
|
||||
beq _return
|
||||
+ lda (P8ZP_SCRATCH_W2),y
|
||||
sec
|
||||
sbc (P8ZP_SCRATCH_W1),y
|
||||
bmi _return_one
|
||||
bne _return_minusone
|
||||
+ cmp (P8ZP_SCRATCH_W2),y
|
||||
bcc _return_minusone
|
||||
bne _return_one
|
||||
inc P8ZP_SCRATCH_W1
|
||||
bne +
|
||||
inc P8ZP_SCRATCH_W1+1
|
||||
|
Loading…
x
Reference in New Issue
Block a user