SCANC SPANC

VAX11

 

SCANC SPANC          SCAN CHARACTERS, SPAN CHARACTERS

 

Purpose

to find or skip a set of characters in character string

Format

opcode len.rw, addr.ab, tbladdr.ab, mask.rb

Operation

Mask test each character until zero (SPANC) or nonzero (SCANC).

Condition codes

N ß 0;

V ßR0 EQL 0;

V ß 0;

C ß 0;

Exceptions

None

Opcodes

2A       SCANC           Scan Characters

2B        SPANC           Span Characters

Description

The bytes of the string specified by the length and address operands are successively used to index into a 256 byte table whose zeroth entry address is specified by the table address operand. The byte selected from the table is ANDed with the mask operand. The operation continues until the result of the AND is non-zero for the SCANC instruction or zero for the SPANC instruction or until all the bytes of the string have been exhausted. If a non-zero AND result for the SCANC or a zero result for the SPANC is detected, the condition code Z-bit is cleared; otherwise, the Z-bit is set.

Notes

1. After execution:

R0 = number of bytes remaining in the string (include the byte which produced the non-zero AND result for SCANC or zero result for SPANC).

R0 is zero only if there was a zero AND result for SCANC or a non-zero result for SPANC.

R1 = address of the byte which produced non-zero AND result for SCANC or a zero AND result for SPANC; Or, if zero result., R1 = address of one byte beyond the string.

R2 = O

R3 = address of the table

2. If the string has zero length, condition code z is set just as though the entire string were scanned (spanned).