Z/Architecture Explained

z/Architecture
Designer:IBM
Bits:64-bit
Version:ARCHLVL 2 and ARCHLVL 3 (2008)
Design:CISC
Type:Register–Register
Register–Memory
Memory–Memory
Encoding:Variable (2, 4 or 6 bytes long)
Branching:Condition code, indexing, counting
Endianness:Big
Predecessor:ESA/390
Gpr:16× 64-bit
Fpr:16× 64-bit
Vpr:32× 128-bit, VR0-VR15 contain FPR0-FPR15
Registers:Access 16× 32, breaking-event-address register (BEAR) 64-bit, Control 16×64, Floating Point Control 32-bit, Prefix 64 bit, PSW 128-bit

z/Architecture, initially and briefly called ESA Modal Extensions (ESAME), is IBM's 64-bit complex instruction set computer (CISC) instruction set architecture, implemented by its mainframe computers. IBM introduced its first z/Architecture-based system, the z900, in late 2000.[1] Later z/Architecture systems include the IBM z800, z990, z890, System z9, System z10, zEnterprise 196, zEnterprise 114, zEC12, zBC12, z13, z14, z15 and z16.

z/Architecture retains backward compatibility with previous 32-bit-data/31-bit-addressing architecture ESA/390 and its predecessors back to the 32-bit-data/24-bit-addressing System/360. The IBM z13 is the last z Systems server to support running an operating system in ESA/390 architecture mode.[2] However, all 24-bit and 31-bit problem-state application programs originally written to run on the ESA/390 architecture will be unaffected by this change.

Features

z/Architecture includes almost all of the features of ESA/390, and adds some new features. Among the features of z/Architecture are

A channel subsystem with the architecture introduced by S/370-XA

Branch relative instructions introduced by ESA/390

Trimodal (24/31/64-bit) addresses

16 32-bit access registers (ARs) introduced by ESA/370

16 64-bit general registers (GRs)

16 64-bit control registers (CRs) introduced by System/370

16 64-bit floating-point registers (FPRs)

32 128-bit vector registers (VRs); bits 0-63 of VR0-VR15 contain FPR0-FPR15

1 32-bit floating point control (FPC) register

1 128-bit processor status register (PSW), which includes a 64-bit instruction address

An 8-KiB prefix storage area (PSA)

Cryptographic Facility

IEEE Binary-floating-point instructions added by ESA/390

IEEE Decimal-floating point instructionsFor information on when each feature was introduced, consult Principles of operation.

Registers

IBM z/Architecture registers
General Registers 0-15

Two's complement value
0<-- 1 --><-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 --><-- 7 --><-- 8 --><-- 9 --><-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31

Two's complement value (continued)
32<-- 33 --><-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38--><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53--><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
Access Registers 0-15

0000000PALESNALEN
0<-- 1 --><-- 2 --><-- 3 --><-- 4 --><-- 5 -->678<-- 9 --><-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 -->15<-- 16 -->16<-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31
BitsFieldMeaning
0-60000000
7PPrimary
0=use dispatchable-unit access list
1=use primary-space access list
8-15ALESNaccess-list-entry sequence number
16-31ALENaccess-list-entry number
Breaking-event-address register (BEAR)

See Principles of Operation
0<-- 1 --><-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 --><-- 7 --><-- 8 --><-- 9 --><-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31
(continued)
32<-- 33 --><-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
Control Registers 0-15

See Principles of Operation or Control Registers
0<-- 1 --><-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 --><-- 7 --><-- 8 --><-- 9 --><-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31
(continued)
32<-- 33 --><-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
Floating Point Registers (hexadecimal) 0-15

SBiased exponentMantissa
01<-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 -->78<-- 9 --><-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31

Mantissa (continued)
32<-- 33 --><-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
Floating Point Registers (binary, single precision) 0-15

SBiased exponentMantissa
01<-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 --><-- 7 -->89<-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31
Floating Point Registers (binary, double precision) 0-15

