Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Predefined variables

&pagelevel(5)&pagelevel

PRODAMP provides two predefined variables, OPC_TABLE and SVC_TABLE, to control access to internal DAMP tables. On the one hand, these variables can be used as normal numeric variables, i.e. you can assign values to them and use them in arithmetic expressions. However, the length of the variables is less than that of normal numeric variables and thus not every numeric variable can be assigned.
An assigned value is, however, also used as an index for localizing an entry within a DAMP table. This index can then be used to address symbols which describe this entry.

OPC_TABLE

This variable is 2 bytes long and is used as an index for an entry in the DAMP table which describes the instruction code and is used during disassembly. If the contents of OPC_TABLE are less than 256 (i.e. if only one byte is used), they are understood to be the operation code for an instruction. If the contents are greater than 255 (if 2 bytes are used), they are understood to be the first two bytes of an instruction, the second byte being a subcode. An entry in the instruction table is described by the following DSECT:

INST     DSECT  
INSTTYPE DS    X           INSTRUCTION TYPE
INSTNO   EQU   0              NO VALID INSTRUCTION
INSTRR   EQU   4              RR INSTRUCTION
INSTRX   EQU   8              RX INSTRUCTION
INSTRS   EQU   12             RS INSTRUCTION
INSTSI   EQU   16             SI INSTRUCTION
INSTSS   EQU   20             SS INSTRUCTION
INSTUN   EQU   24             UNKNOWN INSTRUCTION TYPE
INSTFLAG DS    X           FLAG
INSTPRIV EQU   X'80'          PRIVILEGED OPERATION
INSTSVAL EQU   X'40'          SUBFUNCTION VALID/AVAILABLE
INSTSVMN EQU   X'20'          SUBFUNCTION MNEMONIC VALID
INSTPSMN EQU   X'10'          PSEUDO MNEMONIC AVAILABLE
INSTFPI  EQU   X'08'          FLOATING POINT INSTRUCTION
INSTSPEC EQU   X'04'          SPECIAL OPERATION
INSTADW  EQU   X'03'          ACCESS DOUBLE WORD
INSTAWD  EQU   X'02'          ACCESS WORD
INSTAHW  EQU   X'01'          ACCESS HALFWORD
INSTXCPT DS    X           EXCEPTIONS
INSTOP1  EQU   X'80'          OPERAND 1 EXCEPTION
INSTOP1M EQU   X'40'          OPERAND 1 = MASK/R0=0 IF RR,RX
INSTOP1E EQU   X'20'          OPERAND 1 = EVEN/EXTENDED
INSTOP2  EQU   X'10'          OPERAND 2 EXCEPTION
INSTOP2M EQU   X'08'          OPERAND 2 = MASK/R0=0 IF RR
INSTOP2E EQU   X'04'          OPERAND 2 = EVEN/EXTENDED
INSTOP3  EQU   X'02'          OPERAND 3 EXCEPTION
INSTOP3M EQU   X'01'          OPERAND 3 = MASK
INSTOPC  DS    X           OPERATION CODE
INSTSVC  EQU   X'0A'          OPERATION CODE = SVC
INSTRS2  EQU   X'20'          RS INSTRUCTION WITH 2 SIZES
INSTOMN  DS    CL5         INSTRUCTION MNEMONIC 

INSTO2M  DS    X           MASK FOR OPERAND 2
INSTFCT  DS    0XL6        SUBFUNCTION
INSTFCD  DS    X           FUNCTION DISPLACEMENT
INSTMSK  DS    X           FUNCTION MASK
INSTFCU  EQU   X'F0'          FUNCTION CODE IN UPPER HALFBYTE
INSTFCL  EQU   X'0F'          FUNCTION CODE IN LOWER HALFBYTE
INSTFCF  EQU   X'FF'          FUNCTION CODE IN FULL BYTE
INSTPTR  DS    A           FUNCTION POINTER
         ORG   INSTFCT
INSTFPT  DS    X           FUNCTION PSEUDO TYPE (RR ONLY)
INSTFTM  EQU   X'FC'          FUNCTION MASK FOR PSEUDO TYPE
INSTFTD  EQU   X'03'          FUNCTION MASK FOR DISPLACEMENT
INSTFMN  DS    CL4         FUNCTION MNEMONIC
INSTILEN EQU   *-INST      ITEM LENGTH

The following example is intended to illustrate how to address entries in the relevant DAMP table using the variable OPC_TABLE. As a prerequisite, a disassembly table must have been assigned, as is done when a diagnosis object is opened. If no such table has been assigned, you will need to declare one with the MODIFY-OBJECT-ASSUMPTIONS statement. 

Example for OPC_TABLE

OPC_TABLE := X'B223';
MNEMO     :=  ' '*7;
PSEUDO    :=  'none';
INSTSVAL  := P'40';
INSTSVMN  := P'20';
INSTTYPE  := OPC_TABLE.INSTTYPE;
IF CURRENT.ERROR <> 0 THEN
   MESSAGE ( 'No instruction table available.' );
   RETURN;
END IF;
IF INSTTYPE = 0 THEN
   MNEMO := 'invalid';
ELSIF INSTTYPE = 24 THEN
   MNEMO := 'unknown';
ELSE
   MNEMO := OPC_TABLE.INSTOMN;
END IF;
IF INSTSVAL + INSTSVMN IN OPC_TABLE.INSTFLAG THEN
   IF OPC_TABLE > 255 THEN
      PSEUDO := OPC_TABLE.INSTFMN;
   ELSE
      PSEUDO := '    ';
   END IF;
END IF;
MESSAGE ( 'Mnemonic: '+MNEMO+' Pseudo: '+Pseudo );

SVC_TABLE

This single-byte variable is used as an index for an entry in the internal DAMP SVC table, which contains an 8-byte mnemonic for each SVC. The symbol file does not include a DSECT for these entries. The entries must be described using an ARRANGE statement as illustrated by the example below. 

Example for SVC_TABLE

SVC_TABLE := X'5C';
ARRANGE .MNEMO : TYPE = STRING, LENGTH = 8, OFFSET = 0;
END ARRANGE;
MNEMO := ' '*8;
MNEMO := SVC_TABLE.MNEMO;
IF CURRENT.ERROR <> 0 THEN
   MESSAGE ( 'No SVC table available.' );
ELSE
   MESSAGE ( 'SVC ' + HEX_STRING(SVC_TABLE,2)+' = '+MNEMO );
END IF;