Motorola M68CPU32BUG Manuel d'utilisateur Page 136

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 196
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 135
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
Vue de la page 135
1 2 ... 131 132 133 134 135 136 137 138 139 140 141 ... 195 196

Commentaires sur ces manuels

Pas de commentaire