/sys$common/syshlp/helplib.hlb MACRO, VAX MACRO Assembler, Instructions, MATCHC *Conan The Librarian (sorry for the slow response - running on an old VAX) |
Purpose: To find a substring (object) in a character string Format: opcode objlen.rw,objaddr.ab,srclen.rw,srcaddr.ab Operation: {compare object substring with srcstring until match} C. Codes: N = 0, Z = {R0 EQL 0}, Z = 0, C = 0 Exceptions: None Opcode: 39 MATCHC Match characters Description: src as specified by srclen and srcaddr is searched for a substring which matches the object string as specified by objlen and objaddr. If the substring is found the Z bit is set, otherwise it is cleared. The search continues until src is exhausted or until a match is found. Notes: After execution: R0 = if a match occurred, 0; otherwise the number of bytes in the object string R1 = if a match occurred, the address of one byte beyond the object string; that is, objaddr + objlen; otherwise, the address of the object string R2 = if a match occurred, the number of bytes remaining in the source string; otherwise 0 R3 = if a match occurred, the address of one byte beyond the last byte matched; otherwise, the address of one byte beyond the source string; that is, srcaddr + srclen For zero-length source and object strings, R3 and R1 contain the source and object addresses, respectively. If both strings have 0 length or if the object string has length 0, condition code Z is set and registers R0-R3 are left just as though the substring were found. If the source has 0 length and the object string has nonzero length, condition code Z is cleared and registers R0-R3 are left just as though the substring were not found.
|