10. STR_COMP

*------------------------------------------------------------------------------
* NAME          STR_COMP
*------------------------------------------------------------------------------
* DEPENDENCY    None
* PURPOSE       To compare two strings for exact equality
* DESCRIPTION   Comprare the strings at (A1) and (A2) for exact equality.
*               Numbers in the string are considered as well as letters etc.
*               Equivalent to 'IF (A1$ = A2$)'
* INPUTS :
*               A1.L = First string
*               A2.L = Second string
* OUTPUTS :
*               D0 = Result of comparison.
*                    -1 = A1 string is < A2 string
*                     0 = A1 string = A2 string
*                    +1 = A1 string > A2 string
*               A1.L = First string (preserved)
*               A2.L = Second string (preserved)
*------------------------------------------------------------------------------
str_comp    movem.l a0-a2,-(a7)         ; Must preserve workers
            moveq   #2,d0               ; Include numbers, case is significant
sc_params   move.l  a1,a0               ; Uses different registers
            move.l  a2,a1               ; So swap them over
            move.w  UT_CSTR,a2          ; Fetch the vector address
            jsr     (a2)                ; Compare strings using ROM routine
            movem.l (a7)+,a0-a2         ; Restore working registers
            tst.l  d0                   ; Make sure Z is set/unset
            rts