Support This Project Get i5/OS Programmer's Toolkit at SourceForge.net. Fast, secure and Free Open Source software downloads

General Description of an OPM MI Program Template

An OPM program template consists of the following components:

The above-mentioned components are the following

Let's cite a very very simplge OPM MI program, spr91.emi, for example.

dcl dd buf char(32) auto          ;
dcl dd p pkd(7,0) def(buf) pos(1) init(p'5')  ;
dcl dd q pkd(7,0) auto init(p'5')  ;

        subn(s) q, 5            ;
brk 'B'                         ;
        div(s) p, q             ;
brk 'A'                         ;
        rtx *                   ;
pend                            ;

The components in SPR91's program template are the following.

OPM Creation Template

The OPM creation template contains all program attributes of an OPM MI program. These program attributers can be materialized via MI instruction MATPG. The following is the OPM creation template of SPR91. For example, you can find out that there're 4 instructions in SPR91's instruction stream component; program SPR91 uses 48 bytes of automatic storage; etc.
 OPM CREATION TEMPLATE                                                                                    ADDRESS: 1F9391706B 000020
     TEMPLATE SIZE    2622           MATERIAL SIZE    2642           OBJECT TYPE      02             OBJECT SUBTYPE   01
     OBJECT NAME      SPR91                                          CREATE OPTS      C0000000       RECOVERY OPTS    0000
     ASP              0              SPACE SIZE       480            SPACE INIT VAL                  PERFORM CLASS    01
     STORAGE UNIT     00             RESERVED         00             TR SIZE 4K UNIT  00             RESERVED         00
     PUBLIC AUTH      0000           EXT OFFSET       0              CONTEXT PTR      00000000000000001EF9F51B7A000400
     ACCESS GRP PTR   00000000000000000000000000000000               PGM ATTRS        10A0           OPT OPTIONS      80
     OBSERV ATTR      FC             STATIC STORE SZ  00000000       AUTO STORE SIZE  00000030       NUM INSTR V0     0004
     NUM ODV ENT V0   0003           MI INSTR OFFSET  00000100       ODV OFFSET       00000118       OES OFFSET       0000012C
     HLL BOM DTA LEN  00000001       HLL BOM LENGTH   00000006       HLL BOM OFFSET   00000A38       HLL SYM DTA LEN  00000000
     HLL SYM LENGTH   000008ED       HLL SYM OFFSET   00000148       OMT OFFSET       00000A40       NUM INSTR V1     00000004
     NUM ODV ENT V1   00000000
 1F9391706B 000020 +0000   00000A3E00000A52  0201E2D7D9F9F140   4040404040404040  4040404040404040 *..........SPR91                 *
 1F9391706B 000040 +0020   4040404040404040  C000000000000000   000001E000010000  0000000000000000 *        ........................*
 1F9391706B 000060 +0040   0000000000000000  1EF9F51B7A000400   0000000000000000  0000000000000000 *.........95.:...................*
 1F9391706B 000080 +0060   10A080FC00000000  0000003000040003   0000010000000118  0000012C00000001 *................................*
 1F9391706B 0000A0 +0080   0000000600000A38  00000000000008ED   0000014800000A40  0000000400000000 *....................... ........*
 1F9391706B 0000C0 +00A0   0000000000000000  0000000000000000   0000000000000000  0000000000000000 *................................*
 1F9391706B 0000E0 +00C0   0000000000000000  0000000000000000   0000000000000000  0000000000000000 *................................*

OPM Instruction Stream Component

The instruction stream component consists of a 4-byte binary value that defines the total length of the instruction stream component and a variable-length array of 2-byte entries that defines the instruction stream. The 2-byte entries define instruction operation codes, and optionally instruction operation code extenders, instruction operands, and branch targets.

The following is the instruction stream component in SPR91's program template. The beginning 4-byte binary value hex 16 indicates that the total size of the instruction stream component is 22 bytes. Following the techniqued discussed in "Analyzing the MI Instruction Stream Component", you can find out that SPR91 contains 4 instruction: SUBN (Subtract Numeric), DIV (Divide), RTX (Return External), and directive instruction PEND (which indicates the end of the input instruction stream).

 OPM INSTRUCTION STREAM COMPONENT                                                                         ADDRESS: 1F9391706B 000120
 1F9391706B 000120 +0000   0000001611470003  2005114F00020003   02A100000260                       *.....................-          *

OPM ODT Directory Vector (ODV)

