Function codes

This is a 4 byte field that has the following structure:

Table 1. Function code field structure
Origin Length Contents
0 1 Function Code (see below)
1 2 Operation Code Table Code (see below)
2 1 Version (4)

The function code indicates 1 or more results and the format of the offsets to be returned. It is specified as an 8-bit string:

Code Function Performed Output Example
b'1.…...' Return op-code mnemonic left-justified with blank fill, in caller-provided area 🅱2 MVCbbbbb
b'.1...... ' Return fully-disassembled instruction in caller-provided area Y(19),C'MVC 3(1,R2),0(R5)'Y(17),C'DD FR3,7(1,R4)'
b'..1.....' Return instruction disassembled into component fields in caller-provided area See Operand-Field Table Structure for format
b'...1....' Return instruction characteristics in caller provided area See Instruction Characteristics for format
b'.......1' Return machine instruction displacements as hexadecimal values MVC X'3'(1,R2),X'0'(R5)
Note:
  1. An invalid function code will cause a return code 16, and no output.
  2. An unidentified op-code returns xx--bbbb in the caller-provided 8-byte mnemonic field 🅱, where xx is the first byte of the op-code converted from hexadecimal to EBCDIC (for example, X'03' become X'F0F3'), and sets the return code to 4.
  3. By default machine instruction displacements will be returned as a decimal value.

The Operation Code Table Code indicates which opcode table is to be used in the disassembly. It is specified as a 16-bit string:

Code Operation Code table
b'1....... ........' UNI
b'.1...... ........' DOS
b'..1..... ........' 370
b'...1.... ........' XA
b'....1... ........' ESA
b'.....1.. ........' ZS1 or ZOP
b'......1. ........' ZS2 or YOP
b'.......1 ........' ZS3 or Z9
b'........ 1.......' ZS4 or Z10
b'........ .1......' ZS5 or Z11
b'........ ..1.....' ZS6 or Z12
b'........ ...1....' ZS7 or Z13
b'........ ....1...' ZS8 or Z14
b'........ .....1..' ZS9 or Z15
b'........ ......1.' ZSA or Z16
Note: If no Operation Code Table bit is set the default opcode table, UNI will be used by the disassembler.

Return codes

A code will be returned to indicate the success or failure of the call. This will be in R15. The codes are:

  • 0 - Operation completed with no errors.
  • 4 - Operation completed - but unable to determine machine instruction (only mnemonic field 🅱 valid).
  • 16 - Invalid function code specified - no output produced.