SBiased exponentMantissa
01<-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 --><-- 7 --><-- 8 --><-- 9 --><-- 10 -->1112<-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31

Mantissa (continued)
32<-- 33 --><-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
Prefix register

00000000000000000000000000000000
0<-- 1 --><-- 2 --><-- 3 --><-- 4 --><-- 5 --><-- 6 --><-- 7 --><-- 8 --><-- 9 --><-- 10 --><-- 11 --><-- 12 --><-- 13 --><-- 14 --><-- 15 --><-- 16 --><-- 17 --><-- 18 --><-- 19 --><-- 20 --><-- 21 --><-- 22 --><-- 23 --><-- 24 --><-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 --><-- 30 -->31
0Prefix Bits 33-500n/a
3233<-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 -->505152<-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
z/Architecture long PSW

0R000TI
O
E
X
Key0MWPASCCProgram
Mask
R
I
000000E
A
012<-- 3 -->45678<-- 9 --><-- 10 -->11121314151617181920<-- 21 --><-- 22 -->2324<-- 25 --><-- 26 --><-- 27 --><-- 28 --><-- 29 -->3031

B
A
0
3233<-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63

Instruction Address
64<-- 65 --><-- 66 --><-- 67 --><-- 68 --><-- 69 --><-- 70 --><-- 71 --><-- 72 --><-- 73 --><-- 74 --><-- 75 --><-- 76 --><-- 77 --><-- 78 --><-- 79 --><-- 80 --><-- 81 --><-- 82 --><-- 83 --><-- 84 --><-- 85 --><-- 86 --><-- 87 --><-- 88 --><-- 89 --><-- 90 --><-- 91 --><-- 92 --><-- 93 --><-- 94 -->95

Instruction Address (Continued)
96<-- 97 --><-- 98 --><-- 99 --><-- 100 --><-- 101 --><-- 102 --><-- 103 --><-- 104 --><-- 105 --><-- 106 --><-- 107 --><-- 108 --><-- 109 --><-- 110 --><-- 111 --><-- 112 --><-- 113 --><-- 114 --><-- 115 --><-- 116 --><-- 117 --><-- 118 --><-- 119 --><-- 120 --><-- 121 --><-- 122 --><-- 123 --><-- 124 --><-- 125 --><-- 126 -->127
BitsFieldMeaning
1RPER Mask
5TDAT mode
6IOI/O mask
7EXExternal Mask
8-11KeyPSW key
12E=0Must be zero for LPSWE
13MMachine-check mask
14WWait state
15PProblem state
16-17ASAddress-Space Control
00=primary-space mode
01=Access-register mode
10=Secondary-space mode
11=Home-space mode
18-19CCCondition Code
20-23PM
! Bit! Meaning
20Fixed-point overflow
21Decimal overflow
22HFP Exponent underflow
23HFP Significance
24RIReserved for IBM
31EAExtended Addressing mode
0=defined by BA below; 1=64-bit, BA must be zero
32BABasic Addressing mode
0=24 or 64; 1=31
64-127IAInstruction Address
z/Architecture short PSW

0R000TI
O
E
X
Key1MWPASCCProgram
Mask
R
I
000000E
A
012<-- 3 -->45678<-- 9 --><-- 10 -->11121314151617181920<-- 21 --><-- 22 -->232425<-- 26 --><-- 27 --><-- 28 --><-- 29 -->3031

