MATCHC

VAX11

 

MATCHC Match Characters

 

Purpose

to find substring (object) in character string

Format

opcode objlen.rw, objaddr.ab, srclen.rw, srcaddr.ab

Operation

search the string located on srcaddr for full string match of object

Condition codes

N ß 0;

V ßR0 EQL 0;

V ß 0;

C ß 0;

Exceptions

None

Opcodes

39        MATCHC                   Match Characters

Description

The source string specified by the source length and source address operands is searched for a substring which matches the object string specified by the object length and object ad dress operands. If the substring is found, the condition code Z bit is set; otherwise, it is cleared.

Notes

1. After Execution:

R0 = if a match occurred 0; otherwise the number of bytes in the object string.

Rl = if a match occurred, the address of one byte beyond the object string; otherwise the address of the object string.

R2 = if a match occurred, the number of bytes remaining in the source string after the match; otherwise 0.

R3 = if a match occurred, the address of 1 byte beyond

the last byte matched; otherwise the address of 1 byte

beyond the source

2. If both strings have zero length or if the object string has zero length, condition code Z is set just as though the substring were found.

3. If the source string has zero length and the object string has non-zero length, condition code Z is cleared just a though the substring were not found.