The ODT (object definition table) of an OPM MI program consists of the ODT directory vector (ODV) component and the ODV entry string (OES) component. The detailed formats of ODV and OES are specified in Program Object Specification. Techniques to parse the ODV and OES are discussed in Analyzing the ODV (ODT Directory Vector) Component and the OES (ODT Entry String) Component.
Todo:
link to Program Object Specification.
The ODT directory vector (ODV) component consists of a 4-byte binary value that defines the total length of the ODV and a variable-length vector of 4-byte entries. Each entry describes a program object either by a complete description or through an offset into the OES (object entry string) to a location that contains a description. If no program objects are defined, the ODV can be omitted, and its absence is noted with a value of 0 in the offset to ODV component entry. The ODV is required if the OES is present.

Here's the ODV component of SPR91, the length of which is 16 bytes.

 OPM ODT DIRECTORY VECTOR                                                                                 ADDRESS: 1F9391706B 000138
 1F9391706B 000120 +0000                                                          0000001001040020 *                        ........*
 1F9391706B 000140 +0020   0B03000409030011                                                        *........                        *

OPM ODT Entry String

The ODV entry string (OES) consists of a 4-byte binary value that defines the total length of the OES and a series of variable-length entries that are used to complete an object description. Entries in the ODV contain offsets into the OES. The OES is optional, and its absence is indicated with a value of 0 in the offset to OES component entry.

Here's the OES component of SPR91.

 OPM ODT ENTRY STRING                                                                                     ADDRESS: 1F9391706B 00014C
 1F9391706B 000140 +0000                             00000018   5C00070001000000  010000005F440007 *            ....*...............*
 1F9391706B 000160 +0020   0000005F                                                                *....                            *

OPM High Level Language BOM Table

The HLL breakpoint offset mapping (BOM) table component in an OPM MI component stores the mappings from breakpoints in an OPM MI program to corresponding MI instruction numbers. A breakpoint in an MI program is produced by a break directive statement (BRK) in the MI source of the program. The BOM table component can be used by compilers to relate high-level language statement numbers to instruction numbers. See Analyzing the BOM Table Component for techniques to parse the BOM component.

Here's the BOM component of SPR91. n

 OPM HIGH LEVEL LANGUAGE BOM TABLE                                                                        ADDRESS: 1F9391706B 000A58
 1F9391706B 000A40 +0000                                                          0002C20003C1     *                        ..B..A  *

OPM High Level Language Symbol Table

The HLL symbol table component can be used by compilers to relate high-level language names to ODT numbers. See Analyzing the Symbol Table Component for techniques to parse the symbol table component.

Here's the symbol table component of SPR91.

 OPM HIGH LEVEL LANGUAGE SYMBOL TABLE                                                                     ADDRESS: 1F9391706B 000168
 1F9391706B 000160 +0000                     00000233FFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF *        ........................*
 1F9391706B 000180 +0020   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF *................................*
                        20 LINES 1F9391706B 0001A0 +0040 TO 1F9391706B 000400 +02A0 SAME AS ABOVE
 1F9391706B 000420 +02C0   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF   000008DBFFFFFFFF  FFFFFFFFFFFFFFFF *................................*
 1F9391706B 000440 +02E0   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF *................................*
                        13 LINES 1F9391706B 000460 +0300 TO 1F9391706B 0005E0 +0480 SAME AS ABOVE
 1F9391706B 000600 +04A0   FFFFFFFFFFFFFFFF  000008D0FFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF *................................*
 1F9391706B 000620 +04C0   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF *................................*
                        30 LINES 1F9391706B 000640 +04E0 TO 1F9391706B 0009E0 +0880 SAME AS ABOVE
 1F9391706B 000A00 +08A0   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFF000008E4 *...............................U*
 1F9391706B 000A20 +08C0   FFFFFFFFFFFFFFFF  FFFFFFFFFFFFFFFF   FFFFFFFFFFFFFFFF  FFFFFFFF0001C003 *................................*
 1F9391706B 000A40 +08E0   C2E4C6FFFFFFFF00  02C001D7FFFFFFFF   0003C001D8                         *BUF........P........Q           *

OPM Object Mapping Table

The object mapping table (OMT) component consists of a variable-length vector of 6-byte entries. The number of entries is identical to the number of ODV entries because there is one OMT entry for each ODV entry. The OMT entries correspond one for one with the ODV entries; each OMT entry gives a location mapping for the object defined by its associated ODV entry. See Analyzing the OMT Component for techniques to parse the OMT component.

Here's the OMT component of SPR91.

 OPM OBJECT MAPPING TABLE                                                                                 ADDRESS: 1F9391706B 000A60
 1F9391706B 000A60 +0000   0100000000000100  0000000001000020   0000                               *..................              *

Support This Project
Generated on Mon Aug 22 08:26:47 2011 for i5/OS Programmer's Toolkit: OPM MI Disassembler by  doxygen 1.5.9