* *``````````````````````````````* * STRCMP :: STRING COMPARE * *- -* * COMPARE TWO STRINGS AND * * DETERMINE IF THEY ARE * * IDENTICAL; IF NOT, DETERMINE * * WHICH IS THE SHORTEST AND * * WHICH IS THE LONGEST. * * * * Z FLAG = 1 IF IDENTICAL * * Z FLAG = 0 IF NOT * * CARRY = 1 IF STR2 > STR1 LEN * * CARRY = 0 IF STR1 > STR2 LEN * *- -* * CLOBBERS: * * * * FLAGS: ????---- REG: AXYM * *- -* * CYCLES: ??? * * SIZE: * *- -* * USAGE: * * * * LDA #>STR1 * * PHA * * LDA #STR2 * * PHA * * LDA # STR1 LENGTH ** CARRY = 1 IF STR1 LENGTH >= STR2 LENGTH * :EXIT * ** RESTORE RETURN ADDRESS * LDA RETADR+1 PHA LDA RETADR PHA * LDY #0 LDA (ADDR1),Y ; GET STR1 LENGTH TAX ; RETURN IN X LDA (ADDR2),Y ; STR2 LENGTH TAY ; RETURN IN Y * RTS *