B
A
Instruction Address
3233<-- 34 --><-- 35 --><-- 36 --><-- 37 --><-- 38 --><-- 39 --><-- 40 --><-- 41 --><-- 42 --><-- 43 --><-- 44 --><-- 45 --><-- 46 --><-- 47 --><-- 48 --><-- 49 --><-- 50 --><-- 51 --><-- 52 --><-- 53 --><-- 54 --><-- 55 --><-- 56 --><-- 57 --><-- 58 --><-- 59 --><-- 60 --><-- 61 --><-- 62 -->63
BitsFieldMeaning
1RPER Mask
5TDAT mode
6IOI/O mask
7EXExternal Mask
8-11KeyPSW key
12E=1Must be one for LPSW
13MMachine-check mask
14WWait state
15PProblem state
16-17ASAddress-Space Control
00=primary-space mode
01=Access-register mode
10=Secondary-space mode
11=Home-space mode
18-19CCCondition Code
20-23PM
! Bit! Meaning
20Fixed-point overflow
21Decimal overflow
22HFP Exponent underflow
23HFP Significance
24RIReserved for IBM
31EAExtended Addressing mode
0=defined by BA below; 1=64-bit, BA must be zero
32BABasic Addressing mode
0=24 or 64; 1=31
33-63IAInstruction Address

Each processor has these registers

Access registers

Each CPU has 16 32-bit access registers. When a program running in AR mode specifies register 1-15 as a base register or as a register operand containing an address, the CPU uses the associated access register during address translation.

Breaking-event-address register (BEAR)

The 64-bit BEAR} contains the address of the last instruction the broke the sequential execution of instructions; an interrupt stores the BEAR in the doubleword at real address 272 . After an Execute of a branch, the BEAR contains the address of the execute, not that of the branch.

Control registers

The 16 64-bit control registers provide controls over and the status of a CPU, except for information included in the PSW. They are an evolutionary enhancement to the control registers on the earlier ESA/390 on the IBM S/390 processors. For details on which fields are dependent on specific features, consult the Principles of Operation.Because z/Architecture expands the control registers from 32 bits to 64, the bit numbering differs from that in ESA/390.

z/Architecture mode control registers! CR !! bits !! Field
08Transactional-execution control
09Transactional-execution program-interruption filtering override
010Clock-comparator sign control
013Cryptography counter controll
014Processor-activity-instrumentation-extension control
015Measurement-counter-extraction-authorization control
030Warning-track subclass mask
032TRACE TOD-clock control
033SSM-suppression
034TOD-clock-sync control
035Low-address-protection control
036 Extraction-authority control
037Secondary-space control
038Fetch-protection-override control
039Storage-protection-override control
040Enhanced-DAT-enablement control
043Instruction-execution-protection-enablement control
044ASN-and-LX-reuse control
045AFP-register control
046Vector enablement control
048Malfunction-alert subclass mask
048Malfunction-alert subclass mask
049Emergency-signal subclass mask
050External-call subclass mask
052Clock-comparator subclass mask
053CPU-timer subclass mask
054Service-signal subclass mask
056Initialized to 1
057Interrupt-key subclass mask
058Measurement-alert subclass mask
059 Timing-alert subclass mask
061Crypto control
10-51Primary Address-Space Control Element (ASCE)
Primary region-table origin
Primary segment-table origin
Primary real-space token origin
154Primary subspace-group control
155Primary private-space control
156Primary storage-alteration-event
157Primary space-switch-event control
158Primary real-space control
160-61Primary designation-type control
162-63Primary table length
233-57Dispatchable-unit-control-table origin
259Guarded-storage-facility enablement control
261Transaction diagnostic scope
262-63Transaction diagnostic control
30-31Secondary ASN-second-table-entry instance number
332-47PSW-key mask
348-63Secondary ASN
40-31Primary ASN-second-table-entry instance number
4 32-47Authorization index
448-63Primary ASN
533-57Primary-ASN-second-table-entry origin
6 32-39I/O-interruption subclass mask
70-51Secondary Address-Space Control Element (ASCE)
Secondary region-table origin
Secondary segment-table origin
Secondary real-space token origin
754Secondary subspace-group control
755Secondary private-space control
756Secondary storage-alteration-event control
758Secondary real-space control
760-61Secondary designation-type control
762-63Secondary table length
816-31Enhanced-monitor masks
832-47Extended authorization index
848-63Monitor masks
932Successful-branching-event mask
933Instruction-fetching-event mask
934Storage-alteration-event mask
935Storage-key-alteration-event mask
936Store-using-real-address-event mask
937Zero-address-detection-event mask
938Transaction-end event mask
939Instruction-fetching-nullification-event mask
940Branch-address control
941PER-event-suppression control
943Storage-alteration-space control
100-63PER starting address
110-63PER ending address
120Branch-trace control
121Mode-trace control
122-61Trace-entry address
1262ASN-trace control
1263Explicit-trace control
130-51Home Address-Space Control Element (ASCE)
Home region-table origin
Home segment-table origin
Home real-space token origin
1355Home private-space control
1356Home storage-alteration-eventl
1357Home space-switch-event control
1358Secondary real-space control
1360-61Home designation-type control
1362-63Home table length
1432Set to 1
1433Set to 1
1434Extended save-area control (ESA/390-compatibility modeonly)
1435Channel-report-pending subclass mask
1436Recovery subclass mask
1437Degradation subclass mask
1438External-damage subclass mask
1439Warning subclass mask
1442TOD-clock-control-override control
14 44 ASN-translation control
1445-63ASN-first-table origin
150-60Linkage-stack-entry address

