Translate with Table (XLATEWT)
Instruction Syntax
Op Code (Hex) | Operand 1 | Operand 2 | Operand 3 |
---|---|---|---|
109F | Receiver | Source | Table |
Operand 2: Character scalar.
Operand 3: Character scalar.
Description:
The source characters are translated under control of the translate table and placed in the receiver. The operation begins with the leftmost character of operand 2 and proceeds character-by-character, left-to-right.
Characters are translated as follows:
- The source character is used as an offset and added to the location of operand 3.
- The character contained in the offset location is the translated character. This character is copied to the receiver in the same relative position as the original character in the source string.
If operand 1 overlaps with operand 2 and/or 3, the overlapped operands are updated for every character translated. The operation proceeds from left to right, one character at a time. The following example shows the results of an overlapped operands translate operation. Operands 1, 2, and 3 have the same coincident character string with a value of hex 050403020103.
Hex 050403020103–Initial value
Hex 030403020103–After the 1st character is translated
Hex 030103020103–After the 2nd character is translated
Hex 030102020103–After the 3rd character is translated
Hex 030102020103–After the 4th character is translated
Hex 030102020103–After the 5th character is translated
Hex 030102020102–After the 6th character, the final result
Note that the instruction does not use the length specified for the table operand to constrain access of the bytes addressed by the table operand.
If operand 3 is less than 256 characters long, and a source character specifies an offset beyond the end of operand 3, the result characters are obtained from byte locations in the space following operand 3. If that portion of the space is not currently allocated, a space addressing violation (hex 0601) exception is signaled. If operand 3 is a constant with a length less than 256, source characters specifying offsets greater than or equal to the length of the constant are translated into unpredictable characters.
All of the operands support variable length substring compound scalars.
Substring operand references that allow for a null substring reference (a length value of zero) may be specified for all of the operands on this instruction. Specifying a null substring reference for the table operand does not affect the operation of the instruction. In this case, the bytes addressed by the table operand are still accessed as described above. This is due to the definition of the function of this instruction which does not use the length specified for the table operand to constrain access of the bytes addressed by the table operand. The effect of specifying a null substring reference for either or both of the receiver and the source operands is that no result is set.
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
- 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
- 36 Space Management
- 3601 Space Extension/Truncation
- 44 Protection Violation
- 4401 Object Domain or Hardware Storage Protection Violation
- 4402 Literal Values Cannot Be Changed