Syntax for assembler and disassembly expressions
Use the syntax defined in this section to write expressions for Debug Tool commands
while you debug an assembler or disassembly program.
Assembler expressions can be written in the following forms:
- A standard assembler expression
with an implied length. The following are three examples:
- A standard assembler expression
without an implied length. Expressions can be written in this form
only if the length can be specified or derived from an operand. For
example: R3->+X'2C'
- A conditional assembler expression which is written with conditional
operators and can be used only as the operand of an IF command.
For example: X+1=Y & Z=4
Common syntax elements
You can use the following syntax elements to write an assembler
expression:
- ddd
- A decimal constant, where ddd are valid decimal digits.
For example: 145
- ddd.ddd, dd.dEdd, ddEdd, dd.dE+dd, ddE+dd, dd.dE-dd, ddE-dd
- A floating-point constant, where d is one or more decimal
digits and E is the letter "E". Examples: 1.23,
0.22, 12E+10, or 2.456E-5.
- X'xxxx' or X"xxxx"
- A hexadecimal constant, where xxxx are valid hexadecimal
digits. Examples: X'1F4C' or X"1F4C"
If this constant is from
1 to 4 bytes in length, it can be used in arithmetic or string contexts.
Otherwise, it can only be used in string contexts.
- C'cccc', 'cccc',
or "cccc"
- A character constant. For example: C'F$3' or "F$3"
If this
constant is from 1 to 4 bytes in length, it can be used in arithmetic
or string contexts. Otherwise, it can only be used in string contexts.
- symbol
- A valid symbol used in the assembler source program. Examples:
lastName, UserVar8
If a symbol is defined by using the EQU instruction
and the first usage of the symbol is as a register, the symbol is
associated with that register. If you define a symbol with the intent
to use the symbol as a register but you never reference the symbol
or the first reference to the symbol is not as a register, Debug Tool defines
the symbol as a constant, not as a register. For example, if you define
the symbol R7 by using the instruction R7 EQU 7 and you
never reference R7 or the first reference is not as a register, Debug Tool defines
the symbol R7 as the constant 7, not as register R7.
Debug Tool implicitly
defines the following symbols in all disassembly compilation units
and in any assembler compilation units where the symbol is not already
defined:
- %symbol
- A valid Debug Tool variable. For example: %ADDRESS
Operators
You can use the operators defined in this section to write assembler
expression and conditional assembler expressions.
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 as X(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 Debug Tool to
use the contents of register 1 as the base address of the DSECT which
contains DCBDDNAME.
- operand1<indirection_operator> or operand2<indirection_operator>+operand2
- If the <indirection_operator> is followed by a
plus sign (+), use operand2 as an offset. For example, X-> instructs Debug Tool to
use the contents of X as the address of the storage. For
a second example, R3->+X'22' instructs Debug Tool 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 the STORAGE 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,
the ADDR' function returns 0. For example, ADDR'ABC returns
the address of symbol ABC.
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 symbol ABC.
Operators that can be used only in conditional expressions
The following operators can be used only in conditional expressions
(for example, the IF command):
- =
- Compare the two operands for equality.
- ¬=
- Compare the two operands for inequality.
- <
- Determines whether the left operand is less than the right operand.
- >
- Determines whether the left operand is greater than the right
operand.
- <=
- Determines whether the left operand is less than or equal to
the right operand.
- >=
- Determines whether the left operand is greater than or equal
to the right operand.
- &
- Logical "and" operation.
- |
- Logical "or" operation.
Arithmetic expression evaluation
Assembler and disassembly expressions are evaluated in 32-bit precision
until a 64-bit operand is encountered. At that point, the precision
of both operands is converted
to 64-bit and all subsequent operators in the expression are evaluated
in 64-bit precision. If you want the entire expression evaluated in
64-bit precision, you can use parentheses to alter the order of operations
so that the first operand evaluated has at least one 64-bit operand.
If you are running your program on hardware that does not support
64-bit instructions, Debug Tool evaluates the 64-bit arithmetic expressions
but you can not access the 64-bit General Purpose Registers.
|
This information center is powered by Eclipse technology. (http://www.eclipse.org)