Program status word

Last updated

The program status word [lower-alpha 1] (PSW) is a register that performs the function of a status register and program counter, and sometimes more. The term is also applied to a copy of the PSW in storage. This article only discusses the PSW in the IBM System/360 [1] and its successors, [2] [3] [4] [5] [6] and follows the IBM convention of numbering bits starting with 0 as the leftmost (most significant) bit.

Contents

Although certain fields within the PSW may be tested or set by using non-privileged instructions, testing or setting the remaining fields may only be accomplished by using privileged instructions.

Contained within the PSW are the two bit condition code, representing zero, positive, negative, overflow, and similar flags of other architectures' status registers. Conditional branch instructions test this encoded as a four bit value, with each bit representing a test of one of the four condition code values, 23 + 22 + 21 + 20. (Since IBM uses big-endian bit numbering, mask value 8 selects code 0, mask value 4 selects code 1, mask value 2 selects code 2, and mask value 1 selects code 3.)

The 64-bit PSW describes (among other things)

In the early instances of the architecture (System/360 and early System/370), the instruction address was 24 [lower-alpha 2] bits; in later instances (XA/370), the instruction address was 31 bits plus a mode bit (24 bit addressing mode if zero; 31 bit addressing mode if one) for a total of 32 bits.

In the present instances of the architecture (z/Architecture), the instruction address is 64 bits and the PSW itself is 128 bits.

The PSW may be loaded by the LOAD PSW instruction (LPSW or LPSWE). Its contents may be examined with the Extract PSW instruction (EPSW).

Format

S/360

On all but 360/20, [lower-alpha 3] the PSW has the following formats. S/360 Extended PSW format only applies to the 360/67 with bit 8 of control register 6 set.

IBM S/360 PSW formats
S/360 Standard PSW [11]

System MaskKeyAMWPInterruption Code [12]
07811121314151631

ILCCCProgram
Mask
Instruction Address
3233343536394063
S/360 Standard PSW abbreviations
BitsFieldMeaning
0-7SM
System Mask
BitMeaning
0Channel 0 mask
1Channel 1 mask
2Channel 2 mask
3Channel 3 mask
4Channel 4 mask
5Channel 5 mask
6Channel 6 mask
7External Mask
8-11KeyPSW key
12AASCII
13MMachine-check mask
14WWait state
15PProblem state
16-31ICInterruption Code [13]
32-33ILCInstruction-Length Code [14]
34-35CCCondition Code
36-39PM
Program Mask
BitMeaning
36Fixed-point overflow
37Decimal overflow
38Exponent underflow
39Significance
40-63IAInstruction Address
S/360 Extended PSW [15]

spare24/32
Bit
Mode
Tran
Ctrl
I/O
Mask
Ext.
Mask
KeyAMWPILCCCProgram
Mask
spare
034567811121314151617181920232431

Instruction Address
3263
S/360 Extended PSW abbreviations
BitsFieldMeaning
0-3Spare (must be 0)
424/32-bit Address mode
5Translation Control
6IOI/O Mask (Summary)
7EXExternal Mask (Summary)
8-11KeyProtection Key
12AASCII
13MMachine-check mask
14WWait state
15PProblem state
16-17ILCInstruction-Length Code [16]
18-19CCCondition Code
20-23PM
Program Mask
BitMeaning
20Fixed-point overflow
21Decimal overflow
22Exponent underflow
23Significance
24-31Spare
32-63IAInstruction Address

S/370

IBM S/370 PSW formats
S/370 Basic Control mode PSW [17]

Chan.
Mask
I
O
E
X
Key0MWPInterruption Code
0124567811121314151631

ILCCCProgram
Mask
Instruction Address
3233343536394063
S/370 BC mode PSW abbreviations
BitsFieldMeaning
0-5Channel Masks for channels 0-5
6IOI/O Mask for channels > 5
7EXExternal Mask
8-11KeyPSW key
12E=0Basic Control mode
13MMachine-check mask
14WWait state
15PProblem state
16-31ICInterruption Code [18]
32-33ILCInstruction-Length Code [19]
34-35CCCondition Code
36-39PM
Program Mask
BitMeaning
36Fixed-point overflow
37Decimal overflow
38Exponent underflow
39Significance
40-63IAInstruction Address
S/370 Extended Control mode PSW [20]