Floating point Control (FPC) register

The FPC register contains Interrupt Masks (IM), Status Flags (SF), Data Exception Code (DXC), Decimal Rounding Mode (DRM) and Binary Rounding Mode (BRM). An interruption only stores the DXC if the FPC register if the AFP-register (additional floating-point register) control bit, bit 13 of control register 0, is one. Also, while individual bits of the DXC usually have significance, programs should normally treat it as an 8-bit integer rather than querying individual bits.

FPC fields
Byte nameBits Field nameUse
masks0IMiIEEE-invalid-operation mask
masks1IMzIEEE-division-by-zero mask
masks2IMoIEEE-overflow mask
masks3IMuIEEE-underflow mask
masks4IMxIEEE-inexact mask
masks5IMqQuantum-exception mask
flags8SFiIEEE-invalid-operation flag
flags9SFzIEEE-division-by-zero
flags10SFoIEEE-overflow flag
flags11SFuIEEE-underflow flag
flags12SFxIEEE-inexact flag
flags13SFqQuantum-exception flag
DXC16-23DXCData-exception code
DXC16iIEEE-invalid-operation
DXC17zIEEE-division-by-zero
DXC18oIEEE-overflow
DXC19uIEEE-underflow mask
DXC20xIEEE-inexact mask
DXC21y/qQuantum-exception mask
25-27DRMDFP rounding mode
29-31BRMBFP rounding mode

Floating point registers

Each CPU had 16 64-bit floating point registers; FP0-15 occupy bits 0-63 of VR0-15.

General registers

Each CPU has 16 64-bit general registers, which serve as accumulators, base registers and index registers. Instructions designated as Grandé operate on all 64 bits; some instructions added by the Extended-Immediate Facility operate on any halfword or word in the register; most other instructions do not change or use bits 0-31.

Prefix register

The prefix register is used in translating a real address to an absolute address. In z/Architecture mode, the PSA is 2 pages (8 KiB). Bits 0-32 and 51-63 are always zero. If bits 0-50 of a real address are zero then they are replaced by bits 0-50 of the prefix register; if bits 0-50 of the real address are equal to bits 0-50 of the prefix register then they are replaced with zeros.

Program status word (PSW)

The PSW holds the instruction address and other fields reflecting the status of the program currently running on a CPU. The status of the program is also affected by the contents of the Control registers.

Vector registers

Each CPU has 32 128-bit vector registers.

Notes and References

  1. http://www.cl.cam.ac.uk/teaching/0607/CompArch/ibm-z-plambeck.pdf Development and Attributes of z/Architecture
  2. Web site: Accommodate functions for the z13 server to be discontinued on future servers . . 25 June 2015 . 2017-09-18 . 2017-09-15 . https://web.archive.org/web/20170915023438/https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.e0zm100/z132012hw1.htm . live .