as: s390 Formats

1 
1 9.40.3.4 Instruction Formats
1 ............................
1 
1 The Principles of Operation manuals lists 35 instruction formats where
1 some of the formats have multiple variants.  For the '.insn' pseudo
1 directive the assembler recognizes some of the formats.  Typically, the
1 most general variant of the instruction format is used by the '.insn'
1 directive.
1 
1    The following table lists the abbreviations used in the table of
1 instruction formats:
1 
1      OpCode / OpCd   Part of the op code.
1      Bx              Base register number for operand x.
1      Dx              Displacement for operand x.
1      DLx             Displacement lower 12 bits for operand x.
1      DHx             Displacement higher 8-bits for operand x.
1      Rx              Register number for operand x.
1      Xx              Index register number for operand x.
1      Ix              Signed immediate for operand x.
1      Ux              Unsigned immediate for operand x.
1 
1    An instruction is two, four, or six bytes in length and must be
1 aligned on a 2 byte boundary.  The first two bits of the instruction
1 specify the length of the instruction, 00 indicates a two byte
1 instruction, 01 and 10 indicates a four byte instruction, and 11
1 indicates a six byte instruction.
1 
1    The following table lists the s390 instruction formats that are
1 available with the '.insn' pseudo directive:
1 
1 'E format'
1      +-------------+
1      |    OpCode   |
1      +-------------+
1      0            15
1 
1 'RI format: <insn> R1,I2'
1      +--------+----+----+------------------+
1      | OpCode | R1 |OpCd|        I2        |
1      +--------+----+----+------------------+
1      0        8    12   16                31
1 
1 'RIE format: <insn> R1,R3,I2'
1      +--------+----+----+------------------+--------+--------+
1      | OpCode | R1 | R3 |        I2        |////////| OpCode |
1      +--------+----+----+------------------+--------+--------+
1      0        8    12   16                 32       40      47
1 
1 'RIL format: <insn> R1,I2'
1      +--------+----+----+------------------------------------+
1      | OpCode | R1 |OpCd|                  I2                |
1      +--------+----+----+------------------------------------+
1      0        8    12   16                                  47
1 
1 'RILU format: <insn> R1,U2'
1      +--------+----+----+------------------------------------+
1      | OpCode | R1 |OpCd|                  U2                |
1      +--------+----+----+------------------------------------+
1      0        8    12   16                                  47
1 
1 'RIS format: <insn> R1,I2,M3,D4(B4)'
1      +--------+----+----+----+-------------+--------+--------+
1      | OpCode | R1 | M3 | B4 |     D4      |   I2   | Opcode |
1      +--------+----+----+----+-------------+--------+--------+
1      0        8    12   16   20            32       36      47
1 
1 'RR format: <insn> R1,R2'
1      +--------+----+----+
1      | OpCode | R1 | R2 |
1      +--------+----+----+
1      0        8    12  15
1 
1 'RRE format: <insn> R1,R2'
1      +------------------+--------+----+----+
1      |      OpCode      |////////| R1 | R2 |
1      +------------------+--------+----+----+
1      0                  16       24   28  31
1 
1 'RRF format: <insn> R1,R2,R3,M4'
1      +------------------+----+----+----+----+
1      |      OpCode      | R3 | M4 | R1 | R2 |
1      +------------------+----+----+----+----+
1      0                  16   20   24   28  31
1 
1 'RRS format: <insn> R1,R2,M3,D4(B4)'
1      +--------+----+----+----+-------------+----+----+--------+
1      | OpCode | R1 | R3 | B4 |     D4      | M3 |////| OpCode |
1      +--------+----+----+----+-------------+----+----+--------+
1      0        8    12   16   20            32   36   40      47
1 
1 'RS format: <insn> R1,R3,D2(B2)'
1      +--------+----+----+----+-------------+
1      | OpCode | R1 | R3 | B2 |     D2      |
1      +--------+----+----+----+-------------+
1      0        8    12   16   20           31
1 
1 'RSE format: <insn> R1,R3,D2(B2)'
1      +--------+----+----+----+-------------+--------+--------+
1      | OpCode | R1 | R3 | B2 |     D2      |////////| OpCode |
1      +--------+----+----+----+-------------+--------+--------+
1      0        8    12   16   20            32       40      47
1 
1 'RSI format: <insn> R1,R3,I2'
1      +--------+----+----+------------------------------------+
1      | OpCode | R1 | R3 |                  I2                |
1      +--------+----+----+------------------------------------+
1      0        8    12   16                                  47
1 
1 'RSY format: <insn> R1,R3,D2(B2)'
1      +--------+----+----+----+-------------+--------+--------+
1      | OpCode | R1 | R3 | B2 |    DL2      |  DH2   | OpCode |
1      +--------+----+----+----+-------------+--------+--------+
1      0        8    12   16   20            32       40      47
1 
1 'RX format: <insn> R1,D2(X2,B2)'
1      +--------+----+----+----+-------------+
1      | OpCode | R1 | X2 | B2 |     D2      |
1      +--------+----+----+----+-------------+
1      0        8    12   16   20           31
1 
1 'RXE format: <insn> R1,D2(X2,B2)'
1      +--------+----+----+----+-------------+--------+--------+
1      | OpCode | R1 | X2 | B2 |     D2      |////////| OpCode |
1      +--------+----+----+----+-------------+--------+--------+
1      0        8    12   16   20            32       40      47
1 
1 'RXF format: <insn> R1,R3,D2(X2,B2)'
1      +--------+----+----+----+-------------+----+---+--------+
1      | OpCode | R3 | X2 | B2 |     D2      | R1 |///| OpCode |
1      +--------+----+----+----+-------------+----+---+--------+
1      0        8    12   16   20            32   36  40      47
1 
1 'RXY format: <insn> R1,D2(X2,B2)'
1      +--------+----+----+----+-------------+--------+--------+
1      | OpCode | R1 | X2 | B2 |     DL2     |   DH2  | OpCode |
1      +--------+----+----+----+-------------+--------+--------+
1      0        8    12   16   20            32   36   40      47
1 
1 'S format: <insn> D2(B2)'
1      +------------------+----+-------------+
1      |      OpCode      | B2 |     D2      |
1      +------------------+----+-------------+
1      0                  16   20           31
1 
1 'SI format: <insn> D1(B1),I2'
1      +--------+---------+----+-------------+
1      | OpCode |   I2    | B1 |     D1      |
1      +--------+---------+----+-------------+
1      0        8         16   20           31
1 
1 'SIY format: <insn> D1(B1),U2'
1      +--------+---------+----+-------------+--------+--------+
1      | OpCode |   I2    | B1 |     DL1     |  DH1   | OpCode |
1      +--------+---------+----+-------------+--------+--------+
1      0        8         16   20            32   36   40      47
1 
1 'SIL format: <insn> D1(B1),I2'
1      +------------------+----+-------------+-----------------+
1      |      OpCode      | B1 |      D1     |       I2        |
1      +------------------+----+-------------+-----------------+
1      0                  16   20            32               47
1 
1 'SS format: <insn> D1(R1,B1),D2(B3),R3'
1      +--------+----+----+----+-------------+----+------------+
1      | OpCode | R1 | R3 | B1 |     D1      | B2 |     D2     |
1      +--------+----+----+----+-------------+----+------------+
1      0        8    12   16   20            32   36          47
1 
1 'SSE format: <insn> D1(B1),D2(B2)'
1      +------------------+----+-------------+----+------------+
1      |      OpCode      | B1 |     D1      | B2 |     D2     |
1      +------------------+----+-------------+----+------------+
1      0        8    12   16   20            32   36           47
1 
1 'SSF format: <insn> D1(B1),D2(B2),R3'
1      +--------+----+----+----+-------------+----+------------+
1      | OpCode | R3 |OpCd| B1 |     D1      | B2 |     D2     |
1      +--------+----+----+----+-------------+----+------------+
1      0        8    12   16   20            32   36           47
1 
1 'VRV format: <insn> V1,D2(V2,B2),M3'
1      +--------+----+----+----+-------------+----+------------+
1      | OpCode | V1 | V2 | B2 |     D2      | M3 |   Opcode   |
1      +--------+----+----+----+-------------+----+------------+
1      0        8    12   16   20            32   36           47
1 
1 'VRI format: <insn> V1,V2,I3,M4,M5'
1      +--------+----+----+-------------+----+----+------------+
1      | OpCode | V1 | V2 |     I3      | M5 | M4 |   Opcode   |
1      +--------+----+----+-------------+----+----+------------+
1      0        8    12   16            28   32   36           47
1 
1 'VRX format: <insn> V1,D2(R2,B2),M3'
1      +--------+----+----+----+-------------+----+------------+
1      | OpCode | V1 | R2 | B2 |     D2      | M3 |   Opcode   |
1      +--------+----+----+----+-------------+----+------------+
1      0        8    12   16   20            32   36           47
1 
1 'VRS format: <insn> R1,V3,D2(B2),M4'
1      +--------+----+----+----+-------------+----+------------+
1      | OpCode | R1 | V3 | B2 |     D2      | M4 |   Opcode   |
1      +--------+----+----+----+-------------+----+------------+
1      0        8    12   16   20            32   36           47
1 
1 'VRR format: <insn> V1,V2,V3,M4,M5,M6'
1      +--------+----+----+----+---+----+----+----+------------+
1      | OpCode | V1 | V2 | V3 |///| M6 | M5 | M4 |   Opcode   |
1      +--------+----+----+----+---+----+----+----+------------+
1      0        8    12   16       24   28   32   36           47
1 
1 'VSI format: <insn> V1,D2(B2),I3'
1      +--------+---------+----+-------------+----+------------+
1      | OpCode |   I3    | B2 |     D2      | V1 |   Opcode   |
1      +--------+---------+----+-------------+----+------------+
1      0        8         16   20            32   36           47
1 
1    For the complete list of all instruction format variants see the
1 Principles of Operation manuals.
1