0R000TI
O
E
X
Key1MWPS0CCProgram
Mask
00000000
0124567811121314151617181920232431

00000000Instruction Address
32394063
S/370 EC mode PSW abbreviations
BitsFieldMeaning
1RPER Mask
5TDAT mode
6IOI/O Mask; subject to channel mask in CR2
7EXExternal Mask; subject to external subclass mask in CR0
8-11KeyPSW key
12E=1Extended Control mode
13MMachine-check mask
14WWait state
15PProblem state
16SAddress-Space Control
0=primary-space mode
1=Secondary-space mode
18-19CCCondition Code
20-23PM
Program Mask
BitMeaning
20Fixed-point overflow
21Decimal overflow
22Exponent underflow
23Significance
40-63IAInstruction Address

S/370 Extended Architecture (S/370-XA)

IBM Extended Architecture (XA) PSW format
Extended Architecture Extended Control mode PSW [21]

0R000TI
O
E
X
Key1MWPS0CCProgram
Mask
00000000
0124567811121314151617181920232431

AInstruction Address
323363
S/370-XA EC mode PSW abbreviations
BitsFieldMeaning
1RPER Mask
5TDAT mode
6IOI/O Mask; subject to channel mask in CR2
7EXExternal Mask; subject to external subclass mask in CR0
8-11KeyPSW key
12E=1Extended Control mode
13MMachine-check mask
14WWait state
15PProblem state
16SAddress-Space Control
0=primary-space mode
1=Secondary-space mode
18-19CCCondition Code
20-23PM
Program Mask
BitMeaning
20Fixed-point overflow
21Decimal overflow
22Exponent underflow
23Significance
32AAddressing mode
0=24 bit; 1=31 bit
33-63IAInstruction Address

Enterprise Systems Architecture (ESA)

IBM Enterprise Systems Architecture (ESA) PSW format
Enterprise Systems Architecture Extended Control mode PSW [22] [23]

0R000TI
O
E
X
Key1MWPASCCProgram
Mask
00000000
0124567811121314151617181920232431

AInstruction Address
323363
ESA EC mode PSW abbreviations
BitsFieldMeaning
1RPER Mask
5TDAT mode
6IOI/O Mask; subject to channel mask in CR2
7EXExternal Mask; subject to external subclass mask in CR0
8-11KeyPSW key
12E=1Extended Control mode
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
Program Mask
BitMeaning
20Fixed-point overflow
21Decimal overflow
22Exponent underflow [lower-alpha 4]
23Significance [lower-alpha 5]
32AAddressing mode
0=24 bit; 1=31 bit
33-63IAInstruction Address

z/Architecture

IBM z/Architecture PSW formats
z/Architecture long PSW [24]

0R000TI
O
E
X
Key0MWPASCCProgram
Mask
R
I
000000E
A
012456781112131415161718192023243031

B
A
0
323363

Instruction Address
6495

Instruction Address (Continued)
96127
Long PSW abbreviations
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
Program Mask
BitMeaning
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 [25]

0R000TI
O
E
X
Key1MWPASCCProgram
Mask
R
I
000000E
A
01245678111213141516171819202324253031

B
A
Instruction Address
323363
Short PSW abbreviations
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
Program Mask
BitMeaning
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

Notes

  1. The nomenclature varies among architectures.
  2. However, a 360/67 [7] equipped with the Extended Dynamic Address Translation [8] feature has a 32-bit mode selected by bit 4 of the PSW [9] in Extended PSW mode [8] (Control Register 6, bit 8 [10] ).
  3. Despite the name, the 350/20 does not adhere to the S/360 architecture.
  4. Bit 22 is renamed as HFP exponent underflow in ESA/390
  5. Bit 23 is renamed as HFP significance in ESA/390

Related Research Articles

IBM mainframes are large computer systems produced by IBM since 1952. During the 1960s and 1970s, IBM dominated the large computer market. Current mainframe computers in IBM's line of business computers are developments of the basic design of the IBM System/360.

<span class="mw-page-title-main">MVS</span> Operating system for IBM mainframes

Multiple Virtual Storage, more commonly called MVS, was the most commonly used operating system on the System/370 and System/390 IBM mainframe computers. IBM developed MVS, along with OS/VS1 and SVS, as a successor to OS/360. It is unrelated to IBM's other mainframe operating system lines, e.g., VSE, VM, TPF.

