%DISASSEMBLE enables memory contents to be "retranslated" into symbolic Assembler notation and displayed accordingly.
The output-quantity operand defines the amount of memory contents that are to be disassembled and output.
The start operand enables you to determine the address where AID is to begin disassembling.
Command | Operand |
|
|
Disassembly of the memory contents starts with the first byte. For memory contents which cannot be interpreted as an instruction, an output line is generated which contains the hexadecimal representation of the memory contents and the message INVALID OPCODE. The search for a valid operation code then proceeds in steps of 2 bytes each.
%DISASSEMBLE without a start operand permits the user to continue a previously issued %DISASSEMBLE command until the test object is switched or a new operand value is defined by means of a BS2000 or AID command (START-EXECUTABLE-PROGRAM, LOAD-EXECUTABLE-PROGRAM, %BASE). AID continues disassembly at the memory address following the address last processed by the previous %DISASSEMBLE command. If output-quantity is not specified either, AID generates the same amount of output lines as declared before.
If the user has not entered a %DISASSEMBLE command during a test session or has changed the test object and does not specify current values for one or both operands in the %DISASSEMBLE command, AID works with default values (10 for output-quantity and V’0’ for start). If the program was not loaded from V’0’, start must be specified.
The %OUT command can be used to control how processed memory information is to be represented and whether it is to be output to SYSOUT, SYSLST or to a cataloged file. The format of the output lines is explained after the description of the start operand.
The %DISASSEMBLE command does not alter the program state.
output-quantity |
Specifies the amount of the memory contents that are to be disassembled and output. If you don‘t specify output-quantity, AID inserts the default value 10 in the first %DISASSEMBLE after loading the program.
For each further %DISASSEMBLE command the last specified output-quantity is used.
output-quantity-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{ number |
length | ALL }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
number
Specifies, how many Assembler instructions are to be disassembled and output.
is an integer with the value:
1 ≤ number ≤ 231-1
length
Specifies the size of the memory content that is to be interpreted and output within a single, prompted %DISASSEMBLE command.
is a hexadecimal number #’f..f’ with the value:
1 ≤ length ≤ 231-1
ALL
Specifies that the Assembler instructions are to be disassembled and output until the end of the CSECT, in which the start value is located. If start is not specified, the current %DA position determines the CSECT.
If the start value is not located within a CSECT, the command is rejected with an error message.
start |
Defines the address at which disassembly of memory contents into Assembler commands is to begin. If the start value is not specified, AID assumes the default value V’0’ for the first %DISASSEMBLE after a program is loaded. If a program has not been loaded from V’0’, AID issues an error message. On every further %DISASSEMBLE, AID continues after the Assembler command last disassembled.
start-OPERAND - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FROM [•][qua•][...] { C=segmentname
| C=sharename
| program-id
| statement-name
| source-reference
| compl-memref
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
•
If the period is in the leading position it denotes a prequalification, which must have been defined by a previous %QUALIFY command. Consecutive qualifications must be delimited by a period. In addition, there must be a period between the final qualification and the following operand part.
qua
Qualifications must be specified if an address operand does not apply to the current AID work area, the current compilation unit or the program, or if it is not unique in some other way.
E={VM | Dn}
Only required if the current base qualification is not to apply for start (see %BASE command).
S=srcname
This is only specified if start is not to be contained in the current compilation unit.
PROC=program-id
This is only specified if start is not to be contained in the current program (see chapter “COBOL-specific addressing”), or if it is to be defined with statementname and this is not unique in the compilation unit.
If the srcname in the S qualification is the same as the program-id, instead of both of these only the PROG qualification should be written.
Only the base qualification or the CTX qualification can be placed before the C qualifications listed below. The C qualification takes the user away from the symbolic level. No symbolic operands can be written directly afterwards (see section “Symbolic memory references” (Symbolic memory references)), only a compl-memref.
C=segmentname
The effect of this entry is to set start to the start address of the designated segment.
C=sharename
The effect of this entry is to set start to the start address of the designated object module.
program-id
This specification is possible following an explicit PROC/PROG qualification with the same program-id, or if the current interrupt point is in the program identified by program-id. The consequence is to set start at the first executable statement in the designated program.
statement-name
designates the address of the first instruction in a section or paragraph in the PROCEDURE DIVISION.
{ L'section' | L'paragraph' [IN L'section'] }
An alphanumeric section or paragraph name can be specified without L’...’ since this name cannot be confused with a data name in this command.
If a paragraph name is not unambiguous within a program, it must be identified by the section name of the section in which it was defined: L'paragraph' IN
L'section'
. If the user intends to follow this with a byte offset, a pointer operator ( -> ) must be entered first.
source-reference
designates the address of the first instruction generated for a statement in the PROCEDURE DIVISION and must be specified in one of the following formats:
S’n’
for lines with paragraph or section names in which no COBOL verb occurs.
This specification is not possible for programs which have been compiled with STMT-REFERENCE=COLUMN1-TO-6
.
S’nverb[m]’ | xverb[m]’
for lines containing a COBOL verb.
If the user intends to follow this with a byte offset, a pointer operator ( -> ) must be entered first.
compl-memref
This should produce the start address of a machine instruction, otherwise the disassembly obtained will be meaningless. compl-memref may contain the following operations (see AID Core Manual (Related publications) [1]):
- byte offset (•)
- indirect addressing (->)
- type modification (%A, %S, %SX)
- length modification (%Ln, %L=(expression), %Ln)
- address selection (%@(...))
If a statement name or a source reference is to be used as a memory reference, it must be followed by a pointer operator ( -> ). In this case statementname must be specified with L’...’. Without the pointer operator the statement name and source reference can be used anywhere where hexadecimal numbers can be written.
Example: %DISASSEMBLE L'PUTOUT'->.4
A position 4 bytes on from the first instruction in the PUTOUT section is moved to and disassembly takes place from there.
A type modification makes sense only if the contents of a data element can be used as an address or if the address is taken from a register.
Example: %1G.2%AL2->
The last two bytes from AID register %1G are used as the address.
Output of the %DISASSEMBLE log
By default, the %DISASSEMBLE log is output with additional information to SYSOUT (T=MAX). With %OUT the user can select the output media and specify whether or not additional information is to be output by AID.
AID does not take into account XMAX and XFLAT modes for outputting the
%DISASSEMBLE log. Instead, it generates the default value (T=MAX).
The following is contained in a %DA output line if the default value T=MAX is set:
CSECT-relative memory address
memory contents retranslated into symbolic Assembler notation, displacements being represented as hexadecimal numbers (as opposed to Assembler format)
for memory contents which do not begin with a valid operation code: Assembler statement DC in hexadecimal format and with a length of 2 bytes, followed by the note INVALID OPCODE
hexadecimal representation of the memory contents (machine code).
Example of line format with T=MAX
The statement number in the %DISASSEMBLE command refers to the sample application in section “Source listing”.
|
The %OUT operand value T=MIN causes AID to create shortened output lines in which the CSECT-relative address is replaced by the virtual address and the hexadecimal representation of the memory contents is omitted.
Example of line format with T=MIN
|
Examples
%DISASSEMBLE FROM PROG=EXAMPLE.OUT2 IN PUTOUT
This command initiates disassembly of 10 instructions (default), starting with the address of the first executable instruction of paragraph OUT2 in section PUTOUT.%DA 2 FROM E=D1.PROG=EXAMPLE.EXAMPLE
Starting with the start address of the EXAMPLE program in the dump file with link name D1, two instructions are to be disassembled.%DA FROM S'45INIT'
Since no value is specified for output-quantity, AID either inserts the default value (in the case of the first %DISASSEMBLE for this program) or takes the value from the previous %DISASSEMBLE. Disassembly starts with the first instruction generated for the statement S’45INIT’.