Here are some 6800 code samples for comparison.
Uppercase a string.
Keeping the single pointer in the X register works well.
Code:
ldx #string ; 3 bytes, 3 cycles
bra endchk ; 2 bytes, 4 cycles
do
cmpa #'z'+1 ; 2 bytes, 2 cycles
bcc next ; 2 bytes, 4 cycles
cmpa #'a' ; 2 bytes, 2 cycles
bcs next ; 2 bytes, 4 cycles
eora #$20 ; 2 bytes, 2 cycles
staa 0,x ; 2 bytes, 6 cycles
next
inx ; 1 byte, 4 cycles
endchk
ldaa 0,x ; 2 bytes, 5 cycles
bne do ; 2 bytes, 4 cycles
strcmp
Shuttling the 2 pointers in & out of the X register slows things down.
Code:
;pstr1 and pstr2 are 2 byte on zp
ldx #string1 ; 3 bytes, 3 cycles
stx pstr1 ; 2 bytes, 5 cycles
ldx #string2 ; 3 bytes, 3 cycles
stx pstr2 ; 2 bytes, 5 cycles
loop
ldx pstr1 ; 2 bytes, 4 cycles
ldaa 0,x ; 2 bytes, 5 cycles
beq l1 ; 2 bytes, 4 cycles
inx ; 1 byte, 4 cycles
stx pstr1 ; 2 bytes, 5 cycles
ldx pstr2 ; 2 bytes, 4 cycles
suba 0,x ; 2 bytes, 5 cycles
bne l2 ; 2 bytes, 4 cycles
inx ; 1 byte, 4 cycles
stx pstr2 ; 2 bytes, 5 cycles
bra loop ; 2 bytes, 4 cycles
l1 ldx pstr2 ; 2 bytes, 5 cycles
suba 0,x ; 2 bytes, 5 cycles
l2