<span class="mw-page-title-main">IBM System/360</span> IBM mainframe computer family (1964–1977)

The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applications and to cover a complete range of applications from small to large. The design distinguished between architecture and implementation, allowing IBM to release a suite of compatible designs at different prices. All but the only partially compatible Model 44 and the most expensive systems use microcode to implement the instruction set, which features 8-bit byte addressing and binary, decimal, and hexadecimal floating-point calculations.

In computing, endianness, also known as byte sex, is the order or sequence of bytes of a word of digital data in computer memory. Endianness is primarily expressed as big-endian (BE) or little-endian (LE). A big-endian system stores the most significant byte of a word at the smallest memory address and the least significant byte at the largest. A little-endian system, in contrast, stores the least-significant byte at the smallest address. Bi-endianness is a feature supported by numerous computer architectures that feature switchable endianness in data fetches and stores or for instruction fetches. Other orderings are generically called middle-endian or mixed-endian.

<span class="mw-page-title-main">IBM System/370</span> Family of mainframe computers 1970-1990

The IBM System/370 (S/370) is a model range of IBM mainframe computers announced on June 30, 1970, as the successors to the System/360 family. The series mostly maintains backward compatibility with the S/360, allowing an easy migration path for customers; this, plus improved performance, were the dominant themes of the product announcement. In September 1990, the System/370 line was replaced with the System/390.

In computer architecture, 32-bit computing refers to computer systems with a processor, memory, and other major system components that operate on data in 32-bit units. Compared to smaller bit widths, 32-bit computers can perform large calculations more efficiently and process more data per clock cycle. Typical 32-bit personal computers also have a 32-bit address bus, permitting up to 4 GB of RAM to be accessed; far more than previous generations of system architecture allowed.

<span class="mw-page-title-main">VM (operating system)</span> Family of IBM operating systems

VM is a family of IBM virtual machine operating systems used on IBM mainframes System/370, System/390, zSeries, System z and compatible systems, including the Hercules emulator for personal computers.

Disk Operating System/360, also DOS/360, or simply DOS, is the discontinued first member of a sequence of operating systems for IBM System/360, System/370 and later mainframes. It was announced by IBM on the last day of 1964, and it was first delivered in June 1966. In its time, DOS/360 was the most widely used operating system in the world.

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. 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.

In computing, channel I/O is a high-performance input/output (I/O) architecture that is implemented in various forms on a number of computer architectures, especially on mainframe computers. In the past, channels were generally implemented with custom devices, variously named channel, I/O processor, I/O controller, I/O synchronizer, or DMA controller.

In computer architecture, 26-bit integers, memory addresses, or other data units are those that are 26 bits wide, and thus can represent unsigned values up to 67,108,863. Two examples of computer processors that featured 26-bit memory addressing are certain second generation IBM System/370 mainframe computer models introduced in 1981, which had 26-bit physical addresses but had only the same 24-bit virtual addresses as earlier models, and the first generations of ARM processors.

In computer architecture, 31-bit integers, memory addresses, or other data units are those that are 31 bits wide.

The Task Control Block (TCB) contains the state of a task in, e.g., OS/360 and successors on IBM System/360 architecture and successors.

Basic Assembly Language (BAL) is the commonly used term for a low-level programming language used on IBM System/360 and successor mainframes. Originally, "Basic Assembly Language" applied only to an extremely restricted dialect designed to run under control of IBM Basic Programming Support (BPS/360) on systems with only 8 KB of main memory, and only a card reader, a card punch, and a printer for input/output — thus the word "Basic". However, the full name and the initialism "BAL" almost immediately attached themselves in popular use to all assembly-language dialects on the System/360 and its descendants. BAL for BPS/360 was introduced with the System/360 in 1964.

<span class="mw-page-title-main">IBM System/360 Model 67</span> 1967 IBM mainframe model with virtual memory and 32-bit addressing

The IBM System/360 Model 67 (S/360-67) was an important IBM mainframe model in the late 1960s. Unlike the rest of the S/360 series, it included features to facilitate time-sharing applications, notably a Dynamic Address Translation unit, the "DAT box", to support virtual memory, 32-bit addressing and the 2846 Channel Controller to allow sharing channels between processors. The S/360-67 was otherwise compatible with the rest of the S/360 series.

