Operators that can be used in any expression
Use the operators defined in this section to write assembler expressions.
- +
- Addition
- –
- Subtraction or prefix minus
- *
- Multiplication
- /
- Division
- //
- Remainder
- ||
- Concatenation (C and X-type operands only)
- &
- Bitwise AND
- |
- Bitwise OR
- (…)
- Parenthesis to control the order of operation, specify the subscript
of an array, or select a substring.
- symbol(subscript)
- Parenthesis to specify a subscript for an array. For example,
if an array is defined by the instruction
X DS 5F
, you can specify the first word in the array asX(1)
. - symbol(substring)
- Parenthesis to select a substring of a single byte from a character or hexadecimal variable
- symbol(substrstart:substrend)
- Parenthesis to select a substring of the bytes from substrstart to substrend from a character or hexadecimal variable
- symbol(substrstart::substrlen)
- Parenthesis to select a substring of substrlen bytes beginning at substrstart from a character or hexadecimal variable
For an array of character or hexadecimal strings, these forms can be combined by using symbol(subscript,substring), symbol(subscript,substrstart:substrend), or symbol(subscript,substrstart::substrlen).
–>
,=>
,%>
, or==>
- Indirection operator. You can use an indirection operator as
follows:
operand1<indirection_operator>operand2
- Use the contents of operand1 as the base address of
the DSECT which contains operand2. For example,
R1->DCBDDNAME
instructs z/OS® Debugger to use the contents of register 1 as the base address of the DSECT which containsDCBDDNAME
. operand1<indirection_operator>
oroperand2<indirection_operator>+operand2
- If the
<indirection_operator>
is followed by a plus sign (+), use operand2 as an offset. For example,X->
instructs z/OS Debugger to use the contents ofX
as the address of the storage. For a second example,R3->+X'22'
instructs z/OS Debugger to use the contents of register 3 and add hexadecimal 22 (the offset) to determine the address of storage.If the indirection operator is not followed by a symbol, no length is implied. This form is most commonly used where the length can be determined by another operand. For example, the command
STORAGE(R10->,4)=22
provides the length in the second operand of theSTORAGE
command. If you use this form in a situation where a length is required but not provided by another operand, the length defaults to four.
The following indirection operators indicate which address specification to use:
->
- Use the current Amode specification.
==>
- Use a 64–bit address specification.
=>
- Use a 31–bit address specification.
%>
- Use a 24–bit address specification.
(.)
- Dot operator (period). You can use a dot operator to qualify a name in a DSECT by the name on a labeled USING statement. The dot operator must be immediately preceded by a label from a previous labeled USING statement and must be immediately followed by a name defined in a DSECT.
ADDR'
- Returns the address of a symbol. If the operand of
ADDR'
is a symbol that is known in the current CU but resides in another CSECT, theADDR'
function returns 0. For example,ADDR'ABC
returns the address of symbolABC
.If the address of the symbol is a 64-bit address, then
ADDR'
returns an 8-byte value. Otherwise,ADDR'
returns a 4-byte value. L'
- Returns the length of a symbol. For example,
L'ABC
returns the length of the symbolABC
.