SYSTEM CALLS
M68CPU32BUG/D REV 1 5-22
.STRCMP Compare Two Strings .STRCMP
5.2.18 Compare Two Strings
SYSCALL .STRCMP
TRAP CODE: $0068
An equality comparison is made and a boolean flag is returned to the caller. If the strings are not
identical the flag is $00, otherwise it is $FF.
Entry Conditions:
SP ==> Address of string#1
Address of string#2
Three bytes (unused)
Byte to receive string comparison result
Exit Conditions:
SP ==> Three bytes (unused)
Byte that received string comparison result
EXAMPLE
If A1 and A2 contain the addresses of the two strings.
SUBQ.L #4,A7
Allocate longword to receive result
PEA (A1)
Push address of one string
PEA (A2)
Push address of the other string
SYSCALL .STRCMP
Compare the strings
MOVE.L (A7)+,D0
Pop boolean flag into data register
TST.B D0 Check boolean flag
BNE ARE SAME Branch if strings are identical
Commentaires sur ces manuels