Test Bit in String (TSTBTS)


Op Code (Hex) Extender Operand 1 Operand 2 Operand 3 [4]
TSTBTSB 1C0E Branch options Source Offset Branch targets


TSTBTSI 180E Indicator options Source Offset Indicator targets
Operand 1: Character scalar or numeric scalar.

Operand 2: Binary scalar.

Operand 3:

Bound program access

Built-in number for TSTBTS is 1. TSTBTS ( source : address offset : unsigned binary(4) ) : signed binary(4) /* return_code */

The return code will be set as follows:

Return code

Meaning

1

Bit set.

0

Bit clear.

This built-in function is used to provide support for the branch and indicator forms of the TSTBTS instruction. The user must specify code to process the return_code and perform the desired branching or indicator setting.

The offset parameter must be between 0 and 65,535.

Description  Tests the bit of the source operand as indicated by the offset operand to determine if the bit is set or not set.

Based on the test, the resulting condition is used with the extender field to either

The source operand can be character or numeric. The leftmost bytes of the source operand are used in the operation. The source operand is interpreted as a bit string with the bits numbered left to right from 0 to the total number of bits in the string minus one.

The offset operand indicates which bit of the source operand is to be tested, with a offset of zero indicating the leftmost bit of the leftmost byte of the source operand.

If an offset value less than zero or beyond the length of the string is specified a scalar value invalid  (hex 3203) exception is signaled.

Resultant Conditions 

Authorization Required

Lock Enforcement

Exceptions

06 Addressing

08 Argument/Parameter

10 Damage Encountered

1C Machine-Dependent

20 Machine Support

22 Object Access

24 Pointer Specification

2E Resource Control Limit

32 Scalar Specification

36 Space Management

44 Protection Violation