In IBM terminology, an Access Register (AR) is a hardware register in ESA/370 and later processors. Access registers work in conjunction with the general purpose registers, giving a program transparent access to up to sixteen 2 GB address spaces simultaneously. ARs were introduced with ESA/370 in 1988, and supported by the MVS/ESA operating system.

A Supervisor Call instruction (SVC) is a hardware instruction used by the System/360 family of IBM mainframe computers up to contemporary zSeries, the Amdahl 470V/5, 470V/6, 470V/7, 470V/8, 580, 5880, 5990M, and 5990A, and others; Univac 90/60, 90/70 and 90/80, and possibly others; the Fujitsu M180 (UP) and M200 (MP), and others; and is also used in the Hercules open source mainframe emulation software. It causes an interrupt to request a service from the operating system. The system routine providing the service is called an SVC routine. SVC is a system call.

The IBM System/360 architecture is the model independent architecture for the entire S/360 line of mainframe computers, including but not limited to the instruction set architecture. The elements of the architecture are documented in the IBM System/360 Principles of Operation and the IBM System/360 I/O Interface Channel to Control Unit Original Equipment Manufacturers' Information manuals.

<span class="mw-page-title-main">IBM System/360 Model 44</span> Specialized IBM computer model from 1960s

The IBM System/360 Model 44 is a specialized member of the IBM System/360 family, with a variant of the System/360 computer architecture, designed for scientific computing, real-time computing, process control and numerical control (NC).

<span class="mw-page-title-main">IBM System/390</span> Line of mainframe computers

The IBM System/390 is a discontinued mainframe product family implementing the ESA/390, the fifth generation of the System/360 instruction set architecture. The first computers to use the ESA/390 were the Enterprise System/9000 (ES/9000) family, which were introduced in 1990. These were followed by the 9672, Multiprise, and Integrated Server families of System/390 in 1994–1999, using CMOS microprocessors. The ESA/390 succeeded the ESA/370 used in the Enhanced 3090 and 4381 "E" models, and the System/370 architecture last used in the IBM 9370 low-end mainframe. The ESA/390 was succeeded by the 64-bit z/Architecture in 2000.

References

  1. S360.
  2. S370.
  3. S370-XA.
  4. S370-ESA.
  5. S390-ESA.
  6. z.
  7. func67.
  8. 1 2 func67, p. 57, Glossary.
  9. func67, p. 15, Instruction Fetching and Execution.
  10. func67, p. 16, Table 4. Control Registers.
  11. S360, p. 15, Program Status Word.
  12. S360, pp. 15–16, Interruption.
  13. S370, pp. 15–16, Interruption.
  14. S370, p. 156, Instruction-Length Code.
  15. func67, pp. 15–16, Instruction Fetching and Execution.
  16. S360, p. 156, Instruction-Length Code.
  17. S370, pp. 4-8 –&#32, 4–9, Program-Status Word Format in BC Mode.
  18. S370, pp. 6-3 –&#32, 6–5, Interruption Action.
  19. S370, pp. 6-7 –&#32, 6–9, Instruction-Length Code.
  20. S370, pp. 4-6 –&#32, 4–7, Program-Status Word Format in EC Mode.
  21. S370-XA, p. 4-5, Program-Status-Word Format.
  22. S370-ESA, p. 4-5, Program-Status-Word Format.
  23. S390-ESA, p. 4-5, Program-Status-Word Format.
  24. z, pp. 4-5 –&#32, 4–8, Program-Status-Word Format.
  25. z, p. 4-8, Short PSW Format.
S360
IBM System/360 Principles of Operation (PDF) (Eighth ed.). IBM. September 1968. A22-6821-7.
func67
IBM System/360 Model 67 Functional Characteristics (PDF) (Third ed.). IBM. February 1972. GA27-2719-2.
S370
IBM System/370 Principles of Operation (PDF) (Eleventh ed.). IBM. September 1987. A22-7000-10.
S370-XA
IBM System/370 Extended Architecture Principles of Operation (PDF) (Second ed.). IBM. January 1987. SA22-7085-1.
S370-ESA
IBM Enterprise Systems Architecture/370 Principles of Operation (PDF) (First ed.). IBM. August 1988. SA22-7200-0.
z
z/Architecture Principles of Operation (PDF) (Thirteenth ed.). IBM. September 2019. SA22-7832-12.