Test Bit in String (TSTBTS)

Instruction Syntax

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:

  • Branch Form–Branch point, instruction pointer, relative instruction number, or absolute instruction number.
  • Indicator Form–Numeric variable scalar or character variable scalar.

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

  • Transfer control conditionally to the instruction indicated in one of the branch target operands (branch form).
  • Assign a value to each of the indicator operands (indicator form).

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

  • Zero-The selected bit of the bit string source operand is zero.
  • One-The selected bit of the bit string source operand is one.

Authorization Required

  • None

Lock Enforcement

  • None

Exceptions

  • 06 Addressing
    • 0601 Space Addressing Violation
    • 0602 Boundary Alignment
    • 0603 Range
  • 08 Argument/Parameter
    • 0801 Parameter Reference Violation
  • 10 Damage Encountered
    • 1004 System Object Damage State
    • 1044 Partial System Object Damage
  • 1C Machine-Dependent
    • 1C03 Machine Storage Limit Exceeded
  • 20 Machine Support
    • 2002 Machine Check
    • 2003 Function Check
  • 22 Object Access
    • 2202 Object Destroyed
    • 2203 Object Suspended
    • 2208 Object Compressed
    • 220B Object Not Available
  • 24 Pointer Specification
    • 2401 Pointer Does Not Exist
    • 2402 Pointer Type Invalid
  • 2E Resource Control Limit
    • 2E01 User Profile Storage Limit Exceeded
  • 32 Scalar Specification
    • 3201 Scalar Type Invalid
    • 3203 Scalar Value Invalid
  • 36 Space Management
    • 3601 Space Extension/Truncation
  • 44 Protection Violation
    • 4401 Object Domain or Hardware Storage Protection Violation