Professional Documents
Culture Documents
Ibmzarch
Ibmzarch
Ibmzarch
Principles of Operation
SA22-7832-00
z/Architecture IBM
Principles of Operation
SA22-7832-00
Note:
Before using this information and the product it supports, be sure to read the general information under Notices on page xv.
Softcopy Note:
The reader should be aware of the fact that this publication contains many symbols, such as superscripts, that may not display
correctly with any given hardware or software. The definitive version of this publication is the hardcopy version.
This publication is provided for use in conjunction with other relevant IBM publications, and IBM makes no warranty, express or
implied, about its completeness or accuracy. The information in this publication is current as of its publication date but is subject to
change without notice.
Publications are not stocked at the address given below. Requests for IBM publications should be made to your IBM representative
or to the IBM branch office serving your locality.
A form for reader's comments is provided at the back of this publication. If the form has been removed, address your comments to:
International Business Machines Corporation
Department 55JA Mail Station P384
2455 South Road
Poughkeepsie, N.Y., 12601-5400
United States of America
When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes
appropriate without incurring any obligation to you.
Copyright International Business Machines Corporation 1990, 2000. All rights reserved.
US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
Contents
Notices . . . . . . . . . . . . . . . . . . . . . . . xv Storage Addressing . . . . . . . . . . . . . . . 3-2
Trademarks . . . . . . . . . . . . . . . . . . . . xv Information Formats . . . . . . . . . . . . . 3-2
Integral Boundaries . . . . . . . . . . . . . 3-3
Preface . . . . . . . . . . . . . . . . . . . . . . xvii Address Types and Formats . . . . . . . . . . 3-3
Size and Number Notation . . . . . . . . . xviii Address Types . . . . . . . . . . . . . . . . 3-3
Bytes, Characters, and Codes . . . . . . . . xix Absolute Address . . . . . . . . . . . . . 3-3
Other Publications . . . . . . . . . . . . . . . xix Real Address . . . . . . . . . . . . . . . 3-4
Virtual Address . . . . . . . . . . . . . . 3-4
Chapter 1. Introduction . . . . . . . . . . . 1-1 Primary Virtual Address . . . . . . . . . 3-4
Highlights of z/Architecture . . . . . . . . . . . 1-1 Secondary Virtual Address . . . . . . . . 3-4
General Instructions for 64-Bit Integers . . 1-2 AR-Specified Virtual Address . . . . . . 3-5
Other New General Instructions . . . . . . 1-2 Home Virtual Address . . . . . . . . . . 3-5
Floating-Point Instructions . . . . . . . . . . 1-4 Logical Address . . . . . . . . . . . . . . 3-5
Control Instructions . . . . . . . . . . . . . 1-4 Instruction Address . . . . . . . . . . . . 3-5
Trimodal Addressing . . . . . . . . . . . . . 1-4 Effective Address . . . . . . . . . . . . . 3-5
Modal Instructions . . . . . . . . . . . . . 1-4 Address Size and Wraparound . . . . . . . 3-5
Effects on Bits 0-31 of a General Address Wraparound . . . . . . . . . . . 3-6
Register . . . . . . . . . . . . . . . . . 1-5 Storage Key . . . . . . . . . . . . . . . . . . . 3-8
Extended-Translation Facility 2 . . . . . . . 1-5 Protection . . . . . . . . . . . . . . . . . . . . . 3-9
The ESA/390 Base . . . . . . . . . . . . . . . 1-6 Key-Controlled Protection . . . . . . . . . . 3-9
The ESA/370 and 370-XA Base . . . . . . 1-11 Storage-Protection-Override Control . . 3-10
System Program . . . . . . . . . . . . . . . . . 1-13 Fetch-Protection-Override Control . . . 3-11
Compatibility . . . . . . . . . . . . . . . . . . . 1-13 Access-List-Controlled Protection . . . . . 3-11
Compatibility among z/Architecture Page Protection . . . . . . . . . . . . . . . 3-11
Systems . . . . . . . . . . . . . . . . . . 1-13 Low-Address Protection . . . . . . . . . . . 3-12
Compatibility between z/Architecture and Suppression on Protection . . . . . . . . . 3-12
ESA/390 . . . . . . . . . . . . . . . . . 1-14 Reference Recording . . . . . . . . . . . . . . 3-14
Control-Program Compatibility . . . . . . 1-14 Change Recording . . . . . . . . . . . . . . . 3-14
Problem-State Compatibility . . . . . . . 1-14 Prefixing . . . . . . . . . . . . . . . . . . . . . 3-15
Availability . . . . . . . . . . . . . . . . . . . . 1-14 Address Spaces . . . . . . . . . . . . . . . . . 3-16
Changing to Different Address Spaces . 3-17
Chapter 2. Organization . . . . . . . . . . . 2-1 Address-Space Number . . . . . . . . . 3-17
Main Storage . . . . . . . . . . . . . . . . . . . 2-2 ASN Translation . . . . . . . . . . . . . . . . . 3-18
Expanded Storage . . . . . . . . . . . . . . . 2-2 ASN-Translation Controls . . . . . . . . . . 3-18
CPU . . . . . . . . . . . . . . . . . . . . . . . . 2-2 Control Register 14 . . . . . . . . . . . . 3-18
PSW . . . . . . . . . . . . . . . . . . . . . . 2-3 ASN-Translation Tables . . . . . . . . . . . 3-19
General Registers . . . . . . . . . . . . . . 2-3 ASN-First-Table Entries . . . . . . . . . 3-19
Floating-Point Registers . . . . . . . . . . . 2-3 ASN-Second-Table Entries . . . . . . . 3-19
Floating-Point-Control Register . . . . . . . 2-4 ASN-Translation Process . . . . . . . . . . 3-21
Control Registers . . . . . . . . . . . . . . . 2-4 ASN-First-Table Lookup . . . . . . . . . 3-22
Access Registers . . . . . . . . . . . . . . . 2-4 ASN-Second-Table Lookup . . . . . . . 3-23
Cryptographic Facility . . . . . . . . . . . . 2-6 Recognition of Exceptions during ASN
External Time Reference . . . . . . . . . . . . 2-6 Translation . . . . . . . . . . . . . . . 3-23
I/O . . . . . . . . . . . . . . . . . . . . . . . . . 2-6 ASN Authorization . . . . . . . . . . . . . . . . 3-23
Channel Subsystem . . . . . . . . . . . . . 2-6 ASN-Authorization Controls . . . . . . . . . 3-23
Channel Paths . . . . . . . . . . . . . . . . 2-6 Control Register 4 . . . . . . . . . . . . . 3-23
I/O Devices and Control Units . . . . . . . 2-7 ASN-Second-Table Entry . . . . . . . . 3-24
Operator Facilities . . . . . . . . . . . . . . . . 2-7 Authority-Table Entries . . . . . . . . . . . 3-24
ASN-Authorization Process . . . . . . . . . 3-24
Chapter 3. Storage . . . . . . . . . . . . . . 3-1 Authority-Table Lookup . . . . . . . . . . 3-25
Contents v
Header Entries . . . . . . . . . . . . . . 5-69 Early Exception Recognition . . . . . . . 6-9
Trailer Entries . . . . . . . . . . . . . . . 5-69 Late Exception Recognition . . . . . . . 6-10
State Entries . . . . . . . . . . . . . . . . 5-70 External Interruption . . . . . . . . . . . . . . . 6-10
Stacking Process . . . . . . . . . . . . . . . 5-72 Clock Comparator . . . . . . . . . . . . . . 6-11
Locating Space for a New Entry . . . . 5-72 CPU Timer . . . . . . . . . . . . . . . . . . 6-11
Forming the New Entry . . . . . . . . . . 5-73 Emergency Signal . . . . . . . . . . . . . . 6-11
Updating the Current Entry . . . . . . . 5-74 ETR . . . . . . . . . . . . . . . . . . . . . . 6-12
Updating Control Register 15 . . . . . . 5-74 External Call . . . . . . . . . . . . . . . . . 6-12
Recognition of Exceptions during the Interrupt Key . . . . . . . . . . . . . . . . . 6-12
Stacking Process . . . . . . . . . . . 5-74 Malfunction Alert . . . . . . . . . . . . . . . 6-12
Unstacking Process . . . . . . . . . . . . . 5-75 Service Signal . . . . . . . . . . . . . . . . 6-13
Locating the Current Entry and I/O Interruption . . . . . . . . . . . . . . . . . . 6-13
Processing a Header Entry . . . . . 5-75 Machine-Check Interruption . . . . . . . . . . 6-13
Checking for a State Entry . . . . . . . . 5-76 Program Interruption . . . . . . . . . . . . . . 6-14
Restoring Information . . . . . . . . . . . 5-76 Data-Exception Code (DXC) . . . . . . . . 6-14
Updating the Preceding Entry . . . . . . 5-77 Priority of Program Interruptions for
Updating Control Register 15 . . . . . . 5-77 Data Exceptions . . . . . . . . . . . 6-16
Recognition of Exceptions during the Program-Interruption Conditions . . . . . . 6-16
Unstacking Process . . . . . . . . . 5-77 Addressing Exception . . . . . . . . . . 6-16
Sequence of Storage References . . . . . . . 5-77 AFX-Translation Exception . . . . . . . . 6-19
Conceptual Sequence . . . . . . . . . . 5-77 ALEN-Translation Exception . . . . . . . 6-19
Overlapped Operation of Instruction ALE-Sequence Exception . . . . . . . . 6-19
Execution . . . . . . . . . . . . . . . 5-78 ALET-Specification Exception . . . . . . 6-19
Divisible Instruction Execution . . . . . . 5-78 ASCE-Type Exception . . . . . . . . . . 6-19
Interlocks for Virtual-Storage References . 5-79 ASTE-Sequence Exception . . . . . . . 6-20
Interlocks between Instructions . . . . . 5-79 ASTE-Validity Exception . . . . . . . . . 6-20
Interlocks within a Single Instruction . . 5-80 ASX-Translation Exception . . . . . . . 6-21
Instruction Fetching . . . . . . . . . . . . . 5-81 Crypto-Operation Exception . . . . . . . 6-21
ART-Table and DAT-Table Fetches . . . . 5-83 Data Exception . . . . . . . . . . . . . . 6-21
Storage-Key Accesses . . . . . . . . . . . 5-83 Decimal-Divide Exception . . . . . . . . 6-22
Storage-Operand References . . . . . . . 5-84 Decimal-Overflow Exception . . . . . . . 6-22
Storage-Operand Fetch References . . 5-84 Execute Exception . . . . . . . . . . . . 6-22
Storage-Operand Store References . . 5-84 EX-Translation Exception . . . . . . . . 6-22
Storage-Operand Update References . 5-85 Extended-Authority Exception . . . . . . 6-22
Storage-Operand Consistency . . . . . . . 5-86 Fixed-Point-Divide Exception . . . . . . 6-23
Single-Access References . . . . . . . . 5-86 Fixed-Point-Overflow Exception . . . . . 6-23
Multiple-Access References . . . . . . . 5-86 HFP-Divide Exception . . . . . . . . . . 6-23
Block-Concurrent References . . . . . . 5-87 HFP-Exponent-Overflow Exception . . . 6-23
Consistency Specification . . . . . . . . 5-87 HFP-Exponent-Underflow Exception . . 6-23
Relation between Operand Accesses . . . 5-88 HFP-Significance Exception . . . . . . . 6-24
Other Storage References . . . . . . . . . 5-89 HFP-Square-Root Exception . . . . . . 6-24
Serialization . . . . . . . . . . . . . . . . . . . 5-89 LX-Translation Exception . . . . . . . . 6-24
CPU Serialization . . . . . . . . . . . . . . 5-89 Monitor Event . . . . . . . . . . . . . . . 6-24
Channel-Program Serialization . . . . . . . 5-91 Operand Exception . . . . . . . . . . . . 6-25
Operation Exception . . . . . . . . . . . 6-25
Chapter 6. Interruptions . . . . . . . . . . . 6-1 Page-Translation Exception . . . . . . . 6-26
Interruption Action . . . . . . . . . . . . . . . . 6-2 PC-Translation-Specification Exception 6-26
Interruption Code . . . . . . . . . . . . . . . 6-5 PER Event . . . . . . . . . . . . . . . . . 6-26
Enabling and Disabling . . . . . . . . . . . 6-6 Primary-Authority Exception . . . . . . . 6-26
Handling of Floating Interruption Conditions 6-7 Privileged-Operation Exception . . . . . 6-27
Instruction-Length Code . . . . . . . . . . . 6-7 Protection Exception . . . . . . . . . . . 6-27
Zero ILC . . . . . . . . . . . . . . . . . . 6-7 Region-First-Translation Exception . . . 6-28
ILC on Instruction-Fetching Exceptions . 6-8 Region-Second-Translation Exception . 6-29
Exceptions Associated with the PSW . . . 6-9 Region-Third-Translation Exception . . 6-29
Contents vii
LOAD POSITIVE . . . . . . . . . . . . . . . 7-90 TEST UNDER MASK (TEST UNDER
LOAD REVERSED . . . . . . . . . . . . . . 7-91 MASK HIGH, TEST UNDER MASK
MONITOR CALL . . . . . . . . . . . . . . . 7-92 LOW) . . . . . . . . . . . . . . . . . . 7-147
MOVE . . . . . . . . . . . . . . . . . . . . . 7-93 TRANSLATE . . . . . . . . . . . . . . . . 7-148
MOVE INVERSE . . . . . . . . . . . . . . . 7-93 TRANSLATE AND TEST . . . . . . . . . 7-149
MOVE LONG . . . . . . . . . . . . . . . . . 7-94 TRANSLATE EXTENDED . . . . . . . . 7-150
MOVE LONG EXTENDED . . . . . . . . . 7-97 TRANSLATE ONE TO ONE . . . . . . . 7-152
MOVE LONG UNICODE . . . . . . . . . 7-101 TRANSLATE ONE TO TWO . . . . . . . 7-152
MOVE NUMERICS . . . . . . . . . . . . . 7-104 TRANSLATE TWO TO ONE . . . . . . . 7-152
MOVE STRING . . . . . . . . . . . . . . . 7-104 TRANSLATE TWO TO TWO . . . . . . . 7-153
MOVE WITH OFFSET . . . . . . . . . . . 7-106 UNPACK . . . . . . . . . . . . . . . . . . 7-157
MOVE ZONES . . . . . . . . . . . . . . . 7-106 UNPACK ASCII . . . . . . . . . . . . . . 7-158
MULTIPLY . . . . . . . . . . . . . . . . . 7-107 UNPACK UNICODE . . . . . . . . . . . . 7-159
MULTIPLY HALFWORD . . . . . . . . . 7-107 UPDATE TREE . . . . . . . . . . . . . . . 7-160
MULTIPLY HALFWORD IMMEDIATE . . 7-108
MULTIPLY LOGICAL . . . . . . . . . . . 7-108 Chapter 8. Decimal Instructions . . . . . . 8-1
MULTIPLY SINGLE . . . . . . . . . . . . 7-109 Decimal-Number Formats . . . . . . . . . . . 8-1
OR . . . . . . . . . . . . . . . . . . . . . . 7-110 Zoned Format . . . . . . . . . . . . . . . . . 8-1
OR IMMEDIATE . . . . . . . . . . . . . . 7-111 Packed Format . . . . . . . . . . . . . . . . 8-1
PACK . . . . . . . . . . . . . . . . . . . . 7-111 Decimal Codes . . . . . . . . . . . . . . . . 8-2
PACK ASCII . . . . . . . . . . . . . . . . 7-112 Decimal Operations . . . . . . . . . . . . . . . 8-2
PACK UNICODE . . . . . . . . . . . . . . 7-113 Decimal-Arithmetic Instructions . . . . . . . 8-2
PERFORM LOCKED OPERATION . . . 7-114 Editing Instructions . . . . . . . . . . . . . . 8-3
ROTATE LEFT SINGLE LOGICAL . . . 7-129 Execution of Decimal Instructions . . . . . 8-3
SEARCH STRING . . . . . . . . . . . . . 7-130 Other Instructions for Decimal Operands . 8-3
SET ACCESS . . . . . . . . . . . . . . . 7-131 Decimal-Operand Data Exception . . . . . 8-4
SET ADDRESSING MODE . . . . . . . . 7-131 Instructions . . . . . . . . . . . . . . . . . . . . 8-4
SET PROGRAM MASK . . . . . . . . . . 7-132 ADD DECIMAL . . . . . . . . . . . . . . . . 8-5
SHIFT LEFT DOUBLE . . . . . . . . . . . 7-132 COMPARE DECIMAL . . . . . . . . . . . . 8-6
SHIFT LEFT DOUBLE LOGICAL . . . . 7-133 DIVIDE DECIMAL . . . . . . . . . . . . . . 8-6
SHIFT LEFT SINGLE . . . . . . . . . . . 7-134 EDIT . . . . . . . . . . . . . . . . . . . . . . 8-7
SHIFT LEFT SINGLE LOGICAL . . . . . 7-134 EDIT AND MARK . . . . . . . . . . . . . . 8-9
SHIFT RIGHT DOUBLE . . . . . . . . . . 7-135 MULTIPLY DECIMAL . . . . . . . . . . . . 8-11
SHIFT RIGHT DOUBLE LOGICAL . . . 7-135 SHIFT AND ROUND DECIMAL . . . . . . 8-11
SHIFT RIGHT SINGLE . . . . . . . . . . 7-136 SUBTRACT DECIMAL . . . . . . . . . . . 8-12
SHIFT RIGHT SINGLE LOGICAL . . . . 7-136 TEST DECIMAL . . . . . . . . . . . . . . . 8-13
STORE . . . . . . . . . . . . . . . . . . . 7-137 ZERO AND ADD . . . . . . . . . . . . . . . 8-13
STORE ACCESS MULTIPLE . . . . . . . 7-137
STORE CHARACTER . . . . . . . . . . . 7-137 Chapter 9. Floating-Point Overview and
STORE CHARACTERS UNDER MASK .7-138 Support Instructions . . . . . . . . . . . . 9-1
STORE CLOCK . . . . . . . . . . . . . . 7-138 Registers And Controls . . . . . . . . . . . . . 9-2
STORE CLOCK EXTENDED . . . . . . . 7-139 Floating-Point Registers . . . . . . . . . . . 9-2
STORE HALFWORD . . . . . . . . . . . 7-141 Additional Floating-Point (AFP)
STORE MULTIPLE . . . . . . . . . . . . 7-141 Registers . . . . . . . . . . . . . . . . 9-2
STORE MULTIPLE HIGH . . . . . . . . . 7-142 Valid Floating-Point-Register
STORE PAIR TO QUADWORD . . . . . 7-142 Designations . . . . . . . . . . . . . . 9-2
STORE REVERSED . . . . . . . . . . . . 7-142 Floating-Point-Control (FPC) Register . . . 9-2
SUBTRACT . . . . . . . . . . . . . . . . . 7-143 AFP-Register-Control Bit . . . . . . . . . . 9-2
SUBTRACT HALFWORD . . . . . . . . . 7-144 Explicit Rounding Methods . . . . . . . . . 9-3
SUBTRACT LOGICAL . . . . . . . . . . . 7-144 Summary of Rounding Action . . . . . . 9-3
SUBTRACT LOGICAL WITH BORROW .7-145 Comparison of BFP and HFP Number
SUPERVISOR CALL . . . . . . . . . . . 7-146 Representations . . . . . . . . . . . . . . . . 9-4
TEST ADDRESSING MODE . . . . . . . 7-146 BFP and HFP Number Ranges . . . . . . 9-4
TEST AND SET . . . . . . . . . . . . . . 7-146
Contents ix
Subclass . . . . . . . . . . . . . . . . . . . 11-16 Machine-Check Masking . . . . . . . . . . . 11-24
System Damage . . . . . . . . . . . . 11-16 Channel-Report-Pending Subclass
Instruction-Processing Damage . . . . 11-16 Mask . . . . . . . . . . . . . . . . . 11-24
System Recovery . . . . . . . . . . . . 11-16 Recovery Subclass Mask . . . . . . . 11-25
Timing-Facility Damage . . . . . . . . 11-16 Degradation Subclass Mask . . . . . . 11-25
External Damage . . . . . . . . . . . . 11-17 External-Damage Subclass Mask . . . 11-25
Degradation . . . . . . . . . . . . . . . 11-17 Warning Subclass Mask . . . . . . . . 11-25
Warning . . . . . . . . . . . . . . . . . 11-17 Machine-Check Logout . . . . . . . . . . . . 11-25
Channel Report Pending . . . . . . . . 11-17 Summary of Machine-Check Masking . . . 11-25
Service-Processor Damage . . . . . . 11-18
Channel-Subsystem Damage . . . . . 11-18 Chapter 12. Operator Facilities . . . . . . . 12-1
Subclass Modifiers . . . . . . . . . . . . . 11-18 Manual Operation . . . . . . . . . . . . . . . . 12-1
Backed Up . . . . . . . . . . . . . . . . 11-18 Basic Operator Facilities . . . . . . . . . . . . 12-1
Delayed Access Exception . . . . . . . 11-18 Address-Compare Controls . . . . . . . . . 12-1
Ancillary Report . . . . . . . . . . . . . 11-18 Alter-and-Display Controls . . . . . . . . . 12-2
Synchronous Architectural-Mode Indicator . . . . . . . . 12-2
Machine-Check-Interruption Conditions 11-18 Architectural-Mode-Selection Controls . . . 12-2
Processing Backup . . . . . . . . . . . 11-18 Check-Stop Indicator . . . . . . . . . . . . 12-3
Processing Damage . . . . . . . . . . 11-19 IML Controls . . . . . . . . . . . . . . . . . 12-3
Storage Errors . . . . . . . . . . . . . . . 11-19 Interrupt Key . . . . . . . . . . . . . . . . . 12-3
Storage Error Uncorrected . . . . . . . 11-19 Load Indicator . . . . . . . . . . . . . . . . 12-3
Storage Error Corrected . . . . . . . . 11-20 Load-Clear Key . . . . . . . . . . . . . . . . 12-3
Storage-Key Error Uncorrected . . . . 11-20 Load-Normal Key . . . . . . . . . . . . . . . 12-3
Storage Degradation . . . . . . . . . . 11-20 Load-Unit-Address Controls . . . . . . . . . 12-3
Indirect Storage Error . . . . . . . . . . 11-20 Manual Indicator . . . . . . . . . . . . . . . 12-3
Machine-Check Interruption-Code Power Controls . . . . . . . . . . . . . . . . 12-4
Validity Bits . . . . . . . . . . . . . . . 11-21 Rate Control . . . . . . . . . . . . . . . . . 12-4
PSW-MWP Validity . . . . . . . . . . . 11-21 Restart Key . . . . . . . . . . . . . . . . . . 12-4
PSW Mask and Key Validity . . . . . . 11-21 Start Key . . . . . . . . . . . . . . . . . . . 12-4
PSW Program-Mask and Stop Key . . . . . . . . . . . . . . . . . . . 12-4
Condition-Code Validity . . . . . . 11-21 Store-Status Key . . . . . . . . . . . . . . . 12-5
PSW-Instruction-Address Validity . . . 11-21 System-Reset-Clear Key . . . . . . . . . . 12-5
Failing-Storage-Address Validity . . . 11-21 System-Reset-Normal Key . . . . . . . . . 12-5
External-Damage-Code Validity . . . . 11-21 Test Indicator . . . . . . . . . . . . . . . . . 12-5
Floating-Point-Register Validity . . . . 11-21 TOD-Clock Control . . . . . . . . . . . . . . 12-5
General-Register Validity . . . . . . . . 11-21 Wait Indicator . . . . . . . . . . . . . . . . . 12-6
Control-Register Validity . . . . . . . . 11-21 Multiprocessing Configurations . . . . . . . . 12-6
Storage Logical Validity . . . . . . . . 11-22
Access-Register Validity . . . . . . . . 11-22 Chapter 13. I/O Overview . . . . . . . . . . 13-1
TOD-Programmable-Register Validity .11-22 Input/Output (I/O) . . . . . . . . . . . . . . . . 13-1
Floating-Point-Control-Register The Channel Subsystem . . . . . . . . . . . . 13-1
Validity . . . . . . . . . . . . . . . . 11-22 Subchannels . . . . . . . . . . . . . . . . . 13-2
CPU-Timer Validity . . . . . . . . . . . 11-22 Attachment of Input/Output Devices . . . . . 13-2
Clock-Comparator Validity . . . . . . . 11-22 Channel Paths . . . . . . . . . . . . . . . . 13-2
Machine-Check Extended Interruption Control Units . . . . . . . . . . . . . . . . . 13-4
Information . . . . . . . . . . . . . . . . . 11-22 I/O Devices . . . . . . . . . . . . . . . . . . 13-4
Register-Save Areas . . . . . . . . . . . . 11-22 I/O Addressing . . . . . . . . . . . . . . . . . . 13-5
External-Damage Code . . . . . . . . . . 11-23 Channel-Path Identifier . . . . . . . . . . . 13-5
Failing-Storage Address . . . . . . . . . . 11-23 Subchannel Number . . . . . . . . . . . . . 13-5
Handling of Machine-Check Conditions . . 11-23 Device Number . . . . . . . . . . . . . . . . 13-5
Floating Interruption Conditions . . . . . 11-23 Device Identifier . . . . . . . . . . . . . . . 13-5
Floating Machine-Check-Interruption Execution of I/O Operations . . . . . . . . . . 13-6
Conditions . . . . . . . . . . . . . . 11-24 Start-Function Initiation . . . . . . . . . . . 13-6
Floating I/O Interruptions . . . . . . . . 11-24 Path Management . . . . . . . . . . . . . . 13-6
Contents xi
Program-Controlled Interruption . . . . 16-23 Incorrect-Length-Indication Suppression . . 17-18
Incorrect Length . . . . . . . . . . . . . 16-23 Concurrent Sense . . . . . . . . . . . . . . . 17-18
Program Check . . . . . . . . . . . . . 16-24 Channel-Subsystem Recovery . . . . . . . . 17-19
Protection Check . . . . . . . . . . . . 16-26 Channel Report . . . . . . . . . . . . . . . 17-19
Channel-Data Check . . . . . . . . . . 16-26 Channel-Report Word . . . . . . . . . . . 17-21
Channel-Control Check . . . . . . . . 16-27 Channel Subsystem I/O-Priority Facility . . 17-22
Interface-Control Check . . . . . . . . 16-28 Number of Channel Subsystem
Chaining Check . . . . . . . . . . . . . 16-29 Priority Levels . . . . . . . . . . . . 17-23
Count Field . . . . . . . . . . . . . . . . . 16-29
Extended-Status Word . . . . . . . . . . . . 16-32 Chapter 18. Hexadecimal-Floating-Point
Extended-Status Format 0 . . . . . . . . 16-32 Instructions . . . . . . . . . . . . . . . . . 18-1
Subchannel Logout . . . . . . . . . . . 16-32 HFP Arithmetic . . . . . . . . . . . . . . . . . . 18-1
Extended-Report Word . . . . . . . . . 16-36 HFP Number Representation . . . . . . . . 18-1
Failing-Storage Address . . . . . . . . 16-37 Normalization . . . . . . . . . . . . . . . . . 18-3
Secondary-CCW Address . . . . . . . 16-38 HFP Data Format . . . . . . . . . . . . . . 18-3
Extended-Status Format 1 . . . . . . . . 16-38 Instructions . . . . . . . . . . . . . . . . . . . . 18-4
Extended-Status Format 2 . . . . . . . . 16-38 ADD NORMALIZED . . . . . . . . . . . . . 18-8
Extended-Status Format 3 . . . . . . . . 16-39 ADD UNNORMALIZED . . . . . . . . . . . 18-9
Extended-Control Word . . . . . . . . . . . . 16-40 COMPARE . . . . . . . . . . . . . . . . . 18-10
CONVERT FROM FIXED . . . . . . . . . 18-11
Chapter 17. I/O Support Functions . . . . 17-1 CONVERT TO FIXED . . . . . . . . . . . 18-11
Channel-Subsystem Monitoring . . . . . . . . 17-1 DIVIDE . . . . . . . . . . . . . . . . . . . 18-12
Channel-Subsystem Timing . . . . . . . . . 17-1 HALVE . . . . . . . . . . . . . . . . . . . . 18-13
Channel-Subsystem Timer . . . . . . . . 17-2 LOAD AND TEST . . . . . . . . . . . . . 18-14
Measurement-Block Update . . . . . . . . 17-2 LOAD COMPLEMENT . . . . . . . . . . . 18-14
Measurement Block . . . . . . . . . . . . 17-3 LOAD FP INTEGER . . . . . . . . . . . . 18-15
Measurement-Block Origin . . . . . . . . 17-5 LOAD LENGTHENED . . . . . . . . . . . 18-15
Measurement-Block Key . . . . . . . . . 17-6 LOAD NEGATIVE . . . . . . . . . . . . . 18-16
Measurement-Block Index . . . . . . . . 17-6 LOAD POSITIVE . . . . . . . . . . . . . . 18-16
Measurement-Block-Update Mode . . . 17-6 LOAD ROUNDED . . . . . . . . . . . . . 18-17
Measurement-Block-Update Enable . . 17-6 MULTIPLY . . . . . . . . . . . . . . . . . 18-18
Control-Unit-Queuing Measurement . . 17-7 SQUARE ROOT . . . . . . . . . . . . . . 18-19
Control-Unit-Defer Time . . . . . . . . . 17-7 SUBTRACT NORMALIZED . . . . . . . . 18-21
Device-Active-Only Measurement . . . . 17-7 SUBTRACT UNNORMALIZED . . . . . . 18-21
Time-Interval-Measurement Accuracy . 17-7
Device-Connect-Time Measurement . . . . 17-8 Chapter 19. Binary-Floating-Point
Device-Connect-Time-Measurement Instructions . . . . . . . . . . . . . . . . . 19-1
Mode . . . . . . . . . . . . . . . . . . 17-8 Binary-Floating-Point Facility . . . . . . . . . . 19-1
Device-Connect-Time-Measurement Floating-Point-Control (FPC) Register . . . 19-2
Enable . . . . . . . . . . . . . . . . . 17-8 IEEE Masks and Flags . . . . . . . . . . 19-3
Signals and Resets . . . . . . . . . . . . . . . 17-9 FPC DXC Byte . . . . . . . . . . . . . . 19-3
Signals . . . . . . . . . . . . . . . . . . . . . 17-9 Operations on the FPC Register . . . . 19-3
Halt Signal . . . . . . . . . . . . . . . . . 17-9 BFP Arithmetic . . . . . . . . . . . . . . . . . . 19-4
Clear Signal . . . . . . . . . . . . . . . . 17-9 BFP Data Formats . . . . . . . . . . . . . . 19-4
Reset Signal . . . . . . . . . . . . . . . 17-10 BFP Short Format . . . . . . . . . . . . . 19-4
Resets . . . . . . . . . . . . . . . . . . . . 17-10 BFP Long Format . . . . . . . . . . . . . 19-4
Channel-Path Reset . . . . . . . . . . 17-10 BFP Extended Format . . . . . . . . . . 19-4
I/O-System Reset . . . . . . . . . . . . 17-10 Biased Exponent . . . . . . . . . . . . . 19-4
Externally Initiated Functions . . . . . . . . 17-14 Significand . . . . . . . . . . . . . . . . . 19-4
Initial Program Loading . . . . . . . . . . 17-15 Values of Nonzero Numbers . . . . . . 19-4
Reconfiguration of the I/O System . . . . 17-17 Classes of BFP Data . . . . . . . . . . . . 19-5
Status Verification . . . . . . . . . . . . . . . 17-17 Zeros . . . . . . . . . . . . . . . . . . . . 19-6
Address-Limit Checking . . . . . . . . . . . 17-17 Denormalized Numbers . . . . . . . . . 19-6
Configuration Alert . . . . . . . . . . . . . . 17-18 Normalized Numbers . . . . . . . . . . . 19-6
Contents xiii
MOVE STRING (MVST) . . . . . . . . . . A-26 MULTIPLY (MD, MDR, MDE, MDER,
MOVE WITH OFFSET (MVO) . . . . . . A-26 MXD, MXDR, MXR) . . . . . . . . . . . A-41
MOVE ZONES (MVZ) . . . . . . . . . . . A-27 Hexadecimal-Floating-Point-Number
MULTIPLY (M, MR) . . . . . . . . . . . . A-27 Conversion . . . . . . . . . . . . . . . . A-42
MULTIPLY HALFWORD (MH) . . . . . . A-27 Fixed Point to Hexadecimal Floating
OR (O, OC, OI, OR) . . . . . . . . . . . . A-28 Point . . . . . . . . . . . . . . . . . . A-42
OI Example . . . . . . . . . . . . . . . A-28 Hexadecimal Floating Point to Fixed
PACK (PACK) . . . . . . . . . . . . . . . A-28 Point . . . . . . . . . . . . . . . . . . A-42
SEARCH STRING (SRST) . . . . . . . . A-29 Multiprogramming and Multiprocessing
SRST Example 1 . . . . . . . . . . . . A-29 Examples . . . . . . . . . . . . . . . . . . A-43
SRST Example 2 . . . . . . . . . . . . A-29 Example of a Program Failure Using OR
SHIFT LEFT DOUBLE (SLDA) . . . . . . A-29 Immediate . . . . . . . . . . . . . . . . A-43
SHIFT LEFT SINGLE (SLA) . . . . . . . A-30 Conditional Swapping Instructions (CS,
STORE CHARACTERS UNDER MASK CDS) . . . . . . . . . . . . . . . . . . . A-44
(STCM) . . . . . . . . . . . . . . . . . . A-30 Setting a Single Bit . . . . . . . . . . . A-44
STORE MULTIPLE (STM) . . . . . . . . A-30 Updating Counters . . . . . . . . . . . A-45
TEST UNDER MASK (TM) . . . . . . . . A-31 Bypassing Post and Wait . . . . . . . . . A-45
TRANSLATE (TR) . . . . . . . . . . . . . A-31 Bypass Post Routine . . . . . . . . . . A-45
TRANSLATE AND TEST (TRT) . . . . . A-32 Bypass Wait Routine . . . . . . . . . . A-46
UNPACK (UNPK) . . . . . . . . . . . . . A-33 Lock/Unlock . . . . . . . . . . . . . . . . . A-46
UPDATE TREE (UPT) . . . . . . . . . . . A-34 Lock/Unlock with LIFO Queuing for
Decimal Instructions . . . . . . . . . . . . . . A-34 Contentions . . . . . . . . . . . . . . A-46
ADD DECIMAL (AP) . . . . . . . . . . . . A-34 Lock/Unlock with FIFO Queuing for
COMPARE DECIMAL (CP) . . . . . . . . A-34 Contentions . . . . . . . . . . . . . . A-47
DIVIDE DECIMAL (DP) . . . . . . . . . . A-34 Free-Pool Manipulation . . . . . . . . . . A-48
EDIT (ED) . . . . . . . . . . . . . . . . . . A-35 PERFORM LOCKED OPERATION (PLO) A-50
EDIT AND MARK (EDMK) . . . . . . . . A-36 Sorting Instructions . . . . . . . . . . . . . . A-51
MULTIPLY DECIMAL (MP) . . . . . . . . A-36 Tree Format . . . . . . . . . . . . . . . . . A-51
SHIFT AND ROUND DECIMAL (SRP) . A-37 Example of Use of Sort Instructions . . . A-53
Decimal Left Shift . . . . . . . . . . . . A-37
Decimal Right Shift . . . . . . . . . . . A-37 Appendix B. Lists of Instructions . . . . . B-1
Decimal Right Shift and Round . . . . A-38
Multiplying by a Variable Power of 10 . A-38 Appendix C. Condition-Code Settings . . C-1
ZERO AND ADD (ZAP) . . . . . . . . . . A-38
Hexadecimal-Floating-Point Instructions . . A-39 Appendix G. Table of Powers of 2 . . . . . G-1
ADD NORMALIZED (AD, ADR, AE, AER,
AXR) . . . . . . . . . . . . . . . . . . . . A-39 Appendix H. Hexadecimal Tables . . . . . H-1
ADD UNNORMALIZED (AU, AUR, AW,
AWR) . . . . . . . . . . . . . . . . . . . A-39 Appendix I. EBCDIC and Other Codes . . . I-1
COMPARE (CD, CDR, CE, CER) . . . . A-40
DIVIDE (DD, DDR, DE, DER) . . . . . . A-40 Index . . . . . . . . . . . . . . . . . . . . . . . X-1
HALVE (HDR, HER) . . . . . . . . . . . . A-41
All facilities discussed in this publication are not Chapter 4, Control, describes the facilities for the
necessarily available on every model. Further- switching of system status, for special externally
more, in some instances the definitions have been initiated operations, for debugging, and for timing.
structured to allow for some degree of It deals specifically with CPU states, control
extendibility, and therefore certain capabilities may modes, the program-status word (PSW), control
be described or implied that are not offered on registers, tracing, program-event recording, timing
any model. Examples of such capabilities are the facilities, resets, store status, and initial program
use of a 16-bit field in the subsystem-identification loading.
word to identify the channel subsystem, the size of
the CPU address, and the number of CPUs Chapter 5, Program Execution, explains the role of
sharing main storage. The allowance for this type instructions in program execution, looks in detail at
of extendibility should not be construed as instruction formats, and describes briefly the use
implying any intention by IBM to provide such of the program-status word (PSW), of branching,
capabilities. For information about the character- and of interruptions. It contains the principal
istics and availability of facilities on a specific description of the advanced address-space facili-
model, see the functional characteristics publica- ties that were introduced in ESA/370*. It also
tion for that model. details the aspects of program execution on one
z/Architecture, Enterprise Systems Architecture/390, ESA/390, and ESA/370 are trademarks of the International Business
Machines Corporation.
Chapter 6, Interruptions, details the mechanism Chapter 15, Basic I/O Functions, describes the
that permits the CPU to change its state as a basic I/O functions performed by the channel sub-
result of conditions external to the system, within system, including the initiation, control, and con-
the system, or within the CPU itself. Six classes clusion of I/O operations.
of interruptions are identified and described:
machine-check interruptions, program inter- Chapter 16, I/O Interruptions, covers I/O inter-
ruptions, supervisor-call interruptions, external ruptions and interruption conditions.
interruptions, input/output interruptions, and restart
interruptions. Chapter 17, I/O Support Functions, describes such
functions as channel-subsystem usage monitoring,
Chapter 7, General Instructions, contains detailed resets, initial-program loading, reconfiguration, and
descriptions of logical and binary-integer data channel-subsystem recovery.
formats and of all unprivileged instructions except
the decimal and floating-point instructions. Chapter 18, Hexadecimal-Floating-Point
Instructions, contains detailed descriptions of the
Chapter 8, Decimal Instructions, describes in hexadecimal-floating-point (HFP) data formats and
detail decimal data formats and the decimal the HFP instructions.
instructions.
Chapter 19, Binary-Floating-Point Instructions,
Chapter 9, Floating-Point Overview and Support contains detailed descriptions of the binary-
Instructions, includes an introduction to the floating-point (BFP) data formats and the BFP
floating-point operations, detailed descriptions of instructions.
those instructions common to both hexadecimal-
floating-point and binary-floating-point operations, The Appendixes include:
and summaries of all floating-point instructions. Information about number representation
Instruction-use examples
Chapter 10, Control Instructions, contains detailed Lists of the instructions arranged in several
descriptions of all of the semiprivileged and privi- sequences
leged instructions except for the I/O instructions. A summary of the condition-code settings
A table of the powers of 2
Chapter 11, Machine-Check Handling, describes
Tabular information helpful in dealing with
the mechanisms for detecting, correcting, and
hexadecimal numbers
reporting machine malfunctions.
A table of EBCDIC and other codes.
Chapter 12, Operator Facilities, describes the
basic manual functions and controls available for Size and Number Notation
operating and controlling the system.
In this publication, the letters K, M, G, T, P, and E
Chapters 13-17 of this publication provide a denote the multipliers 2, 2, 2, 2, 2, and
detailed definition of the functions performed by 2, respectively. Although the letters are bor-
the channel subsystem and the logical interface rowed from the decimal system and stand for kilo
between the CPU and the channel subsystem. (10), mega (10), giga (10), tera (10), peta
(10), and exa (10), they do not have the
Chapter 13, I/O Overview, provides a brief decimal meaning but instead represent the power
description of the basic components and operation of 2 closest to the corresponding power of 10.
of the channel subsystem. Their meaning in this publication is as follows:
K (kilo) 1,24 = 2
In this publication, unless otherwise specified, the
M (mega) 1,48,576 = 2 value given for a byte is the value obtained by
considering the bits of the byte to represent a
G (giga) 1,73,741,824 = 2 binary code. Thus, when a byte is said to contain
a zero, the value 00000000 binary, or 00 hex, is
T (tera) 1,99,511,627,776 = 2 meant, and not the value for an EBCDIC character
P (peta) 1,125,899,96,842,624 = 2 0, which would be F0 hex.
E (exa) 1,152,921,54,66,846,976 = 2 Other Publications
The following are some examples of the use of K, The parallel-I/O interface is described in the publi-
M, G, T, and E: cation IBM System/360 and System/370 I/O Inter-
face Channel to Control Unit Original Equipment
2,048 is expressed as 2K.
Manufacturers' Information, GA22-6974.
4,096 is expressed as 4K.
65,536 is expressed as 64K (not 65K).
The parallel-I/O channel-to-channel adapter is
2 is expressed as 16M.
described in the publication IBM Enterprise
2 is expressed as 2G.
Systems Architecture/390 Channel-to-Channel
2 is expressed as 4T.
Adapter for the System/360 and System/370 I/O
2 is expressed as 16E.
Interface, SA22-7091.
When the words thousand and million are
used, no special power-of-2 meaning is assigned The Enterprise Systems Connection Architecture*
to them. (ESCON*) I/O interface, referred to in this publi-
cation along with the FICON I/O interface as the
All numbers in this publication are in decimal serial-I/O interface, is described in the publication
unless they are explicitly noted as being in binary IBM Enterprise Systems Architecture/390 ESCON
or hexadecimal (hex). I/O Interface, SA22-7202.
Enterprise Systems Connection Architecture and ESCON are trademarks of the International Business Machines Corporation.
Preface xix
z/Architecture form of the COMPRESSION CALL The interpretive-execution facility is described in
instruction is described in this publication. the publication IBM 370-XA Interpretive Execution,
SA22-7095.
This publication provides, for reference purposes, A 64-bit addressing mode, in addition to the
a detailed description of z/Architecture. 24-bit and 31-bit addressing modes of
ESA/390, which are carried forward to
The architecture of a system defines its attributes z/Architecture.
as seen by the programmer, that is, the concep-
Both operand addresses and instruction
tual structure and functional behavior of the
addresses can be 64-bit addresses. The
machine, as distinct from the organization of the
program-status word (PSW) is expanded to 16
data flow, the logical design, the physical design,
bytes to contain the larger instruction address.
and the performance of any particular implementa-
The PSW also contains a newly assigned bit
tion. Several dissimilar machine implementations
that specifies the 64-bit addressing mode.
may conform to a single architecture. When the
execution of a set of programs on different Up to three additional levels of dynamic-
machine implementations produces the results address-translation (DAT) tables, called region
that are defined by a single architecture, the tables, for translating 64-bit virtual addresses.
implementations are considered to be compatible
A virtual address space may be specified
for those programs.
either by a segment-table designation as in
ESA/390 or by a region-table designation, and
either of these types of designation is called
Highlights of z/Architecture an address-space-control element (ASCE).
z/Architecture is the next step in the evolution An ASCE may alternatively be a real-space
from the System/360 to the System/370, designation that causes virtual addresses to
System/370 extended architecture (370-XA), be treated simply as real addresses without
Enterprise Systems Architecture/370* (ESA/370), the use of DAT tables.
and Enterprise Systems Architecture/390
An 8K-byte prefix area for containing larger
(ESA/390). z/Architecture includes all of the facili-
old and new PSWs and register save areas.
ties of ESA/390 except for the asynchronous-
pageout, asynchronous-data-mover, A SIGNAL PROCESSOR order for switching
program-call-fast, and vector facilities. between the ESA/390 and z/Architecture
z/Architecture also provides significant extensions, architectural modes.
as follows: Initial program loading sets the ESA/390 archi-
Sixty-four-bit general registers and control reg- tectural mode. The new SIGNAL
isters. PROCESSOR order then can be used to set
the z/Architecture mode or to return from
OS/390 and z/OS are trademarks of the International Business Machines Corporation.
AIX/ESA, CICS, and MVS/ESA are trademarks of the International Business Machines Corporation.
MVS/ESA, VM/ESA, Sysplex Timer, and DB2 are trademarks of the International Business Machines Corporation.
PR/SM LPAR mode is enhanced to allow up The COMPARE AND FORM CODEWORD
to 10 logical partitions in a single-image con- and UPDATE TREE instructions facilitate
figuration and 20 in a physically-partitioned sorting applications.
configuration. The previous limits were seven The interpretive-execution facility allows cre-
and 14, respectively. (June, 1992) ation of virtual machines that may operate
Coincident with z/Architecture, PR/SM LPAR according to several architectures and whose
mode allows 15 logical partitions, and physical performance is enhanced because many
partitioning is not supported. virtual-machine functions are directly inter-
preted by the machine rather than simulated
The coupling facility enables high-performance by the program. This facility is described in
data sharing among MVS/ESA systems that
Processor Resource/Systems Manager and PR/SM are trademarks of the International Business Machines Corporation.
Logically, a system consists of main storage, one /ETR/
or more central processing units (CPUs), operator
facilities, a channel subsystem, and I/O devices.
I/O devices are attached to the channel sub-
system through control units. The connection
CPU
between the channel subsystem and a control unit
is called a channel path.
A channel path employs either a parallel- Expanded Storage Main Storage
transmission protocol or a serial-transmission pro- CPU
tocol and, accordingly, is called either a parallel or
Crypto
a serial channel path. A serial channel path may
connect to a control unit through a dynamic switch
that is capable of providing different internal con-
nections between the ports of the switch.
Expanded storage may also be available in the
system, a cryptographic unit may be included in a Channel
Subsystem
CPU, and an external time reference (ETR) may
be connected to the system. ............... ...
Serial Channel Paths Parallel Channel Paths
The physical identity of the above functions may
/ / /
vary among implementations, called models.
Figure 2-1 depicts the logical structure of a Dynamic Dynamic /
Switch Switch
two-CPU multiprocessing system that includes CU CU/
expanded storage and a cryptographic unit and ... ... O O O
that is connected to an ETR. /
O O O
Specific processors may differ in their internal CU
characteristics, the installed facilities, the number CUCU CU /
of subchannels, channel paths, and control units
CU/
which can be attached to the channel subsystem, / CU/ O O O
the size of main and expanded storage, and the O O O O O O
/ /
representation of the operator facilities. O O O O O O
Figure 2-1. Logical Structure of an ESA/390 System
with Two CPUs
5 5
1 1 5 %
1 2 5 5
11 3 5 %
1 4 5 5
11 5 5 %
11 6 5 5
111 7 5 %
1 8 5 5
11 9 5 %
11 1 5 5
111 11 5 %
11 12 5 5
111 13 5 %
111 14 5 5
1111 15 5 %
Note: The arrows indicate that the two registers may be coupled as a double-register pair,
designated by specifying the lower-numbered register in the R field. For example, the floating-point
register pair 13 and 15 is designated by 1101 binary in the R field.
Figure 2-2. Control, Access, General, and Floating-Point Registers
The channel subsystem directs the flow of infor- ESCON I/O interface, called a serial-I/O inter-
mation between I/O devices and main storage. It face; the channel path is called a serial
relieves CPUs of the task of communicating channel path
directly with I/O devices and permits data proc- FICON I/O interface, also called a serial-I/O
essing to proceed concurrently with I/O proc- interface; the channel path again is called a
essing. The channel subsystem uses one or more serial channel path
channel paths as the communication link in man-
Each parallel-I/O interface consists of a number of
aging the flow of information to or from I/O
electrical signal lines between the channel sub-
devices. As part of I/O processing, the channel
system and one or more control units. Eight
subsystem also performs the path-management
control units can share a single parallel-I/O inter-
function of testing for channel-path availability,
face. Up to 256 I/O devices can be addressed on
selecting an available channel path, and initiating
a single parallel-I/O interface. The parallel-I/O
execution of the operation with the I/O device.
interface is described in the publication IBM
Within the channel subsystem are subchannels.
System/360 and System/370 I/O Interface
One subchannel is provided for and dedicated to Channel to Control Unit Original Equipment Man-
each I/O device accessible to the channel sub- ufacturers' Information, GA22-6974.
system. Each subchannel contains storage for
Each serial-I/O interface consists of two optical-
information concerning the associated I/O device
fiber conductors between any two of a channel
and its attachment to the channel subsystem. The
subsystem, a dynamic switch, and a control unit.
subchannel also provides storage for information
A dynamic switch can be connected by means of
concerning I/O operations and other functions
multiple serial-I/O interfaces to either the same or
involving the associated I/O device. Information
different channel subsystems and to multiple
contained in the subchannel can be accessed by
control units. The number of control units which
This chapter discusses the representation of infor- address spaces, the various types of addresses,
mation in main storage, as well as addressing, and the manner in which one type of address is
protection, and reference and change recording. translated to another type of address. A list of
The aspects of addressing which are covered permanently assigned storage locations appears
include the format of addresses, the concept of at the end of the chapter.
Instructions and operands when EAM and BAM are zero L,I,R,V W24
Successive bytes of instructions and operands when EAM and I,L,V W24
BAM are zero
Instructions and operands when EAM is zero and BAM is one L,I,R,V W31
Successive bytes of instructions and operands when EAM is I,L,V W31
zero and BAM is one
Instructions and operands when EAM and BAM are one L,I,R,V W64
Successive bytes of instructions and operands when EAM and I,L,V W64
BAM are one
DAT-table entries when used for implicit translation or LRA A or R X64
or STRAG
ASN-second-table, authority-table (during ASN authorization), R X31
linkage-table, and entry-table entries
Authority-table (during access-register translation) and A or R X31
access-list entries
Linkage-stack entry V W64
I/O measurement block A P31
For a channel program with format- CCWs:
Successive CCWs A P24
Successive IDAWs A P24
Successive bytes of I/O data (without IDAWs) A P24
Successive bytes of I/O data (with format-1 IDAWs) A P31
Successive bytes of I/O data (with format-2 IDAWs) A P64
For a channel program with format-1 CCWs:
Successive CCWs A P31
Successive IDAWs A P31
Successive bytes of I/O data (without IDAWs) A P31
Successive bytes of I/O data (with format-1 IDAWs) A P31
Successive bytes of I/O data (with format-2 IDAWs) A P64
1 The suppression-on-protection function originated as the ESA/390 suppression-on-protection facility. Suppression for page pro-
tection was new as part of that facility.
Figure 3-4. Suppression-on-Protection Results The change bit is not set to one for an attempt to
store if the access is prohibited. In particular:
1. For the CPU, a store access is prohibited
Reference Recording whenever an access exception exists for that
Reference recording provides information for use access, or whenever an exception exists
in selecting pages for replacement. Reference which is of higher priority than the priority of
recording uses the reference bit, bit 5 of the an access exception for that access.
storage key. The reference bit is set to one each 2. For the channel subsystem, a store access is
time a location in the corresponding storage block prohibited whenever a key-controlled-
is referred to either for fetching or storing informa- protection violation exists for that access.
tion, regardless of whether DAT is on or off.
Change recording is always active and takes
Reference recording is always active and takes place for all store accesses to storage, including
place for all storage accesses, including those those made by any CPU, any operator facility, or
made by any CPU, any operator facility, or the the channel subsystem. It takes place for implicit
channel subsystem. It takes place for implicit references made by the machine, such as those
accesses made by the machine, such as those which are part of interruptions.
which are part of interruptions and I/O-instruction
execution.
The relationship between real and absolute The distinction between real and absolute
addresses is graphically depicted in Figure 3-5 on addresses is made even when the prefix register
page 3-16. contains all zeros, in which case a real address
and its corresponding absolute address are iden-
The prefix is a 51-bit quantity contained in bit posi- tical.
tions 0-50 of the prefix register. The register has
the following format:
(1) Real addresses in which bits 0-50 are equal to bits 0-50 of the prefix for this CPU (A or B).
(2) Absolute addresses of the block that contains for this CPU (A or B) the real locations 0-8191.
Figure 3-5. Relationship between Real and Absolute Addresses
ASN Translation The AFX is used to select an entry from the ASN
ASN translation is the process of translating a first table. The origin of the ASN first table is des-
16-bit ASN to locate the ASN-second-table entry ignated by the ASN-first-table origin in control reg-
designated by the ASN. ASN translation is per- ister 14. The ASN-first-table entry contains the
formed as part of PROGRAM TRANSFER with origin of the ASN second table. The ASX is used
space switching (PT-ss) and SET SECONDARY to select an entry from the ASN second table.
ASN with space switching (SSAR-ss), and it may
be performed as part of LOAD ADDRESS SPACE As a result of primary ASN translation and during
PARAMETERS. For PT-ss, the ASN which is the operation of PROGRAM CALL with space
translated replaces the primary ASN in control switching, the address of the located
register 4. For SSAR-ss, the ASN which is trans- ASN-second-table entry (ASTE) is placed in
lated replaces the secondary ASN in control reg- control register 5 as the new primary-ASTE origin
ister 3. These two translation processes are (PASTEO).
called primary ASN translation and secondary
ASN translation, respectively, and both can occur ASN-Translation Controls
for LOAD ADDRESS SPACE PARAMETERS.
The ASN-translation process is the same for both ASN translation is controlled by the
primary and secondary ASN translation; only the ASN-translation-control bit and the ASN-first-table
uses of the results of the process are different. origin, both of which reside in control register 14.
I ASTO
ASTESN
1 26 31
16 191
The fields in the entry are allocated as follows:
LTD
AFX-Invalid Bit (I): Bit 0 controls whether the
ASN second table associated with the V LTO LTL
ASN-first-table entry is available. When bit 0 is
zero, ASN translation proceeds by using the des- 192 217 223
ignated ASN second table. When the bit is one,
the ASN translation cannot continue.
/////////////////////////////////
ASN-Second-Table Origin (ASTO): Bits 1-25,
224 255
with six zeros appended on the right, are used to
form a 31-bit real address that designates the
beginning of the ASN second table. The fields in bytes 0-31 of the ASN-second-table
entry are allocated as follows. Only the fields that
ASN-Second-Table Entries are used in or as a result of ASN translation or
The ASN-second-table entry has a length of 64 PROGRAM CALL with space switching are
bytes, with only the first 32 bytes currently in use. described in detail.
Bytes 0-31 of the entry have the following format:
ASX-Invalid Bit (I): Bit 0 controls whether the
address space associated with the
I ATO B ASN-second-table entry is available. When bit 0
is zero, ASN translation proceeds. When the bit is
1 3 31 one, the ASN translation cannot continue.
Base-Space Bit (B): Bit 31 specifies, when one, The subspace-group-control bit (G), bit 118 of the
that the address space associated with the ASCE field, indicates, when one, that the ASCE
ASN-second-table entry is the base space of a specifies an address space that is the base space
subspace group. Bit 31 is further described in or a subspace of a subspace group. The bit is
Subspace-Group ASN-Second-Table Entries on further described in Subspace-Group
page 5-57. ASN-Second-Table Entries on page 5-57.
Authorization Index (AX): Bits 32-47 are used Bit 121 (X) of the ASCE field is the space-switch-
in ASN authorization as an index to locate the event-control bit. When, in the space-switching
authority bits in the authority table. The AX field is operations of PROGRAM CALL, PROGRAM
used as a result of primary ASN translation by RETURN, and PROGRAM TRANSFER, this bit is
PROGRAM RETURN and PROGRAM one in control register 1 either before or after the
TRANSFER and, possibly, LOAD ADDRESS execution of the instruction, a program interruption
SPACE PARAMETERS. It is also used by for a space-switch event occurs after the exe-
PROGRAM CALL with space switching. The AX cution of the instruction is completed. A space-
field is ignored after secondary ASN translation. switch-event program interruption also occurs after
the completion of a SET ADDRESS SPACE
Authority-Table Length (ATL): Bits 48-59 CONTROL, SET ADDRESS SPACE CONTROL
specify the length of the authority table in units of FAST, or RESUME PROGRAM instruction that
four bytes, thus making the authority table variable changes the translation mode either to or from the
in multiples of 16 entries. The length of the home-space mode when this bit is one in either
authority table, in units of four bytes, is one more control register 1 or control register 13. When, in
than the ATL value. The contents of the ATL field LOAD ADDRESS SPACE PARAMETERS, this bit
are used to establish whether the entry designated is one during primary ASN translation, this fact is
by a particular AX falls within the authority table. indicated by the condition code.
Address-Space-Control Element (ASCE): Bits The real-space-control bit (R), bit 122 of the ASCE
64-127 are an eight-byte address-space-control field, indicates, when zero, that the ASCE is a
element (ASCE) that may be a region-table desig- region-table or segment-table designation or,
nation (RTD), a segment-table designation (STD), when one, that the ASCE is a real-space desig-
or a real-space designation (RSD). (The term nation.
region-table designation is used to mean a
region-first-table designation, region-second-table When bit 122 is zero, the designation-type-control
designation, or region-third-table designation.) bits (DT), bits 124 and 125 of the ASCE field, indi-
The ASCE field is used as a result of ASN trans- cate the designation type of the ASCE. A value
lation or in PROGRAM CALL with space switching 11, 10, 01, or 00 binary of bits 124 and 125 indi-
to replace the primary ASCE (PASCE) or the sec- cates a region-first-table designation, region-
ondary ASCE (SASCE). For PROGRAM CALL second-table designation, region-third-table
with space switching, the ASCE field replaces the designation, or segment-table designation, respec-
PASCE, bits 0-63 of control register 1. For SET tively.
SECONDARY ASN, the ASCE field replaces the
SASCE, bits 0-63 of control register 7. Each of The other fields in the ASCE (RTO, STO, P, S,
these actions may occur independently for LOAD TL, and RSTKO) are described in Control Reg-
ADDRESS SPACE PARAMETERS. For ister 1 on page 3-29.
PROGRAM TRANSFER, the ASCE field replaces
both the PASCE and the SASCE. For PROGRAM The linkage-table-designation (LTD) field in the
RETURN, as a result of primary ASN translation, ASN-second-table entry is described in
the ASCE field replaces the PASCE, and, as a PC-Number Translation Control on page 5-29.
result of secondary ASN translation, the ASCE The access-list-designation (ALD) field and the
R: Address is real
\: Last 48 bytes of ASTE are not shown
Figure 3-6. ASN Translation
The 31-bit real address of the ASN-second-table ASN authorization is also performed as part of
entry is obtained by appending six zeros on the PROGRAM RETURN when the restored sec-
right to bits 1-25 of the ASN-first-table entry and ondary ASN does not equal the restored primary
adding the ASX with six rightmost and 19 leftmost ASN. ASN authorization of the restored sec-
zeros appended. When a carry into bit position 0 ondary ASN is performed after ASN translation of
occurs during the addition, an addressing excep- the restored secondary ASN.
tion may be recognized, or the carry may be
ignored, causing the table to wrap from 2 - 1 to When performed as part of PT-ss, the ASN
zero. The 31-bit address is formed and used authorization tests whether the ASN can be estab-
regardless of whether the current PSW specifies lished as the primary ASN and is called
the 24-bit, 31-bit, or 64-bit addressing mode. primary-ASN authorization. When performed as
part of LOAD ADDRESS SPACE PARAMETERS,
The fetch of the 64 bytes of the ASN-second-table PROGRAM RETURN, or SSAR-ss, the ASN
entry appears to be word-concurrent as observed authorization tests whether the ASN can be estab-
by other CPUs, with the leftmost word fetched lished as the secondary ASN and is called
first. The order in which the remaining 15 words secondary-ASN authorization.
are fetched is unpredictable. The fetch access is
not subject to protection. When the storage The ASN authorization is performed by means of
address which is generated for fetching the an authority table in real storage which is desig-
ASN-second-table entry designates a location nated by the authority-table-origin and authority-
which is not available in the configuration, an table-length fields in the ASN-second-table entry.
addressing exception is recognized, and the oper-
ation is suppressed. ASN-Authorization Controls
Bit 0 of the ASN-second-table entry specifies ASN authorization uses the authority-table origin
whether the address space is accessible. If this and the authority-table length from the
bit is one, an ASX-translation exception is recog- ASN-second-table entry, together with an authori-
nized. zation index.
6
Authority Table
5+
For primary ASN authorization (PT-ss only):
Primary-authority exception if P bit
zero or table length exceeded.
5
R PS For secondary ASN authorization (PR and SSAR-ss only):
Secondary-authority exception if S bit
zero or table length exceeded.
For secondary ASN authorization (LASP only):
Set condition code 2 if S bit zero or
table length exceeded.
R: Address is real
\: Last 48 bytes of ASTE are not shown
Figure 3-7. ASN Authorization
Authority-Table Lookup zeros appended on the left. When a carry into bit
The authorization index, in conjunction with the position 0 occurs during the addition, an
authority-table origin contained in the addressing exception may be recognized, or the
ASN-second-table entry, is used to select an entry carry may be ignored, causing the table to wrap
from the authority table. from 2 - 1 to zero. The 31-bit address is
formed and used regardless of whether the
The authorization index is contained in bit posi- current PSW specifies the 24-bit, 31-bit, or 64-bit
tions 32-47 of control register 4. addressing mode.
Bit positions 1-29 of the AST entry contain the left- As part of the authority-table-entry-lookup process,
most 29 bits of the 31-bit real address of the bits 0-11 of the authorization index are compared
authority table (ATO), and bit positions 48-59 against the authority-table length. If the compared
contain the length of the authority table (ATL). portion is greater than the authority-table length, a
primary-authority exception or secondary-authority
The 31-bit real address of a byte in the authority exception is recognized for PT-ss or SSAR-ss,
table is obtained by appending two zeros on the respectively. For LOAD ADDRESS SPACE
right to the authority-table origin and adding the 14 PARAMETERS, when the authority-table length is
leftmost bits of the authorization index with 17 exceeded, condition code 2 is set.
1
With appropriate support by an operating system,
1 2 3 the dynamic-address-translation facility may be
used to provide to a user a system wherein
1 4 5 storage appears to be larger than the main
storage which is available in the configuration.
1 1 6 7
This apparent main storage is referred to as virtual
storage, and the addresses used to designate
If the selected bit is one, the ASN is authorized, locations in the virtual storage are referred to as
and the appropriate fields in the AST entry are virtual addresses. The virtual storage of a user
loaded into the appropriate control registers. If the may far exceed the size of the main storage which
selected bit is zero, the ASN is not authorized, is available in the configuration and normally is
and a primary-authority exception is recognized for maintained in auxiliary storage. The virtual
PT-ss or a secondary-authority exception is recog- storage is considered to be composed of blocks of
nized for SSAR-ss or PROGRAM RETURN. For addresses, called pages. Only the most recently
LOAD ADDRESS SPACE PARAMETERS, when referred-to pages of the virtual storage are
the ASN is not authorized, condition code 2 is set. assigned to occupy blocks of physical main
storage. As the user refers to pages of virtual
Recognition of Exceptions during ASN storage that do not appear in main storage, they
Authorization are brought in to replace pages in main storage
The exceptions which can be encountered during that are less likely to be needed. The swapping of
the primary- and secondary-ASN-authorization pages of storage may be performed by the oper-
processes and their priorities are described in the ating system without the user's knowledge.
definitions of the instructions in which ASN author-
ization is performed. The sequence of virtual addresses associated with
a virtual storage is called an address space. With
Programming Note: The primary- and
appropriate support by an operating system, the
secondary-authority exceptions cause nullification
In the process of replacing blocks of main storage In the process of translation when using a
by new information from an external medium, it segment-table designation or a region-table desig-
must be determined which block to replace and nation, three types of units of information are
whether the block being replaced should be recognizedregions, segments, and pages. A
recorded and preserved in auxiliary storage. To region is a block of sequential virtual addresses
aid in this decision process, a reference bit and a spanning 2G bytes and beginning at a 2G-byte
change bit are associated with the storage key. boundary. A segment is a block of sequential
virtual addresses spanning 1M bytes and begin-
Dynamic address translation may be specified for ning at a 1M-byte boundary. A page is a block of
instruction and data addresses generated by the sequential virtual addresses spanning 4K bytes
CPU but is not available for the addressing of data and beginning at a 4K-byte boundary.
and of CCWs and IDAWs in I/O operations. The
CCW-indirect-data-addressing facility is provided The virtual address, accordingly, is divided into
to aid I/O operations in a virtual-storage environ- four principal fields. Bits 0-32 are called the
ment. region index (RX), bits 33-43 are called the
segment index (SX), bits 44-51 are called the
Address computation can be carried out in the page index (PX), and bits 52-63 are called the
24-bit, 31-bit, or 64-bit addressing mode. When byte index (BX). The virtual address has the fol-
address computation is performed in the 24-bit or lowing format:
31-bit addressing mode, 40 or 33 zeros, respec- /
tively, are appended on the left to form a 64-bit RX SX PX BX
address. Therefore, the resultant logical address /
is always 64 bits in length. The real address that 33 44 52 63
is formed by dynamic address translation, and the As determined by its address-space-control
absolute address that is then formed by prefixing, element, a virtual address space may be a
are always 64 bits in length. 2G-byte space consisting of one region, or it may
be up to a 16E-byte space consisting of up to 8G
Dynamic address translation is the process of
regions. The RX part of a virtual address applying
translating a virtual address during a storage refer-
to a 2G-byte address space must be all zeros;
ence into the corresponding real address. The
otherwise, an exception is recognized.
virtual address may be a primary virtual address,
secondary virtual address, AR-specified virtual The RX part of a virtual address is itself divided
address, or home virtual address. These into three fields. Bits 0-10 are called the region
11 22 33
Translation Control
A virtual address in which the RTX is the leftmost
significant part (a 42-bit address) is capable of Address translation is controlled by three bits in
addressing 4T bytes (2K regions), one in which the PSW and by a set of bits referred to as the
the RSX is the leftmost significant part (a 53-bit translation parameters. The translation parame-
address) is capable of addressing 8P bytes (4M ters are in control registers 0, 1, 7, and 13. Addi-
regions), and one in which the RFX is the leftmost tional controls are located in the translation tables.
significant part (a 64-bit address) is capable of
addressing 16E bytes (8G regions). Additional controls are provided as described in
Chapter 5, Program Execution. These controls
A virtual address in which the RX is always zero determine whether the contents of each access
can be translated into real addresses by means of register can be used to obtain an address-space-
two translation tables: a segment table and a control element for use by DAT.
page table. If the RX may be nonzero, from one
to three additional translation tables are required, Translation Modes
as follows. If the RFX may be nonzero, a region The three bits in the PSW that control dynamic
first table, region second table, and region third address translation are bit 5, the DAT-mode bit,
table are required. If the RFX is always zero but and bits 16 and 17, the address-space-control
the RSX may be nonzero, a region second table bits. When the DAT-mode bit is zero, then DAT is
and region third table are required. If the RFX off, and the CPU is in the real mode. When the
and RSX are always zero but the RTX may be DAT-mode bit is one, then DAT is on, and the
nonzero, a region third table is required. An CPU is in the translation mode designated by the
exception is recognized if the address-space- address-space-control bits: 00 designates the
control element for an address space does not primary-space mode, 01 designates the access-
designate the highest level of table (beginning with register mode, 10 designates the secondary-space
the region first table and continuing downward to mode, and 11 designates the home-space mode.
the segment table) needed to translate a refer- The various modes are shown in Figure 3-8,
ence to the address space. along with the handling of addresses in each
mode.
A region first table, region second table, or region
third table is sometimes referred to simply as a Handling of Addresses
region table. Similarly, a region-first-table desig- PSW Bit
Instruction Logical
nation, region-second-table designation, or region- 51617DAT Mode Addresses Addresses
third-table designation is sometimes referred to as
OffReal mode Real Real
a region-table designation. 1OffReal mode Real Real
1 OffReal mode Real Real
The region, segment, and page tables reflect the 1 1OffReal mode Real Real
1 On Primary-space mode Primary Primary
current assignment of real storage. The assign- virtual virtual
ment of real storage occurs in units of pages, the 1 1On Access-register mode Primary AR-speci-
virtual fied
real locations being assigned contiguously within a virtual
page. The pages need not be adjacent in real 1 1 On Secondary-space mode Primary Secondary
virtual virtual
storage even though assigned to a set of sequen- 1 1 1On Home-space mode Home Home
tial virtual addresses. virtual virtual
Figure 3-8. Translation Modes
S subspace group.
S
Primary Private-Space Control (P): If bit 55 of
37 control register 1 is one, then (1) a one value of
the common-segment bit in a translation-
Secondary-Space Control (SS): Bit 37 of lookaside-buffer (TLB) representation of a
control register 0 is the secondary-space-control segment-table entry prevents the entry and the
bit. When this bit is zero and execution of MOVE TLB page-table copy it designates from being
TO PRIMARY, MOVE TO SECONDARY, or SET used when translating references to the primary
ADDRESS SPACE CONTROL is attempted, a address space, even with a match between the
special-operation exception is recognized. When table or token origin in control register 1 and the
this bit is one, it indicates that the region table or table origin in the TLB entry, (2) low-address pro-
segment table designated by the secondary tection and fetch-protection override do not apply
address-space-control element is attached when to the primary address space; and (3) a
the CPU is in the primary-space mode. translation-specification exception is recognized if
a reference to the primary address space is trans-
Control Register 1 lated by means of a segment-table entry in
Control register 1 contains the primary address- storage and the common-segment bit is one in the
space-control element (PASCE). The register has entry. Item 1 in the above list applies simply if,
one of the following two formats, depending on the and item 2 applies even when, the contents of
real-space-control bit (R) in the register: control register 1 are a real-space designation.
Primary Region-Table or Segment-Table
Designation (R=) Primary Storage-Alteration-Event Control (S):
/ When the storage-alteration-space control in
Primary Region-Table control register 9 is one, bit 56 of control register 1
or Segment-Table Origin GPSXR DTTL specifies, when one, that the primary address
/
space is one for which storage-alteration events
52 54 58 6 63
can occur. Bit 56 is examined when the PASCE
Primary Real-Space Designation (R=1) is used to perform dynamic-address translation for
/
a storage-operand store reference. Bit 56 is
Primary Real-Space
Token Origin GPSXR ignored when the storage-alteration-space control
/ is zero.
52 54 58 63
Primary Space-Switch-Event Control (X):
The fields in the primary address-space-control
When bit 57 of control register 1 is one:
element are allocated as follows:
A space-switch-event program interruption
Primary Region-Table or Segment-Table occurs when execution of the space-switching
Origin: Bits 0-51 of the primary region-table or form of PROGRAM CALL (PC-ss),
segment-table designation in control register 1, PROGRAM RETURN (PR-ss), or PROGRAM
with 12 zeros appended on the right, form a 64-bit TRANSFER (PT-ss) is completed. The inter-
address that designates the beginning of the ruption occurs if bit 57 is one either before or
primary region table or segment table. It is unpre- after the operation.
dictable whether the address is real or absolute.
A space-switch-event program interruption
This table is called the primary region table or
occurs upon completion of a RESUME
segment table since it is used to translate virtual
PROGRAM, SET ADDRESS SPACE
addresses in the primary address space.
CONTROL, or SET ADDRESS SPACE
CONTROL FAST instruction that changes the
address space from which instructions are
2 The portion of the virtual address to the left of the index selected by DT must be zero;
otherwise, an ASCE-type exception is recognized. Bits and 1 of the index must be less
than or equal to TL in the ASCE, and I in the selected table entry must be zero;
otherwise, a region-first-translation, region-second-translation, region-third-translation
or segment-translation exception is recognized, depending on the table level selected by
DT. TT in the selected table entry must equal DT; otherwise, a translation-specification
exception is recognized.
3 Bits and 1 of the next index must be equal to or greater than TF, and less than or equal
to TL, in the current table entry, and I in the next selected table entry must be zero;
otherwise, a region-second-translation, region-third-translation, or segment-translation
exception is recognized, depending on the table level of the next selected entry. TT in
the next selected entry must be one less than TT in the current entry; otherwise, a
translation-specification exception is recognized.
5 Information, which may include portions of the virtual address and the table origin or
real-space token origin in the effective ASCE, is used to search the TLB.
6 If a match exists, the page-frame real address from the TLB is used in forming the real
address. If no match exists and the effective ASCE is a table designation, table entries
in real or absolute storage are fetched. The resulting fetched entries are used to
translate the address and, in conjunction with the search information, may be used to form
entries in the TLB. If the effective ASCE is a real-space designation, a TLB entry that
translates the virtual address to the equal real address may be formed.
Figure 3-9 (Part 3 of 3). Translation Process
Each of the remaining table entries in a translation 3. The TLB combined region-and-segment-table
path is attached when the next-higher-level entry entry meets either one of the following
is attached and valid and would not cause a requirements:
translation-specification exception if used for trans- a. The common-segment bit is one in the
lation and the subject entry is within the table des- TLB entry.
ignated by the next-higher-level entry. Within the
b. The table-origin (TO) field in the TLB entry
table means as determined by the origin, offset,
matches the table- or token-origin field in
and length fields in the next-higher-level entry.
an attaching address-space-control
A page-table entry is attached when it is within the element.
page table designated by either an attached and A TLB combined region-and-segment-table entry
valid segment-table entry that would not cause a may be used for a particular instance of implicit
translation-specification exception if used for trans- address translation only when the entry is in the
lation or a usable TLB combined region-and- usable state, either the common-segment bit is
segment-table entry. A usable TLB combined one in the TLB entry or the table-origin (TO) field
region-and-segment-table entry is explained in the in the TLB entry matches the table- or token-origin
next section. field in the address-space-control element being
used in the translation, and the region-index and
A region-table entry or segment-table entry causes segment-index fields in the TLB entry match those
a translation-specification exception if the table- of the virtual address being translated. However,
type bits, bits 60 and 61, in the entry are incon- the TLB combined region-and-segment-table entry
sistent with the level at which the entry would be is not used if the common-segment bit is one in
encountered when using the translation path in the the entry and either the private-space-control bit is
translation process. A segment-table entry also one in the address-space-control element being
causes a translation-specification exception if the used in the translation or that address-space-
private-space-control bit is one in the address- control element is a real-space designation. In
space-control element used to select it and the both these cases, the TLB entry is not used even
Restart Old PSW: The current PSW is Machine-Check New PSW: The new
stored as the old PSW at locations PSW is fetched from locations 480-495
288-303 during a restart interruption. during a machine-check interruption.
External Old PSW: The current PSW is Input/Output New PSW: The new PSW
stored as the old PSW at locations is fetched from locations 496-511 during
304-319 during an external interruption. an I/O interruption.
Initial-Program-Loading PSW
4 4
8 8 Initial-Program-Loading CCW1
C 12
18 24
1C 28
2 32
24 36
28 4
2C 44
3 48
34 52
38 56
3C 6
4 64
44 68
48 72
4C 76
5 8
54 84
58 88
5C 92
6 96
64 1
68 14
6C 18
7 112
74 116
78 12
7C 124
C4 196
CC 24
D 28
D4 212
D8 216
DC 22
E 224
E4 228
1 256
14 26
18 264
1C 268
11 272
114 276
118 28
11C 284
18 384
184 388
188 392
18C 396
19 4
194 44
198 48
19C 412
1 496
14 41
18 414
1C 418
11 4112
114 4116
/ / (448 bytes) /
11A8 452
11AC 4524
11B 4528
11B4 4532
11B8 4536
11BC 454
131 488
1314 4884
132 4896
1324 49 Store-Status TOD Prog Reg Save Area; or MC TOD Prog Reg S A
1338 492
133C 4924
This chapter describes in detail the facilities for load state during the initial-program-loading opera-
controlling, measuring, and recording the opera- tion. The CPU enters the check-stop state only as
tion of one or more CPUs. the result of machine malfunctions.
BRANCH AND STACK Yes - Yes - Yes - Yes - Yes - BAM - Yes -
BRANCH IN SUBSPACE GROUP - - - - - - - - - - BAMBAM - -
INSERT PROGRAM MASK - - - - - - - - Yes - - - - -
INSERT PSW KEY - - Yes - - - - - - - - - - -
INSERT ADDRESS SPACE - - - - - - Yes - - - - - - -
CONTROL
Explanation:
- No.
The action takes place only if the associated R field in the instruction is nonzero.
In the reduced-authority state, the action takes place only if the R field in the instruction
is nonzero.
The action also takes place in the 64-bit addressing mode if the R field in the instruction is
zero.
PROGRAM RETURN does not change the PER mask.
PROGRAM TRANSFER does not change the problem-state bit from one to zero.
Programming Note: A summary of the oper- logical and instruction addresses are treated as
ations which save or set the problem state, real addresses. When the bit is one, DAT is on,
addressing mode, and instruction address is con- and the dynamic-address-translation mechanism is
tained in Subroutine Linkage without the Linkage invoked.
Stack on page 5-10.
I/O Mask (IO): Bit 6 controls whether the CPU is
enabled for I/O interruptions. When the bit is
Program-Status-Word Format zero, an I/O interruption cannot occur. When the
bit is one, I/O interruptions are subject to the
IE Prog E
RTOX Key MWPA SC C Mask A I/O-interruption subclass-mask bits in control reg-
5 8 12 16 18 2 24 31
ister 6. When an I/O-interruption subclass-mask
bit is zero, an I/O interruption for that
24-bit
1 31-bit
1 1 64-bit Control Registers
Ctrl Initial
Reg Bits Name of Field Associated with Value
14 32 Unused 1
14 33 Unused 1
14 35 Channel-report-pending subclass I/O machine-check handling
mask
14 36 Recovery subclass mask Machine-check handling
14 37 Degradation subclass mask Machine-check handling
14 38 External-damage subclass mask Machine-check handling 1
14 39 Warning subclass mask Machine-check handling
14 42 TOD-clock-control-override control TOD clock
14 44 ASN-translation control Instruction authorization
14 45-63ASN-first-table origin ASN translation
Explanation:
The fields not listed are unassigned. The initial value for all unlisted
control-register bit positions is zero.
This bit is not used but is initialized to one for consistency with the
System/37 definition.
The address-space-control element (ASCE) in the control register has one of
three formats, depending on bit 58 of the register, the real-space control,
and bits 6 and 61 of the register, the designation-type control. When bit
58 is zero, the ASCE is a region-table designation if bits 6 and 61 are 11,
1, or 1 binary, or it is a segment-table designation if bits 6 and 61 are
binary. When bit 58 is one, the ASCE is a real-space designation. Bits
-51 are the region-table origin, the segment-table origin or the real-space
token origin, depending on whether the ASCE is a region-table designation, a
segment-table designation, or a real-space designation, respectively.
Bits 6-63 are assigned when the ASCE in the control register is a region-
table designation or a segment-table designation.
BAKR B - - B B - B
BALR B - - B B - B
BASR B - - B B - B
BASSM B - MS B B | MSB MS B | MSB
BSA B - - B B - B
BSG B BSG - BSG B BSG BSG
BSM - - MS - MS - MS
PC - PC MS PC MS PC & MSPC & MS
PR-b - - MS - MS MS MS
PR-pc - PR MS PR MS PR PR
PT - PT - PT - PT PT
RP B - MS B B | MSB MS B | MSB
SASN - SASN - SASN - SASN SASN
SAM24/ - - MS - MS MS MS
31/64
TRAP2/4 B - - B B - B
Explanation:
- None.
-b The case when PROGRAM RETURN unstacks a branch state
entry.
-pc The case when PROGRAM RETURN unstacks a program-call state
entry.
| OR.
& AND.
8 31
1 31
F3 Branch (Branch, RP, or TRAP2/4 when Resulting PSW Bit 31 Is One (See
Note) and Bits -32 of Branch Address Are Not All Zeros)
8 12 32 63
64 95
F1 BRANCH IN SUBSPACE GROUP (if ASN Tracing On, in 24-Bit or 31-Bit Mode)
8 32 63
8 32 63
64 95
F1 Mode Switch (BASSM, BSM, PC, PR, RP, or SAM64 from 24-Bit or 31-Bit
Mode when Resulting PSW Bit 31 Is One (See Note))
8 12 32 63
Figure 4-6 (Part 1 of 7). Trace Entries
8 12 32 63
F3 Mode Switch (BASSM, BSM, PC, PR, RP, SAM24, or SAM31 from 64-Bit Mode
to 24-Bit or 31-Bit Mode when Bits -31 of Updated Instruction Address
Are Not All Zeros)
8 12 32 63
64 95
8 12 32 63
8 12 32 63
8 12 32 63
64 95
Figure 4-6 (Part 2 of 7). Trace Entries
PSW
11Key PC Number ABits 33-62 of Return AddressP
8 12 32 63
PSW
11Key PC Number Bits -31 of Return Address
8 12 32 63
64 95
PSW
111Key New PASN ABits 33-62 of Return AddressP
8 12 16 32 63
64 95
F2 PROGRAM RETURN (in 64-Bit Mode when Bits -31 of Updated Instruction
Address Are All Zeros and Resulting Mode Is 24-Bit or 31-Bit)
PSW
111Key 1 New PASN ABits 33-62 of Return AddressP
8 12 16 32 63
64 95
Figure 4-6 (Part 3 of 7). Trace Entries
PSW
1111Key 11 New PASN ABits 33-62 of Return AddressP
8 12 16 32 63
64 127
F4 PROGRAM RETURN (in 24-Bit or 31-Bit Mode when Resulting PSW Bit 31
Is One (See Note) and Bits -31 of Return Address Are All Zeros)
PSW
111Key 1 New PASN Bits 32-62 of Return Address P
8 12 16 32 63
64 95
F5 PROGRAM RETURN (in 64-Bit Mode when Bits -31 of Updated Instruction
Address Are All Zeros, Resulting PSW Bit 31 Is One (See Note), and Bits
-31 of Return Address Are All Zeros)
PSW
111Key 11 New PASN Bits 32-62 of Return Address P
8 12 16 32 63
64 95
F6 PROGRAM RETURN (in 64-Bit Mode when Bits -31 of Updated Instruction
Address Are Not All Zeros, Resulting PSW Bit 31 Is One (See Note), and
Bits -31 of Return Address Are All Zeros)
PSW
1111Key 111 New PASN Bits 32-62 of Return Address P
8 12 16 32 63
64 127
Figure 4-6 (Part 4 of 7). Trace Entries
PSW
1111Key 11 New PASN Bits -31 of Return Address
8 12 16 32 63
64 96 127
F8 PROGRAM RETURN (in 64-Bit Mode when Bits -31 of Updated Instruction
Address Are All Zeros, Resulting PSW Bit 31 Is One (See Note), and Bits
-31 of Return Address Are Not All Zeros)
PSW
1111Key 111 New PASN Bits -31 of Return Address
8 12 16 32 63
64 96 127
F9 PROGRAM RETURN (in 64-Bit Mode when Bits -31 of Updated Instruction
Address Are Not All Zeros, Resulting PSW Bit 31 Is One (See Note), and
Bits -31 of Return Address Are Not All Zeros)
PSW
111Key 1111 New PASN Bits -31 of Return Address
8 12 16 32 63
64 96 127
128 159
PSW
111Key New PASN Bits 32-63 of R Before
8 12 16 32 63
Figure 4-6 (Part 5 of 7). Trace Entries
PSW
111Key 1 New PASN Bits 32-63 of R Before
8 12 16 32 63
F3 PROGRAM TRANSFER (in 64-Bit Mode when Bits -31 of R Are Not All
Zeros)
PSW
111Key 11 New PASN Bits -31 of R Before
8 12 16 32 63
64 95
1 New SASN
8 16 31
F1 TRACE (TRACE)
4 8 16 63
/
TRACE Operand (R) - (R)
/
64 96 95 + 32(N+1)
F2 TRACE (TRACG)
4 8 16 63
64 96 127
/
(R) - (R)
/
128 127 + 64(N+1)
Figure 4-6 (Part 6 of 7). Trace Entries
Trace Entry
Trace-Entry Bits
For-
-7 8-1112-15 Type mat
Branch 1
1 SET SECONDARY ASN 1
11 PROGRAM CALL 1
11 PROGRAM CALL 2
111 PROGRAM TRANSFER 1
111 TRACE 1
111 1 TRACE 2
1 Branch 2
The fields in the trace entries are defined as after branching (a format-1 entry), bit positions
follows. The fields are described in the order in 8-31 contain bits 40-63 of the branch address.
which they first appear in Figure 4-6 on When the 31-bit addressing mode is in effect after
page 4-14. branching or PSW bit 31 is one after branching
and bits 0-32 of the branch address are all zeros,
Branch Address: The branch address is the bit positions 1-31 of the trace entry (format 2)
address of the next instruction to be executed contain bits 33-63 of the branch address. When
when the branch is taken. In a branch trace entry PSW bit 31 is one after branching and bits 0-32 of
made when the 24-bit addressing mode is in effect the branch address are not all zeros, bit positions
In a BRANCH IN SUBSPACE GROUP trace entry Bit position 32 of a PROGRAM RETURN trace
made on execution in the 24-bit or 31-bit entry made when the resulting addressing mode is
addressing mode, bit positions 33-63 of the trace the 24-bit or 31-bit mode (a format-1, format-2, or
entry (format 1) contain bits 33-63 of the branch format-3 entry) contains the basic-addressing-
address, or, in the 64-bit addressing mode, bit mode bit that replaces bit 32 of the PSW.
positions 32-95 of the trace entry (format 2)
contain bits 0-63 of the branch address. Bit position 64 of a PROGRAM RETURN trace
entry made in the 24-bit or 31-bit addressing
In a mode-switching-branch trace entry made on a mode when the return address occupies only one
switch from the 64-bit addressing mode to the word in the entry, (a format-1 or format-4 entry),
24-bit or 31-bit addressing mode, bit positions contains the value of PSW bit 32 that existed
33-63 of the entry (format 1) contain bits 33-63 of before the PROGRAM RETURN operation. When
the branch address; or, on a switch from PSW bit the return address occupies two words (a format-7
31 being off to the bit being on, bit positions 32-63 entry), bit position 96 contains that value of PSW
of the entry (format 2) contain bits 32-63 of the bit 32.
branch address if bits 0-31 of the branch address
are zeros, or bits 32-95 of the entry (format 3) Updated Instruction Address: Bit positions
contain bits 0-63 of the branch address if bits 0-31 33-63 of a mode-switch trace entry that indicates
of the branch address are not all zeros. a switch from PSW bit 31 being off to the bit being
on (a format-1 entry) contains bits 33-63 of the
Primary-List Bit (P) and Bits 9-31 of ALET: Bit updated instruction address in the PSW (bits
position 8 of a BRANCH IN SUBSPACE GROUP 97-127 of the PSW) before that address is
trace entry contains bit 7 of the access-list-entry replaced, if it is replaced, by the mode-switch
token (ALET) in the access register designated by operation. Bit positions 32-63 of a mode-switch
the R field of the instruction. Bit positions 9-31 of trace entry (format 2) that indicates a switch from
the trace entry contain bits 9-31 of the ALET. the 64-bit addressing mode to the 24-bit or 31-bit
addressing mode contains bits 32-63 of the
Basic-Addressing-Mode Bit (A): Bit position 32 updated instruction address in the PSW (bits
of a BRANCH IN SUBSPACE GROUP trace entry 96-127 of the PSW) before that address is
made on execution in the 24-bit or 31-bit replaced, if it is replaced, by the mode-switch
addressing mode (a format-1 entry) contains the operation, if bits 0-31 of the updated instruction
basic-addressing-mode bit that replaces bit 32 of address are zeros; or bit positions 32-95 of the
the PSW. trace entry (format 3) contain bits 0-63 of that
updated instruction address (bits 64-127 of the
Bit position 32 of a mode-switch trace entry that PSW) if bits 0-31 of the address are not all zeros.
indicates a switch from PSW bit 31 being off to
the bit being on (a format-1 entry) contains the The following description of a PROGRAM
value of PSW bit 32 that existed before the mode- RETURN trace entry applies when the return
switch operation. address in the entry occupies only one word in the
entry. Bit positions 65-95 of the trace entry made
Bit position 32 of a mode-switching-branch trace on execution in the 24-bit or 31-bit addressing
entry that indicates a switch from the 64-bit mode (a format-1 or format-4 entry) contain bits
addressing mode to the 24-bit or 31-bit addressing 33-63 of the updated instruction address in the
mode (a format-1 entry) contains the value that PSW (bits 97-127 of the PSW) before that
replaces PSW bit 32. address is replaced from the linkage-stack state
entry; or, when the execution is in the 64-bit
Bit position 32 of a PROGRAM CALL trace entry addressing mode, bit positions 64-95 of the trace
made on execution in the 24-bit or 31-bit entry (format 2 or 5) contain bits 32-63 of that
addressing mode (regardless of the resulting updated instruction address (bits 96-127 of the
addressing mode) (a format-1 entry) contains the PSW) if bits 0-31 of the address are zeros, or bit
positions 64-127 of the trace entry (format 3 or 6)
When PROGRAM RETURN unstacks a linkage- The information for controlling PER resides in
stack state entry that was formed by BRANCH control registers 9, 10, and 11 and the address-
AND STACK and ASN tracing is on, trace space-control element. The information in the
exceptions may be recognized, even though a control registers has the following format:
trace entry is not made and no part of a trace
Control Register 9
entry is stored. /
EM B S
The order in which information is placed in a trace /
entry is unpredictable. Furthermore, as observed 32 37 4 42 63
by other CPUs and by channel programs, the con-
tents of a byte of a trace entry may appear to Control Register 10
change more than once before completion of the /
instruction for which the entry is made. Starting Address
/
The trace-entry address in control register 12 is 63
updated only on completion of execution of an
instruction for which a trace entry is made. Control Register 11
/
A serialization and checkpoint-synchronization Ending Address
function is performed before the operation begins /
and again after the operation is completed. 63
Region-Table or Segment-Table Designation (R=) PER is under control of bit 1 of the PSW, the PER
/ mask. When the PER mask and a particular
Region-Table or PER-event mask bit are all ones, the CPU is
Segment-Table Origin GPSXR DTTL enabled for the corresponding type of event; oth-
/ erwise, it is disabled. However, the CPU is
52 54 58 6 63
enabled for the store-using-real-address event
Real-Space Designation (R=1)
/ only when the storage-alteration mask bit and the
Real-Space store-using-real-address mask bit are both one.
Token Origin GPSXR
/ An interruption due to a PER event normally
52 54 58 63 occurs after the execution of the instruction
responsible for the event. The occurrence of the
Storage-Alteration-Event Bit (S): When the event does not affect the execution of the instruc-
storage-alteration-space control in control register tion, which may be completed, partially completed,
9 is one, bit 56 of the address-space control terminated, suppressed, or nullified. However,
element specifies, when one, that the address recognition of a storage-alteration event causes no
space defined by the address-space-control more than 4K bytes to be stored beginning with
element is one for which storage-alteration events the byte that caused the event, and this may
can occur. Bit 56 is examined when the address- result in partial completion of an interruptible
space-control element is used to perform dynamic- instruction.
address translation for a storage-operand store
reference. The address-space-control element When the CPU is disabled for a particular PER
may be the PASCE, SASCE, or HASCE in control event at the time it occurs, either by the PER
register 1, 7, or 13, respectively, or it may be mask in the PSW or by the masks in control reg-
obtained from an ASN-second-table entry during ister 9, the event is not recognized.
access-register translation. Instead of being
obtained from an ASN-second-table entry in main A change to the PER mask in the PSW or to the
storage, bit 56 may be obtained from an PER control fields in control registers 9, 10, and
ASN-second-table entry in the ART-lookaside 11 affects PER starting with the execution of the
immediately following instruction.
5 8 13 15 9 ATMID-validity bit
10 PSW bit 32
11 PSW bit 5
Locations 152-159: 12 PSW bit 16
/
PER Address 13 PSW bit 17
/
63 A valid ATMID is necessarily stored only if the
PER event was caused by one of the following
instructions:
If an instruction-fetching event is the only PER Storage alteration does not apply to instructions
event recognized for an interruptible instruction whose operands are specified to be real
that is to be interrupted because of an asynchro- addresses. Thus, storage alteration does not
nous condition (I/O, external, restart, or apply to INVALIDATE PAGE TABLE ENTRY,
repressible machine-check condition) or the per- RESET REFERENCE BIT EXTENDED, SET
formance of the stop function, and if a unit of STORAGE KEY EXTENDED, STORE USING
operation of the instruction remains to be exe- REAL ADDRESS, TEST BLOCK, and TEST
cuted, the instruction-fetching event may be dis- PENDING INTERRUPTION (when the effective
carded, and whether it is discarded is address is zero).
unpredictable.
A storage-alteration event causes a PER storage-
The PER instruction-fetching event is indicated by alteration event to be recognized if bit 34 of the
setting bit 1 of the PER code to one. PER-event masks is one and the PER mask in the
PSW is one. Bit 36 of the PER-event masks is
Storage Alteration ignored when determining whether a PER storage-
A storage-alteration event occurs whenever a alteration event is to be recognized.
CPU, by using a logical or virtual address, makes
a store access without an access exception to the PER storage-alteration event is indicated by
storage area designated by control registers 10 setting bit 2 of the PER code to one and bit 4 of
and 11. However, when DAT is on and the the PER code to zero.
storage-alteration-space control in control register
Specification
Odd instruction address in the PSW S No No No No
Instruction access N or S No U No No
Specification
EXECUTE target address odd S No U No -
EXECUTE target access N or S No U No -
Other nullifying N No Yes No -
Other suppressing S No Yes No No
All terminating T No Yes Yes -
All completing C Yes Yes Yes -
Explanation:
- The condition does not apply.
Although PER events of this type are not indicated for the cur-
rent unit of operation of an interruptible instruction, PER
events of this type that were recognized on completed units of
operation of the interruptible instruction are indicated.
This event may be indicated, depending on the model, if the
event has not occurred but would have been indicated if execu-
tion had been completed.
C The operation or, in the case of the interruptible instructions,
the unit of operation is completed.
N The operation or, in the case of the interruptible instructions,
the unit of operation is nullified.
S The operation or, in the case of the interruptible instructions,
the unit of operation is suppressed.
T The execution of the instruction is terminated.
Yes The PER event is indicated with the other program interruption
condition if the event has occurred; that is, the contents of
the designated storage location were altered, or an attempt was
made to execute an instruction whose first byte is located in
the designated storage area.
No The PER event is not indicated.
U It is unpredictable whether the PER event is indicated.
The operation of the clock is not affected by any Set State: The clock enters the set state only
normal activity or event in the system. Incre- from the stopped state. The change of state is
menting of the clock does not depend on whether under control of the TOD-clock-sync-control bit, bit
the wait-state bit of the PSW is one or whether the 34 of control register 0, of the CPU which most
CPU is in the operating, load, stopped, or check- recently caused the clock to enter the stopped
stop state. Its operation is not affected by CPU, state. If the bit is zero, the clock enters the set
initial-CPU, or clear resets or by initial program state at the completion of execution of SET
loading. Operation of the clock is also not CLOCK. If the bit is one, the clock remains in the
affected by the setting of the rate control or by an stopped state until the bit is set to zero on that
initial-machine-loading operation. Depending on CPU or until another CPU executes a SET
the model and the configuration, the TOD clock CLOCK instruction affecting the clock. If an
may or may not be powered independent of the external time reference (ETR) is installed, a signal
CPU. from the ETR may be used to set the set state
from the stopped state.
For the purpose of establishing uniqueness and 1. Bit position 31 of the clock is incremented
sequence of occurrence of the results of STORE every 1.048576 seconds; for some applica-
CLOCK and STORE CLOCK EXTENDED, the tions, reference to the leftmost 32 bits of the
64-bit value provided by STORE CLOCK may be clock may provide sufficient resolution.
considered to be extended to 104 bits by 2. Communication between systems is facilitated
appending 40 zeros on the right, with the STORE by establishing a standard time origin that is
CLOCK value and STORE CLOCK EXTENDED the calendar date and time to which a clock
bits 8-111 then both being treated as 104-bit value of zero corresponds. January 1, 1900,
unsigned binary integers. 0 a.m. Coordinated Universal Time (UTC) is
recommended as this origin, and it is said to
In a configuration where more than one CPU begin the standard epoch for the clock. This
accesses the clock, SET CLOCK is interlocked is also the epoch used when the TOD clock is
such that the entire contents appear to be updated synchronized to the external time reference
concurrently; that is, if SET CLOCK instructions (ETR). Note that the former term, Greenwich
are executed simultaneously by two CPUs, the Mean Time (GMT), is now obsolete and has
final result is either one or the other value. If SET been replaced with the more precise UTC.
CLOCK is executed by one CPU and STORE
CLOCK or STORE CLOCK EXTENDED by the 3. A program using the clock value as a
other, the result obtained by STORE CLOCK or time-of-day and calendar indication must be
STORE CLOCK EXTENDED is either the entire consistent with the programming support
old value or the entire new value. When SET under which the program is to be executed. If
CLOCK is executed by one CPU, a STORE the programming support uses the standard
CLOCK or STORE CLOCK EXTENDED instruc- epoch, bit 0 of the clock remains one through
tion executed by another CPU may find the clock the years 1972-2041. (Bit 0 turned on at
in the stopped state even when the 11:56:53.685248 (UTC) May 11, 1971.) Ordi-
TOD-clock-sync-control bit, bit 34 of control reg- narily, testing bit 0 for a one is sufficient to
ister 0, of each CPU is zero. Since the clock determine if the clock value is in the standard
enters the set state before incrementing, the first epoch.
STORE CLOCK or STORE CLOCK EXTENDED 4. In converting to or from the current date or
instruction executed after the clock enters the set time, the programming support must take into
state may still find the original value introduced by account that leap seconds have been
SET CLOCK. inserted or deleted because of time-correction
standards. When the TOD clock has been set
TOD Programmable Register correctly to a time within the standard epoch,
Each CPU has a TOD programmable register. the sum of the accumulated leap seconds
Bits 16-31 of the register contain the program- must be subtracted from the clock time to
mable field that is appended on the right to the determine UTC time.
TOD-clock value by STORE CLOCK EXTENDED.
5. Because of the limited accuracy of manually
The register has the following format:
setting the clock value, the rightmost bit posi-
tions of the clock, expressing fractions of a
second, are normally not valid as indications
A request for a clock-comparator interruption does The CPU timer is a binary counter with a format
not remain pending when the value of the clock which is the same as that of bits 0-63 of the TOD
comparator is made equal to or greater than that clock, except that bit 0 is considered a sign. The
of the TOD clock or when the value of the TOD CPU timer nominally is decremented by sub-
clock is made less than the clock-comparator tracting a one in bit position 51 every micro-
value. The latter may occur as a result of the second. In models having a higher or lower
TOD clock either being set or wrapping to zero. resolution, a different bit position is decremented
at such a frequency that the rate of decrementing
The clock comparator can be inspected by exe- the CPU timer is the same as if a one were sub-
cuting the instruction STORE CLOCK tracted in bit position 51 every microsecond. The
COMPARATOR and can be set to a specified resolution of the CPU timer is such that the step-
value by executing the SET CLOCK ping rate is comparable to the instruction-
COMPARATOR instruction. execution rate of the model.
The contents of the clock comparator are initial- The CPU timer requests an external interruption
ized to zero by initial CPU reset. with the interruption code 1005 hex whenever the
CPU-timer value is negative (bit 0 of the CPU
Programming Notes:
timer is one). The request does not remain
1. An interruption request for the clock pending when the CPU-timer value is changed to
comparator persists as long as the clock- a nonnegative value.
comparator value is less than that of the TOD
clock or as long as the TOD clock is in the When both the CPU timer and the TOD clock are
error state or the not-operational state. There- running, the stepping rates are synchronized such
fore, one of the following actions must be that both are stepped at the same rate. Normally,
taken after an external interruption for the decrementing the CPU timer is not affected by
clock comparator has occurred and before the concurrent I/O activity. However, in some models
CPU is again enabled for external inter- the CPU timer may stop during extreme I/O
ruptions: the value of the clock comparator activity and other similar interference situations.
must be replaced, the TOD clock must be set, In these cases, the time recorded by the CPU
the TOD clock must wrap to zero, or the timer provides a more accurate measure of the
clock-comparator-subclass mask must be set CPU time used by the program than would have
to zero. Otherwise, loops of external inter- been recorded had the CPU timer continued to
ruptions are formed. step.
2. The instruction STORE CLOCK or STORE The CPU timer is decremented when the CPU is
CLOCK EXTENDED may store a value which in the operating state or the load state. When the
is greater than that in the clock comparator, manual rate control is set to instruction step, the
even though the CPU is enabled for the clock- CPU timer is decremented only during the time in
comparator interruption. This is because the which the CPU is actually performing a unit of
TOD clock may be incremented one or more operation. However, depending on the model, the
times between when instruction execution is CPU timer may or may not be decremented when
begun and when the clock value is accessed. the TOD clock is in the error, stopped, or not-
In this situation, the interruption occurs when operational state.
the execution of STORE CLOCK or STORE
CLOCK EXTENDED is completed.
Function Performed on
CPU on Which Key Other CPUs Remainder of
Key Activated Was Activated in Config Configuration
Explanation:
Activation of a system-reset or load key may change the config-
uration, including the connection with I/O, storage units, and
other CPUs.
Only the CPU elements of this reset apply.
Only the non-CPU elements of this reset apply.
CPU U S S S S
PSW U U/V# C\ C\ C\
Prefix U U/V C C C
CPU timer U U/V C C C
Clock comparator U U/V C C C
TOD programmable register U U/V C C C
Control registers U U/V I I I
Floating-point-control U U/V C C C
register
Access registers U U/V U/V C C
General registers U U/V U/V C C
Floating-point registers U U/V U/V C C
Storage keys U U U C C
Volatile main storage U U U C C
Nonvolatile main storage U U U C U
Expanded storage U U U U C
TOD clock U U U U T
Floating interruption C U U C C
conditions
I/O system R U U R R
PERFORM LOCKED OPERATION U U U RC RP
locks
Explanation:
# If the architectural mode is changed from the z/Architecture mode
to the ESA/39 mode, the PSW does not remain unchanged.
Instead, the PSW is changed from 16 bytes to eight bytes,
and the bits of the eight-byte PSW are set as follows:
bits -11 and 13-32 are set equal to the same bits of the
16-byte PSW, bit 12 is set to one, and bits 33-63 are set
equal to bits 97-127 of the 16-byte PSW. The PSW is
invalid in the ESA/39 mode if PSW bit 31 is one.
\ Clearing the contents of the PSW to zero causes the PSW
to be invalid if the architectural mode is ESA/39.
When the IPL sequence follows the reset function on that
CPU, the CPU does not necessarily enter the stopped
state, and the PSW is not necessarily cleared to zeros.
When these units are separately powered, the action is
performed only when the power for the unit is turned on.
These clearing and initializing functions include 3. The contents of the main storage in the con-
validation. figuration and the associated storage keys are
set to zero with valid checking-block code.
Setting the current PSW to zero when the CPU is 4. The locks used by any CPU in the configura-
in the ESA/390 architectural mode at the end of tion when executing the PERFORM LOCKED
the operation causes the PSW to be invalid, since OPERATION instruction are released.
PSW bit 12 must be one in that mode. Thus, in
this case if the CPU is placed in the operating 5. A subsystem reset is performed.
state after a reset without first introducing a new Validation is included in setting registers and in
PSW, a specification exception is recognized. clearing storage and storage keys.
Equipment Check: This condition exists when Stopped: This condition exists when the
the CPU executing the instruction detects equip- addressed CPU is in the stopped state. The con-
ment malfunctioning that has affected only the dition, when present, is indicated only in response
execution of this instruction and the associated to sense. This condition cannot be reported as a
order. The order code may or may not have been result of a SIGNAL PROCESSOR by a CPU
transmitted and may or may not have been addressing itself.
accepted, and the status bits provided by the
addressed CPU may be in error. This condition is Operator Intervening: This condition exists
not detected if the invalid-parameter condition for when the addressed CPU is executing certain
the set-architecture order is detected. operations initiated from local or remote operator
facilities. The particular manually initiated oper-
Incorrect State: A set-prefix or store-status-at- ations that cause this condition to be present
address order has been rejected because the depend on the model and on the order specified.
addressed CPU is not stopped, or a set- The operator-intervening condition may exist when
Receiver Check: This condition exists when the X A zero or a one is presented in this bit posi-
addressed CPU detects malfunctioning of equip- tion, reflecting the current state of the corre-
ment during the communications associated with sponding condition.
the execution of SIGNAL PROCESSOR. When E Either a zero or the current state of the corre-
this condition is indicated, the order has not been sponding condition is indicated.
initiated, and, since the malfunction may have
If the presented status bits are all zeros, the order
affected the generation of the remaining receiver
has been accepted, and the issuing CPU sets
status bits, these bits are not necessarily valid. A
condition code 0. If one or more ones are pre-
machine-check condition may or may not have
sented, the order has been rejected, and the
been generated at the addressed CPU.
issuing CPU stores the status in the general reg-
ister designated by the R field of the SIGNAL
Operands in storage may have an implied length; To describe the execution of instructions, oper-
be specified by a bit mask; be specified by a ands are designated as first and second operands
four-bit or eight-bit length specification, called the and, in some cases, third operands.
L field, in the instruction; or have a length speci-
fied by the contents of a general register. The In general, two operands participate in an instruc-
addresses of operands in storage are specified by tion execution, and the result replaces the first
means of a format that uses the contents of a operand. However, CONVERT TO DECIMAL,
general register as part of the address. This TEST BLOCK, and instructions with store in the
makes it possible to: instruction name (other than STORE THEN AND
SYSTEM MASK and STORE THEN OR SYSTEM
1. Specify a complete address by using an
MASK) use the second-operand address to desig-
abbreviated notation
nate a location in which to store. TEST AND
2. Perform address manipulation using SET, COMPARE AND SWAP, and COMPARE
instructions which employ general registers for DOUBLE AND SWAP may perform an update on
operands the second operand. Except when otherwise
stated, the contents of all registers and storage
3. Modify addresses by program means without
locations participating in the addressing or exe-
alteration of the instruction stream
cution part of an operation remain unchanged.
4. Operate independent of the location of data
areas by directly using addresses received
from other programs
Instruction Formats
The address used to refer to storage either is con- An instruction is one, two, or three halfwords in
tained in a register designated by the R field in the length and must be located in storage on a
instruction or is calculated from a base address, halfword boundary. Each instruction is in one of
index, and displacement, specified by the B, X, 17 basic formats: E, RR, RRE, RRF, RX, RXE,
and D fields, respectively, in the instruction. RXF, RS, RSE, RSI, RI, RIE, RIL, SI, S, SSE, and
SS, with three variations of RRF, two of RS and
RSE, and four of SS. (See Figure 5-1 on
page 5-4.)
16 24 28 31 RSI Format
RRF Format Op Code R R I
Op Code R //// R R 8 12 16 31
16 2 24 28 31 RI Format
Op Code R OpCd I
Op Code M //// R R
8 12 16 31
16 2 24 28 31
RIE Format
/
Op Code R M R R Op Code R R I ////////Op Code
/
16 2 24 28 31 8 12 16 32 4 47
RS Format SS Format
//
Op Code R R B D Op Code L B D B D
//
8 12 16 2 31 8 16 2 32 36 47
Figure 5-1 (Part 1 of 3). Basic Instruction Formats Figure 5-1 (Part 2 of 3). Basic Instruction Formats
In the SS format with two R fields, as used by the When an instruction is fetched from the location
MOVE TO PRIMARY, MOVE TO SECONDARY, designated by the current PSW, the instruction
and MOVE WITH KEY instructions, the contents address is increased by the number of bytes in
of the general register specified by the R field are the instruction, and the instruction is executed.
a 32-bit unsigned value called the true length. The same steps are then repeated by using the
The operands are of the same length, called the new value of the instruction address to fetch the
effective length. The effective length is equal to next instruction in the sequence.
the true length or 256, whichever is less. The
In the 24-bit addressing mode, instruction
instructions set the condition code to facilitate pro-
addresses wrap around, with the halfword at
gramming a loop to move the total number of
instruction address 2 - 2 being followed by the
bytes specified by the true length. The SS format
halfword at instruction address 0. Thus, in the
with two R fields is also used to specify a range of
24-bit addressing mode, any carry out of PSW bit
registers and two storage operands by the LOAD
position 104, as a result of updating the instruction
MULTIPLE DISJOINT instruction and to specify
address, is lost. In the 31-bit or 64-bit addressing
one or two registers and one or two storage oper-
mode, instruction addresses similarly wrap around,
ands by the PERFORM LOCKED OPERATION
with the halfword at instruction address 2 - 2 or
instruction.
2 - 2, respectively, followed by the halfword at
instruction address 0. A carry out of PSW bit
position 97 or 64, respectively, is lost.
Address Generation
Operand-Address Generation
Trimodal Addressing
Bits 31 and 32 of the current PSW are the
Formation of the Intermediate Value
An operand address that refers to storage is
addressing-mode bits. Bit 31 is the extended-
derived from an intermediate value, which either is
addressing-mode bit, and bit 32 is the basic-
contained in a register designated by an R field in
addressing-mode bit. These bits control the size
the instruction or is calculated from the sum of
of the effective address produced by address gen-
three binary numbers: base address, index, and
eration. When bits 31 and 32 of the current PSW
displacement.
both are zeros, the CPU is in the 24-bit
The 64-bit intermediate value for a relative branch A specification exception due to an odd branch
instruction in the RSI, RI, RIE, or RIL format is the address and access exceptions due to fetching of
sum of two addends, with overflow from bit posi- the instruction at the branch location are not
tion 0 ignored. In the RSI, RI, or RIE format, the recognized as part of the branch operation but
first addend is the contents of the I field with one instead are recognized as exceptions associated
zero bit appended on the right and 47 bits equal with the execution of the instruction at the branch
to the sign bit of the contents appended on the location.
left. In the RIL format, the first addend is the con-
tents of the I field with one zero bit appended on A branch instruction, such as BRANCH AND
the right and 31 bits equal to the sign bit of the SAVE, can designate the same general register
contents appended on the left. In all formats, the for branch-address computation and as the
second addend is the 64-bit address of the branch location of an operand. Branch-address computa-
instruction. The address of the branch instruction tion is completed before the remainder of the
is the instruction address in the PSW before that operation is performed.
address is updated to address the next sequential
instruction, or it is the address of the target of the
EXECUTE instruction if EXECUTE is used. If Instruction Execution and
EXECUTE is used in the 24-bit or 31-bit Sequencing
addressing mode, the address of the branch
instruction is the target address with 40 or 33 The program-status word (PSW), described in
zeros, respectively, appended on the left. Chapter 4, Control contains information required
for proper program execution. The PSW is used
to control instruction sequencing and to hold and
Formation of the Branch Address
indicate the status of the CPU in relation to the
The branch address is always 64 bits long, with
program currently being executed. The active or
the bits numbered 0-63. The branch addresss
controlling PSW is called the current PSW.
replaces bits 64-127 of the current PSW.
Branch instructions perform the functions of deci-
The manner in which the branch address is
sion making, loop control, and subroutine linkage.
obtained from the intermediate value depends on
A branch instruction affects instruction sequencing
the addressing mode. For those branch
by introducing a new instruction address into the
instructions which change the addressing mode,
Figure 5-2 (Part 1 of 2). Summary of Simple Branch Linkage Instructions and Other Instructions
Figure 5-2 (Part 2 of 2). Summary of Simple Branch Linkage Instructions and Other Instructions
Explanation:
- No
\ In the 24-bit addressing mode, the instruction-length code, condition code, and program mask
are saved in bit positions 32-39 of the R general register.
Figure 5-3 (Part 1 of 2). Summary of Linkage Instructions without the Linkage Stack
Figure 5-3 (Part 2 of 2). Summary of Linkage Instructions without the Linkage Stack
Programming Note: This note describes the mode but may have called programs which
simple branch-type linkage instructions that were operate in either the 24-bit or 31-bit addressing
included in 370-XA and carried forward to mode. They and also modified 370-XA, ESA/370,
ESA/370, ESA/390, and z/Architecture. To give and ESA/390 programs now may call programs
the reader a better understanding of the utility and that operate in the 24-bit, 31-bit, or 64-bit
intended usage of these linkage instructions, the addressing mode. New programs may be written
following paragraphs in this note describe various to operate in any addressing mode, and, in some
program linkages and conventions and the use of cases, a program may be written such that it can
the linkage instructions in these situations. be invoked in any addressing mode.
The linkage instructions were originally provided to BRANCH AND SAVE AND SET MODE (BASSM)
permit System/370 programs to operate with no is intended to be the principal calling instruction to
modification or only slight modification on 370/XA subroutines outside of an assembler/linkage-editor
(and successor) systems and also to provide addi- control section (CSECT), for use by all new pro-
tional function for those programs which were grams and particularly by programs that must
designed to take advantage of the 31-bit change the addressing mode during the linkage.
addressing of 370/XA. The instructions provided BRANCH AND SET MODE (BSM) is intended to
the capability for both old and new programs to be the return instruction used after a BASSM.
coexist in storage and to communicate with each BASSM uses a V-type address constant (VCON),
other. The instructions now have been enhanced which has been a four-byte field containing a
to permit usage of the 64-bit addressing of 31-bit entry-point address and a leftmost bit indi-
z/Architecture. cating whether the entry is in the 24-bit or 31-bit
addressing mode. The calling sequence normally
With respect to System/370 programs, it is is:
assumed that old, unmodified programs operate in L 15,VCON
the 24-bit addressing mode and call, or directly BASSM 14,15
communicate with, other programs operating in
the 24-bit addressing mode only. Modified pro- The return from such a routine normally is:
grams normally operate in the 24-bit addressing BSM ,14
Figure 5-4. Glue Module for Linkage from the 24-Bit Mode to the 31-Bit Mode
The COMPARE UNTIL SUBSTRING EQUAL and All of these situations are limited to the extent that
COMPRESSION CALL instructions both are inter- a store access does not occur and the change bit
ruptible instructions and ones that may set condi- is not set when the store access is prohibited. For
tion code 3 after performing a CPU-determined the CPU, a store access is prohibited whenever
amount of processing. an access exception exists for that access, or
whenever an exception exists which is of higher
Programming Notes: priority than the priority of an access exception for
that access.
1. Any interruption, other than supervisor call
and some program interruptions, can occur When, in these situations, an interruption for an
after a partial execution of an interruptible exception requiring suppression occurs, the
instruction. In particular, interruptions for instruction address in the old PSW designates the
external, I/O, machine-check, restart, and next sequential instruction. When an interruption
program interruptions for access exceptions for an exception requiring nullification occurs, the
and PER events can occur between units of instruction address in the old PSW designates the
operation. instruction causing the exception even though
2. The amount of data processed in a unit of partial results may have been stored.
operation of an interruptible instruction
depends on the model and may depend on Storage Change and Restoration for
the type of condition which causes the exe- DAT-Associated Access Exceptions
cution of the instruction to be interrupted or In this section, the term DAT-associated access
stopped. Thus, when an interruption occurs at exceptions is used to refer to those exceptions
the end of the current unit of operation, the which may occur as part of the dynamic-address-
length of the unit of operation may be different translation process. These exceptions are
for different types of interruptions. Also, when ASCE-type, region-first translation, region-second
the stop function is requested during the exe- translation, region-third translation, segment trans-
cution of an interruptible instruction, the CPU lation, page translation, translation specification,
enters the stopped state at the completion of and addressing due to a DAT-table entry being
the execution of the current unit of operation. designated at a location that is not available in the
Similarly, in the instruction-step mode, only a configuration. The first six of these exceptions
EREG SO-PAH
EREGG SO-PAH
ESAR SO-PSAH Q
ESTA SO-PAH
IAC SO-PSAH Q
IPK Q
IVSK SO-PSAH Q
LASP P SO CC CC
LRA P CCA CCA CCA
LRAG P CCA CCA CCA
MSTA SO-PAH
MVCDK Q
MVCP SO-PS SO Q
MVCS SO-PS SO Q
MVCSK Q
bPC-cp SO-P SO Q
sPC-cp SO-PA SO Q
bPC-ss SO-P SO SO Q X1
sPC-ss SO-PA SO SO Q X1
PR-cp SO-PA SO SA
PR-ss SO-PA SO PASA X1
PT-cp QSO-P SO
PT-ss QSO-P SO SO PA X1
RP X2
SAC QSO-PSAH SO X2
SACF QSO-PSAH SO X2
SPKA Q
SSAR-cp SO-PSAH SO
SSAR-ss SO-PSAH SO SA
STRAG P EA ALQ ASQ
TAR CC CC CC
TPROT P CC CC CC
The linkage-table designation has the following LX Invalid Bit (I): Bit 0 controls whether the
format: entry table associated with the linkage-table entry
is available.
Linkage-Table Designation
in Primary ASTE
V LTO LTL
PC Number
(x128)
LX EX
(x4) (x32)
6
Linkage Table
5+
5
R I ETO ETL
(x64)
6
Entry Table
5+
5
R \\ A EIA P AKM ASN EKM
TGL.-S. Fields ASTE Address EP
R: Address is real
\\: First word and A of ETE are bits -32 of EIA if G is one.
Figure 5-7. PC-Number Translation
Obtaining the Linkage-Table control register 5, and adding 24. The addition
Designation cannot cause a carry into bit position 0. The
The linkage-table designation is obtained from 31-bit address is formed and used regardless of
bytes 24-27 of the primary ASN-second-table whether the current PSW specifies the 24-bit,
entry, the starting address of which is specified by 31-bit, or 64-bit addressing mode.
the contents of control register 5.
All four bytes of the linkage-table designation are
The 31-bit real address of the linkage-table desig- fetched concurrently from the primary ASTE. The
nation is obtained by appending six zeros on the fetch access is not subject to protection. When
right to the primary-ASTE origin, bits 33-57 of the storage address which is generated for
fetching the linkage-table designation designates a
Designating Access Registers: In the access- An instruction R field may designate an access
register mode, an instruction B or R field desig- register for other than the purpose of access-
nates an access register, for use in register translation.
access-register translation, under the following
conditions: The fields which may designate access registers,
The field is a B field which designates a whether or not for access-register translation, are
general register containing a base address. indicated in the summary figure at the beginning
The base address is used, along with a dis- of each instruction chapter.
placement (D) and possibly an index (X), to
form the logical address of a storage operand. Obtaining the Address-Space-Control
Element: This section and the following ones
The field is an R field which designates a introduce the access-register-translation process
general register containing the logical address and present the concepts related to access lists.
of a storage operand.
For example, consider the following instruction: The address-space-control element specified by
an access register is obtained by access-register
MVC (L,1),(2) translation as follows:
The second operand, of length L, is to be moved If the access register contains 00000000 hex,
to the first-operand location. The logical address the specified address-space-control element is
of the second operand is in general register 2, and the primary address-space-control element
that of the first-operand location in general register (PASCE), obtained from control register 1.
1. The address space containing the second
operand is specified by access register 2, and that If the access register contains 00000001 hex,
the specified address-space-control element is
Thus, for a dispatchable unit, the dispatchable-unit Allocating and Invalidating Access-List
access list is intended to be constant (although its Entries: It is intended that access lists be pro-
entries may be changed, as will be described), vided by the control program and that they be pro-
and the primary-space access list is a function of tected from direct manipulation by any problem
which program is being executed, through being a program. This protection may be obtained by
function of the primary address space of the means of key-controlled protection or by placing
program. Also, all dispatchable units and pro- the access lists in real storage not accessible by
grams in the same primary address space have any problem program by means of DAT.
the same primary-space access list.
As determined by a bit in the entry, an access-list
Access-List-Entry Token: The contents of an entry is either valid or invalid. A valid access-list
access register are called an access-list-entry entry specifies an address space and can be used
token (ALET) since, in the general case, they des- by a suitably authorized program to access that
ignate an entry in an access list. An ALET has space. An invalid access-list entry is available for
the following format: allocation as a valid entry. It is intended that the
control program provide services that allocate
It may be that a particular access-list entry is allo- A program is authorized to use an access-list
cated, then invalidated, and then allocated again, entry, in access-register translation, if any of the
this time specifying a different address space than following conditions is met:
the first time. To guard against erroneous use of
1. The private bit in the access-list entry is zero.
an ALET that designates a conceptually wrong
This condition provides a high-performance
address space, an access-list-entry sequence
means to authorize any and all programs that
number (ALESN) is provided in both the ALET
are executed to perform the dispatchable unit.
and the access-list entry. When the control
program allocates an access-list entry, it should 2. The ALEAX in the access-list entry is equal to
place the same ALESN in the entry and in the the EAX in control register 8. This condition
designating ALET that it returns to the problem provides a high-performance means to
program. When the control program reallocates authorize only particular programs.
an access-list entry, it should change the value of 3. The EAX selects a secondary bit that is one in
the ALESN. An exception is recognized during the authority table associated with the address
access-register translation if the ALESN in the space that is specified by the access-list entry.
ALET used is not equal to the ALESN in the des- The authority table is locatable in that the
ignated access-list entry. access-list entry contains the real origin of the
ASN-second-table entry (ASTE) for the
The ALESN check is a reliability mechanism, not
address space, and the ASTE contains the
an authority mechanism, because the ALET is not
real origin of the authority table. This condi-
protected from the problem program, and the
tion provides another means, less well-
problem program can change the ALESN in the
performing than condition 2, for authorizing
ALET to any value. Also, this is not a fail-proof
only particular programs. However, providing
reliability mechanism because the ALESN is one
for condition 3 to be met instead of condition 2
byte and its value wraps around after 256 reallo-
can be advantageous because it permits
cations, assuming that the value is incremented by
several programs, each executed with a dif-
one for each reallocation.
ferent EAX, all to use a single access-list
entry to access a particular address space.
Authorizing the Use of Access-List Entries:
Although an access list is intended to be associ- Access-register translation tests for the three con-
ated with either a dispatchable unit or a primary ditions in the order indicated by their numbers,
address space, the valid entries in the list are and a higher-numbered condition is not tested for
intended to be associated with the different pro- if a lower-numbered condition is met. An excep-
grams that are executed, in some order, to tion is recognized if none of the conditions is met.
perform the work of the dispatchable unit. It is
intended that each program be able to have a par- Figure 5-9 on page 5-40 shows an example of
ticular authority that permits the use of only those how the authorization mechanism can be used. In
access-list entries that are associated with the the figure, PBZ means that the private bit is
program. The authority being referred to here is zero, and PBO means that the private bit is one.
represented by a 16-bit extended authorization
index (EAX) in control register 8.
The figure shows an access listassume it is a use ALE 7 to access space 25 because the
dispatchable-unit access listin which the entries ALEAX in the ALE equals the EAX for the
of interest are entries 4, 7, 9, and 12. Each program, and no other program can use this ALE.
access-list entry contains a private bit, an ALEAX, Similarly, only program C can use ALE 9.
and the real origin of the ASTE for an address Program B can use ALE 12 because the ALEAX
space. The private bit in entry 4 is zero, and, and EAX are equal, and program C can use it
therefore, the value of the ALEAX in entry 4 is because C's EAX selects a secondary bit that is
immaterial and is not shown. The private bits in one in the authority table for space 17.
entries 7, 9, and 12 are ones, and the ALEAX
values in these entries are as shown. The The example would be the same if programs A, B,
numbers used to identify the address spaces (36, and C were all in the same address space and the
25, 62, and 17) are arbitrary. They may be the access list were the primary-space access list for
ASNs of the address spaces; however, ASNs are that space.
in no way used in access-register translation.
Only the authority table for address space 17 is An ALE in which the private bit is zero may be
shown. In it, the secondary bit selected by EAX called public because the ALE can be used by
10 is one. Assume that no secondary bits are any program, regardless of the value of the
ones in the authority tables for the other spaces. current EAX. An ALE in which the private bit is
one may be called private because the ability of a
The figure also shows a sequence of three pro- program to use the ALE depends on the current
grams, named A, B, and C, that is executed to EAX.
perform the work of the dispatchable unit associ-
ated with the access list. These programs may be Notes on the Authorization Mechanism: An
in the same or different address spaces. The access list is a kind of capability list, in the sense
EAX in control register 8 when each of these pro- in which the word capability is used in computer
grams is executed is 0, 5, and 10, respectively. science. It is up to the control program to formu-
late the policies that are used to allocate entries in
Each of programs A, B, and C can use access-list an access list, and the programmed authorization
entry (ALE) 4 to access address space 36 since checking required during allocation may be very
the private bit in ALE 4 is zero. Program B can complex and lengthy. After a valid entry has been
Preventing Store References: The access-list The LOAD ACCESS MULTIPLE instruction loads
entry contains a fetch-only bit which, when one, a specified set of consecutively numbered access
specifies that the access-list entry cannot be used registers from a specified storage location whose
to perform storage-operand store references. The length in words equals the number of access reg-
principal description of the effect of the fetch-only isters loaded. Conversely, the STORE ACCESS
bit is in Access-List-Controlled Protection on MULTIPLE instruction function stores the contents
page 3-11. of a set of access registers at a storage location.
The fields in the ALET are allocated as follows: When the ALET is 00000000 or 00000001 hex, it
specifies the primary or secondary address space,
Primary-List Bit (P): When the ALET is not respectively, and the above format does not apply.
00000000 or 00000001 hex, bit 7 specifies the
access list to be used by access-register trans- Access register 0 usually is treated in access-
lation. When bit 7 is zero, the dispatchable-unit register translation as containing 00000000 hex,
access list is used; this is specified by the and its actual contents are not examined; the
dispatchable-unit access-list designation in the access-register translation done as part of TEST
dispatchable-unit control table designated by the ACCESS is the only exception. Access register 0
contents of control register 2. When bit 7 is one, is also treated as containing 00000000 hex when
the primary-space access list is used; this is spec- it is designated by the B field of LOAD ADDRESS
ified by the primary-space access-list designation EXTENDED when PSW bits 16 and 17 are 01
in the primary ASTE designated by the contents of binary. When access register 0 is specified for
control register 5. TEST ACCESS or as a source for COPY
ACCESS, EXTRACT ACCESS, or STORE
Access-List-Entry Sequence Number ACCESS MULTIPLE, the actual contents of the
(ALESN): Bits 8-15 may be used as a check on access register are used. Access register 0, like
whether the access-list entry designated by the any other access register, can be loaded by
ALET has been invalidated and reallocated since COPY ACCESS, LOAD ACCESS MULTIPLE,
the ALET was obtained. During access-register LOAD ADDRESS EXTENDED, and SET
translation when the ALET is not 00000000 or ACCESS.
00000001 hex, bits 8-15 of the ALET are com-
pared against the access-list-entry sequence Another definition of ALETs 00000000 and
number (ALESN) in the designated access-list 00000001 hex is given in BRANCH IN SUB-
entry. SPACE GROUP on page 10-13.
The dispatchable-unit access-list designation Bytes 0-7 (BASTEO, SA, and SSASTEO) and
(DUALD) is located in bytes 16-19 of a 64-byte 12-15 (SSASTESN) of the DUCT are described in
area called the dispatchable-unit control table Subspace-Group Dispatchable-Unit Control
(DUCT). The DUCT resides in real storage, and Table on page 5-55. Bytes 20-23 (PSW key
its location is specified by the DUCT origin in mask, PSW key, RA, and P) and 32-39 (BA and
control register 2. return address) are described in BRANCH AND
SET AUTHORITY on page 10-6. Bytes 44-47
The dispatchable-unit control table has the fol- (trap-control-block address and E) are described
lowing format: in TRAP on page 10-116. Bytes 8-11, 24-27,
40-43, and 48-63 are reserved for possible future
Hex Dec extensions and should contain all zeros. Bytes
2 32
The fields in the access-list designation are allo-
24 36 B Bits 33-63 of cated as follows:
A Return Address
The access-list entry is checked for validity and for Whenever access to real or absolute storage is
containing the correct access-list-entry sequence made during access-register translation for the
number (ALESN). purpose of fetching an entry from an access-list-
designation source, access list, ASN second table,
The ASN-second-table entry (ASTE) addressed by or authority table, key-controlled protection does
the access-list entry is checked for validity and for not apply.
containing the correct ASN-second-table-entry
sequence number (ASTESN). The principal features of access-register trans-
lation, including the effect of the ALB, are shown
Whether the program is authorized to use the in Figure 5-10 on page 5-50.
access-list entry is determined through the use of
Explanation:
Information, which may include the ALD-source origin, ALET, ALO, and EAX, is used to search
2 the ALB. This information, along with information from the ALE, ASTE, and ATE, may be
placed in the ALB.
Locating the ASN-Second-Table Entry When the private bit is one and the ALEAX is not
The ASN-second-table-entry (ASTE) origin in the equal to the EAX, a process called the extended-
access-list entry is used to locate the ASTE. Bits authorization process is performed. Extended
65-89 of the access-list entry, with six zeros authorization uses the EAX to select an entry in
appended on the right, form the 31-bit real the authority table designated by the ASTE, and it
address of the ASTE. tests the secondary-authority bit in the selected
entry for being one. The program is authorized if
The 64-byte ASTE is fetched by using the real the tested bit is one.
address. The fetch of the entry appears to be
word-concurrent as observed by other CPUs, with Extended authorization is the same as the
the leftmost word fetched first. The order in which secondary-ASN-authorization process described in
the remaining words are fetched is unpredictable. ASN Authorization on page 3-23, except as
The fetch access is not subject to protection. follows:
When the storage address that is generated for
The authority-table origin is treated as a real
fetching the ASTE refers to a location which is not
or absolute address instead of as a real
available in the configuration, an addressing
address.
exception is recognized, and the operation is sup-
pressed. The EAX in control register 8 is used instead
of the authorization index (AX) in control reg-
Bit 0 of the ASTE indicates whether the ASTE ister 4.
specifies an address space. This bit is inspected,
When the value in bit positions 0-11 of the
and, if it is one, an ASTE-validity exception is
EAX is greater than the authority-table length
recognized, and the operation is nullified.
(ATL) in the ASTE, an extended-authority
exception is recognized instead of a
When bit 0 is zero, the ASTE sequence number
secondary-authority exception. The operation
(ASTESN) in bit positions 160-191 of the ASTE is
is nullified if the extended-authority exception
compared against the ASTESN in bit positions
is recognized.
96-127 of the access-list entry to determine
whether the addressing capability represented by When the private bit is one, the ALEAX is not
the access-list entry has been revoked. Inequality equal to the EAX, and the secondary bit in the
authority-table entry selected by the EAX is not
An access-list entry or ASN-second-table entry is An ALB ALD may be used for a particular instance
valid when the invalid bit associated with the entry of access-register translation when either of the
is zero. Access-list designations and authority- following conditions is met:
table entries have no invalid bit and are always
1. The primary-list bit in the ALET to be trans-
valid. The primary-space access-list designation
lated is zero, and the ALDSO field in the ALB
is valid regardless of the value of the invalid bit in
ALD matches the current dispatchable-unit-
the primary ASTE.
control-table origin.
An ART-table entry may be placed in the ALB 2. The primary-list bit in the ALET to be trans-
whenever the entry is attached and valid. lated is one, and the ALDSO field in the ALB
ALD matches the current primary-ASTE origin.
An access-list designation is attached to a CPU
An ALB ALE is in the usable state when the ALO
when the designation is within the dispatchable-
field in the ALB ALE matches the ALO field in an
unit control table designated by the dispatchable-
attached ALD or a usable ALB ALD.
unit-control-table origin in control register 2 or is
within the primary ASTE designated by the
An ALB ALE may be used for a particular instance
primary-ASTE origin in control register 5.
of access-register translation when all of the fol-
lowing conditions are met:
An access-list entry is attached to a CPU when
the entry is within the access list specified by 1. The ALET to be translated has a value larger
either an attached access-list designation (ALD) or than 1. (If the ALET is 0 or 1, the contents of
a usable ALB ALD. A usable ALB ALD is CR 1 or CR 7 are used.)
explained in the next section.
2. The ALO field in the ALB ALE matches the
ALO field in the ALD or ALB ALD being used
An ASN-second-table entry is attached to a CPU
in the translation.
when it is designated by the ASTE origin in either
an attached and valid access-list entry (ALE) or a 3. The ALEN field in the ALB ALE matches the
usable ALB ALE. A usable ALB ALE is explained ALEN field in the ALET to be translated.
in the next section.
An ALB ASTE is in the usable state when the
ASTEO field in the ALB ASTE matches the
An authority-table entry is attached to a CPU
ASTEO field in an attached and valid ALE or a
when it is within the authority table designated by
usable ALB ALE.
either an attached and valid ASN-second-table
entry (ASTE) or a usable ALB ASTE. A usable
An ALB ASTE may be used for a particular
ALB ASTE is explained in the next section.
instance of access-register translation when the
ASTEO field in the ALB ASTE matches the
ASTEO field in the ALE or ALB ALE being used in
the translation.
Base-Space Bit (B): Bit 31 specifies, when one, Access-List Designation (ALD): When this
that the address space associated with the ASTE ASTE is designated by the primary-ASTE origin in
is the base space of a subspace group. When control register 5, bits 128-159 are the primary-
BRANCH IN SUBSPACE GROUP uses an ALET space access-list designation (PSALD). During
other than ALETs 0 and 1 to locate a destination access-register translation when the primary-list
ASTE, it recognizes a special-operation exception bit, bit 7, in the ALET being translated is one, the
if the destination-ASTE origin does not equal the PSALD is the effective access-list designation.
base-ASTE origin in the dispatchable-unit control
table and bit 31 is one in the destination ASTE. ASN-Second-Table-Entry Sequence Number
(ASTESN): Bits 160-191 are used to control
Authorization Index (AX): Bits 32-47 are not revocation of the accessing capability represented
used by BRANCH IN SUBSPACE GROUP. by access-list entries that designate the ASTE.
During access-register translation, bits 160-191
Authority-Table Length (ATL): Bits 48-59 are are compared against the ASTESN in the access-
not used by BRANCH IN SUBSPACE GROUP. list entry, and inequality causes an
ASTE-sequence exception to be recognized.
Address-Space-Control Element (ASCE): Bits
64-127 are an eight-byte address-space-control Bits 224-255 in the ASTE are available for use by
element (ASCE) that may be a segment-table des- programming. When the ASTE is designated by a
ignation (STD), a region-table designation (RTD), subspace-ASTE origin (SSASTEO) in a
or a real-space designation (RSD). (The term dispatchable-unit control table, bits 160-191 are
region-table designation is used to mean a also used to control revocation of the linkage
region-first-table designation, region-second-table capability represented by that SSASTEO. When
designation, or region-third-table designation.) BRANCH IN SUBSPACE GROUP uses ALET 1 to
The ASCE field is obtained as the result of transfer control to the subspace specified by the
access-register translation done for BRANCH IN SSASTEO, or when PROGRAM CALL,
SUBSPACE GROUP. When BRANCH IN SUB- PROGRAM RETURN, PROGRAM TRANSFER,
SPACE GROUP uses an ALET other than ALETs SET SECONDARY ASN, or LOAD ADDRESS
0 and 1 to locate a destination ASTE, it recog- SPACE PARAMETERS uses the SSASTEO to set
nizes a special-operation exception if the bits 0-55 and 57-63 of the primary ASCE in
destination-ASTE origin does not equal the control register 1 or the secondary ASCE in
base-ASTE origin in the dispatchable-unit control control register 7 from the same bits of the ASCE
table and the subspace-group-control bit, bit 118 in the subspace ASTE, those instructions first test
(G), in the destination ASTE is zero. When bit 0 of the subspace ASTE for being zero and
BRANCH IN SUBSPACE GROUP transfers recognize an ASTE-validity exception if it is not,
control to the base space of a subspace group and they then compare bits 160-191 to the
associated with the current dispatchable unit, it subspace-ASTE sequence number (SSASTESN)
places bits 64-127 in control register 1; otherwise, in the dispatchable-unit control table and recog-
when BRANCH IN SUBSPACE GROUP transfers nize an ASTE-sequence exception if there is an
control to a subspace of the subspace group, it inequality. However, when either of the two
places bits 65-119 and 121-127 in bit positions named exception conditions exists for LOAD
0-55 and 57-63, respectively, of control register 1. ADDRESS SPACE PARAMETERS, the instruction
Bits 64-127 are used after ASN translation by sets condition code 1 or 2 instead of recognizing
PROGRAM CALL, PROGRAM RETURN, the exception.
Extended-Authorization-Index Control (E): Bit Bits 130 and 140-143 are reserved for possible
133, when one, specifies that bits 144-159 are to future extensions and should be zeros.
replace the current extended authorization index in
control register 8 as part of the stacking
PROGRAM CALL operation. When this bit is Linkage-Stack Operations
zero, the current extended authorization index
A linkage stack may be formed by the control
remains unchanged. Bit 133 is ignored during the
program for each dispatchable unit. The linkage
basic PROGRAM CALL operation.
stack is used to save the execution state and the
contents of the general registers and access regis-
Address-Space-Control Control (C): Bit 134,
ters during the BRANCH AND STACK and
when one, specifies that bit 17 of the current PSW
stacking PROGRAM CALL operations. The
is to be set to one as part of the stacking
linkage stack is also used to restore a portion of
PROGRAM CALL operation. When this bit is
the execution state and general-register and
zero, bit 17 is set to zero. Because the CPU must
access-register contents during the PROGRAM
be in either the primary-space mode or the
RETURN operation.
access-register mode when a stacking PROGRAM
CALL instruction is issued, the result is that the
A linkage stack resides in virtual storage. The
CPU is placed in the access-register mode if bit
linkage stack for a dispatchable unit is in the
134 is one or the primary-space mode if bit 134 is
home address space for that dispatchable unit.
zero. Bit 134 is ignored during the basic
The home address space is designated by the
PROGRAM CALL operation.
home address-space-control element in control
register 13.
Secondary-ASN Control (S): Bit 135, when one,
specifies that bits 80-95 are to become the new
The linkage stack is intended to be protected from
secondary ASN, and the new SASCE is to be set
problem-state programs so that these programs
equal to the new PASCE, as part of the stacking
cannot examine or modify the information saved in
PROGRAM CALL with-space-switching (PC-ss)
the linkage stack, except by means of the
operation. When this bit is zero, the new SASN
EXTRACT STACKED REGISTERS, EXTRACT
and SASCE are set equal to the PASN and
STACKED STATE, and MODIFY STACKED
PASCE, respectively, of the calling program. Bit
STATE instructions. This protection can be
135 is ignored during the basic PROGRAM CALL
obtained by means of key-controlled protection.
operation and the stacking PROGRAM CALL to-
current-primary (PC-cp) operation. A linkage stack may consist of a number of
linkage-stack sections chained together. A
Entry Key (EK): Bits 136-139 replace the PSW
linkage-stack section is variable in length. The
key in the PSW as part of the stacking
maximum length of each linkage-stack section is
PROGRAM CALL operation if the PSW-key
65,560 bytes.
control, bit 131, is one. Bits 136-139 are ignored,
and the current PSW key remains unchanged, if There are three types of entry in the linkage stack:
bit 131 is zero. Bits 136-139 are ignored during header entry, trailer entry, and state entry. A
the basic PROGRAM CALL operation. header entry and a trailer entry are at the begin-
ning and end, respectively, of a linkage-stack
section, and they are used to chain linkage-stack
sections together. Header entries and trailer
&
8 8 Contents of PSW Bits -63
/ General Registers / 128 Bytes
7 112 -15 136 143
78 12 6 In a Branch State Entry Made in 24-Bit
or 31-Bit Mode
8 128 &
88 136 Other Status Bits 33-63 of
/ Information / 96 Bytes A Branch Address
D 28
D8 216 6 144 148 151
Yes No No No No
Yes No Yes No Unp.
Yes Yes No \ \
Yes Yes Yes Yes Yes
No No No No No
No No Yes No Unp.
No Yes No No No
No Yes Yes No Unp.
Explanation:
\ This case cannot occur.
Unp. It is unpredictable whether or not the overlap is recognized.
The restart, program, supervisor-call, external, Serialization is performed by CPU reset, all inter-
input/output, and machine-check PSWs appear to ruptions, and by the execution of the following
be accessed doubleword-concurrent as observed instructions:
by other CPUs. These references appear to occur
The general instructions BRANCH ON CON-
after the conceptually previous unit of operation
DITION (BCR) with the M and R field con-
and before the conceptually subsequent unit of
taining all ones and all zeros, respectively,
operation. The relationship between the
and COMPARE AND SWAP, COMPARE
new-PSW fetch, the old-PSW store, and the
DOUBLE AND SWAP, STORE CLOCK,
interruption-code store is unpredictable.
SUPERVISOR CALL, and TEST AND SET.
Store accesses for interruption codes are not nec- LOAD PSW, LOAD PSW EXTENDED, and
essarily single-access stores. The store accesses SET STORAGE KEY EXTENDED.
for the external and supervisor-call-interruption
All I/O instructions.
codes appear to occur between the conceptually
previous and conceptually subsequent operations. COMPARE AND SWAP AND PURGE,
The store accesses for the program-interruption PURGE ALB, PURGE TLB, and SET PREFIX.
codes may precede the storage-operand refer- COMPARE AND SWAP AND PURGE may
ences associated with the instruction which results also cause the ART-lookaside buffer (ALB)
in the program interruption. and translation-lookaside buffer (TLB) to be
cleared of all entries. PURGE ALB and SET
PREFIX also cause the ALB to be cleared of
all entries. PURGE TLB and SET PREFIX
also cause the TLB to be cleared of all
entries.
The interruption mechanism permits the CPU to tion of the type of condition, interruption conditions
change its state as a result of conditions external are grouped into six classes: external,
to the configuration, within the configuration, or input/output, machine check, program, restart, and
within the CPU itself. To permit fast response to supervisor call.
conditions of high priority and immediate recogni-
RESTART None
(old PSW 288,
new PSW 416)
Restart key u unaffected
Explanation:
Locations for the old PSWs, new PSWs, and interruption codes are real locations.
A model-independent machine-check interruption code of 64 bits is stored at
real locations 232-239.
The effect of the machine-check condition is indicated by bits in the machine-
check-interruption code. The setting of these bits indicates the extent of
the damage and whether the unit of operation is nullified, terminated, or
unaffected.
The interruption code in the column labeled "Hex" is the hex code for the
basic interruption; this code does not show the effects of concurrent inter-
[BEGIN NO RPQ ONLY]
ruption conditions represented by n or p in the column labeled "Binary."
[END NO RPQ ONLY]
Bits 32-39 of control register 6 provide detailed masking of I/O-interruption
subclasses -7 respectively.
When the interruption code indicates a PER event, an ILC of may be stored
only when bits 8-15 of the interruption code are 111 (PER, specifi-
cation).
The unit of operation is completed, unless a program exception concurrently
indicated causes the unit of operation to be nullified, suppressed, or
terminated.
Explanation (Continued):
n A possible nonzero code indicating another concurrent program-interruption
condition
p If one, the bit indicates a concurrent PER-event interruption condition.
s Bits of the I field of SUPERVISOR CALL.
u Not stored.
For supervisor-call and program interruptions, a In the case of LOAD PSW, LOAD PSW
nonzero ILC identifies in halfwords the length of EXTENDED, PROGRAM RETURN, and the
the instruction that was last executed. That supervisor-call interruption, a PER event may be
instruction may be one for which a specification indicated concurrently with a specification excep-
exception was recognized due to an odd instruc- tion having an ILC of 0.
tion address or for which an access exception
(addressing, ASCE-type, page-translation, pro- In the case of a PROGRAM RETURN instruction
tection, region-translation, segment-translation, or that causes both a space-switch event and a
translation-specification) was recognized during PSW-format error, the space-switch event is
the fetching of the instruction. Whenever an recognized, but it is unpredictable whether the ILC
instruction is executed by means of EXECUTE, is 0 or 1, or 0 or 2 if EXECUTE was used.
When any exceptions are encountered on fetching For situation d, the effective address of the
the target instruction of EXECUTE, the ILC is 2. last instruction executed can be calculated,
but, since the address-space-control element
Programming Notes: for the instruction address space is unpredict-
able, the corresponding real address is
1. A nonzero instruction-length code for a
unknown.
program interruption indicates the number of
halfword locations by which the instruction 2. The instruction-length code (ILC) is redundant
address in the program old PSW must be when a PER event is indicated since the PER
reduced to obtain the instruction address of address in the doubleword at real location 152
the last instruction executed, unless one of the identifies the instruction causing the inter-
following situations exists: ruption (or the EXECUTE instruction, as
appropriate). Similarly, the ILC is redundant
a. The interruption is caused by an exception
when the operation is nullified, since in this
resulting in nullification.
case the instruction address in the PSW is not
If the same ETR condition occurs more than once The interrupt-key condition is indicated by an
before the interruption occurs, the request is gen- external-interruption code of 0040 hex.
erated only once. The request is generated for all
CPUs in the configuration. Malfunction Alert
The subclass-mask bit is in bit position 59 of
An interruption request for a malfunction alert is
control register 0. This bit is initialized to zero.
generated when another CPU in the configuration
enters the check-stop state or loses power. The
The ETR condition is indicated by an external-
request is preserved and remains pending in the
interruption code of 1406 hex.
receiving CPU until it is cleared. The pending
request is cleared when it causes an interruption
External Call and by CPU reset.
An interruption request for an external call is gen- Facilities are provided for holding a separate
erated when the CPU accepts the external-call malfunction-alert request pending in the receiving
order specified by a SIGNAL PROCESSOR CPU for each of the other CPUs in the configura-
instruction addressing this CPU. The instruction tion. Removal of a CPU from the configuration
may have been executed by this CPU or by does not generate a malfunction-alert condition.
another CPU in the configuration. The request is
preserved and remains pending in the receiving The subclass-mask bit is in bit position 48 of
CPU until it is cleared. The pending request is control register 0. This bit is initialized to zero.
cleared when it causes an interruption and by
CPU reset. The malfunction-alert condition is indicated by an
external-interruption code of 1200 hex. The
Only one external-call request, along with the address of the CPU that generated the condition
processor address, may be held pending in a CPU is stored at real locations 132-133.
at a time.
The service-signal condition is indicated by an I/O interruptions are grouped into eight
external-interruption code of 2401 hex. A 32-bit I/O-interruption subclasses, numbered from 0-7.
parameter is stored at real locations 128-131. *** Each I/O-interruption subclass has an associated
I/O-interruption subclass-mask bit in bit positions
32-39 of control register 6. Each subchannel has
I/O Interruption an I/O-interruption subclass value associated with
it. The CPU is enabled for I/O interruptions of a
The input/output (I/O) interruption provides a particular I/O-interruption subclass only when
means by which the CPU responds to conditions PSW bit 6 is one and the associated
originating in I/O devices and the channel sub- I/O-interruption subclass-mask bit in control reg-
system. ister 6 is also one. If the corresponding
I/O-interruption subclass-mask bit is zero, then the
A request for an I/O interruption may occur at any CPU is disabled for I/O interruptions with that sub-
time, and more than one request may occur at the class value. I/O interruptions for all subclasses
same time. The requests are preserved and are disallowed when PSW bit 6 is zero.
remain pending until accepted by a CPU, or until
cleared by some other means, such as subsystem
reset. Machine-Check Interruption
The I/O interruption occurs at the completion of a The machine-check interruption is a means for
unit of operation. Priority is established among reporting to the program the occurrence of equip-
requests so that in each CPU only one interruption ment malfunctions. Information is provided to
request is processed at a time. Priority among assist the program in determining the source of
requests for interruptions of differing the fault and extent of the damage.
I/O-interruption subclasses is according to the
numerical value of the I/O-interruption subclass A machine-check interruption causes the old PSW
(with zero having the highest priority), in conjunc- to be stored at real locations 352-367 and a new
tion with the I/O-interruption subclass-mask set- PSW to be fetched from real locations 480-495.
tings in control register 6. For more details, see
Chapter 16, I/O Interruptions. The cause and severity of the malfunction are
identified by a 64-bit machine-check-interruption
When a CPU becomes enabled for I/O inter- code stored at real locations 232-239. Further
ruptions and the channel subsystem has estab- information identifying the cause of the interruption
Except for PER events and the crypto-operation Data-Exception Code (DXC)
exception, the condition causing the interruption is
indicated by a coded value placed in the rightmost When a data exception causes a program inter-
seven bit positions of the interruption code. Only ruption, a data-exception code (DXC) is stored at
one condition at a time can be indicated. Bits 0-7 location 147, and zeros are stored at locations
of the interruption code are set to zeros. 144-146. The DXC distinguishes between the
various types of data-exception conditions. When
PER events are indicated by setting bit 8 of the the AFP-register (additional floating-point register)
interruption code to one. When this is the only control bit, bit 45 of control register 0, is one, the
condition, bits 9-15 are set to zeros. When a PER DXC is also placed in the DXC field of the
event is indicated concurrently with another floating-point-control (FPC) register. The DXC
program-interruption condition, bit 8 is one, and field in the FPC register remains unchanged when
the coded value for the other condition is indicated any other program exception is reported. The
in bit positions 9-15. Bits 0-7 of the interruption DXC is an 8-bit code indicating the specific cause
code are always set to zeros. of a data exception. The data exceptions and
data-exception codes are shown in Figure 6-2 on
The crypto-operation exception is indicated by an page 6-15 and Figure 6-3 on page 6-16.
interruption code of 0119 hex, or 0199 hex if a
PER event is also indicated.
Protection -- -- -- Suppress
exception
for access-
list-
controlled
protection
Explanation:
-- Not applicable.
Table entries include region table, segment table, page table, linkage
table, entry table, ASN first table, ASN second table, authority table,
dispatchable-unit-control table, primary ASN-second-table entry,
access list, and linkage stack.
Table entries include linkage stack and trace table.
Page protection applies to the linkage stack but not the trace table.
For termination, changes may occur only to result fields. In this
context, "result field" includes condition code, registers, and
storage locations, if any, which are designated to be changed by the
instruction. However, no change is made to a storage location or a
storage key when the reference causes an access exception. Therefore,
if an instruction is due to change only the contents of a field in
main storage, and every byte of that field would cause an access ex-
ception, the result is the same as if the operation had been sup-
pressed. The action may be, for key-controlled protection and low-
address protection, suppression instead of termination; see
"Suppression on Protection" in Chapter 3, "Storage."
When the effective address of TPI is zero, the store access is to
implicit real locations 184-191, and key-controlled protection, page
protection, and low-address protection do not apply.
Suppression occurs only for the compare-and-load and compare-and-
swap operations.
The instruction-length code is 2. 9. In the problem state, the key value specified
by the rightmost byte of general register 1 for
The primary-authority exception is indicated by a the instruction MOVE WITH SOURCE KEY or
program-interruption code of 0024 hex (or 00A4 MOVE WITH DESTINATION KEY corre-
hex if a concurrent PER event is indicated). sponds to a zero PSW-key-mask bit in control
register 3.
Privileged-Operation Exception 10. In the problem state, the key value specified
A privileged-operation exception is recognized by the rightmost byte of the register desig-
when any of the following is true: nated by the R field for the instruction
1. Execution of a privileged instruction is BRANCH AND SET AUTHORITY corresponds
attempted in the problem state. to a zero PSW-key-mask bit in control register
3.
2. The value of the rightmost bit of the general
register designated by the R field of the 11. In the problem state, bits 16 and 17 of the
PROGRAM TRANSFER instruction is zero PSW field in the second operand of RESUME
and would cause the PSW problem-state bit to PROGRAM have the value 11 binary.
change from the problem state (one) to the The operation is suppressed.
supervisor state (zero).
3. In the problem state, the key value specified The instruction-length code is 2 or 3.
by the second operand of the SET PSW KEY
The privileged-operation exception is indicated by
FROM ADDRESS instruction corresponds to a
a program-interruption code of 0002 hex (or 0082
zero PSW-key-mask bit in control register 3.
hex if a concurrent PER event is indicated).
4. In the problem state, the key value specified
by the rightmost byte of the register desig- Protection Exception
nated by the R field of the MOVE WITH KEY A protection exception is recognized when any of
instruction corresponds to a zero the following is true:
PSW-key-mask bit in control register 3.
1. Key-Controlled Protection: The CPU attempts
5. In the problem state, the key value specified to access a storage location that is protected
by the rightmost byte of the register desig- against the type of reference, and the access
nated by the R field for the instruction MOVE key does not match the storage key.
TO PRIMARY, MOVE TO SECONDARY, or
MOVE WITH KEY corresponds to a zero 2. Access-List-Controlled Protection: The CPU
PSW-key-mask bit in control register 3. attempts to store, in the access-register mode,
by means of an access-list entry which has
6. In the problem state, any of the instructions the fetch-only bit set to one.
EXTRACT PRIMARY ASN 3. Low-Address Protection: The CPU attempts a
EXTRACT SECONDARY ASN store that is subject to low-address protection,
INSERT ADDRESS SPACE CONTROL the effective address is in the range 0-511 or
INSERT PSW KEY 4096-4607, and the low-address protection
INSERT VIRTUAL STORAGE KEY control, bit 35 of control register 0, is one.
is encountered, and the extraction-authority
control, bit 4 of control register 0, is zero.
12. Execution of TRAP is attempted, and the 6. An odd-numbered general register is desig-
TRAP-enabled bit, bit 31 in bytes 44-47 of the nated by an R field of an instruction that
dispatchable-unit control table, is zero. requires an even-numbered register desig-
nation.
13. Execution of basic PROGRAM CALL is
attempted, and the extended-addressing-mode 7. A floating-point register other than 0, 1, 4, 5,
bit, bit 31 of the current PSW, does not equal 8, 9, 12, or 13 is designated for an extended
the entry-extended-addressing-mode bit, bit operand.
129, in the entry-table entry. 8. The multiplier or divisor in decimal arithmetic
14. Execution of LOAD REAL ADDRESS (LRA) is exceeds 15 digits and sign.
attempted in the 24-bit or 31-bit addressing 9. The length of the first-operand field is less
mode, and bits 0-32 of the resulting real or than or equal to the length of the second-
absolute address are not all zeros. operand field in decimal multiplication or divi-
sion.
Access register
Bits -6 not all zeros cc3 Complete cc3 Complete AS Suppress
Effective access-list designation
Invalid address of designation A Suppress A Suppress A Suppress
Access-list entry
Access-list-length violation cc3 Complete cc3 Complete AT Nullify
Invalid address of entry A Suppress A Suppress A Suppress
I bit on cc3 Complete cc3 Complete AT Nullify
Sequence number in access register cc3 Complete cc3 Complete ALQ Nullify
not equal to sequence number in
entry
ASN-second-table entry
Invalid address of entry A Suppress A Suppress A Suppress
I bit on cc3 Complete cc3 Complete AV Nullify
Sequence number in access-list cc3 Complete cc3 Complete ASQ Nullify
entry not equal to sequence
number in entry
Authority-table entry
Authority-table-length violation cc3 Complete cc3 Complete EA Nullify
Invalid address of entry A Suppress A Suppress A Suppress
Secondary-authority bit not one cc3 Complete cc3 Complete EA Nullify
Address-space-control element
Bits -1, -21, or -32 of cc3 Complete cc3 Complete ATY Nullify
instruction or operand address
not all zeros when address-
space-control element is a
region-second-table designation,
region-third-table designation,
or segment-table designation,
respectively
Region-table-entry designated by
address-space-control element or
region-table-entry
Entry outside of table cc3 Complete cc3 Complete RT Nullify
Invalid address of entry A Suppress A Suppress A Suppress
I bit on cc3 Complete cc3 Complete RT Nullify
TT in entry not equal DT in TS Suppress TS Suppress TS Suppress
address-space-control element or
not one less than TT in next-
higher-level entry
Explanation:
- The condition does not apply.
\ Action is to terminate except where otherwise specified in this publication.
For access-list-controlled protection and page protection, the action is
always to suppress.
TAR does not have a logical address. The rows "Address-space-control
element" through "Access for operands" apply only to TPROT, not to TAR.
Protection applies only to accesses for instruction fetch and for operands.
It does not apply to the fetching of the effective access-list
designation or any of the listed entries.
Exceptions related to an access register, effective access-list designa-
tion, access-list entry, ASN-second-table entry, or authority-table entry
are recognized only in the access-register mode except that, for LOAD REAL
ADDRESS and STORE REAL ADDRESS, they are recognized when PSW bits 16 and 17
are 1 binary, and, for TEST ACCESS, they are recognized regardless of the
translation mode.
Authority table is not accessed and secondary-authority bit is not checked
if the private bit in the access-list entry is zero or the access-list-
entry authorization index in the access-list entry is equal to the extended
authorization index in control register 8.
A translation-specification exception for a format error in a table entry
is recognized only when the execution of an instruction requires the entry
for translation of an address.
Any access exception is recognized as part of the instructions, it is not covered in the individual
execution of the instruction with which the excep- instruction definitions.
tion is associated. An access exception is not
recognized when the CPU attempts to prefetch Except where otherwise indicated in the individual
from an unavailable location or detects some other instruction description, the following rules apply for
access-exception condition, but a branch instruc- exceptions associated with an access to an
tion or an interruption changes the instruction operand location. For a fetch-type operand,
sequence such that the instruction is not exe- access exceptions are necessarily indicated only
cuted. for that portion of the operand which is required
for completing the operation. It is unpredictable
Every instruction can cause an access exception whether access exceptions are indicated for those
to be recognized because of instruction fetch. portions of a fetch-type operand which are not
Additionally, access exceptions associated with required for completing the operation. For a store-
instruction execution may occur because of an type operand, access exceptions are recognized
access to an operand in storage. for the entire operand even if the operation could
be completed without the use of the inaccessible
An access exception due to fetching an instruction part of the operand. In situations where the value
is indicated when the first instruction halfword of a store-type operand is defined to be unpredict-
cannot be fetched without encountering the excep- able, it is unpredictable whether an access excep-
tion. When the first halfword of the instruction has tion is indicated.
no access exceptions, access exceptions may be
indicated for additional halfwords according to the Whenever an access to an operand location can
instruction length specified by the first two bits of cause an access exception to be recognized, the
the instruction; however, when the operation can word access is included in the list of program
be performed without accessing the second or exceptions in the description of the instruction.
third halfwords of the instruction, it is unpredict- This entry also indicates which operand can cause
able whether the access exception is indicated for the exception to be recognized and whether the
the unused part. Since the indication of access exception is recognized on a fetch or store access
exceptions for instruction fetch is common to all to that operand location. Access exceptions are
recognized only for the portion of the operand as
defined for each particular instruction.
Explanation:
Not applicable when not in the access-register mode; not
applicable for execution of TEST ACCESS and for translation of
operand address of LOAD REAL ADDRESS and TEST PROTECTION.
Not applicable when not in the access-register mode, except
applicable for execution of TEST ACCESS and, when PSW bits 16
and 17 are 1 binary, for translation of operand address of
LOAD REAL ADDRESS and second-operand address of STORE REAL
ADDRESS.
Not applicable when DAT is off except for translation of
second-operand address of STORE REAL ADDRESS; not applicable
to operand addresses of LOAD REAL ADDRESS and TEST PROTECTION.
Not applicable when DAT is off except for translation of
operand address of LOAD REAL ADDRESS and second-operand
address of STORE REAL ADDRESS.
Not applicable when DAT is off, except for execution of
INVALIDATE PAGE TABLE ENTRY and for translation of operand
address of LOAD REAL ADDRESS and second-operand address of
STORE REAL ADDRESS.
Not applicable when DAT is off.
For MOVE PAGE, if the condition is true for both operands, the
exception is recognized for the second operand. Also, if the
condition-code-option bit is one, the exception is not
recognized. Instead, condition code 1 is set if the condition
is true for only the first operand, or condition code 2 is set
if the condition is true for the second operand or both
operands.
ASN-Translation Exceptions
The ASN-translation exceptions are those
exceptions which are common to the process of
translating an ASN in the instructions PROGRAM
RETURN, PROGRAM TRANSFER, and SET
SECONDARY ASN. The exceptions and the pri-
ority in which they are detected are shown in
Figure 6-8 on page 6-46.
During the execution of an instruction, several Instruction execution is resumed using the last-
interruption-causing events may occur simultane- fetched PSW. The order of executing interruption
ously. The instruction may give rise to a program subroutines is, therefore, the reverse of the order
interruption, a request for an external interruption in which the PSWs are fetched.
may be received, equipment malfunctioning may
be detected, an I/O-interruption request may be If the new PSW for a program interruption does
made, and the restart key may be activated. not specify the wait state and has an odd instruc-
Instead of the program interruption, a supervisor- tion address, or causes an access exception to be
call interruption might occur; or both can occur if recognized, another program interruption occurs.
PER is active. Simultaneous interruption requests Since this second interruption introduces the same
are honored in a predetermined order. unacceptable PSW, a string of interruptions is
established. These program exceptions are
An exigent machine-check condition has the recognized as part of the execution of the fol-
highest priority. When it occurs, the current oper- lowing instruction, and the string may be broken
ation is terminated or nullified. Program and by an external, I/O, machine-check, or restart
supervisor-call interruptions that would have interruption or by the stop function.
occurred as a result of the current operation may
be eliminated. Any pending repressible machine- If the new PSW for a program interruption con-
check conditions may be indicated with the tains a one in bit position 12 or in an unassigned
exigent machine-check interruption. Every rea- bit position, if the leftmost 40 bits of the instruction
ADD (32) AR RR C IF 1A
ADD (64) AGR RRE C N IF B98
ADD (64<32) AGFR RRE C N IF B918
ADD (32) A RX C A IF B5A
ADD (64) AG RXE C N A IF BE38
LOAD (32) LR RR 18
LOAD (64) LGR RRE N B94
LOAD (64<32) LGFR RRE N B914
LOAD (32) L RX A B58
LOAD (64) LG RXE N A BE34
Explanation:
Causes serialization and checkpoint synchronization.
Causes serialization and checkpoint synchronization when the M and R fields contain all
ones and all zeros, respectively.
$ Causes serialization.
A Access exceptions for logical addresses.
A Access exceptions; not all access exceptions may occur; see instruction description for
details.
AI Access exceptions for instruction address.
B PER branch event.
B B field designates an access register in the access-register mode.
B B field designates an access register in the access-register mode.
BP B field designates an access register when PSW bits 16 and 17 have the value 1 binary.
C Condition code is set.
Dd Decimal-operand data exception.
E E instruction format.
E2 Extended-translation facility 2.
EX Execute exception.
FC Designation of access registers depends on the function code of the instruction.
G Instruction execution includes the implied use of general register .
GM Instruction execution includes the implied use of multiple general registers:
General registers 1, 2, and 3 for COMPARE AND FORM CODEWORD.
General registers and 1 for COMPARE UNTIL SUBSTRING EQUAL and PERFORM LOCKED
OPERATION.
General registers and 1 for COMPRESSION CALL, TRANSLATE ONE TO ONE, TRANSLATE ONE
TO TWO, TRANSLATE TWO TO ONE, and TRANSLATE TWO TO TWO
General registers 1 and 2 for TRANSLATE AND TEST.
General registers -5 for UPDATE TREE.
IF Fixed-point-overflow exception.
II Interruptible instruction.
IK Fixed-point-divide exception.
I1 Access register 1 is implicitly designated in the access-register mode.
I2 Access register 2 is implicitly designated in the access-register mode.
I4 Access register 4 is implicitly designated in the access-register mode.
L New condition code is loaded.
Program Exceptions:
'B98' //////// R R
Access (fetch, operand 2 of A, AG, and AGF
16 24 28 31 only)
Fixed-point overflow
AGFR R,R [RRE]
ADD HALFWORD
16 24 28 31
'4A' R X B D
A R,D(X,B) [RX]
8 12 16 2 31
'5A' R X B D
ADD HALFWORD IMMEDIATE
8 12 16 2 31
AHI R,I [RI]
AG R,D(X,B) [RXE]
/ 'A7' R 'A' I
'E3' R X B D //////// '8'
/ 8 12 16 31
8 12 16 2 32 4 47
AGHI R,I [RI]
AGF R,D(X,B) [RXE]
/ 'A7' R 'B' I
'E3' R X B D //////// '18'
/ 8 12 16 31
8 12 16 2 32 4 47
The second operand is added to the first operand,
The second operand is added to the first operand, and the sum is placed at the first-operand
and the sum is placed at the first-operand location. The second operand is two bytes in
location. For ADD (AR, A), the operands and the length and is treated as a 16-bit signed binary
sum are treated as 32-bit signed binary integers. integer. For ADD HALFWORD and ADD
For ADD (AGR, AG), they are treated as 64-bit HALFWORD IMMEDIATE (AHI), the first operand
signed binary integers. For ADD (AGFR, AGF), and the sum are treated as 32-bit signed binary
the second operand is treated as a 32-bit signed integers. For ADD HALFWORD IMMEDIATE
binary integer, and the first operand and the sum (AGHI), they are treated as 64-bit signed binary
are treated as 64-bit signed binary integers. integers.
When there is an overflow, the result is obtained When there is an overflow, the result is obtained
by allowing any carry into the sign-bit position and by allowing any carry into the sign-bit position and
ignoring any carry out of the sign-bit position, and ignoring any carry out of the sign-bit position, and
16 24 28 31
'B998' //////// R R
ALGFR R,R [RRE]
16 24 28 31
16 24 28 31
'B988' //////// R R
AL R,D(X,B) [RX]
16 24 28 31
8 12 16 2 31 /
'E3' R X B D //////// '98'
/
ALG R,D(X,B) [RXE]
8 12 16 2 32 4 47
/
'E3' R X B D //////// 'A'
/
8 12 16 2 32 4 47
/
'E3' R X B D //////// '88' '54' R X B D
/
8 12 16 2 32 4 47 8 12 16 2 31
The second operand and the carry are added to NG R,D(X,B) [RXE]
the first operand, and the sum is placed at the
/
first-operand location. For ADD LOGICAL WITH 'E3' R X B D //////// '8'
CARRY (ALCR, ALC), the operands, the carry, /
and the sum are treated as 32-bit unsigned binary 8 12 16 2 32 4 47
integers. For ADD LOGICAL WITH CARRY
(ALCGR, ALCG), they are treated as 64-bit NI D(B),I [SI]
unsigned binary integers.
Resulting Condition Code: '94' I B D
0 Result zero; no carry 8 16 2 31
1 Result not zero; no carry
2 Result zero; carry NC D(L,B),D(B) [SS]
3 Result not zero; carry
//
Program Exceptions: 'D4' L B D B D
//
Access (fetch, operand 2 of ALC and ALCG 8 16 2 32 36 47
only)
Condition Code: The code remains unchanged. Information from the current PSW, including the
updated instruction address, is saved as link infor-
Program Exceptions: mation at the first-operand location. Subse-
quently, the instruction address in the PSW is
Trace (R field nonzero, BALR only) replaced by the branch address.
Programming Notes: In the 24-bit or 31-bit addressing mode, the link
1. An example of the use of the BRANCH AND information is bits 32 and 97-127 of the PSW,
LINK instruction is given in Appendix A, consisting of the basic-addressing-mode bit and
Number Representation and Instruction-Use the rightmost 31 bits of the updated instruction
Examples. address. The link information is placed in bit posi-
tions 32 and 33-63, respectively, of the first-
2. When the R field in the RR format is zero,
Program Exceptions:
Information from the current PSW, including the
updated instruction address, is saved as link infor- Trace (R field nonzero)
mation at the first-operand location. Subse-
Programming Notes:
8 12 15
1. An example of the use of the BRANCH AND
In the 24-bit or 31-bit addressing mode, bit 32 of SET MODE instruction is given in
the current PSW, the basic-addressing-mode bit, Appendix A, Number Representation and
is inserted into bit position 32 of the first operand, Instruction-Use Examples.
a zero is inserted into bit position 63 of that 2. BRANCH AND SET MODE with an R field of
operand, and bits 0-31 and 33-62 of the operand zero is intended to be the standard return
remain unchanged. In the 64-bit addressing instruction in a program entered by means of
mode, a one is inserted into bit position 63 of the BRANCH AND SAVE AND SET MODE. It
first operand, and bits 0-62 of the operand remain can also be the return instruction in a program
unchanged. Subsequently, the addressing-mode entered in the 24-bit or 31-bit addressing
bits and instruction address in the PSW are mode by means of BRANCH AND SAVE,
replaced as specified by the second operand. BRANCH RELATIVE AND SAVE, or BRANCH
The instruction address in the current PSW is 3. When all four mask bits are zeros or when the
replaced by the branch address if the condition R field in the RR format contains zero, the
code has one of the values specified by M; other- branch instruction is equivalent to a no-
wise, normal instruction sequencing proceeds with operation. When all four mask bits are ones,
the updated instruction address. that is, the mask value is 15, the branch is
unconditional unless the R field in the RR
In the RX format, the second-operand address is format is zero.
used as the branch address. In the RR format, 4. Execution of BCR 15,0 (that is, an instruction
the contents of general register R are used to with a value of 07F0 hex) may result in signif-
generate the branch address; however, when the icant performance degradation. To ensure
R field is zero, the operation is performed without optimum performance, the program should
branching. avoid use of BCR 15,0 except in cases when
the serialization or checkpoint-synchronization
The M field is used as a four-bit mask. The four
function is actually required.
condition codes (0, 1, 2, and 3) correspond, left to
right, with the four bits of the mask, as follows: 5. Note that the relation between the RR and RX
formats in branch-address specification is not
Instruction Mask the same as in operand-address specification.
Condition Bit No. of Position For branch instructions in the RX format, the
Code Mask Value branch address is the address specified by
X, B, and D; in the RR format, the branch
8 8 address is contained in the register desig-
1 9 4
2 1 2 nated by R. For operands, the address
3 11 1 specified by X, B, and D is the operand
address, but the register designated by R
Condition Code: The code remains unchanged. The instruction address in the current PSW is
replaced by the branch address if the condition
Program Exceptions: None. code has one of the values specified by M; other-
wise, normal instruction sequencing proceeds with
Programming Notes: the updated instruction address.
1. The operation is the same as that of the
BRANCH AND SAVE (BAS) instruction except The contents of the I field are a signed binary
for the means of specifying the branch integer specifying the number of halfwords that is
address. An example of the use of BRANCH added to the address of the instruction to generate
AND SAVE is given in Appendix A. the branch address.
Instruction Mask
Condition Bit No. of Position 'A7' R '6' I
Code Mask Value
8 12 16 31
8 8
1 9 4 BRCTG R,I [RI]
2 1 2
3 11 1
'A7' R '7' I
The current condition code is used to select the
8 12 16 31
corresponding mask bit. If the mask bit selected
by the condition code is one, the branch is suc-
cessful. If the mask bit selected is zero, normal A one is subtracted from the first operand, and the
instruction sequencing proceeds with the next result is placed at the first-operand location. For
sequential instruction. BRANCH RELATIVE ON COUNT (BRCT), the first
operand and result are treated as 32-bit binary
Condition Code: The code remains unchanged. integers, with overflow ignored. For BRANCH
RELATIVE ON COUNT (BRCTG), the first
Program Exceptions: None. operand and result are treated as 64-bit binary
integers, with overflow ignored. When the result is
Programming Notes: zero, normal instruction sequencing proceeds with
1. The operation is the same as that of the the updated instruction address. When the result
BRANCH ON CONDITION instruction except is not zero, the instruction address in the current
for the means of specifying the branch PSW is replaced by the branch address.
address. An example of the use of BRANCH
The contents of the I field are a signed binary
ON CONDITION is given in Appendix A.
integer specifying the number of halfwords that is
2. When a branch is to depend on more than added to the address of the instruction to generate
one condition, the pertinent condition codes the branch address.
are specified in the mask as the sum of their
mask position values. A mask of 12, for Condition Code: The code remains unchanged.
example, specifies that a branch is to be
made when the condition code is 0 or 1. Program Exceptions: None.
3. When all four mask bits are zeros, the branch Programming Notes:
instruction is equivalent to a no-operation.
When all four mask bits are ones, that is, the 1. The operation is the same as that of the
mask value is 15, the branch is unconditional. BRANCH ON COUNT instruction except for
the means of specifying the branch address.
4. When the instruction is the target of An example of the use of BRANCH ON
EXECUTE, the branch is relative to the target COUNT is given in Appendix A.
address; see Branch-Address Generation on
page 5-8. 2. The first operand and result can be consid-
ered as either signed or unsigned binary inte-
gers since the result of a binary subtraction is
the same in both cases.
3. An initial count of one results in zero, and no
branching takes place; an initial count of zero
results in -1 and causes branching to be exe-
cuted; an initial count of -1 results in -2 and
causes branching to be executed; and so on.
In a loop, branching takes place each time the
If the operation ends because the entire second Access exceptions for the portion of the second
operand has been processed, the condition code operand to the right of the last byte processed
is set to 0. If the operation ends because a lesser may or may not be recognized. For a second
CPU-determined amount of the second operand operand longer than 4K bytes, access exceptions
has been processed, the condition code is set to are not recognized for locations more than 4K
3. When the operation is to end with a setting of bytes beyond the last byte processed.
condition code 3, any carry out of bit position 32
of the first operand is added to bit position 63 of Access exceptions are not recognized if the R
the first operand before the operation ends. field is odd. When the length of the second
operand is zero, no access exceptions are recog-
At the completion of the operation, the 32-bit or nized.
64-bit operand-length field in the R + 1 register
is decremented by the number of actual second- Resulting Condition Code:
operand bytes added to the first operand (not 0 Entire second operand processed
including any conceptually appended all-zeros 1 --
bytes), and the address in the R register is incre- 2 --
mented by the same number. Thus, the the 32-bit 3 CPU-determined amount of second operand
or 64-bit operand-length field contains a zero processed
value if the condition code is set to 0, or it con-
tains a nonzero value if the condition code is set Program Exceptions:
to 3. In the 24-bit or 31-bit addressing mode, bits
0-31 of the R + 1 register always remain Access (fetch, operand 2)
unchanged. Specification
COMPARE
8 12 15
COMPARE AND FORM
CGR R,R [RRE] CODEWORD
CFC D(B) [S]
'B92' //////// R R
16 24 28 31 'B21A' B D
16 2 31
CGFR R,R [RRE]
'59' R X B D
The second-operand address is not used to
8 12 16 2 31 address data. Bits 49-62 of the second-operand
address, with one rightmost and one leftmost zero
CG R,D(X,B) [RXE] appended, are used as a 16-bit index limit. Bit 63
of the second-operand address is the operand-
/ control bit. When bit 63 is zero, the codeword is
'E3' R X B D //////// '2' formed from the high operand; when bit 63 is one,
/ the codeword is formed from the low operand.
8 12 16 2 32 4 47
The remainder of the second-operand address is
ignored.
CGF R,D(X,B) [RXE]
General registers 1 and 3 contain the base
/
'E3' R X B D //////// '3' addresses of the first and third operands. Bits
/ 48-63 of general register 2 are used as an index
8 12 16 2 32 4 47 for addressing both the first and third operands.
General registers 1, 2, and 3 must all initially
contain even values; otherwise, a specification
The first operand is compared with the second
exception is recognized.
operand, and the result is indicated in the condi-
tion code. For COMPARE (CR, C), the operands
In the access-register mode, access register 1
are treated as 32-bit signed binary integers. For
specifies the address space containing the first
COMPARE (CGR, CG), they are treated as 64-bit
and third operands.
signed binary integers For COMPARE (CGFR,
CGF), the second operand is treated as a 32-bit The size of the units by which the first and third
signed binary integer, and the first operand is operands are compared, the size of the resulting
treated as a 64-bit signed binary integer. codeword, and the participation of bits 0-31 of
general registers 1, 2, and 3 in the operation
Resulting Condition Code:
depend on the addressing mode. In the 24-bit or
0 Operands equal 31-bit addressing mode, the comparison unit is
1 First operand low two bytes, the codeword is four bytes, and bits
2 First operand high 0-31 are ignored and remain unchanged. In the
3 --
Explanation:
- The bits remain unchanged.
OGR1 The original value of GR1 bits 32-63.
OGR3 The original value of GR3 bits 32-63.
OGR3b1 The original value of GR3 bits 32-63 with bit 32
set to one.
X Bits 32-47 of GR2 are 2 more than the index of the
first unequal halfword.
nop1 Bits 48-63 of GR2 are the one's complement of the
first unequal halfword in operand 1.
nop3 Bits 48-63 of GR2 are the one's complement of the
first unequal halfword in operand 3.
top1 Bits 48-63 of GR2 are the first unequal halfword
in operand 1.
top3 Bits 48-63 of GR2 are the first unequal halfword
in operand 3.
Figure 7-3. Operation of COMPARE AND FORM CODEWORD in the 24-Bit or 31-bit Addressing Mode
Explanation:
- The bits remain unchanged.
OGR1 The original value of GR1 bits -63.
OGR3 The original value of GR3 bits -63.
OGR3b1 The original value of GR3 bits -63 with bit set
to one.
X Bits -15 of GR2 are 6 more than the index of the
first unequal six-byte unit.
nop1 Bits 16-63 of GR2 are the one's complement of the
first unequal six-byte unit in operand 1.
nop3 Bits 16-63 of GR2 are the one's complement of the
first unequal six-byte unit in operand 3.
top1 Bits 16-63 of GR2 are the first unequal six-byte
unit in operand 1.
top3 Bits 16-63 of GR2 are the first unequal six-byte
unit in operand 3.
Figure 7-5. Operation of COMPARE AND FORM CODEWORD in the 64-Bit Addressing Mode
COMPARE LOGICAL
'49' R X B D
CLR R,R [RR]
8 12 16 2 31
'15' R R
8 12 15
The comparison proceeds left to right, byte by The location of the leftmost byte of the first
byte, and ends as soon as an inequality is found operand and second operand is designated by the
or the end of the fields is reached. contents of general registers R and R, respec-
tively. The number of bytes in the first-operand
When the mask is not zero, exceptions associated and second-operand locations is specified by
with storage-operand access are recognized for unsigned binary integers in bit positions 40-63 of
no more than the number of bytes specified by the general registers R + 1 and R + 1, respec-
mask. Access exceptions may or may not be tively. Bit positions 32-39 of general register
recognized for the portion of a storage operand to R + 1 contain the padding byte. The contents of
the right of the first unequal byte. When the mask bit positions 0-39 of general register R + 1 and
is zero, access exceptions are recognized for one of bit positions 0-31 of general register R + 1
byte at the second-operand address. are ignored.
The comparison proceeds left to right, byte by The execution of the instruction is interruptible.
byte, and ends as soon as an inequality is found When an interruption occurs, other than one that
or the end of the longer operand is reached. If causes termination, the lengths in general regis-
the operands are not of the same length, the ters R + 1 and R + 1 are decremented by the
shorter operand is considered to be extended on number of bytes compared, and the addresses in
the right with the appropriate number of padding general registers R and R are incremented by
bytes. the same number, so that the instruction, when
reexecuted, resumes at the point of interruption.
If both operands are of zero length, the operands In the 24-bit or 31-bit addressing mode, the left-
are considered to be equal. most bits which are not part of the address in bit
positions 32-63 of general registers R and R are
set to zeros, and the contents of bit positions 0-31
Figure 7-8. Register Contents and Second-Operand Address for COMPARE LOGICAL LONG EXTENDED
The comparison proceeds left to right, byte by CPU-determined number of bytes have been com-
byte, and ends as soon as an inequality is found, pared, whichever occurs first. If the operands are
the end of the longer operand is reached, or a not of the same length, the shorter operand is
If both operands are of zero length, the operands The amount of processing that results in the
are considered to be equal. setting of condition code 3 is determined by the
CPU on the basis of improving system perform-
If the operation ends because of an inequality, the ance, and it may be a different amount each time
address fields in general registers R and R at the instruction is executed. The maximum amount
completion identify the first unequal byte in each is approximately 4K bytes of either operand.
operand. The lengths in bit positions 32-63, in the
24-bit or 31-bit addressing mode, or in bit posi- At the completion of the operation in the 24-bit or
tions 0-63, in the 64-bit addressing mode, of 31-bit addressing mode, the leftmost bits which
general registers R + 1 and R + 1 are decre- are not part of the address in bit positions 32-63
mented by the number of bytes that were equal, of general registers R and R may be set to
unless the inequality occurred with the padding zeros or may remain unchanged from their original
byte, in which case the length field for the shorter values, even when one or both of the initial length
operand is set to zero. The addresses in general values are zero.
registers R and R are incremented by the
amounts by which the corresponding length fields Access exceptions for the portion of a storage
were decremented. Condition code 1 is set if the operand to the right of the first unequal byte may
first operand is low, or condition code 2 is set if or may not be recognized. For operands longer
the first operand is high. than 4K bytes, access exceptions are not recog-
nized more than 4K bytes beyond the byte being
If the two operands, including the padding byte, if processed. Access exceptions are not indicated
necessary, are equal, both length fields are made for locations more than 4K bytes beyond the first
zero at completion, and the addresses are incre- unequal byte.
mented by the corresponding operand-length
values. Condition code 0 is set. When the length of an operand is zero, no access
exceptions are recognized for that operand.
If the operation is completed because a Access exceptions are not recognized for an
CPU-determined number of bytes have been com- operand if the R field associated with that operand
pared without finding an inequality or reaching the is odd.
end of the longer operand, the lengths in general
registers R + 1 and R + 1 are decremented by Resulting Condition Code:
the number of bytes compared, and the addresses 0 All bytes compared; operands equal, or both
in general registers R and R are incremented by zero length
the same number, so that the instruction, when 1 All bytes compared, first operand low
reexecuted, resumes at the next bytes to be com- 2 All bytes compared, first operand high
pared. If the operation is completed after the 3 CPU-determined number of bytes compared
shorter operand has been exhausted, the length without finding an inequality
field pertaining to the shorter operand is zero, and
the operand address is updated accordingly. Con- Program Exceptions:
dition code 3 is set.
Access (fetch, operands 1 and 3)
In the 24-bit or 31-bit addressing mode, the con- Specification
tents of bit positions 0-31 of general registers R,
R + 1, R, and R + 1, always remain Programming Notes:
unchanged. 1. COMPARE LOGICAL LONG EXTENDED is
intended for use in place of COMPARE
The padding byte may be formed from D(B) LOGICAL LONG when the operand lengths
multiple times during the execution of the instruc- are specified as 32-bit binary integers.
tion, and the registers designated by R and R COMPARE LOGICAL LONG EXTENDED sets
may be updated multiple times. Therefore, if B condition code 3 in cases in which COMPARE
equals R, R + 1, R, or R + 1 and is subject LOGICAL LONG would be interrupted.
Figure 7-9. Register Contents and Second-Operand Address for COMPARE LOGICAL LONG UNICODE
operand is considered to be extended on the right If both operands are of zero length, the operands
with the appropriate number of two-byte padding are considered to be equal.
characters.
The location of the leftmost byte of the first When condition code 1 or 2 is set, the address of
operand and second operand is designated by the the last byte processed in the first and second
24-Bit Addressing Mode 31-Bit Addressing Mode
/ /
R //////////// First-Operand Address //// First-Operand Address
/ /
4 63 33 63
/ /
R + 1 /// First-Operand Length /// First-Operand Length
/ /
32 63 32 63
/ /
R ////////////Second-Operand Address //// Second-Operand Address
/ /
4 63 33 63
/ /
R + 1 /// Second-Operand Length /// Second-Operand Length
/ /
32 63 32 63
64-Bit Addressing Mode
/
R First-Operand Address
/
63
/
R + 1 First-Operand Length
/
63
/
R Second-Operand Address
/
63
/
R + 1 Second-Operand Length
/
63
The result is obtained as if the operands were The comparison proceeds left to right, byte by
processed from left to right. However, multiple byte, and ends as soon as (1) equal substrings of
accesses may be made to all or some of the bytes the specified length are found, (2) the end of the
of each operand. longer operand is reached without finding equal
substrings of the specified length, or (3) the last
bytes compared are unequal, and a
If both operands are of zero length but the speci- In the 24-bit or 31-bit addressing mode, the con-
fied substring length is not zero, it is considered tents of bit positions 0-31 of general registers R,
that the end of the longer operand was reached R + 1, R, and R + 1, always remain
when unequal bytes were the last bytes com- unchanged.
pared, and condition code 2 is set.
The substring length and padding byte may be
If equal bytes have been compared but then fetched from general registers 0 and 1 multiple
unequal bytes are compared, it is considered that times during the execution of the instruction, and
all bytes so far compared are unequal. the registers designated by R and R may be
updated multiple times. Therefore, if R or R is
At the completion of the operation, the operand- zero, the results are unpredictable.
length fields in the R + 1 and R + 1 registers
are decremented by the number of unequal bytes When condition code 3 is set, the general regis-
compared (including equal bytes before unequal ters used by the instruction have been set so that
bytes compared), and the addresses in the R the remainder of the operands can be processed
and R registers are incremented by the same by simply branching back and reexecuting the
number. However, in the case when a byte of the instruction.
longer operand is compared against the padding
byte, the length field for the shorter operand is not The amount of processing that results in the
decremented below zero, and the corresponding setting of condition code 3 is determined by the
address is not incremented above the address of CPU on the basis of improving system perform-
the first byte after the shorter operand. In the ance, and it may be a different amount each time
24-bit or 31-bit addressing mode, the leftmost bits the instruction is executed.
which are not part of the addresses in bit positions
32-63 of registers R and R are set to zeros, The execution of the instruction is interruptible
even if the substring length is zero or both when the last bytes compared are unequal; it is
operand lengths are initially zero. not interruptible when the last bytes compared are
equal. When an interruption occurs, other than
Thus, when condition code 0 or 1 is set, the one that causes termination, the contents of the
resulting addresses in the R and R registers registers designated by the R and R fields are
compressed-data operand always contains index as shown in the figure. Bits 48-51 must not have
symbols that designate entries in the expansion any of the values 0000 or 0110-1111 binary; oth-
dictionary. erwise, a specification exception is recognized.
When symbol-translation is not specified, bits
Bits 48-51 (CDSS) of general register 0 specify 48-51 also specify, as shown in the figure, the
the number of bits in the index symbols or inter- number of eight-byte entries in each of the com-
change symbols in the compressed-data operand, pression and expansion dictionaries, and, thus,
/
S F
GR /////////////TCDSS//1E////////
/
47 52 54 56 63
Explanation:
Compression dictionary during compression, or expansion dictionary during
expansion
CBN Compressed-data bit number
CDSS Compressed-data symbol size, and dictionary size when symbol
translation not specified
CDSS Symbol Dictionary
(binary) Size Size
Causes a specification exception to be recognized
1 9 bits 512 entries, 4K bytes
1 1 bits 1K entries, 8K bytes
11 11 bits 2K entries, 16K bytes
1 12 bits 4K entries, 32K bytes
11 13 bits 8K entries, 64K bytes
11-1111 Causes a specification exception to be recognized
E Expansion operation
F1 Format-1 sibling descriptors (ignored during expansion)
ST Symbol-translation option (ignored during expansion)
STT Off. Symbol-translation-table offset (ignored during expansion)
they specify the size in bytes of each of the dic- are unpredictable. For example, if the CDSS is
tionaries. When symbol translation is specified, 0101, the offset must be at least 32K bytes.
the compression dictionary is considered to extend
to the beginning of the symbol-translation table, Bit 54 (F1) of general register 0 specifies that the
that is, the size in bytes of the compression dic- compression dictionary contains format-0 sibling
tionary is the offset in bit positions 52-60 of descriptors if the bit is zero or format-1 sibling
general register 1, with seven rightmost zeros descriptors if the bit is one. Sibling descriptors
appended. The size in bytes of the symbol- are used during the compression operation. A
translation table is considered to be one fourth format-0 sibling descriptor is eight bytes at an
that of the compression dictionary. However, the index position in the compression dictionary. A
offset in general register 1 must be at least as format-1 sibling descriptor is 16 bytes, with the
large as the size of the compression dictionary first eight bytes at an index position in the com-
would be if symbol translation were not specified pression dictionary and the second eight bytes at
and the CDSS were one less than it actually is, the same index position in the expansion dic-
and, when the CDSS is 0001 binary, the offset tionary. During compression when bit 54 is one,
must be at least 2K bytes; otherwise, the results an expansion dictionary is considered to imme-
If an access exception is due to be recognized for The references to the operands, dictionaries, and
either of the operands or for a dictionary or the symbol-translation table are multiple-access refer-
symbol-translation table, the result is that either ences.
the exception is recognized or condition code 3 is
set. If condition code 3 is set, the exception will Special Conditions
CONVERT TO BINARY
Unicode High Surrogate 111111 Any Unicode character in the range 0000 to 007F
Bit Numbers 1234567 8912345 hex is converted to a one-byte UTF-8 character as
follows:
Identifying Bit Letters 1111ab cdefghij
Unicode jklmnop
Character
Unicode Low Surrogate 11112222 22222233
Bit Numbers 6789123 4567891 UTF-8 jklmnop
Character
Identifying Bit Letters 11111kl mnopqrst
Any Unicode character in the range 0080 to 07FF
hex is converted to a two-byte UTF-8 character as
follows:
Any Unicode character in the range 0800 to D7FF In the 24-bit or 31-bit addressing mode, the con-
and DC00 to FFFF hex is converted to a three- tents of bit positions 0-31 of general registers R,
byte UTF-8 character as follows: R + 1, R, and R + 1, always remain
Unicode abcdefgh ijklmnop unchanged.
Character
When condition code 3 is set, the registers have
UTF-8 111abcd 1efghij 1klmnop been updated so that the instruction, when reexe-
Character cuted, resumes at the next byte locations to be
Any Unicode surrogate pair starting with a high processed.
surrogate in the range D800 to DBFF hex is con-
verted to a four-byte UTF-8 character as follows: The amount of processing that results in the
setting of condition code 3 is determined by the
Unicode 1111ab cdefghij 11111kl mnopqrst
Characters CPU on the basis of improving system perform-
ance, and it may be a different amount each time
UTF-8 1111uvw 1xyefgh 1ijklmn 1opqrst the instruction is executed.
Character
When the R register is the same register as the
where uvwxy = abcd + 1 R register, the results are unpredictable.
The first six bits of the second Unicode character
are ignored. When the second operand overlaps the first
operand, the results are unpredictable.
The second-operand location is considered
exhausted when it does not contain at least two Access exceptions for the portions of the oper-
remaining bytes or at least four remaining bytes ands to the right of the last byte processed may or
when the first two bytes are a Unicode high surro- may not be recognized. For an operand longer
gate. The first-operand location is considered than 4K bytes, access exceptions are not recog-
exhausted when it does not contain at least the nized for locations more than 4K bytes beyond the
one, two, three, or four remaining bytes required last byte processed.
to contain the UTF-8 character resulting from the
conversion of the next second-operand character When the length of an operand is zero, no access
or surrogate pair. exceptions are recognized for that operand.
Access exceptions are not recognized for an
When the second-operand location is exhausted, operand if the R field associated with that operand
condition code 0 is set. When the first-operand is odd.
location is exhausted, condition code 1 is set,
except that condition code 0 is set if the second- Resulting Condition Code:
operand location also is exhausted. When a 0 Entire second operand processed
CPU-determined number of characters have been 1 End of first operand reached
converted, condition code 3 is set. 2 --
3 CPU-determined number of characters con-
When the operation is completed, the contents of verted
general register R + 1 are decremented by the
number of bytes converted, and the contents of Program Exceptions:
general register R are incremented by the same
number. Also, the contents of general register Access (fetch, operand 2; store, operand 1)
R + 1 are decremented by the number of bytes Specification
placed at the first-operand location, and the con- Programming Note: When condition code 3 is
tents of general register R are incremented by set, the program can simply branch back to the
the same number. When general registers R instruction to continue the conversion. The
When the contents of the first byte of a UTF-8 When the contents of the first byte of a UTF-8
character are in the range E0 to EF hex, the char- character are in the range F0 to F7 hex, the char-
acter is a three-byte character, and it is converted acter is a four-byte character, and it is converted
to a two-byte Unicode character as follows:
When the second-operand location is exhausted, When the second operand overlaps the first
condition code 0 is set. When the first-operand operand, the results are unpredictable.
location is exhausted, condition code 1 is set,
except that condition code 0 is set if the second- Access exceptions for the portions of the oper-
operand location also is exhausted. When a ands to the right of the last byte processed may or
CPU-determined number of characters have been may not be recognized. For an operand longer
processed, condition code 3 is set. than 4K bytes, access exceptions are not recog-
nized for locations more than 4K bytes beyond the
When the contents of the first byte of the next last byte processed.
UTF-8 character are in the range 80 to BF hex or
F8 to FF hex, the character is invalid, and condi- When the length of an operand is zero, no access
tion code 2 is set. exceptions are recognized for that operand.
Access exceptions are not recognized for an
When the conditions for setting condition codes 1 operand if the R field associated with that operand
and 2 are both met, condition code 2 is set. is odd.
Program Exceptions:
DLG R,D(X,B) [RXE]
Access (fetch, operand 2 of DL or DLG only)
/ Fixed-point divide
'E3' R X B D //////// '87' Specification
/
8 12 16 2 32 36 4 47
DIVIDE SINGLE
The 64-bit or 128-bit first operand (the dividend) is
DSGR R,R [RRE]
divided by the 32-bit or 64-bit second operand (the
divisor), and the 32-bit or 64-bit remainder and
quotient are placed at the first-operand location. 'B9D' //////// R R
The R field designates an even-odd pair of 16 24 28 31
general registers and must designate an even-
numbered register; otherwise, a specification DSGFR R,R [RRE]
exception is recognized.
For DIVIDE LOGICAL (DLR, DL), the dividend is 'B91D' //////// R R
treated as a 64-bit unsigned binary integer. The 16 24 28 31
leftmost 32 bits of the dividend are in bit positions
32-63 of general register R, and the rightmost 32
DSG R,D(X,B) [RXE]
bits are in bit positions 32-63 of general register
R + 1. /
'E3' R X B D //////// 'D'
The divisor, remainder, and quotient are treated /
as 32-bit unsigned binary integers. For DIVIDE 8 12 16 2 32 4 47
LOGICAL (DLR), the divisor is in bit positions
32-63 of general register R. The remainder is DSGF R,D(X,B) [RXE]
placed in bit positions 32-63 of general register
R, and the quotient is placed in bit positions /
'E3' R X B D //////// '1D'
32-63 of general register R + 1. Bits 0-31 of the
/
registers remain unchanged. 8 12 16 2 32 4 47
Program Exceptions:
'57' R X B D
Access (fetch, operand 2, X, XG, and XC;
8 12 16 2 31 fetch and store, operand 1, XI and XC)
The contents of access register R are placed in Condition Code: The code remains unchanged.
bit positions 32-63 of general register R. Bits
0-31 of general register R remain unchanged. Program Exceptions:
Resulting Condition Code: 'A5' R '2' I
0 All inserted bits zeros, or mask bits all zeros
8 12 16 31
1 Leftmost inserted bit one
2 Leftmost inserted bit zero, and not all inserted
bits zeros IILL R,I [RI]
3 --
'A5' R '3' I
Program Exceptions:
8 12 16 31
Access (fetch, operand 2)
'18' R R only)
Programming Note: An example of the use of
8 12 15
the LOAD instruction is given in Appendix A,
Number Representation and Instruction-Use
LGR R,R [RRE] Examples.
'B94' //////// R R
16 24 28 31
16 24 28 31
'B913' //////// R R
LTGFR R,R [RRE]
16 24 28 31
8 12 16 31
LOAD LOGICAL CHARACTER
The second operand is sign extended and placed LLGC R,D(X,B) [RXE]
at the first-operand location. The second operand
is two bytes in length and is treated as a 16-bit /
'E3' R X B D //////// '9'
signed binary integer. For LOAD HALFWORD
/
(LH) and LOAD HALFWORD IMMEDIATE (LHI), 8 12 16 2 32 4 47
the first operand is treated as a 32-bit signed
binary integer. For LOAD HALFWORD (LGH) and
LOAD HALFWORD IMMEDIATE (LGHI), the first The one-byte second operand is placed in bit
operand is treated as a 64-bit signed binary positions 56-63 of general register R, and zeros
integer. are placed in bit positions 0-55 of general register
R.
Condition Code: The code remains unchanged.
Condition Code: The code remains unchanged.
Program Exceptions:
Program Exceptions:
Access (fetch, operand 2 of LH and LGH)
Access (fetch, operand 2)
Programming Note: An example of the use of
/ LLIHH 0-15
'E3' R X B D //////// '91' LLIHL 16-31
/
8 12 16 2 32 4 47 LLILH 32-47
LLILL 48-63
The two-byte second operand is placed in bit posi-
tions 48-63 of general register R, and zeros are
Condition Code: The code remains unchanged.
placed in bit positions 0-47 of general register R.
Program Exceptions: None.
Condition Code: The code remains unchanged.
/
LLIHL R,I [RI] 'E3' R X B D //////// '17'
/
8 12 16 2 32 4 47
'A5' R 'D' I
'B91' //////// R R
Condition Code: The code remains unchanged.
16 24 28 31
Program Exceptions:
LNGFR R,R [RRE] Access (fetch, operand 2)
Specification
16 24 28 31
'B91F' //////// R R
LPGFR R,R [RRE] 16 24 28 31
16 24 28 31
'B9F' //////// R R
The absolute value of the second operand is 16 24 28 31
placed at the first-operand location. For LOAD
POSITIVE (LPR), the second operand and result LRVH R,D(X,B) [RXE]
are treated as 32-bit signed binary integers, and,
for LOAD POSITIVE (LPGR), they are treated as /
64-bit signed binary integers. For LOAD POSI- 'E3' R X B D //////// '1F'
/
TIVE (LPGFR), the second operand is treated as 8 12 16 2 32 4 47
a 32-bit signed binary integer, and the result is
treated as a 64-bit signed binary integer.
LRV R,D(X,B) [RXE]
When there is an overflow, the result is obtained /
by allowing any carry into the sign-bit position and 'E3' R X B D //////// '1E'
ignoring any carry out of the sign-bit position, and /
condition code 3 is set. If the fixed-point-overflow 8 12 16 2 32 4 47
mask is one, a program interruption for fixed-point
overflow occurs. LRVG R,D(X,B) [RXE]
Access (fetch, operand 2 of MVC; store, 1. An example of the use of the MOVE
operand 1, MVI and MVC) INVERSE instruction is given in Appendix A,
Number Representation and Instruction-Use
Programming Notes: Examples.
1. Examples of the use of the MOVE instruction 2. The contents of each byte moved remain
are given in Appendix A, Number Represen- unchanged.
tation and Instruction-Use Examples. 3. MOVE INVERSE is the only SS-format
2. It is possible to propagate one byte through instruction for which the second-operand
an entire field by having the first operand start address designates the rightmost, instead of
one byte to the right of the second operand. the leftmost, byte of the second operand.
The R and R fields each designate an even-odd Operands do not overlap destructively, and move-
pair of general registers and must designate an ment is performed, if the leftmost byte of the first
even-numbered register; otherwise, a specification operand does not coincide with any of the second-
exception is recognized. operand bytes participating in the operation other
than the leftmost byte of the second operand.
The location of the leftmost byte of the first When an operand wraps around from location
operand and second operand is designated by the 2 - 1 (or 2 - 1 or 2 - 1) to location 0,
contents of general registers R and R, respec- operand bytes in locations up to and including
tively. The number of bytes in the first-operand 2 - 1 (or 2 - 1 or 2 - 1) are considered to
and second-operand locations is specified by be to the left of bytes in locations from 0 up.
unsigned binary integers in bit positions 40-63 of
general registers R + 1 and R + 1, respec- In the 24-bit addressing mode, wraparound is from
tively. Bit positions 32-39 of general register location 2 - 1 to location 0; in the 31-bit
R + 1 contain the padding byte. The contents of addressing mode, wraparound is from location
bit positions 0-39 of general register R + 1 and 2 - 1 to location 0; in the 64-bit addressing
of bit positions 0-31 of general register R + 1 mode, wraparound is from location 2 - 1 to
are ignored. location 0.
The handling of the addresses in general registers In the access-register mode, the contents of
R and R is dependent on the addressing mode. access register R and access register R are
compared. If the R or R field is zero, 32 zeros
In the 24-bit addressing mode, the contents of bit are used rather than the contents of access reg-
positions 40-63 of general registers R and R ister 0. If all 32 bits of the compared values are
constitute the address, and the contents of bit equal, then the destructive overlap test is made.
positions 0-39 are ignored. In the 31-bit If all 32 bits of the compared values are not equal,
addressing mode, the contents of bit positions destructive overlap is declared not to exist. If, for
33-63 of the registers constitute the address, and this case, the operands actually overlap in real
the contents of bit positions 0-32 are ignored. In storage, it is unpredictable whether the result
the 64-bit addressing mode, the contents of bit reflects the overlap condition.
positions 0-63 constitute the address.
When the length specified by bits 40-63 of general
The contents of the registers just described are register R + 1 is zero, no movement takes
shown in Figure 7-16 on page 7-95. The move-
place, and condition code 0 or 1 is set to indicate most bits which are not part of the address in bit
the relative values of the lengths. positions 32-63 of general registers R and R are
set to zeros, and the contents of bit positions 0-31
The execution of the instruction is interruptible. remain unchanged. In any addressing mode, the
When an interruption occurs, other than one that contents of bit positions 0-39 of general registers
causes termination, the lengths in general regis- R + 1 and R + 1 remain unchanged; and the
ters R + 1 and R + 1 are decremented by the condition code is unpredictable. If the operation is
number of bytes moved, and the addresses in interrupted during padding, the length field in
general registers R and R are incremented by general register R + 1 is 0, the address in
the same number, so that the instruction, when general register R is incremented by the original
reexecuted, resumes at the point of interruption. length in general register R + 1, and general
In the 24-bit or 31-bit addressing mode, the left-
Figure 7-17. Register Contents and Second-Operand Address for MOVE LONG EXTENDED
Figure 7-18. Register Contents and Second-Operand Address for MOVE LONG UNICODE
cide with any of the third-operand characters operand wraps around from location 2 - 1 (or
participating in the operation other than the left- 2 - 1 or 2 - 1) to location 0, operand charac-
most character of the third operand. When an ters in locations up to and including 2 - 1 (or
The handling of the addresses in general registers The amount of processing that results in the
R and R is dependent on the addressing mode. setting of condition code 3 is determined by the
In the 24-bit addressing mode, the contents of bit CPU on the basis of improving system perform-
positions 40-63 of general registers R and R ance, and it may be a different amount each time
constitute the address, and the contents of bit the instruction is executed.
positions 0-39 are ignored. In the 31-bit
addressing mode, the contents of bit positions Access exceptions for the first and second oper-
33-63 of the registers constitute the address, and ands are recognized only for that portion of the
the contents of bit positions 0-32 are ignored. In operand that is necessarily used in the operation.
the 64-bit addressing mode, the contents of bit
positions 0-63 constitute the address. The storage-operand-consistency rules are the
same as for the MOVE (MVC) instruction, except
The end of the second operand is indicated by an that destructive overlap is not recognized.
ending character in the last byte position of the
operand. The ending character to be used to Resulting Condition Code:
determine the end of the second operand is speci- 0 --
fied in bit positions 56-63 of general register 0. Bit 1 Entire second operand moved; general reg-
positions 32-55 of general register 0 are reserved ister R updated with address of ending char-
for possible future extensions and must contain all acter in first operand; general register R
zeros; otherwise, a specification exception is unchanged
recognized. 2 --
3 CPU-determined number of bytes moved;
The operation proceeds left to right and ends as
general registers R and R updated with
soon as the second-operand ending character has
addresses of next bytes
been moved or a CPU-determined number of
second-operand bytes have been moved, which- Program Exceptions:
ever occurs first. The CPU-determined number is
at least one. When the ending character is in the Access (fetch, operand 2; store, operand 1)
first byte position of the second operand, only the Specification
ending character is moved. When the ending
character has been moved, condition code 1 is Programming Notes:
set. When a CPU-determined number of second- 1. An example of the use of the MOVE STRING
operand bytes not including an ending character instruction is given in Appendix A, Number
have been moved, condition code 3 is set. Representation and Instruction-Use
Destructive overlap is not recognized. If the Examples.
second operand is used as a source after it has
2. When condition code 3 is set, the program
been used as a destination, the results are unpre-
can simply branch back to the instruction to
dictable to the extent that an ending character in
continue the data movement. The program
the second operand may not be recognized.
need not determine the number of bytes that
When condition code 1 is set, the address of the were moved.
ending character in the first operand is placed in 3. R or R may be zero, in which case general
general register R, and the contents of general register 0 is treated as containing an address
register R remain unchanged. When condition and also the ending character.
code 3 is set, the address of the next byte to be
Examples.
8 12 15
2. The significant part of the product usually
M R,D(X,B) [RX] occupies 62 bit positions or fewer. Only when
two maximum 32-bit negative numbers are
multiplied are 63 significant product bits
'5C' R X B D formed.
8 12 16 2 31
MULTIPLY HALFWORD
The 32-bit first operand (the multiplicand) is multi-
MH R,D(X,B) [RX]
plied by the 32-bit second-operand (the multiplier),
and the 64-bit product is placed at the first-
operand location. '4C' R X B D
The R field designates an even-odd pair of 8 12 16 2 31
general registers and must designate an even-
The sign of the product is determined by the rules The connective OR is applied to the operands bit
of algebra from the multiplier and multiplicand by bit. The contents of a bit position in the result
sign, except that a zero result is always positive. are set to one if the corresponding bit position in
one or both operands contains a one; otherwise,
Condition Code: The code remains unchanged. the result bit is set to zero.
8 12 16 2 31 Programming Notes:
1. Examples of the use of the OR instruction are
OG R,D(X,B) [RXE] given in Appendix A, Number Representation
and Instruction-Use Examples.
/
'E3' R X B D //////// '81' 2. OR may be used to set a bit to one.
/
8 12 16 2 32 4 47 3. Accesses to the first operand of OR (OI) and
OR (OC) consist in fetching a first-operand
byte from storage and subsequently storing
OI D(B),I [SI]
the updated value. These fetch and store
accesses to a particular byte do not neces-
'96' I B D sarily occur one immediately after the other.
Thus, OR cannot be safely used to update a
8 16 2 31 location in storage if the possibility exists that
another CPU or a channel program may also
OC D(L,B),D(B) [SS] be updating the location. An example of this
effect is shown in Multiprogramming and
//
'D6' L B D B D Multiprocessing Examples in Appendix A,
// Number Representation and Instruction-Use
8 16 2 32 36 47 Examples.
The two-byte second-operand characters are Access (fetch, operand 2; store, operand 1)
treated as Unicode Basic Latin characters con- Operation (if the extended-translation facility 2
taining decimal digits, having the binary encoding is not installed)
0000-1001 for 0-9, in their rightmost four bit posi- Specification
tions. The leftmost 12 bit positions of a character
Programming Notes:
are ignored. The second operand is considered to
be positive. 1. The following example illustrates the use of
PACK UNICODE to pack European numbers:
The implied positive sign (1100 binary) and the
source digits are placed at the first-operand
Operand addresses in a parameter list, if used, All unused fields in a parameter list should contain
are in doublewords in the list. In the 24-bit all zeros; otherwise, the program may not operate
addressing mode, an operand address is bits compatibly in the future.
40-63 of a doubleword, and bits 0-39 of the
doubleword are ignored. In the 31-bit addressing A serialization operation is performed immediately
mode, an operand address is bits 33-63 of a after the lock is obtained and again immediately
doubleword, and bits 0-32 of the doubleword are before it is released. However, values fetched
ignored. In the 64-bit addressing mode, an from the parameter list before the lock is obtained
operand address is bits 0-63 of a doubleword. are not necessarily refetched. A serialization
operation is not performed if the test bit, bit 55 of
In the access-register mode, access register 1 general register 0, is one.
specifies the address space containing the
program lock token (PLT), access register B In the following figures showing the parameter lists
specifies the address space containing the second for the different function codes, the offsets shown
operand, and access register B specifies the on the left are byte values.
Explanation:
For function codes that are a multiple of 4 (including ) or one more than a multiple of
4, operands in general registers are in bit positions 32-63 of the registers, and bits
-31 of the registers are ignored and remain unchanged. For function codes that are two
more than a multiple of 4, operands in general registers are in bit positions -63 of the
registers.
- Operand, value, or address is not used in the operation.
OpNc Operand-N comparison value.
OpNr Operand-N replacement value.
OpNa Operand-N address.
PL Operand, value, or address is in the parameter list.
PLa Parameter-list address.
Figure 7-21. Operand and Address Locations for PERFORM LOCKED OPERATION
Function Codes 0-3 (Compare and Load) The locations of the operands and addresses
used by the instruction are as shown in
Figure 7-21.
Parameter List for Function Code 1 When the first-operand comparison value is not
equal to the second operand, the first-operand
comparison value is replaced by the second
8 Operand-1 Comparison Value operand, and condition code 1 is set.
16 Function Codes 4-7 (Compare and Swap)
24 The locations of the operands and addresses
used by the instruction are as shown in
32
Figure 7-21 on page 7-118.
4 Operand 3
The parameter list used for function code 5 has
48 the following format:
56 Parameter List for Function Code 5
64 Operand-4 ALET
72 Operand-4 Address 8 Operand-1 Comparison Value
16
The parameter list used for function code 3 has 24 Operand-1 Replacement Value
the following format:
The first-operand comparison value is compared When the first-operand comparison value is not
to the second operand. When the first-operand equal to the second operand, the first-operand
comparison value is equal to the second operand, comparison value is replaced by the second
operand, and condition code 1 is set.
Parameter List for Function Code 15 The locations of the operands and addresses
used by the instruction are as shown in
Operand-1 Comparison Value
Figure 7-21 on page 7-118.
8 Operand-1 Comp. Value (continued)
The parameter list used for function code 16 has
16 Operand-1 Replacement Value the following format:
24 Operand-1 Repl. Value (continued) Parameter List for Function Code 16
32
4 8
48 Operand 3 16
56 Operand 3 (continued) 24
64 Operand-4 ALET 32
72 Operand-4 Address 4
48
The first-operand comparison value is compared 56 Operand 3
to the second operand. When the first-operand
comparison value is equal to the second operand, 64 Operand-4 ALET
the first-operand replacement value is stored at
the second-operand location, the third operand is 72 Operand-4 Address
stored at the fourth-operand location, and condi- 8
tion code 0 is set.
88 Operand 5
When the first-operand comparison value is not
equal to the second operand, the first-operand 96 Operand-6 ALET
comparison value is replaced by the second
14 Operand-6 Address
operand, and condition code 1 is set.
Parameter List for Function Code 17 Parameter List for Function Code 18
8 Operand-1 Comparison Value 8
16 16
24 Operand-1 Replacement Value 24
32 32
4 4
48 48
56 Operand 3 56 Operand 3
64 Operand-4 ALET 64 Operand-4 ALET
72 Operand-4 Address 72 Operand-4 Address
8 8
88 Operand 5 88 Operand 5
96 Operand-6 ALET 96 Operand-6 ALET
14 Operand-6 Address 14 Operand-6 Address
Parameter List for Function Code 19 The locations of the operands and addresses
used by the instruction are as shown in
Operand-1 Comparison Value
Figure 7-21 on page 7-118.
8 Operand-1 Comp. Value (continued)
The parameter list used for function code 20 has
16 Operand-1 Replacement Value the following format:
24 Operand-1 Repl. Value (continued) Parameter List for Function Code 2
32
4 8
48 Operand 3 16
56 Operand 3 (continued) 24
64 Operand-4 ALET 32
72 Operand-4 Address 4
8 Operand 5 48
88 Operand 5 (continued) 56 Operand 3
96 Operand-6 ALET 64 Operand-4 ALET
14 Operand-6 Address 72 Operand-4 Address
8
The first-operand comparison value is compared 88 Operand 5
to the second operand. When the first-operand
96 Operand-6 ALET
comparison value is equal to the second operand,
the first-operand replacement value is stored at 14 Operand-6 Address
the second-operand location, the third operand is
stored at the fourth-operand location, the fifth 112
operand is stored at the sixth-operand location,
12 Operand 7
and condition code 0 is set.
128 Operand-8 ALET
When the first-operand comparison value is not
equal to the second operand, the first-operand 136 Operand-8 Address
comparison value is replaced by the second
operand, and condition code 1 is set.
Parameter List for Function Code 21 Parameter List for Function Code 22
8 Operand-1 Comparison Value 8
16 16
24 Operand-1 Replacement Value 24
32 32
4 4
48 48
56 Operand 3 56 Operand 3
64 Operand-4 ALET 64 Operand-4 ALET
72 Operand-4 Address 72 Operand-4 Address
8 8
88 Operand 5 88 Operand 5
96 Operand-6 ALET 96 Operand-6 ALET
14 Operand-6 Address 14 Operand-6 Address
112 112
12 Operand 7 12 Operand 7
128 Operand-8 ALET 128 Operand-8 ALET
136 Operand-8 Address 136 Operand-8 Address
As observed by other CPUs, all storage operands In those cases when a store is performed to the
may be tested for access exceptions before a lock second-operand location and one or more of the
is obtained. (A channel program cannot observe fourth-, sixth-, and eighth-operand locations, the
a lock.) store to the second-operand location is always
performed last, as observed by other CPUs and
As observed by other CPUs, in all operations by channel programs.
except the compare-and-swap operation (which
does not have a fourth operand), the fourth Stores into the parameter list may be performed
operand is accessed while the lock is held only if while the lock is held or after it has been released.
a comparison of the first-operand comparison
value to the second operand while the lock is held A serialization operation is performed immediately
has indicated equality. In these operations, the after the lock is obtained and again immediately
fourth operand is accessed before the lock is held before it is released. However, values fetched
only if a comparison of the first-operand compar- from the parameter list before the lock is obtained
ison value to the second operand has indicated are not necessarily refetched. A serialization
equality and only if, when DAT is on, an INVALI- operation is not performed if the test bit, bit 55 of
DATE PAGE TABLE ENTRY instruction executed general register 0, is one.
by another CPU after the fetch of the second
operand will not be the cause of a page- Access exceptions may be recognized for
translation exception recognized for the fourth parameter-list locations even when the locations
operand, which it will if it sets to one the page- are not required in the operation. The locations
invalid bit in the page-table entry for the fourth are those beginning at offset 0 and extending up
operand when this CPU does not have a TLB through the last location defined for the function
entry corresponding to that page-table entry. In code used.
the compare-and-swap-and-double-store and
compare-and-swap-and-triple-store operations, the For the compare-and-load and compare-and-swap
sixth operand, and also the eighth operand in the operations, the operation is suppressed on all
triple-store operation, are treated the same as the addressing and protection exceptions.
fourth operand described above. The reason for
this specification about INVALIDATE PAGE When a nonrecoverable failure of a CPU while
TABLE ENTRY is given in programming note 6 on holding a lock results in a machine check or entry
page 7-127. into the check-stop state, either no storage oper-
ands have been changed or else all storage oper-
ands that were due to be changed have been
Explanation:
- Not applicable.
OpNc Operand-N comparison value.
OpNr Operand-N replacement value.
ROTATE LEFT SINGLE LOGICAL The 32-bit or 64-bit third operand is rotated left the
number of bits specified by the second-operand
RLL R,R,D(B) [RSE] address, and the result is placed at the first-
operand location. The third operand remains
/ unchanged in general register R. For ROTATE
'EB' R R B D //////// '1D'
LEFT SINGLE LOGICAL (RLL), bits 0-31 of
/
8 12 16 2 32 4 47 general registers R and R remain unchanged.
Program Exceptions:
SET ADDRESSING MODE
Access (fetch, operand 2) SAM24 [E]
Specification
'1C'
Programming Notes:
1. Examples of the use of the SEARCH STRING 15
instruction are given in Appendix A, Number SAM31 [E]
Representation and Instruction-Use Examples
'1D'
2. When condition code 3 is set, the program
can simply branch back to the instruction to 15
continue the search. The program need not SAM64 [E]
determine the number of bytes that were
searched.
'1E'
3. When the address in general register R
equals the address in general register R, 15
condition code 2 is set immediately, and
access exceptions are not recognized. When The addressing mode is set by setting the
the address in general register R is less than extended-addressing-mode bit, bit 31 of the
the address in general register R, condition current PSW, and the basic-addressing-mode bit,
code 2 can be set only if the operand wraps bit 32 of the current PSW, as follows:
around from the top of storage to location 0.
Instruc- PSW Bit PSW Bit Resulting
4. R or R may be zero, in which case general tion 31 32 Addressing Mode
register 0 is treated as containing an address
and also the specified character. SAM24 0 0 24-bit
For SHIFT LEFT SINGLE LOGICAL (SLLG), the The first operand is treated as a 64-bit signed
64-bit third operand is shifted left the number of binary integer. The sign bit of the first operand,
bits specified by the second-operand address, and bit 32 of the even-numbered register, remains
the result is placed at the first-operand location. unchanged. Bit position 32 of the odd-numbered
The third operand remains unchanged in general register contains a numeric bit, which participates
register R. in the shift in the same manner as the other
numeric bits. Bits shifted out of bit position 63 of
The second-operand address is not used to the odd-numbered register are not inspected and
address data; its rightmost six bits indicate the are lost. Bits equal to the sign are supplied to the
number of bit positions to be shifted. The vacated bit positions on the left. Bits 0-31 of
remainder of the address is ignored. general registers R and R + 1 remain
unchanged.
For SLL, the first operand is in bit positions 32-63
of general register R. All 32 bits of the operand Resulting Condition Code:
participate in the left shift.
0 Result zero
For SLLG, the first and third operands are in bit 1 Result less than zero
positions 0-63 of general registers R and R, 2 Result greater than zero
respectively. All 64 bits of the third operand par- 3 --
ticipate in the left shift.
Program Exceptions:
For SLL or SLLG, zeros are supplied to the Specification
vacated bit positions on the right.
8 12 16 2 31
Programming Notes:
The second-operand address is not used to
'88' R //// B D
address data; its rightmost six bits indicate the
number of bit positions to be shifted. The 8 12 16 2 31
remainder of the address is ignored.
SRLG R,R,D(B) [RSE]
For SRA, The first operand is treated as a 32-bit
signed binary integer in bit positions 32-63 of /
general register R. The sign of the first operand 'EB' R R B D //////// 'C'
remains unchanged. All 31 numeric bits of the /
operand participate in the right shift. 8 12 16 2 32 4 47
For SRAG, the first and third operands are treated For SHIFT RIGHT SINGLE LOGICAL (SRL), the
as 64-bit signed binary integers in bit positions 32-bit first operand is shifted right the number of
0-63 of general registers R and R, respectively.
/
'E3' R X B D //////// '2F'
/
8 12 16 2 32 4 47
8 12 16 2 31
SLGFR R,R [RRE]
When there is an overflow, the result is obtained
'5F' R X B D
by allowing any carry into the sign-bit position and
ignoring any carry out of the sign-bit position, and 8 12 16 2 31
condition code 3 is set. If the fixed-point-overflow
mask is one, a program interruption for fixed-point SLG R,D(X,B) [RXE]
overflow occurs.
/
Resulting Condition Code: 'E3' R X B D //////// 'B'
/
0 Result zero; no overflow 8 12 16 2 32 4 47
1 Result less than zero; no overflow
2 Result greater than zero; no overflow SLGF R,D(X,B) [RXE]
3 Overflow
/
Program Exceptions: 'E3' R X B D //////// '1B'
/
Access (fetch, operand 2) 8 12 16 2 32 4 47
Fixed-point overflow
Programming Note: The function of a SUB- The second operand is subtracted from the first
TRACT HALFWORD IMMEDIATE instruction, operand, and the difference is placed at the first-
which is an instruction not provided, can be operand location. For SUBTRACT LOGICAL
obtained by using an ADD HALFWORD IMME- (SLR, SL), the operands and the difference are
DIATE instruction with a negative I field. treated as 32-bit unsigned binary integers. For
SUBTRACT LOGICAL (SLGR, SLG), they are
treated as 64-bit unsigned binary integers. For
SUBTRACT LOGICAL (SLGFR, SLGF) the
second operand is treated as a 32-bit unsigned
binary integer, and the first operand and the differ-
ence are treated as 64-bit unsigned binary inte-
gers.
TEST UNDER MASK (TEST A mask bit of one indicates that the storage bit is
UNDER MASK HIGH, TEST to be tested. When the mask bit is zero, the
storage bit is ignored. When all storage bits thus
UNDER MASK LOW) selected are zero, condition code 0 is set. Condi-
TM D(B),I [SI] tion code 0 is also set when the mask is all zeros.
When the selected bits are all ones, condition
code 3 is set; otherwise, condition code 1 is set.
'91' I B D
Access exceptions associated with the storage
8 16 2 31 operand are recognized for one byte even when
the mask is all zeros.
TMHH R,I [RI]
In TEST UNDER MASK (TMHH, TMHL, TMLH,
TMLL), The contents of the I field are used as a
'A7' R '2' I
16-bit mask. For each instruction, the bits of the
8 12 16 31 mask are made to correspond one for one with 16
bits of the first operand as follows:
TMHL R,I [RI]
Bits
Instruction Tested
'A7' R '3' I
TMHH 0-15
8 12 16 31 TMHL 16-31
TMLH (or TMH) 32-47
TMLH or TMH R,I [RI]
TMLL (or TML) 48-63
'A7' R '' I
A mask bit of one indicates that the first-operand
8 12 16 31 bit is to be tested. When the mask bit is zero, the
first-operand bit is ignored. When all first-operand
bits thus selected are zero, condition code 0 is
set. Condition code 0 is also set when the mask
is all zeros. When the selected bits are mixed
/
GR /////////////////////////// Test
/
56 63
24-Bit Addressing Mode 31-Bit Addressing Mode
/ /
R //////////// First-Operand Address //// First-Operand Address
/ /
4 63 33 63
/ /
R + 1 /// First-Operand Length /// First-Operand Length
/ /
32 63 32 63
/ /
R //////////// Second-Operand Address //// Second-Operand Address
/ /
4 63 33 63
64-Bit Addressing Mode
/
R First-Operand Address
/
63
/
R + 1 First-Operand Length
/
63
/
R Second-Operand Address
/
63
The lengths of the operand and test characters The translation table is treated as being on a
are as follows: doubleword boundary for TRANSLATE ONE TO
For TRANSLATE ONE TO ONE, the second- ONE and TRANSLATE ONE TO TWO and on a
operand, first-operand, and test characters are 4K-byte boundary for TRANSLATE TWO TO ONE
single bytes. and TRANSLATE TWO TO TWO. The rightmost
bits of the register that are not used to form the
For TRANSLATE ONE TO TWO, the second- address, which are bits 61-63 in the doubleword
operand characters are single bytes, and the case and bits 52-63 in the 4K-byte case, are
first-operand and test characters are double ignored.
bytes.
For TRANSLATE TWO TO ONE, the second- The handling of the addresses in general registers
operand characters are double bytes, and the R, R, and 1 is dependent on the addressing
first-operand and test characters are single mode.
bytes.
In the 24-bit addressing mode, the contents of bit
For TRANSLATE TWO TO TWO, the second- positions 40-63 of general registers R and R
operand, first-operand, and test characters are and 40-60 or 40-51 of 1 constitute the address,
double bytes. and the contents of bit positions 0-39 are ignored.
In the 31-bit addressing mode, the contents of bit
For TRANSLATE ONE TO ONE and TRANSLATE positions 33-63 of registers R and R and 33-60
TWO TO ONE, the test character is in bit posi- or 33-51 of 1 constitute the address, and the con-
tions 56-63 of general register 0. For TRANS- tents of bit positions 0-32 are ignored. In the
LATE ONE TO TWO and TRANSLATE TWO TO 64-bit addressing mode, the contents of bit posi-
TWO, the test character is in bit positions 48-63 of tions 0-63 of registers R and R and 0-60 or 0-51
general register 0. of 1 constitute the address.
The R field designates an even-odd pair of The contents of the registers just described are
general registers and must designate an even- shown in Figure 7-24 on page 7-154.
numbered register; otherwise, a specification
exception is recognized.
24-Bit Addressing Mode 31-Bit Addressing Mode
/ /
R //////////// First-Operand Address //// First-Operand Address
/ /
4 63 33 63
/ /
R + 1 /// Second-Operand Length /// Second-Operand Length
/ /
32 63 32 63
/ /
R ////////////Second-Operand Address //// Second-Operand Address
/ /
4 63 33 63
For TRANSLATE ONE TO ONE For TRANSLATE ONE TO ONE
and TRANSLATE ONE TO TWO and TRANSLATE ONE TO TWO
/ /
GR1 ////////////Trans.-Table Addr. /// //// Translation-Table Address ///
/ /
4 61 63 33 61 63
For TRANSLATE TWO TO ONE For TRANSLATE TWO TO ONE
and TRANSLATE TWO TO TWO and TRANSLATE TWO TO TWO
/ /
GR1 ////////////Tr.Tab.Adr//////////// ////Trans.-Table Addr.////////////
/ /
4 52 63 33 52 63
Figure 7-24 (Part 1 of 2). Register Contents for TRANSLATE ONE TO ONE, TRANSLATE ONE TO TWO, TRANS-
LATE TWO TO ONE, and TRANSLATE TWO TO TWO
64-Bit Addressing Mode
/
R First-Operand Address
/
63
/
R + 1 Second-Operand Length
/
63
/
R Second-Operand Address
/
63
For TRANSLATE ONE TO ONE
and TRANSLATE ONE TO TWO
/
GR1 Translation-Table Address ///
/
61 63
For TRANSLATE TWO TO ONE
and TRANSLATE TWO TO TWO
/
GR1 Translation-Table Addr.////////////
/
52 63
Figure 7-24 (Part 2 of 2). Register Contents for TRANSLATE ONE TO ONE, TRANSLATE ONE TO TWO, TRANS-
LATE TWO TO ONE, and TRANSLATE TWO TO TWO
3. The storage operand references of these Condition Code: The code remains unchanged.
instructions may be multiple-access refer-
1. An example of the use of the UNPACK The result is obtained as if the operands were
instruction is given in Appendix A, Number processed right to left.
Representation and Instruction-Use
Examples. The length of the second operand is 16 bytes.
The second operand consists of 31 digits and a
2. A field that is to be unpacked can be
sign.
destroyed by improper overlapping. To save
storage space for unpacking by overlapping
The length of the first operand is designated by
the operands, the rightmost byte of the first
the contents of the L field. The first-operand
operand must be to the right of the rightmost
length must not exceed 32 bytes (L must be less
byte of the second operand by the number of
than or equal to 31); otherwise, a specification
bytes in the second operand minus 2. If only
exception is recognized.
one or two bytes are to be unpacked, the
rightmost bytes of the two operands may coin- If the first operand is too short to contain all digits
cide. of the second operand, the remaining leftmost
3. The storage-operand references of UNPACK portion of the second operand is ignored. Access
may be multiple-access references. (See exceptions for the unused portion of the second
Storage-Operand Consistency on operand may or may not be indicated.
page 5-86.)
When the length of the first operand is 32 bytes,
the leftmost byte is set to ASCII zero, 30 hex.
UNPACK ASCII
No test is made for destructive overlap, and the
UNPKA D(L,B),D(B) [SS]
results in the first-operand location are unpredict-
// able when destructive overlap exists. Operands
'EA' L B D B D are said to overlap destructively when the first-
// operand location is used as a source after
8 16 2 32 36 47 unpacked data has been placed into it.
The format of the second operand is changed As observed by other CPUs and by channel pro-
from packed to ASCII, and the result is placed at grams, the first operand is not necessarily stored
the first-operand location. The packed format is into in any particular order and may appear to be
described in Chapter 8, Decimal Instructions. stored into more than once.
UNPKU D(L,B),D(B) [SS] When the length of the first operand is 32 charac-
ters, the leftmost character is set to Unicode Basic
//
'E2' L B D B D Latin zero, 0030 hex.
//
8 16 2 32 36 47 No test is made for destructive overlap, and the
results in the first-operand location are unpredict-
able when destructive overlap exists. Operands
The format of the second operand is changed
are said to overlap destructively when the first-
from packed to Unicode Basic Latin, and the result
operand location is used as a source after
is placed at the first-operand location. The
unpacked data has been placed into it.
packed format is described in Chapter 8, Decimal
Instructions. As observed by other CPUs and by channel pro-
grams, the first operand is not necessarily stored
The second operand is treated as having the
into in any particular order and may appear to be
packed format. Its digits are converted to two-
stored into more than once.
byte Unicode characters by extending them on the
left with 000000000011 binary (003 hex), and the Resulting Condition Code:
Unicode characters are then placed at the first
operand location. The digits are not checked for 0 Sign is plus
valid codes. The sign of the second operand is 1 Sign is minus
not transferred to the first operand but is checked 2 --
for validity and determines the condition code. If 3 Sign is invalid
the sign is 1010, 1100, 1110 or 1111 binary (plus),
condition code 0 is set. If the sign is 1011 or Program Exceptions:
1101 binary (minus), condition code 1 is set. If Access (fetch, operand 2; store, operand 1)
the sign is not one of the codes for plus or minus, Operation (if the extended-translation facility 2
condition code 3 is set. is not installed)
Specification
The converted last digit is placed in the rightmost
character position of the result field, and the other Programming Note: The following example illus-
converted digits are placed adjacent to the last trates the use of the instruction to unpack to
and to each other in the remainder of the result European numbers:
field.
UNDIGITS DS CL62
PKDIGITS DS PL16
The result is obtained as if the operands were
DC X'123456789'
processed right to left.
DC X'123456789'
DC X'123456789'
The length of the second operand is 16 bytes; the DC X'1C'
second operand consists of 31 digits and a sign. ...
UNPKU UNDIGITS(62),PKDIGITS
The length of the first operand is designated by
the contents of the L field. The first-operand
The size of a node, the size of a codeword, and Bits 32-63 of general register 0 are logically com-
the participation of bits 0-31 of general registers pared with the contents of the first word of the cur-
1-5 in the operation depend on the addressing rently addressed node. If the register operand is
mode. In the 24-bit or 31-bit addressing mode, a low, the contents of bit positions 32-63 of general
node is eight bytes, a codeword is four bytes, and registers 0 and 1 are interchanged with those of
bits 0-31 are ignored and remain unchanged. In the node, and a unit of operation is completed. If
the 64-bit addressing mode, a node is 16 bytes, a the register operand is high, no additional action is
codeword is eight bytes, and bits 0-31 are used in taken, and the unit of operation is completed. If
and may be changed by the operation. the compare values are equal, bit positions 32-63
of general register 2, conceptually followed on the
Operation in the 24-Bit or 31-Bit Addressing right by bit positions 32-63 of general register 3,
Mode are loaded from the currently addressed node, the
instruction is completed, and condition code 0 is
In the 24-bit or 31-bit addressing mode, the
set.
doubleword nodes of a tree in storage are exam-
ined successively on a path toward the base of In those cases when the value in the first word of
the tree, and the contents of bit positions 32-63 of the node is less than or equal to the value in bit
general register 0, conceptually followed on the positions 32-63 of the register, the contents of the
right by the contents of bit positions 32-63 of
The decimal instructions of this chapter perform Decimal digits in the zoned format may be part of
arithmetic and editing operations on decimal data. a larger character set, which includes also alpha-
Additional operations on decimal data are pro- betic and special characters. The zoned format is,
vided by several of the instructions in Chapter 7, therefore, suitable for input, editing, and output of
General Instructions. Decimal operands always numeric data in human-readable form. There are
reside in storage, and all decimal instructions use no decimal-arithmetic instructions which operate
the SS instruction format. Decimal operands directly on decimal numbers in the zoned format;
occupy storage fields that can start on any byte such numbers must first be converted to the
boundary. packed format.
The zone code 1111 is generated in the left four Decimal-Arithmetic Instructions
bit positions of each byte representing a zone and
a decimal digit in zoned-format results. Zoned- The decimal-arithmetic instructions perform addi-
format results are produced by EDIT, EDIT AND tion, subtraction, multiplication, division, compar-
MARK, and UNPACK. For EDIT and EDIT AND ison, and shifting.
MARK, each result byte representing a zoned-
format decimal digit contains the zone code 1111 Operands of the decimal-arithmetic instructions
in the left four bit positions and the decimal-digit are in the packed format and are treated as
code in the right four bit positions. For UNPACK, signed decimal integers. A decimal integer is
zone bits with a coding of 1111 are supplied for all represented in true form as an absolute value with
bytes except the rightmost byte, the zone of which a separate plus or minus sign. It contains an odd
receives the sign. number of decimal digits, from one to 31, and the
sign; this corresponds to an operand length of one
The meaning of the decimal codes is summarized to 16 bytes.
in Figure 8-1.
A decimal zero normally has a plus sign, but multi-
plication, division, and overflow may produce a
Explanation:
A Access exceptions for logical addresses.
B B field designates an access register in the access-register mode.
B B field designates an access register in the access-register mode.
C Condition code is set.
Dd Decimal-operand data exception.
DF Decimal-overflow exception.
DK Decimal-divide exception.
G1 Instruction execution includes the implied use of general register 1.
SP Specification exception.
SS SS instruction format.
ST PER storage-alteration event.
The second operand is added to the first operand, 0 Result zero; no overflow
and the resulting sum is placed at the first- 1 Result less than zero; no overflow
operand location. The operands and result are in 2 Result greater than zero; no overflow
the packed format. 3 Overflow
// //
'F9' L L B D B D 'FD' L L B D B D
// //
8 12 16 2 32 36 47 8 12 16 2 32 36 47
The first operand is compared with the second The first operand (the dividend) is divided by the
operand, and the result is indicated in the condi- second operand (the divisor). The resulting quo-
tion code. The operands are in the packed tient and remainder are placed at the first-operand
format. location. The operands and results are in the
packed format.
Comparison is algebraic and follows the procedure
for decimal subtraction, except that both operands The quotient is placed leftmost in the first-operand
remain unchanged. When the difference is zero, location. The number of bytes in the quotient field
the operands are equal. When a nonzero differ- is equal to the difference between the dividend
ence is positive or negative, the first operand is and divisor lengths (L - L). The remainder is
high or low, respectively. placed rightmost in the first-operand location and
has a length equal to the divisor length. Together,
Overflow cannot occur because the difference is the quotient and remainder fields occupy the
discarded. entire first operand; therefore, the address of the
quotient is the address of the first operand.
All sign and digit codes are checked for validity.
The divisor length cannot exceed 15 digits and
Resulting Condition Code: sign (L not greater than seven) and must be less
0 Operands equal than the dividend length (L less than L); other-
1 First operand low wise, a specification exception is recognized.
2 First operand high
3 -- The dividend, divisor, quotient, and remainder are
each signed decimal integers in the packed format
Program Exceptions: and are right-aligned in their fields. All sign and
digit codes of the dividend and divisor are
Access (fetch, operands 1 and 2) checked for validity.
Data
The sign of the quotient is determined by the rules
Programming Notes: of algebra from the dividend and divisor signs.
1. An example of the use of the COMPARE The sign of the remainder has the same value as
DECIMAL instruction is given in Appendix A, the dividend sign. These rules hold even when
Number Representation and Instruction-Use the quotient or remainder is zero.
Examples.
Overflow cannot occur. If the divisor is zero or the
2. The preferred and alternate sign codes for a quotient is too large to be represented by the
particular sign are treated as equivalent for number of digits specified, a decimal-divide excep-
comparison purposes. tion is recognized. This includes the case of divi-
3. A negative zero and a positive zero compare sion of zero by zero. The decimal-divide
equal. exception is indicated only if the sign codes of
both the dividend and divisor are valid, and only if
the digit or digits used in establishing the excep-
tion are valid.
The length of the source is determined by the The field separator identifies individual fields in a
operation according to the contents of the pattern. multiple-field editing operation. It is always
The source normally consists of one or more replaced in the result by the fill byte, and the sig-
decimal numbers, each in the packed format. The nificance indicator is always off after the field sep-
leftmost four bits of each source byte must specify arator is encountered.
Explanation:
\ No effect on result byte or on new state of significance indicator.
\\ Not applicable because source is not examined.
# For EDIT AND MARK only, the address of the rightmost such result byte is
placed in general register 1.
EDIT AND MARK is identical to EDIT, except for See Figure 8-3 for a summary of the EDIT and
the additional function of inserting the address of EDIT AND MARK operations.
the result byte in general register 1 if the result
byte is a zoned source digit and the significance Resulting Condition Code:
indicator was off before the examination. If no 0 Last field zero or zero length
result byte meets the criteria, general register 1 1 Last field less than zero
remains unchanged; if more than one result byte 2 Last field greater than zero
meets the criteria, the address of the rightmost 3 --
such result byte is inserted.
Program Exceptions:
In the 24-bit addressing mode, the address
replaces bits 40-63 of general register 1, and bits Access (fetch, operand 2; fetch and store,
0-39 of the register are not changed. In the 31-bit operand 1)
addressing mode, the address replaces bits 33-63 Data
of general register 1, bit 32 of the register is set to
zero, and bits 0-31 of the register remain Programming Notes:
unchanged. In the 64-bit addressing mode, the 1. Examples of the use of the EDIT AND MARK
address replaces bits 0-63 of general register 1. instruction are given Appendix A, Number
Representation and Instruction-Use
The contents of access register 1 remain Examples.
unchanged.
2. EDIT AND MARK facilitates the programming
of floating currency-symbol insertion. Using
4. When multiple fields are edited with one exe- 1. An example of the use of the MULTIPLY
cution of the EDIT AND MARK instruction, the DECIMAL instruction is given Appendix A,
address, if any, inserted in general register 1 Number Representation and Instruction-Use
applies to the rightmost field edited for which Examples.
the criteria were met. 2. The product cannot exceed 31 digits and sign.
5. See also the programming note under EDIT The leftmost digit of the product is always
regarding performance degradation due to a zero.
possible trial execution.
SHIFT AND ROUND DECIMAL
MULTIPLY DECIMAL SRP D(L,B),D(B),I [SS]
MP D(L,B),D(L,B) [SS] //
'F' L I B D B D
// //
'FC' L L B D B D 8 12 16 2 32 36 47
//
8 12 16 2 32 36 47
The first operand is shifted in the direction and for
The product of the first operand (the multiplicand) the number of decimal-digit positions specified by
and the second operand (the multiplier) is placed the second-operand address, and, when shifting to
at the first-operand location. The operands and the right is specified, the absolute value of the first
result are in the packed format. operand is rounded by the rounding digit, I. The
first operand and the result are in the packed
The multiplier length cannot exceed 15 digits and format.
sign (L not greater than seven) and must be less
than the multiplicand length (L less than L); oth- The first operand is considered to be in the
erwise, a specification exception is recognized. packed-decimal format. Only its digit portion is
shifted; the sign position does not participate in
The multiplicand must have at least as many the shifting. Zeros are supplied for the vacated
bytes of leftmost zeros as the number of bytes in digit positions. The result replaces the first
the multiplier; otherwise, a data exception is operand. Nothing is stored outside of the speci-
recognized. This restriction ensures that no fied first-operand location.
product overflow occurs.
The second-operand address, specified by the B
The multiplicand, multiplier, and product are each and D fields, is not used to address data; bits
signed decimal integers in the packed format and 58-63 of that address are the shift value, and the
leftmost bits of the address are ignored.
In the absence of overflow, the sign of a zero The second operand is subtracted from the first
result is made positive. If overflow occurs, the operand, and the resulting difference is placed at
sign of the result is the same as the original sign the first-operand location. The operands and
but with the preferred sign code. result are in the packed format.
A data exception is recognized when the first SUBTRACT DECIMAL is executed the same as
operand does not have valid sign and digit codes ADD DECIMAL, except that the second operand is
or when the rounding digit is not a valid digit code. considered to have a sign opposite to the sign in
The validity of the first-operand codes is checked storage. The second operand in storage remains
even when no shift is specified, and the validity of unchanged.
the rounding digit is checked even when no addi-
Resulting Condition Code:
tion for rounding takes place.
0 Result zero; no overflow
Resulting Condition Code: 1 Result less than zero; no overflow
0 Result zero; no overflow 2 Result greater than zero; no overflow
1 Result less than zero; no overflow 3 Overflow
Floating-point instructions are used to perform cal- same for the short, long, and extended formats.
culations on operands having a wide range of The results of most operations on HFP data are
magnitude and to obtain results scaled to preserve truncated to fit into the target format, but there are
precision. instructions available to round the result when
converting to a narrower format. For HFP oper-
Floating-point operands have formats based on ands, the implicit unit digit of the significand is
either the radix 16 or the radix 2. The radix always zero. Since the value of the significand
values 16 and 2 lead to the terminology and fraction are the same, HFP operations are
hexadecimal and binary floating point (HFP and described in terms of the fraction, and the term
BFP). The formats are also based on three significand is not used.
operand lengths: short (32 bits), long (64 bits),
and extended (128 bits). Short operands require Binary-floating-point (BFP) operands have formats
less storage than long or extended operands. On which provide for exponents that specify powers of
the other hand, long and extended operands the radix 2 and significands that are binary
permit greater precision in computation. numbers. The exponent range differs for different
formats, the range being greater for the longer
A floating-point operand may be numeric or, for formats. In the long and extended formats, the
BFP only, nonnumeric (a not-a-number, or NaN). exponent range is significantly greater for BFP
A numeric operand, called a floating-point number, data than for HFP data. The results of operations
has three components: a sign bit, a signed binary performed on BFP data are rounded automatically
exponent, and a significand. The significand con- to fit into the target format; the manner of rounding
sists of an implicit unit digit to the left of an implied is determined by a program-settable rounding
radix point and an explicit fraction field to the right. mode.
The significand digits are based on the radix, 2 or
16. The magnitude (an unsigned value) of the Either normalized or unnormalized numbers may
number is the product of the significand and the be used as operands for any HFP operation,
radix raised to the power of the exponent. The where a normalized number is one having a
number is positive or negative depending on nonzero leftmost fraction digit. Most HFP
whether the sign bit is zero or one, respectively. instructions generate normalized results for
A nonnumeric BFP operand also has a sign bit, greatest precision. HFP add and subtract
signed exponent, and fraction field. instructions that generate unnormalized results are
also available.
Hexadecimal-floating-point (HFP) operands have
formats which provide for exponents that specify There are no unnormalized operands for BFP
powers of the radix 16 and significands that are operations. For normalized BFP numbers, the
hexadecimal numbers. The exponent range is the implicit unit digit of the significand is one. For
Both BFP and HFP data formats appear in Additional Floating-Point (AFP)
storage in the same left-to-right sequence as all Registers
other data formats. Bits of a data format that are Floating-point registers 0, 2, 4, and 6 are ones
numbered 0-7 constitute the byte in the leftmost that were originally available on ESA/390 models.
(lowest-numbered) byte location in storage, bits The remaining 12 floating-point registers (1, 3, 5,
8-15 form the byte in the next sequential location, and 7-15) were added to ESA/390 and are
and so on. (See also the section Storage referred to as the additional floating-point (AFP)
Addressing on page 3-2.) registers. The AFP registers can be used only if
bit 45 of control register 0, the
Most of the floating-point instructions are defined AFP-register-control bit, is one. Attempting to use
in detail in this publication in Chapter 18, an AFP register when the AFP-register-control bit
Hexadecimal-Floating-Point Instructions, and is zero results in an AFP-register data exception
Chapter 19, Binary-Floating-Point Instructions. (DXC 1).
This chapter, Chapter 9, defines in detail
instructions called floating-point-support (FPS) Valid Floating-Point-Register
instructions. The FPS instructions either have
Designations
operands that may be in either the BFP or the
Any installed register may be designated by an
HFP format or have the function of converting
instruction to specify the register location of a
between the two formats. This chapter also pro-
short or long floating-point operand.
vides summary information about all of the
floating-point instructions. An instruction specifying a floating-point operand
in the extended format must designate register 0,
1, 4, 5, 8, 9, 12, or 13; otherwise, a specification
Registers And Controls exception is recognized.
SUBTRACT NORMALIZED GD Figure 9-2. Number Ranges for BFP and HFP
SUBTRACT UNNORMAL- Formats
IZED GD
Explanation: Equivalent BFP and HFP Number
Representations
BR Biased round to nearest.
CRM Rounded according to current rounding The exponent of an HFP number is represented in
mode. the number as an unsigned seven-bit binary
E Result is exact, no rounding is required. integer called the characteristic. The character-
GD Round using a guard digit; see the istic is obtained by adding 64 to the exponent
instruction definition. This is almost, but value (excess-64 notation). The range of the
not quite, round toward 0. characteristic is 0 to 127, which corresponds to an
M Rounding is specified by a modifier field exponent range of 64 to +63.
in the instruction.
RTZ Round toward 0. The exponent of a BFP number is represented in
the number as an unsigned binary integer called
Figure 9-1. Comparison of Rounding Action the biased exponent. The biased exponent is
obtained by adding a bias to the exponent value.
The number of bit positions containing the biased
exponent, the value of the bias, and the exponent
range depend on the number format (short, long,
or extended) and are shown for the three formats
in Figure 19-7 on page 19-5. Biased exponents
Explanation:
A Access exceptions for logical addresses.
B B field designates an access register in the access-register mode.
C Condition code is set.
Da AFP-register data exception.
RR RR instruction format.
RRE RRE instruction format.
RRF RRF instruction format.
RX RX instruction format.
SP Specification exception.
ST PER storage-alteration event.
For numeric operands, the sign of the result is the Hmin < a < 0 T(0), cc1
sign of the source operand. If the source operand 0 T(0), cc0
has a sign bit of one and all other operand bits
+0 T(+0), cc0
are zeros, the result also is a one followed by all
zeros. 0 < a < +Hmin T(+0), cc2
+Hmin a +Hmax T(r), cc2
When, for THDR, the characteristic of the result
would be negative, the result is made all zeros but +Hmax < a + T(+Hmax), cc3
with the same sign as that of the source operand,
NaN T(+Hmax), cc3
and condition code 1 or 2 is set to indicate the
sign of the source operand. Explanation:
Condition code 1 is set to indicate the
When, for THDR, the characteristic of the
source was less than zero.
hexadecimal intermediate result is too large to fit
Condition code 2 is set to indicate the
into the target format, the result is set to all ones
source was greater than zero.
(that is, the largest-in-magnitude representable
ccn Condition code is set to n.
number) but with the same sign as that of the
r The value derived when the BFP source
source operand, and condition code 3 is set.
value a is converted to the HFP format.
This result is always exact.
See Figure 9-6 for a detailed description of the
Hmax Largest (in magnitude) representable
results of this instruction.
number in the target HFP format.
Resulting Condition Code: Hmin Smallest (in magnitude) representable
normalized number in the target HFP
0 Source was zero format.
1 Source was less than zero T(x) The value x is placed at the target
2 Source was greater than zero operand location.
3 Special case
Figure 9-6. Results: CONVERT BFP TO HFP
CONVERT HFP TO BFP The sign of the result is the sign of the second
operand. If the second operand has a sign bit of
Mnemonic R,M,R [RRF] one and all other operand bits are zeros, the
result also is a one followed by all zeros.
Mnemonic Op Code Operands The M field must designate a valid modifier; oth-
TBEDR 'B35' Long HFP operand, erwise, a specification exception is recognized.
short BFP result
TBDR 'B351' Long HFP operand, Resulting Condition Code:
long BFP result
0 Source was zero
The second operand (the source operand) is con- 1 Source was less than zero
verted from the hexadecimal-floating-point (HFP) 2 Source was greater than zero
format to the binary-floating-point (BFP) format, 3 Special case
and the result rounded according to the rounding
method specified by the M field is placed at the Program Exceptions:
first-operand location. The sign and magnitude of Data with DXC 1, AFP register
the source operand are tested to determine the Specification
setting of the condition code.
Programming Notes:
The M field contains a modifier specifying a
rounding method, as follows: 1. The HFP-to-BFP conversion instructions are
summarized in Figure 9-7.
M Rounding Method 2. Conversion to short BFP numbers requires
0 Round toward 0 HFP operands in the long format; a short HFP
1 Biased round to nearest operand should be extended to long by
4 Round to nearest ensuring that the right half of the register is
5 Round toward 0 cleared. Thus, the entire register should be
6 Round toward + cleared before loading a short HFP operand
7 Round toward into it for conversion to BFP. This avoids
unrepeatable rounding errors in the BFP result
A modifier other than 0, 1, or 4-7 is invalid. due to data left over from previous use.
Mnemonic1 R,R [RR] Op Code //////// R R
16 24 28 31
Op Code R R
Mnemonic2 Op Code Operands
8 12 15 LXR 'B365' Extended
Mnemonic1 Op Code Operands
LER '38' Short
LDR '28' Long
8 12 16 2 31 STORE
Mnemonic3 Op Code Operands Mnemonic R,D(X,B) [RX]
LE '78' Short
LD '68' Long
Op Code R X B D
The second operand is placed unchanged at the
first-operand location. 8 12 16 2 31
Figure 9-10. BFP and HFP Instructions with All Operands of Same Length
Figure 9-11. BFP and HFP Instructions with Result Longer than Source
Figure 9-12. BFP and HFP Instructions with Result Shorter than Source
This chapter includes all privileged and semiprivi- An attempt to execute a semiprivileged instruction
leged instructions described in this publication, in the problem state when the authority require-
except the input/output instructions, which are ments are not met generates a privileged-
described in Chapter 14, I/O Instructions. operation exception or some other
program-interruption condition depending on the
Privileged instructions may be executed only when particular requirement which is violated. Those
the CPU is in the supervisor state. An attempt to requirements which cause a privileged-operation
execute a privileged instruction in the problem exception to be generated in the problem state are
state generates a privileged-operation exception. not enforced when execution is attempted in the
supervisor state.
The semiprivileged instructions are those
instructions that can be executed in the problem The control instructions and their mnemonics,
state when certain authority requirements are met. formats, and operation codes are listed in
BRANCH AND SET AUTHORITY in general register R if R is not zero; bits 32 and
97-127 of the PSW and the PKM, PSW key, and
BSA R,R [RRE] problem-state bit are replaced by values saved in
the DUCT; and the dispatchable unit is placed in
the base-authority state. In the 64-bit addressing
'B25A' //////// R R
mode, the action is the same except that bits
In the 24-bit or 31-bit addressing mode, PSW bits If R is nonzero in the 24-bit or 31-bit addressing
32 and 97-127 are saved in word 9 of the DUCT, mode, bits 32 and 97-127 of the current PSW, the
and zeros are stored in word 8. In the 64-bit basic-addressing-mode bit and bits 33-63 of the
addressing mode, PSW bits 64-127 are saved in updated instruction address, are placed in bit posi-
words 8 and 9 of the DUCT. In any addressing tions 32 and 33-63, respectively, of general reg-
mode, the PKM, the PSW key, and the problem- ister R, and bits 0-31 of the register remain
state bit are saved in word 5 of the DUCT, the RA unchanged. If R is nonzero in the 64-bit
bit in word 5 is set to one, and bits 16-23, 29, and addressing mode, bits 64-127 of the current PSW
30 of word 5 are set to zeros. are placed in bit positions 0-63 of general register
R. If R is zero, general register 0 remains
Bits 56-59 of general register R are placed in bit unchanged.
positions 8-11 of the PSW as the new PSW key.
In the problem state, the new PSW key must be In the 24-bit or 31-bit addressing mode, bit 0 of
authorized by the PKM; otherwise, if the new PSW word 9 of the DUCT is placed in PSW bit position
key is not authorized, a privileged-operation 32, and bits 1-31 of word 9, with 33 leftmost zeros
exception is recognized. appended, are placed in PSW bit positions
64-127.
After the new PSW key has been placed in the
PSW, bits 32-47 of general register R are ANDed In the 64-bit addressing mode, the contents of
with the PKM in control register 3, and the result words 8 and 9 of the DUCT are placed in PSW bit
replaces the PKM in control register 3. positions 64-127, and bit 32 of the PSW remains
unchanged.
The problem-state bit in the PSW is set to one.
In any addressing mode, the PKM, the PSW key,
In the 24-bit or 31-bit addressing mode, bit 32 of and the problem-state bit are restored from the
general register R is placed in bit position 32 of DUCT, and the RA bit is set to zero, as previously
the PSW as the new basic-addressing-mode bit. described. There is no test for whether the
When R is nonzero and bit 63 of general register The entry-type code in the state entry is 0001100
R is one, the return address is generated from binary.
the contents of the register under the control of
the 64-bit addressing mode. Bits 0-62 of the Key-controlled protection does not apply to
return address, with a zero appended on the right, accesses to the linkage stack, but low-address
are substituted for the updated instruction address and page protection do apply.
in the current PSW when the contents of that
PSW are placed in the state entry. Bits 31 and 32 Special Conditions
are set to one in the PSW that is placed in the
The CPU must be in the primary-space mode or
state entry. The contents of the current PSW are
access-register mode; otherwise, a special-
not changed.
operation exception is recognized.
When the R field is zero, the current PSW is
A stack-full or stack-specification exception may
placed in the state entry without any change
be recognized during the stacking process.
except for an unpredictable PER mask.
The operation is suppressed on all addressing and
Subsequently, when the R field is nonzero, the
protection exceptions.
instruction address in the current PSW is replaced
by the branch address. The branch address is
The priority of recognition of program exceptions
generated from the contents of general register R
for the instruction is shown in Figure 10-3 on
under the control of the current addressing mode.
page 10-12.
When the R field is zero, the operation is per-
formed without branching.
Condition Code: The code remains unchanged.
The branch state entry is formed and information
Program Exceptions:
is placed in it as described in Stacking Process
on page 5-72. Access (fetch or store, except for key-
controlled protection, linkage-stack entry)
In the 24-bit or 31-bit addressing mode, bits 33-63 Special operation
of the branch address (or of the updated instruc- Stack full
tion address if the operation is performed without Stack specification
Trace
The DASTE located due to an ALET other than When R is nonzero or zero in the 64-bit
ALET 0 and ALET 1 may be the ASTE for the addressing mode, the contents of general register
base space of the subspace group associated with R designate the branch address. The branch
the dispatchable unit. The DASTE is the base- address is generated from the contents of the reg-
space ASTE if the DASTE origin (DASTEO) ister under the control of the 64-bit addressing
obtained from an ALE by ART equals the mode. Bit 32 of the PSW remains unchanged.
BASTEO in the DUCT. For determining whether
the DASTEO equals the BASTEO, either the Regardless of the addressing mode, the new
DASTEO may be compared to the BASTEO, or value for the PSW is computed before general
the DASTEO with one leftmost and six rightmost register R is changed.
zeros appended may be compared to the entire
contents of word 0 of the DUCT. If the DASTE is The secondary ASCE (SASCE) in control register
not the base-space ASTE, the DASTE is treated 7 is set equal to the new PASCE in control reg-
as the ASTE for a subspace of the dispatchable ister 1. The secondary ASN (SASN), bits 48-63 of
unit's subspace group provided that (1) the control register 3, is set equal to the primary ASN
subspace-group bit, bit 54, in the ASCE in the (PASN), bits 48-63 of control register 4.
DASTE is one, and (2) the DASTE does not
specify the base space of another subspace If the DASTE specifies the base space, the
group. The DASTE specifies the base space of subspace-active bit, bit 0 of word 1 of the DUCT,
another subspace group if the base-space bit, bit is set to zero, and bits 1-31 of word 1 remain
31 of word 0 of the DASTE, is one. A special- unchanged. If the DASTE specifies a subspace
operation exception is recognized if either of those by means of ALET 1, then (1) the subspace-active
two provisions is not met.
The fetch, store, and update references to the The operation is suppressed on all addressing and
DUCT are word-concurrent single-access refer- protection exceptions.
ences. The words of the DUCT are accessed in
no particular order. The priority of recognition of program exceptions
for the instruction is shown in the figure Priority of
The operation, since it changes a translation Execution: BRANCH IN SUBSPACE GROUP.
parameter in control register 1, causes all copies
of prefetched instructions to be discarded, except Condition Code: The code remains unchanged.
when in the home-space mode.
Program Exceptions:
Special Conditions Addressing (dispatchable-unit control table,
effective access-list designation, access-list
DAT must be on; otherwise, a special-operation entry, destination ASN-second-table entry)
exception is recognized. A special-operation ALET specification
exception is also recognized if the current primary ALEN translation
address space is not in a subspace group associ- ASTE sequence
ated with the current dispatchable unit, if the ALET ASTE validity
in access register R is ALET 1 but a subspace Protection (low-address; dispatchable-unit
has not previously been entered by the control table)
dispatchable unit by means of BRANCH IN SUB- Special operation
SPACE GROUP, or if the ALET used is other than Trace
ALET 0 and ALET 1 and the destination ASTE
16 24 28 31
Figure 10-5. Register Contents for COMPARE AND The R field must designate an even register; oth-
SWAP AND PURGE erwise, a specification exception is recognized.
Programming Notes:
'B226' //////// R ////
1. Since the instruction is not intended for
problem-state-program or control-program 16 24 28 31
use, DIAGNOSE has no mnemonic.
2. DIAGNOSE, unlike other instructions, does The 16-bit PASN, bits 48-63 of control register 4,
not follow the rule that programming errors are is placed in bit positions 48-63 of general register
distinguished from equipment errors. R. Bits 32-47 of the general register are set to
Improper use of DIAGNOSE may result in zeros, and bits 0-31 remain unchanged.
false machine-check indications or may cause
actual machine malfunctions to be ignored. It Special Conditions
may also alter other aspects of system opera-
tion, including instruction execution and The instruction must be executed with DAT on;
channel-program operation, to an extent that otherwise, a special-operation exception is recog-
the operation does not comply with that speci- nized.
fied in this publication. As a result of the
improper use of DIAGNOSE, the system may In the problem state, the extraction-authority
be left in such a condition that the power-on control, bit 36 of control register 0, must be one;
reset or initial-microprogram-loading (IML) otherwise, a privileged-operation exception is
The priority of recognition of program exceptions The priority of recognition of program exceptions
for the instruction is shown in Figure 10-6. for the instruction is shown in Figure 10-7.
Condition Code: The code remains unchanged. Condition Code: The code remains unchanged.
1.-6. Exceptions with the same priority as 1.-6. Exceptions with the same priority as
the priority of program-interruption the priority of program-interruption
conditions for the general case. conditions for the general case.
7.A Access exceptions for second instruc- 7.A Access exceptions for second instruc-
tion halfword. tion halfword.
7.B Special-operation exception due to 7.B Special-operation exception due to
DAT being off. DAT being off.
8. Privileged-operation exception due to 8. Privileged-operation exception due to
extraction-authority control, bit 36 extraction-authority control, bit 36
of control register , being zero in of control register , being zero in
problem state. problem state.
Figure 10-6. Priority of Execution: EXTRACT Figure 10-7. Priority of Execution: EXTRACT SEC-
PRIMARY ASN ONDARY ASN
'B227' //////// R //// 'B249' //////// R R
16 24 28 31 16 24 28 31
The 16-bit SASN, bits 48-63 of control register 3, EREGG R,R [RRE]
is placed in bit positions 48-63 of general register
R. Bits 32-47 of the general register are set to 'B9E' //////// R R
zeros, and bits 0-31 remain unchanged.
16 24 28 31
Special Conditions
The instruction must be executed with DAT on; Contents of a set of general registers and a set of
otherwise, a special-operation exception is recog- access registers that were saved in the last state
nized. entry in the linkage stack are restored to the regis-
ters. Each set of registers begins with register R
In the problem state, the extraction-authority and ends with register R.
control, bit 36 of control register 0, must be one;
otherwise, a privileged-operation exception is For EXTRACT STACKED REGISTERS (EREG),
the contents of bit positions 32-63 of the general
registers are restored, and the contents of bit posi-
For each of the general registers and the access A stack-empty, stack-specification, or stack-type
registers, the registers are loaded in ascending exception may be recognized during the
order of their register numbers, starting with reg- unstacking process.
ister R and continuing up to and including reg-
ister R, with register 0 following register 15. The The operation is suppressed on all addressing
bit positions of each register are loaded from the exceptions.
position in the state entry where the contents of
the bit positions were saved when the state entry The priority of recognition of program exceptions
was created. The contents of the state entry for the instruction is shown in Figure 10-8 on
remain unchanged. page 10-23.
The last state entry is located as described in Condition Code: The code remains unchanged.
Unstacking Process on page 5-75. The state
entry remains in the linkage stack, and the
Program Exceptions:
linkage-stack-entry address in control register 15 Access (fetch, except for protection, linkage-
remains unchanged. stack entry)
Special operation
Key-controlled protection does not apply to refer- Stack empty
ences to the linkage stack. Stack specification
Stack type
EXTRACT STACKED STATE state-entry byte positions, or byte and bit posi-
tions, from which information is to be extracted, as
ESTA R,R [RRE] follows:
The format of byte positions 128-175 of the state The contents of the state entry remain unchanged.
entry is as follows:
The last state entry is located as described in
Unstacking Process on page 5-75. The state
PKM SASN EAX PASN entry remains in the linkage stack, and the
linkage-stack-entry address in control register 15
128 13 132 134 135
remains unchanged.
The address is a virtual address and is subject to The priority of recognition of program exceptions
the address-space-control bits, bits 16 and 17 of for the instruction is shown in Figure 10-11 on
the current PSW. The address is treated as a page 10-29.
primary virtual address in the primary-space
mode, as a secondary virtual address in the Condition Code: The code remains unchanged.
secondary-space mode, as an AR-specified virtual
address in the access-register mode, or as a Program Exceptions:
home virtual address in the home-space mode. Access (except for protection, address speci-
The reference to the storage key is not subject to fied by general register R)
a protection exception. Privileged operation (extraction-authority
control is zero in the problem state)
Special operation
Special Conditions
The contents of the doubleword at the first-
The operation is suppressed on all addressing and operand location contain values to be loaded into
protection exceptions. control registers 3 and 4, including a secondary
ASN (SASN) and a primary ASN (PASN). Exe-
Condition Code: The code remains unchanged. cution of the instruction consists in performing four
major steps: PASN translation, SASN translation,
Program Exceptions: SASN authorization, and control-register loading.
Each of these steps may or may not be per-
Addressing (page-table entry)
formed, depending on the outcome of certain tests
Privileged operation
and on the setting of bits 61-63 of the second-
Protection (fetch and store, page-table entry,
operand address. These steps, when successful,
key-controlled protection, and low-address
obtain additional values, which are loaded into
protection)
control registers 1, 5, and 7. When the steps are
not successful, no control registers are changed,
Programming Notes:
and the reason is indicated in the condition code.
1. The selective clearing of entries may be
implemented in different ways, depending on The doubleword first operand contains a PSW-key
the model, and, in general, more entries may mask (PKM), a secondary ASN (SASN), an
be cleared than the minimum number authorization index (AX), and a primary ASN
required. Some models may clear all entries (PASN). The primary ASN is translated by means
which contain the page-frame real address of the ASN-translation tables to obtain a
obtained from the page-table entry in storage. primary-ASTE (PASTE) origin (PASTEO) and,
Others may clear all entries which contain the from the PASTE, a primary ASCE (PASCE). An
designated page index, and some implemen- AX is optionally obtained from the PASTE. The
tations may clear precisely the minimum secondary ASN is translated by means of the
number of entries required. Therefore, in ASN-translation tables to obtain a secondary
order for a program to operate on all models, ASCE (SASCE), and, optionally, an authority
the program should not take advantage of any check is made to ensure that the new AX is
properties obtained by a less selective authorized to establish the new SASN.
clearing on a particular model.
The doubleword at the first-operand location has
2. The clearing of TLB entries may make use of
the following format:
the page-frame real address in the page-table
entry. Therefore, if the page-table entry, when
in the attached state, ever contained a page- PKM-d SASN-d AX-d PASN-d
frame real address that is different from the
current value, copies of the previous values 16 32 48 63
may remain in the TLB.
3. INVALIDATE PAGE TABLE ENTRY cannot be The d stands for designated doubleword and is
safely used to update a shared location in used to distinguish these fields from other fields
main storage if the possibility exists that with similar names which are referred to in the
The second-operand address is not used to The PASN translation follows the normal rules for
address data; instead, the rightmost three bits are ASN translation, except that the invalid bits, bit 0
used to control portions of the operation. The in the ASN-first-table entry and bit 0 in the ASTE,
remainder of the second-operand address is when ones, do not result in an ASN-translation
ignored. Bits 61-63 of the second-operand exception, and the space-switch-event-control bit
address are used as follows: in the ASTE, when one, does not result in a
space-switch event. When either of the invalid
Function Specified in bits is one, condition code 1 is set. When the
Second-Operand Address ASTE is valid and either the current primary
space-switch-event-control bit in control register 1
BitWhen Bit Is Zero When Bit Is One is one or the space-switch-event-control bit in the
61 ASN translation per-ASN translation per- ASTE is one, condition code 3 is set. When con-
formed only when newformed.\ dition code 1 or 3 is set, the control registers
ASN and old ASN are remain unchanged.
different.
The contents of the AX and ASCE fields in the
62 AX associated with AX from first oper- ASTE which is accessed as a result of the PASN
PASN used. and used.
translation are referred to as AX-p and ASCE-p,
63 SASN authorization SASN authorization respectively. The origin of the ASTE is referred to
performed.\ not performed. as PASTEO-p.
\ SASN translation and SASN authorization The description in this paragraph applies to use of
are performed only when SASN-d is not the subspace-group facility. After ASCE-p has
equal to PASN-d. When SASN-d is equal to
been obtained, if (1) the subspace-group-control
PASN-d, the SASCE is loaded from the
PASCE, and no authorization is performed. bit, bit 54 in ASCE-p, is one, (2) the dispatchable
unit is subspace active, and (3) PASTEO-p desig-
nates the ASTE for the base space of the
The operation of LOAD ADDRESS SPACE
dispatchable unit, then a copy of ASCE-p, called
PARAMETERS is depicted in Figure 10-15 on
ASCE-rp, is made, 0-55 and 58-63 of ASCE-rp
page 10-38.
are replaced by the same bits of the ASCE in the
ASTE for the subspace in which the dispatchable
PASN Translation
unit last had control. Further details are in
In the PASN-translation process, the PASN-d is Subspace-Replacement Operations on
translated by means of the ASN first table and the page 5-59. If bit 0 in the subspace ASTE is one,
ASN second table. The ASCE field, and or if the ASTE sequence number (ASTESN) in the
optionally the AX field, obtained from the ASTE subspace ASTE does not equal the subspace
are subsequently used to update the corre- ASTESN in the dispatchable-unit control table, an
sponding control registers. The PASTEO resulting exception is not recognized; instead, condition
from PASN translation is used to update control code 1 is set, and the control registers remain
register 5. unchanged.
When SASN translation is performed, by the The operation is suppressed on all addressing and
ASCE-s, or by ASCE-rs if a subspace- protection exceptions.
replacement operation was performed on
ASCE-s. Figure 10-13 on page 10-35 and Figure 10-12 on
page 10-34 summarize the functions of the
When SASN-d does not equal PASN-d and SASN instruction and the priority of recognition of
translation is not performed, the SASCE remains exceptions and condition codes.
unchanged.
Resulting Condition Code:
Other Condition-Code Settings
0 Translation and authorization complete;
When PASN translation is called for and cannot parameters loaded
be completed because bit 0 is one in either the 1 Primary ASN or subspace not available;
ASN-first-table entry or the ASTE, or if it can be parameters not loaded
completed but a subspace-replacement-exception 2 Secondary ASN not available or not author-
condition exists due to bit 0 or the ASTE ized, or secondary subspace not available;
sequence number in the subspace ASTE during a parameters not loaded
subspace-replacement operation on the ASCE-p, 3 Space-switch event specified; parameters not
condition code 1 is set, and the control registers loaded
are not changed.
Program Exceptions:
When PASN translation is called for and com- Access (fetch, operand 1)
pleted and any required subspace-replacement Addressing (ASN-first-table entry, ASN-
operation on the ASCE-p is also completed, and second-table entry, authority-table entry,
then either (1) the current primary space-switch- dispatchable-unit control table)
event-control bit, bit 57 of control register 1, is one Privileged operation
or (2) the space-switch-event-control bit in the Special operation
ASTE designated by PASTEO-p is one, condition Specification
Figure 10-12 (Part 1 of 2). Priority of Execution: LOAD ADDRESS SPACE PARAMETERS
Figure 10-12 (Part 2 of 2). Priority of Execution: LOAD ADDRESS SPACE PARAMETERS
Second-
Operand-
Address
PASN-d Bits PASN Result Field
Equals Translation
PASN-old 61 62 Performed PASCE-newAX-newPASTEO-newPKM-newSASN-newPASN-new
Figure 10-13 (Part 1 of 2). Summary of Actions: LOAD ADDRESS SPACE PARAMETERS
Yes - - - No No PASCE-new
No Yes 1 No No SASCE-old
No Yes 1 1 Yes No ASCE-s
No Yes - Yes Yes ASCE-s
No No - 1 Yes No ASCE-s
No No - Yes Yes ASCE-s
Explanation:
- Action in this case is the same regardless of the outcome of this
comparison or of the setting of this bit.
Second-operand-address bits:
61 Force ASN translation.
62 Use AX from first operand.
63 Skip secondary authority test.
PASCE-new is ASCE-rp (a copy of ASCE-p except with bits -55 and
58-63 replaced from the ASCE in the subspace ASTE), if subspace
replacement is performed.
SASN authorization is performed using ATO-s, ATL-s, and AX-new.
SASCE-new is ASCE-rs (a copy of ASCE-s except with bits -55 and
58-63 replaced from the ASCE in the subspace ASTE), if subspace
replacement is performed.
Figure 10-13 (Part 2 of 2). Summary of Actions: LOAD ADDRESS SPACE PARAMETERS
First-Operand
Bit Positions Abbreviation
-15 PKM-d
16-31 SASN-d
32-47 AX-d
48-63 PASN-d
1-29 - ATO-s
32-47 AX-p -
48-59 - ATL-s
64-127 ASCE-p ASCE-s
Explanation:
- The field is not used in this case.
ASCE-rp is formed from ASCE-p, and ASCE-rs
is formed from ASCE-s, by a subspace-
replacement operation.
Programming Notes:
LCTL R,R,D(B) [RS] 1. To ensure that existing programs operate cor-
rectly if and when new facilities using addi-
'B7' R R B D tional control-register positions are defined,
only zeros should be loaded in unassigned
8 12 16 2 31 control-register positions.
2. Loading of control registers on some models
LCTLG R,R,D(B) [RSE] may require a significant amount of time. This
/ is particularly true for changes in significant
'EB' R R B D //////// '2F' parameters.
/ For example, the TLB may be cleared of
8 12 16 2 32 4 47
entries as a result of changing or enabling the
program-event-recording parameters in control
Bit positions of the set of control registers starting registers 9-11. Where possible, the program
with control register R and ending with control should avoid unnecessary loading of control
register R are loaded from storage beginning at registers. In loading control registers 9-11,
the location designated by the second-operand most models attempt to optimize for the case
address and continuing through as many locations when the bits of control register 9 are zeros.
as needed.
The information loaded into the control registers Bit 12 of the doubleword must be one; otherwise,
becomes active when instruction execution has a specification exception may be recognized,
ended. depending on the model.
The operation is suppressed on all addressing and Any of the unassigned bits (0, 2-4, 24-30, or
protection exceptions. 33-63) is a one.
Bit 12 is a one.
Resulting Condition Code: The code is set as
specified in the new PSW loaded. Bits 31 and 32 are zero and one, respectively,
and bits 64-96 are not all zeros.
Program Exceptions: Bits 31 and 32 are both zero, and bits 64-103
Access (fetch, operand 2) are not all zeros.
Privileged operation Bits 31 and 32 are one and zero, respectively.
Specification
In these cases, the operation is completed, and
Programming Note: The second operand should the resulting instruction-length code is zero.
have the format of an ESA/390 PSW. A specifica-
tion exception will be recognized during or after The test for a specification exception after the
the execution of LOAD PSW if bit 12 of the PSW is loaded is described in Early Exception
operand is zero. Recognition on page 6-9. It may be considered
as occurring early in the process of preparing to
execute the subsequent instruction.
LRAG R,D(X,B) [RXE] ART and DAT may be performed with the use of
the ART-lookaside buffer (ALB) and translation-
/
'E3' R X B D //////// '3' lookaside buffer (TLB), respectively.
/
8 12 16 2 32 4 47 The virtual-address computation is performed
according to the current addressing mode, speci-
fied by bits 31 and 32 of the current PSW.
For LOAD REAL ADDRESS (LRA) in the 24-bit or
31-bit addressing mode, if bits 0-32 of the 64-bit
The addresses of the region-table entry or entries,
real address corresponding to the second-operand
if used, and of the segment-table entry and page-
virtual address are all zeros, bits 32-63 of the real
table entry are treated as 64-bit addresses regard-
address are placed in bit positions 32-63 of
less of the current addressing mode. It is
general register R, and bits 0-31 of the register
unpredictable whether the addresses of these
remain unchanged. If bits 0-32 of the real
entries are treated as real or absolute addresses.
address are not all zeros, a special-operation
exception is recognized. Condition code 0 is set when both ART, if appli-
cable, and DAT can be completed and a special-
For LRA in the 64-bit addressing mode, and for
operation exception is not recognized, that is,
LOAD REAL ADDRESS (LRAG) in any
when an address-space-control element can be
addressing mode, the 64-bit real address corre-
obtained, the entry in each DAT table lies within
sponding to the second-operand virtual address is
the table and has a zero I bit, and, for LRA in the
placed in general register R.
24-bit or 31-bit addressing mode, bits 0-32 of the
resulting real address are zeros. The translated
The virtual address specified by the X, B, and
address is not inspected for boundary alignment
D fields is translated by means of the dynamic-
or for addressing or protection exceptions.
address-translation facility, regardless of whether
DAT is on or off.
When PSW bits 16 and 17 are 01 binary and an
address-space-control element cannot be obtained
DAT is performed by using an address-space-
because of a condition that would normally cause
control element that depends on the current value
one of the exceptions shown in the following table,
of the address-space-control bits, bits 16 and 17
(1) the interruption code assigned to the exception
of the PSW, as shown in the following table:
is placed in bit positions 48-63 of general register
R, bit 32 of this register is set to one, bits 33-47
are set to zeros, and bits 0-31 remain unchanged,
and (2) the instruction is completed by setting
condition code 3.
ALET specification U 1 s 28 3 U 1 s 28 3
ALEN translation U 1 s 29 3 U 1 s 29 3
ALE sequence U 1 s 2A 3 U 1 s 2A 3
ASTE validity U 1 s 2B 3 U 1 s 2B 3
ASTE sequence U 1 s 2C 3 U 1 s 2C 3
Extended authority U 1 s 2D 3 U 1 s 2D 3
ASCE type U 1 s 38 3 U 1 s 38 3
Region first trans. U 1 s 39 3 U 1 s 39 3
Region second trans. U 1 s 3A 3 U 1 s 3A 3
Region third trans. U 1 s 3B 3 U 1 s 3B 3
Segment translation/ U EA3 EA4 3 U EA3 EA4 3
entry outside table/
entry address < 2GB
Segment translation/ U 1 s 1 3 U 1 s 1 3
entry outside table/
entry address >= 2GB
Segment translation/ U EA3 EA4 1 EA1 EA2 EA3 EA4 1
I bit one/
entry address < 2GB
Segment translation/ U 1 s 1 3 EA1 EA2 EA3 EA4 1
I bit one/
entry address >= 2GB
Page translation/ U EA3 EA4 2 EA1 EA2 EA3 EA4 2
I bit one/
entry address < 2GB
Page translation/ U 1 s 11 3 EA1 EA2 EA3 EA4 2
I bit one/
entry address >= 2GB
Real Address < 2GB U RA3 RA4 RA1 RA2 RA3 RA4
Real Address >= 2GB Special-Operation Exception RA1 RA2 RA3 RA4
16 24 28 31
Condition Code: The code remains unchanged.
A specification exception is recognized when R is Condition Code: The code remains unchanged.
odd.
Program Exceptions:
The CPU must be in the primary-space mode,
Access (fetch and store, except for key-
access-register mode, or home-space mode; oth-
controlled protection, linkage-stack entry)
erwise, a special-operation exception is recog-
Special operation
nized.
Specification
Stack empty
A stack-empty, stack-specification, or stack-type
Stack specification
exception may be recognized during the
Stack type
unstacking process.
MOVE PAGE
Explanation:
CCO Condition-code-option bit.
DRI Destination-reference-intention bit.
F When one, specified access key applies to first operand. A specification exception is
recognized if F and S are both ones.
Key Specified access key.
S When one, specified access key applies to second operand. A specification exception is
recognized if F and S are both ones.
A page-out operation is performed which transfers If the expanded-storage block is not available, that
a 4K-byte block from the real-storage location des- is, the block is not provided or is not currently in
ignated by general register R to the expanded- the configuration, then condition code 3 is set, and
storage block designated by general register R. no other action is taken.
Bits 32-63 of general register R are a 32-bit Operation of PAGE OUT in a Multiple-CPU
unsigned binary integer called the expanded- Configuration
storage-block number. This number designates
the 4K-byte block of expanded storage which is to The accesses to main storage and to expanded
be replaced. If the expanded-storage-block storage by PAGE OUT are not necessarily single-
number designates an inaccessible block in access references and are not necessarily per-
expanded storage, condition code 3 is set. formed in a left-to-right direction, as observed by
other CPUs and by channel programs.
The contents of general register R are a real
address which designates a 4K-byte block in main If two or more CPUs issue PAGE IN or PAGE
storage. In the 24-bit-addressing mode, bits 40-51 OUT instructions at approximately the same
designate the block, and bits 0-39 are ignored. In instant in time, depending on the model, the oper-
the 31-bit-addressing mode, bits 33-51 designate ations may be performed one at a time, or the
the block, and bits 0-32 is ignored. In the operations may be performed concurrently. Con-
64-bit-addressing mode, bits 0-51 designate the current operation may occur even if the
block. In all modes, bits 52-63 of the address are instructions address the same expanded-storage
ignored. block.
Because it is a real address, the address desig- When two or more PAGE OUT instructions
nating the main-storage block is not subject to addressing the same expanded-storage block are
dynamic address translation. PAGE OUT is not executed concurrently, the resulting values in the
subject to key-controlled protection. expanded-storage block for each group of bytes
transferred may be from any of the instructions
A serialization and checkpoint-synchronization being executed simultaneously. The number of
function is performed before the operation begins bytes transferred as a group depends on the
and again after the operation is completed. model.
Depending on the model, after the data has been Similarly, for concurrent execution of a PAGE IN
written to the expanded-storage block, a read- and a PAGE OUT instruction for the same
back-check operation may be performed to deter- expanded-storage block, the resulting values for
mine whether the data was written correctly. If the each group of bytes transferred as a result of the
read-back-check operation determines that the execution of the PAGE IN instruction may be
data has been written correctly, condition code 0 either the old or new values from the expanded-
is set. If the read-back-check operation storage block.
encounters an expanded-storage data error, con-
dition code 1 is set. Concurrent operation of paging instructions does
not result in expanded-storage data errors.
Most models do not perform the read-back-check
operation, and, after the page-out operation is Resulting Condition Code:
completed, condition code 0 is set.
0 Page-out operation completed
In both PC-cp and PC-ss, the SASN and sec- The 32-byte entry-table entry (ETE) has the fol-
ondary ASCE (SASCE) are set equal to the ori- lowing format:
ginal PASN and PASCE, respectively. However,
the space-switching stacking PROGRAM CALL When Resulting Addressing Mode Is the
operation may instead set the SASN and SASCE 24-Bit or 31-Bit Mode
equal to the new PASN and PASCE, respectively,
A EIA P
as determined by a control bit in the ETE.
32 63
In a PC-ss to the base space of the dispatchable
unit when the dispatchable unit is subspace
When Resulting Addressing Mode Is the
active, bits 0-55 and 58-63 of the new PASCE are 64-Bit Mode
replaced by the same bits of the ASCE in the
ASTE for the subspace in which the dispatchable EIA P
unit last had control. This occurs before the pos-
sible setting of the SASCE equal to the PASCE. 63
When the resulting addressing mode is the 24-bit PROGRAM CALL to Current Primary (PC-cp)
or 31-bit mode, bits 33-62 of the ETE (the EIA),
with 33 leftmost and one rightmost zeros If bits 80-95 of the ETE (the ASN), are zeros,
appended, are placed in PSW bit positions 64-127 PROGRAM CALL to current primary (PC-cp) is
(the instruction address). When the resulting specified, and the execution of the instruction is
addressing mode is the 64-bit mode, bits 0-62 of completed after the operations described in
the ETE (the EIA), with one rightmost zero PROGRAM CALL PC-Number Translation and
appended, are placed in PSW bit positions either Basic PROGRAM CALL or Stacking
64-127. PROGRAM CALL have been performed and the
following operations have been performed.
Bit 63 of the ETE (P) is placed in PSW bit position
15 (the problem-state bit). The current PASN, bits 48-63 of control register 4,
is placed in bit positions 48-63 of control register 3
When bit 131 of the ETE (K) is zero, bits 8-11 of to become the current SASN.
the PSW (the PSW key) remain unchanged.
When bit 131 of the ETE is one, bits 136-139 of The current PASCE in control register 1 is placed
the ETE (the EK) replace the PSW key in the in control register 7 to become the current
PSW. SASCE.
When bit 132 of the ETE (M) is zero, bits 96-111 The basic PC-cp operation is depicted in parts 1-3
of the ETE (the EKM) are ORed with the PSW-key of Figure 10-22 on page 10-65. The stacking
mask, bits 32-47 of control register 3, and the PC-cp operation is depicted in parts 1, 4, and 5 of
result replaces the PSW-key mask in control reg- the figure.
ister 3. When bit 132 of the ETE is one, bits
PROGRAM CALL with Space Switching (PC-ss)
96-111 of the ETE replace the PSW-key mask in
control register 3.
If the ASN in the ETE is nonzero, PROGRAM
CALL with space switching (PC-ss) is specified,
When bit 133 of the ETE (E) is zero, the EAX, bits
and the execution of the instruction is completed
32-47 of control register 8, remains unchanged.
after the operations described in PROGRAM
When bit 133 of the ETE is one, bits 144-159 of
CALL PC-Number Translation and either Basic
PROGRAM CALL or Stacking PROGRAM CALL
R: Address is real.
\: In stacking PC, PC number is placed in linkage stack.
\\: First word and A of ETE are bits -32 of EIA if resulting addressing
mode is the 64-bit mode.
Figure 10-22 (Part 1 of 6). Execution of PROGRAM CALL
PSW
before P EA IA -62
E= IA 33-62
6 6 6
GR14
32-63AIA 33-62 P
after
Figure 10-22 (Part 2 of 6). Execution of PROGRAM CALL
PSW
before P EA IA -62
E=1 A=1
6 6
GR14
after IA -62 P
Figure 10-22 (Part 3 of 6). Execution of PROGRAM CALL
\: If PC-ss and S=1, SASN is replaced by new PASN, and SASCE is replaced by new PASCE.
Figure 10-22 (Part 4 of 6). Execution of PROGRAM CALL
\: If PC-ss and S=1, SASN is replaced by new PASN, and SASCE is replaced by new PASCE.
Figure 10-22 (Part 5 of 6). Execution of PROGRAM CALL
R: Address is real.
\: First word and A of ETE are bits -32 of EIA if resulting addressing mode is the 64-bit mode.
\\: ASTE is 64 bytes; last 48 bytes are not shown.
\\\: Bits -55 and 58-63 of PASCE may be replaced from a subspace ASCE.
Figure 10-22 (Part 6 of 6). Execution of PROGRAM CALL
PROGRAM RETURN also are restored from the state entry. When the
entry-type code is 0001100 binary, indicating a
PR [E] branch state entry, the current PASN, SASN,
PKM, and EAX remain unchanged.
Programming Note: Because PROGRAM CALL General registers R and R have the following
cannot be executed successfully in the secondary- format:
space or home-space mode, PROGRAM /
RETURN is not intended to load a PSW specifying R /// PSW-Key Mask ASN
one of these translation modes. PROGRAM /
RETURN, unlike SET ADDRESS SPACE 32 48 63
CONTROL and SET ADDRESS SPACE In 24-Bit or 31-Bit Addressing Mode
CONTROL FAST, does not recognize a space- /
switch event because of loading a PSW that spec- R ///A Instruction Address P
ifies the home-space mode. /
32 63
In 64-Bit Addressing Mode
PROGRAM TRANSFER /
R Instruction Address P
PT R,R [RRE] /
63
The instruction can be executed only when the The operation is suppressed on all addressing
CPU is in the primary-space mode and the exceptions.
subsystem-linkage control, bit 0 of the linkage-
table designation, is one. If the CPU is in the real The priority of recognition of program exceptions
mode, secondary-space mode, access-register for the instruction is shown in Figure 10-24 on
mode, or home-space mode, or if the subsystem- page 10-77.
linkage control is zero, a special-operation excep-
tion is recognized. Condition Code: The code remains unchanged.
PROGRAM TRANSFER
Instruction
'B228' ////RR
6 6
In 24-Bit Mode
R R
32-63 PKM ASN 32-63A IA 33-62 P
With 33
Zeros on
CR3 6 6 6 Left
32-63 PKM SASN PSW ///
before after P EA IA -62
///
E=
6
5AND 6 6
In 64-Bit Mode
R IA -62 P
6 6
CR3
32-63 PKM SASN
after
6 6
PSW ///
CR4 after P EA IA -62
32-63 AX PASN ///
before E=1 A=1
6 6 CR1
YesNo before PASCE
=
6 6 (PT-cp only)
PT-cp PT-ss 6
Instruction (See Part 2) CR7
Complete after SASCE
Figure 10-25 (Part 1 of 2). Execution of PROGRAM TRANSFER
6
CR14
32-63 T AFTO AFX ASX
(x496) (x4) (x64)
R
32-63 PKM ASN
6
ASN First Table 6
5+ %5
5
R I ASTO
(x16)
6
ASN Second Table
5+
R5
I ATO B AX ATL ASCE \
(x4)
CR4
32-63 AX PASN
before
(x1/4)
6
Authority Table %
5+ 6 6 6
CR1 CR4
after PASCE 32-63 AX PASN
\\ after
5
R PS
6
CR7
after SASCE
\\
6 6 6
5Primary-authority exception if P bit CR5
is zero or table length is exceeded 32-63 PASTEO
after
R: Address is real.
\: ASTE is 64 bytes; last 48 bytes are not shown.
\\: Bits -55 and 58-63 of PASCE and SASCE may be replaced from a subspace ASCE.
PURGE ALB
Offset of GR Fld 2
An eight-byte second-operand PSW field has the
64 79 ESA/390 PSW format, as follows:
IE Prog
Bit 13 of the parameter list (P) specifies the size R TOX Key 1MWPA SC C Mask
of the PSW field in the second operand. The field 5 8 12 16 18 2 24 31
is eight bytes if bit 13 is zero or 16 bytes if bit 13
is one.
A Instruction Address
32 63
Bits 14 and 15 of the parameter list (R and D)
provide specifications about one or two general-
register fields in the second operand, as follows: A 16-byte second-operand PSW field has the
z/Architecture PSW format, as follows:
When bit 14 is zero, then bit 15 is ignored, the
general-register field 1 in the second operand
Instruction Address Special Conditions
64 95
The instruction is completed only if the bits 31, 32,
PSW Bits Field Name The CPU must be in the supervisor state when
the operation is to set the home-space mode; oth-
16 and 17 Address-space control (AS)
erwise, a privileged-operation exception is recog-
18 and 19 Condition code (CC)
2-23 Program mask nized. When DAT is off, the values of bits 16 and
31 Extended addressing mode (EA) 17 of the PSW field in the second operand are not
32 Basic addressing mode (BA) tested.
64-127 Instruction address
When the CPU is in the home-space mode either
before or after the operation, but not both before
The remaining fields in the PSW field in the and after the operation, a space-switch-event
second operand are ignored. Specifically, there is program interruption occurs after the operation is
no test for whether bit 12 is one in an eight-byte completed if any of the following is true: (1) the
PSW or zero in a 16-byte PSW. There is also no primary space-switch-event control, bit 57 of the
test for whether bit 31 is zero in an eight-byte primary address-space-control element (ASCE) in
PSW. control register 1, is one; (2) the home space-
switch-event control, bit 57 of the home ASCE in
Unassigned fields in the PSW may be assigned in control register 13, is one; or (3) a PER event is
the future and may then be among those restored to be indicated.
by RESUME PROGRAM. Therefore, these fields
in the PSW field in the second operand should The operation is suppressed on all addressing and
contain zeros; otherwise, the program may not protection exceptions.
operate compatibly in the future.
The priority of recognition of program exceptions
When PSW bits 64-127 are replaced from an for the instruction is shown in Figure 10-26 on
eight-byte PSW field in the second operand, they page 10-83.
are replaced with bits 33-63 of the field, with 33
zeros appended on the left. Resulting Condition Code: The code is set as
specified by the new condition code loaded.
The fields in the second operand are fetched
before the contents of access register B and Program Exceptions:
general register B are changed. Access (fetch, parameter list and operand 2)
Privileged operation (attempt to set the home-
space mode when in the problem state)
'B24' B D
When the clock is not operational, the value and
16 2 31 state of the clock are not changed, regardless of
the settings of the TOD-clock control and the
TOD-clock-control-override control, and condition
The current value of the TOD clock is replaced by
code 3 is set.
the contents of the doubleword designated by the
second-operand address, and the clock enters the
Special Conditions
stopped state.
The operand must be designated on a doubleword
The doubleword operand replaces the contents of
boundary; otherwise, a specification exception is
the clock, as determined by the resolution of the
recognized.
clock. Only those bits of the operand are set in
the clock that correspond to the bit positions which Resulting Condition Code:
are updated by the clock; the contents of the
remaining rightmost bit positions of the operand 0 Clock value set
are ignored and are not preserved in the clock. In 1 Clock value secure
some models, starting at or to the right of bit posi- 2 --
3 Clock in not-operational state
'B26' B D
Program Exceptions:
16 2 31 Privileged operation
Specification
The current value of the clock comparator is Programming Note: The values in the TOD
replaced by the contents of the doubleword desig- programmable registers of a configuration should
nated by the second-operand address. be the same and should be unique within a
multiple-configuration system.
Only those bits of the operand are set in the clock
comparator that correspond to the bit positions to
be compared with the TOD clock; the contents of SET CPU TIMER
the remaining rightmost bit positions of the
SPT D(B) [S]
operand are ignored and are not preserved in the
clock comparator.
'B28' B D
Special Conditions
16 2 31
The operand must be designated on a doubleword
boundary; otherwise, a specification exception is The current value of the CPU timer is replaced by
recognized. the contents of the doubleword designated by the
second-operand address.
The operation is suppressed on all addressing and
protection exceptions. Only those bits of the operand are set in the CPU
timer that correspond to the bit positions to be
Condition Code: The code remains unchanged.
updated; the contents of the remaining rightmost
bit positions of the operand are ignored and are
Program Exceptions:
not preserved in the CPU timer.
Access (fetch, operand 2)
Privileged operation Special Conditions
Specification
The operand must be designated on a doubleword
boundary; otherwise, a specification exception is
SET CLOCK PROGRAMMABLE recognized.
FIELD
The operation is suppressed on all addressing and
SCKPF [E]
protection exceptions.
15 Program Exceptions:
Access (fetch, operand 2)
Bits 48-63 of general register 0 are placed in bit Privileged operation
positions 16-31 of the TOD programmable reg- Specification
The contents of bit positions 33-50 of the prefix Condition Code: The code remains unchanged.
register are replaced by the contents of bit posi-
tions 1-18 of the word at the location designated Program Exceptions:
by the second-operand address. The Access (fetch, operand 2)
ART-lookaside buffer (ALB) and translation- Addressing (new prefix area)
lookaside buffer (TLB) of this CPU are cleared of Privileged operation
entries. Specification
After the second operand is fetched, the value is
tested for validity before it is used to replace the SET PSW KEY FROM ADDRESS
contents of the prefix register. Bits 1-18 of the
SPKA D(B) [S]
operand with 13 zeros appended on the right and
33 zeros appended on the left are used as an
absolute address of the 8K-byte new prefix area in 'B2A' B D
storage. This address is treated as a 64-bit
address regardless of the addressing mode speci- 16 2 31
fied by the current PSW. The two 4K-byte blocks
within the new prefix area are accessed; if either The four-bit PSW key, bits 8-11 of the current
is not available in the configuration, an addressing PSW, is replaced by bits 56-59 of the second-
exception is recognized, and the operation is sup- operand address.
pressed. The accesses to the blocks are not
subject to protection; however, the accesses may The second-operand address is not used to
cause the reference bits for the blocks to be set to address data; instead, bits 56-59 of the address
ones. form the new PSW key. Bits 0-55 and 60-63 of
the second-operand address are ignored.
If the operation is completed, the new prefix is
used for any interruptions following the execution Special Conditions
of the instruction and for the execution of subse-
quent instructions. The contents of bit positions 0 In the problem state, the execution of the instruc-
and 19-31 of the second operand are ignored. tion is subject to control by the PSW-key mask in
control register 3. When the bit in the PSW-key
The ART-lookaside buffer (ALB) and translation- mask corresponding to the PSW-key value to be
lookaside buffer (TLB) are cleared of entries. The set is one, the instruction is executed successfully.
ALB and TLB appear cleared of their original con- When the selected bit in the PSW-key mask is
tents, beginning with the fetching of the next zero, a privileged-operation exception is recog-
sequential instruction. nized. In the supervisor state, any value for the
PSW key is valid.
A serialization function is performed before or after
the second operand is fetched and again after the Condition Code: The code remains unchanged.
operation is completed.
Program Exceptions:
Privileged operation (selected PSW-key-mask
bit is zero in the problem state)
First the new ASN is compared with the current The new ASN, bits 48-63 of general register R,
PASN. If the new ASN is equal to the PASN, the replaces the SASN, bits 48-63 of control register
operation is called SET SECONDARY ASN to 3. The address-space-control element in the
current primary (SSAR-cp). If the new ASN is not ASTE replaces the SASCE in control register 7.
equal to the current PASN, the operation is called
SET SECONDARY ASN with space switching The description in this paragraph applies to use of
(SSAR-ss). The SSAR-cp and SSAR-ss oper- the subspace-group facility. After the new SASCE
R: Address is real.
\: ASTE is 64 bytes; last 48 bytes are not shown.
\\: For SSAR-ss only, bits -55 and 58-63 of SASCE may be replaced from a
subspace ASCE.
Figure 10-29. Execution of SET SECONDARY ASN
Special Conditions
'B22B' //////// R R
When the SSM-suppression-control bit, bit 33 of
16 24 28 31
control register 0, is one and the CPU is in the
supervisor state, a special-operation exception is
The storage key for the 4K-byte block that is recognized.
addressed by the contents of general register R
is replaced by bits from general register R. The value to be loaded into the PSW is not
checked for validity before loading. However,
In the 24-bit addressing mode, bits 40-51 of immediately after loading, a specification excep-
general register R designate a 4K-byte block in tion is recognized, and a program interruption
real storage, and bits 0-39 and 52-63 of the reg- occurs, if the contents of bit positions 0 and 2-4 of
ister are ignored. In the 31-bit addressing mode, the PSW are not all zeros. In this case, the
bits 33-51 of general register R designate a instruction is completed, and the instruction-length
4K-byte block in real storage, and bits 0-32 and code is set to 2. The specification exception,
52-63 of the register are ignored. In the 64-bit which is listed as a program exception for this
addressing mode, bits 0-51 of general register R instruction, is described in Early Exception
designate a 4K-byte block in real storage, and bits Recognition on page 6-9. This exception may be
52-63 of the register are ignored. considered as caused by execution of this instruc-
tion or as occurring early in the process of pre-
Because it is a real address, the address desig- paring to execute the subsequent instruction.
nating the storage block is not subject to dynamic
address translation. The reference to the storage The operation is suppressed on all addressing and
key is not subject to a protection exception. protection exceptions.
The new seven-bit storage-key value is obtained Condition Code: The code remains unchanged.
from bit positions 56-62 of general register R.
The contents of bit positions 0-55 and 63 of the Program Exceptions:
register are ignored.
Access (fetch, operand 2)
Privileged operation
A serialization and checkpoint-synchronization
Special operation
function is performed before the operation begins
Specification
and again after the operation is completed.
The current value of the clock comparator is The storage area where the contents of the
stored at the doubleword location designated by control registers are placed starts at the location
the second-operand address. designated by the second-operand address and
continues through as many storage words, for
Zeros are provided for the rightmost bit positions STCTL, or doublewords, for STCTG, as the
of the clock comparator that are not compared number of control registers specified. The con-
with the TOD clock. tents of the control registers are stored in
ascending order of their register numbers, starting
Special Conditions
with control register R and continuing up to and
including control register R, with control register 0
The operand must be designated on a doubleword
following control register 15. The contents of the
boundary; otherwise, a specification exception is
control registers remain unchanged.
recognized.
Special Conditions
Condition Code: The code remains unchanged.
The second operand must be designated on a
Program Exceptions:
word boundary for STCTL or on a doubleword
Access (store, operand 2) boundary for STCTG; otherwise, a specification
Privileged operation exception is recognized.
Specification
Condition Code: The code remains unchanged.
Program Exceptions:
Access (store, operand 2)
Privileged operation
Specification
The current value of the CPU timer is stored at Bits 3-15 and 17-31 are unassigned and are
the doubleword location designated by the stored as zeros.
second-operand address.
The second-operand address is ignored but
Zeros are provided for the rightmost bit positions should be zero to permit possible future exten-
that are not updated by the CPU timer. sions.
Program Exceptions:
STORE PREFIX
Access (store, operand 2)
Privileged operation STPX D(B) [S]
Specification
'B211' B D
16 2 31
SYSIB 2.2.2
Logical-CPU Sequence Code: Words 20-23
contain the 16-character (0-9 or uppercase A-Z)
EBCDIC sequence code of the logical CPU. The / Reserved /
code is right justified with leading EBCDIC zeros if 7
necessary.
8 LPAR Number Resv. LCPUC
The contents of the logical-CPU sequence-code 9 Total LCPU Count Conf. LCPU Count
field is not equivalent to the logical-CPU identifica-
tion number stored by STORE CPU ID. The 1 SB LCPU Count Resv. LCPU Count
logical-CPU sequence code is the portion of the
logical-CPU serial number that remains when the 11
Logical-Partition Name
logical-CPU plant-of-manufacture portion of the
12
serial number is excluded.
13 Logical-Partition CAF
Logical-CPU Plant of Manufacture: Word 24
contains the four-character (0-9 or uppercase A-Z) 14
EBCDIC code that identifies the plant of manufac- / Reserved /
ture for the logical CPU. The code is left justified 17
with trailing blanks if necessary. 18 Ded. LCPU Count Shr. LCPU Count
Logical-CPU ID: Bytes 0 and 1 of word 25 19
contain a 16-bit unsigned binary integer that can / Reserved /
be used in conjunction with the logical-CPU 123
address to distinguish the logical CPU from the
16 31
other logical CPUs provided by the same LPAR
hypervisor.
Reserved: The contents of words 0-7, byte 2 of
Logical-CPU Address: Bytes 2 and 3 of word word 8, words 14-17, and words 19-63 are
25 contain the logical-CPU address by which this reserved and are stored as zeros. The contents
logical CPU is identified within the level-2 config- of words 64-1023 are reserved and may be stored
as zeros or may remain unchanged.
When zero, bit 2 indicates that the amount of Logical-Partition Capability Adjustment Factor
use of the level-1 CPUs that are used to (CAF): Word 13 contains a 32-bit unsigned
provide the logical CPUs for this level-2 con- binary integer, called an adjustment factor, with a
figuration is unlimited. value of 1000 or less. The adjustment factor
3-7 Reserved. specifies the amount of the underlying
level-1-configuration capability that is allowed to
be used for this level-2 configuration by the LPAR
A logical CPU is in the configured state when it is The condition code is set to 3 if the function code
in the level-3 configuration and is available to be in bit positions 32-35 of general register 0 is
used to execute programs. greater than the current-level number.
Standby Logical-CPU Count: Bytes 0 and 1 of Bits 36-55 of general register 0 and 32-47 of
word 2 contain a 16-bit unsigned binary integer general register 1 must be zero; otherwise, a
that specifies the number of logical CPUs for this specification exception is recognized.
level-3 configuration that are in the standby state.
In the 24-bit addressing mode, bits 40-63 of The operation does not depend on the translation
general register R designate the real-storage modebits 5, 16, and 17 of the PSW are ignored.
location, and bits 0-39 of the register are ignored.
In the 31-bit addressing mode, bits 33-63 of When the ALET specified by means of the R field
general register R designate the real-storage is other than 00000000 or 00000001 hex, the ART
location, and bits 0-33 of the register are ignored. process is applied to the ALET. The EAX speci-
In the 64-bit addressing mode, bits 0-63 of general fied by means of the R field is called the effective
register R designate the real-storage location. EAX, and it is the EAX which is used by ART.
When a condition exists that would normally cause
Because it is a real address, the address desig- one of the exceptions shown in the following table,
nating the storage word or doubleword is not the instruction is completed by setting condition
subject to dynamic address translation. code 3.
The location designated by the first-operand ALE sequence ALE sequence number
address is tested for protection exceptions by (ALESN) in ALET not
using the access key specified in bits 56-59 of the equal to ALESN in ALE
second-operand address. ASTE validity ASN-second-table entry
(ASTE) invalid (bit 0 is
The second-operand address is not used to one)
address data; instead, bits 56-59 of the address
form the access key to be used in testing. Bits ASTE sequence ASTE sequence number
0-55 and 60-63 of the second-operand address (ASTESN) in ALE not
are ignored. equal to ASTESN in
ASTE
The first-operand address is a logical address. Extended authority ALE private bit not zero,
When the CPU is in the access-register mode ALE authorization index
(when DAT is on and PSW bits 16 and 17 are 01 (ALEAX) not equal to
binary), the first-operand address is subject to extended authorization
translation by means of both the access-register- index (EAX), and sec-
translation (ART) and the dynamic-address- ondary bit selected by
translation (DAT) processes. ART applies to the EAX either outside
access register designated by the B field, and it authority table or zero
obtains the address-space-control element to be
used by DAT. When DAT is on but the CPU is
not in the access-register mode, the first-operand When the access register contains 00000000 hex
address is subject to translation by DAT. In this or 00000001 hex, ART obtains the address-space-
case, DAT uses the address-space-control control element from control register 1 or 7,
element contained in control register 1, 7, or 13 respectively, without accessing the access list.
when the CPU is in the primary-space, secondary- When the B field designates access register 0,
space, or home-space mode, respectively. When ART treats the access register as containing
DAT is off, the first-operand address is a real 00000000 hex and does not examine the actual
address not subject to translation by either ART or contents of the access register.
DAT.
When ART is completed successfully, the opera-
When the CPU is in the access-register mode and tion is continued through the performance of DAT.
an address-space-control element cannot be
When DAT is on and the first-operand address
obtained by ART because of a condition that
cannot be translated because of a condition that
would normally cause one of the exceptions
would normally cause one of the exceptions
shown in the following table, the instruction is
shown in the following table, the instruction is
completed by setting condition code 3.
completed by setting condition code 3.
The trap operation stores information into the trap Bits 2-12 and 15-31 are reserved and are stored
save area as follows: as zeros.
Hex Dec
Bits 33-63 of Second-Operand Address of
Trap Flags TRAP4: For TRAP4, bits 33-63 of the second-
operand address, generated under the control of
4 4 Reserved (Zeros Stored) the current addressing mode and with a zero
8 8 Bits 33-63 of Second-Op appended on the left, are stored in byte positions
Address of TRAP4 8-11. Only bits 33-63 of the second-operand
address are stored even when the current
C 12 Access Register 15 addressing mode is the 64-bit mode. For TRAP2,
all zeros are stored in byte positions 8-11.
1 16
14 2 PSW Values
18 24 Access Register 15: The contents of access
1C 28 register 15 are stored in byte positions 12-15.
The machine-check-handling mechanism provides permit automatic recovery from some malfunc-
extensive equipment-malfunction detection to tions. Equipment malfunctions and certain
ensure the integrity of system operation and to external disturbances are reported by means of a
For checking purposes, the contents of the entire Uncorrected errors in storage and in the storage
checking block, including the redundancy, are key may be reported, along with a failing-storage
called the checking-block code (CBC). When a address, to indicate where the error occurred.
CBC completely meets the checking requirements Depending on the situation, these errors may be
(that is, no failure is detected), it is said to be reported along with system recovery or with the
valid. When both detection and correction are damage or backup condition resulting from the
provided and a CBC is not valid but satisfies the error.
checking requirements for correction (the failure is
correctable), it is said to be near-valid. When a
CBC does not satisfy the checking requirements
CPU Retry
(the failure is uncorrectable), it is said to be
In some models, information about some portion
invalid.
of the state of the machine is saved periodically.
The point in the processing at which this informa-
tion is saved is called a checkpoint. The informa-
tion saved is referred to as the checkpoint
information. The action of saving the information
is referred to as establishing a checkpoint. The
action of discarding previously saved information
is called invalidation of the checkpoint information.
Validating a checking block does not ensure that a When invalid CBC is detected in storage, a
valid CBC will be observed the next time the machine-check condition may occur; depending on
checking block is accessed. If the failure is solid, the circumstances, the machine-check condition
validation is effective only if the information placed may be system damage, instruction-processing
in the checking block is such that the failing bits damage, or system recovery. If the invalid CBC is
are set to the value to which they fail. If an detected as part of the execution of a channel
attempt is made to set the bits to the state oppo- program, the error is reported as an I/O-error con-
site to that in which they fail, then the validation dition. When a CCW, indirect-data-address word,
will not be effective. Thus, for a solid failure, vali- or data is prefetched from storage, is found to
dation is only useful to eliminate the error condi- have invalid CBC, but is not used in the channel
tion, even though the underlying failure remains, program, the condition is normally not reported as
thereby reducing the exposure to additional an I/O-error condition. The condition may or may
reports. The locations, however, cannot be used, not be reported as a machine-check-interruption
since invalid CBC will result from attempts to store condition. Invalid CBC detected during accesses
other values at the location. For an intermittent to storage for other than CPU-related accesses
failure, however, validation is useful to restore a may be reported as system recovery with storage
valid CBC such that a subsequent partial store error uncorrected indicated, since the primary
into the checking block will be permitted. (A error indication is reported by some other means.
partial store is a store into a checking block
without replacing the entire checking block.) When the storage checking block consists of mul-
tiple bytes and contains invalid CBC, special
When a checking block consists of multiple bytes storage-validation procedures are generally neces-
in storage, or multiple bits in CPU registers, the sary to restore or place new information in the
invalid CBC can be made valid only when all of checking block. Validation of storage is provided
the bytes or bits are replaced simultaneously. with the manual load-clear and system-reset-clear
operations and is also provided as a program
For each type of field in the system, certain function. Programmed storage validation is done
instructions are defined to validate the field. a block at a time, by executing the privileged
Depending on the model, additional instructions instruction TEST BLOCK. Manual storage vali-
may also perform validation; or, in some models, a dation by clear reset validates all blocks which are
register is automatically validated as part of the available in the configuration.
machine-check-interruption sequence after the ori-
ginal contents of the register are placed in the A checking block with invalid CBC is never vali-
appropriate save area. dated unless the entire contents of the checking
block are replaced. An attempt to store into a
When an error occurs in a checking block, the ori- checking block having invalid CBC, without
ginal information contained in the checking block replacing the entire checking block, leaves the
should be considered lost even after validation. data in the checking block (including the check
Automatic register validation leaves the contents bits) unchanged. Even when an instruction or a
Explanation:
CPU virtual- and logical-address store accesses are sub-
ject to page protection. When the page-protection bit
is one, the location will not be changed; however, the
machine may indicate a machine-check condition if the
storage key or the data itself has invalid CBC.
The contents of the main-storage location are not changed.
The contents of the reference and change bits are set
to ones if the "complete" action is taken.
The action shown for an access key of zero is also appli-
cable to references to which key-controlled protection
does not apply.
Every reasonable attempt is made to limit the side In addition to the point of interruption permitted for
effects of any machine check and the associated repressible machine-check conditions, the point of
interruption. Normally, interruptions, as well as interruption for a terminating exigent machine-
the progress of I/O operations, remain unaffected. check condition may also be after the unit of oper-
The malfunction, however, may affect these activ- ation is completed but before any associated
ities, and, if the currently active PSW has bit 13 program or supervisor-call interruption occurs. In
set to one, the machine-check interruption will this case, a valid PSW instruction address is
indicate the total extent of the damage caused, defined as that which would have been stored in
and not just the damage which originated the con- the old PSW for the program or supervisor-call
dition. interruption. Since the operation has been termi-
nated, the values in the result fields, other than
Point of Interruption the instruction address, are unpredictable. Thus,
the validity bits associated with fields which are
The point in the processing which is indicated by due to be changed by the instruction stream are
the interruption and used as a reference point by meaningless when a terminating exigent machine-
the machine to determine and indicate the validity check condition is reported.
of the status stored is referred to as the point of
interruption. When the point of interruption and the point of
damage due to an exigent machine-check condi-
Because of the checkpoint capability in models tion are separated by a checkpoint-
with CPU retry, the interruption resulting from an synchronization function, the damage has not
exigent machine-check-interruption condition may been isolated to a particular program, and system
indicate a point in the CPU processing sequence damage is indicated.
which is logically prior to the error. Additionally,
the model may have some choice as to which When an exigent machine-check-interruption con-
point in the CPU processing sequence the inter- dition occurs, the point of interruption which is
ruption is indicated, and, in some cases, the chosen affects the amount of damage which must
status which can be indicated as valid depends on be indicated. An attempt is made, when possible,
the point chosen. to choose a point of interruption which permits the
minimum indication of damage. In general, the
S P S C E D C S C S S K D W M P IF E F G C S
D D RD DGW P P K BE C E S P S M AAC P R RT
4 8 12 16 24 26 31
I A D P F A C C
E R A R C PT C
32 4 42 46 48 56 63
Bits Name
Note: All other bits of the MCIC are unassigned and stored as zeros.
Figure 11-3. Machine-Check Interruption-Code Format
Access-Register Validity
Bit 33 (AR), when one, indicates that the contents Machine-Check Extended
of the access-register save area at real locations
4928-4991 reflect the correct state of the access Interruption Information
registers at the point of interruption. As part of the machine-check interruption, in some
cases, extended interruption information is placed
TOD-Programmable-Register Validity in fixed areas assigned in storage. The contents
Bit 42 (PR), when one, indicates that the contents of registers associated with the CPU are placed in
of the TOD-programmable-register save area at register-save areas. For external damage, addi-
real locations 4900-4903 reflect the correct state tional information is provided for some models by
of the TOD programmable register at the point of storing an external-damage code. When storage
interruption. error uncorrected, storage error corrected, or
storage-key error uncorrected is indicated, the
Floating-Point-Control-Register Validity failing-storage address is saved.
Bit 43 (FC), when one, indicates that the contents
of the floating-point-control-register save area at Each of these fields has associated with it a
real locations 4892-4895 reflect the correct state validity bit in the machine-check-interruption code.
of the floating-point-control register at the point of If, for any reason, the machine cannot store the
interruption. proper information in the field, the associated
validity bit is set to zero.
CPU-Timer Validity
Bit 46 (CT), when one, indicates that the CPU Register-Save Areas
timer is not in error and that the contents of the
CPU-timer save area at real locations 4904-4911 As part of the machine-check interruption, the
reflect the correct state of the CPU timer at the current contents of the CPU registers, except for
time the interruption occurred. the prefix register and the TOD clock, are stored
in eight register-save areas assigned in storage.
Each of these areas has associated with it a
validity bit in the machine-check-interruption code.
Reserved: Bits 0-7, 10-16, and 21-31 are A floating interruption is presented to the first CPU
reserved for future expansion and are always set in the configuration which is enabled for the inter-
to zero. ruption condition and can accept the interruption.
A CPU cannot accept the interruption when the
CPU is in the check-stop state, has an invalid
Machine-Check Condition
Sub- Action when CPU
MCIC Class Disabled
Bit Subclass Mask for Subclass
Explanation:
- The condition does not have a subclass mask.
P Indication is held pending.
Y Indication may be held pending or may be discarded.
CM Channel-report-pending subclass mask (bit 35 of CR14).
DM Degradation subclass mask (bit 37 of CR14).
EM External-damage subclass mask (bit 38 of CR14).
RM Recovery subclass mask (bit 36 of CR14).
WM Warning subclass mask (bit 39 of CR14).
When the power is completely turned on, an IML The effect is unpredictable when the restart key is
operation is performed on models which have an activated while any CPU in the configuration is in
IML function. A power-on reset is then initiated the load state. In particular, if the CPU performs a
(see Resets on page 4-41). It depends on the restart interruption and enters the operating state
model whether the architectural mode of operation while another CPU is in the load state, operations
can be selected when the power is turned on, or such as I/O instructions, the SIGNAL
whether the mode-selection controls have to be PROCESSOR instruction, and the INVALIDATE
used to change the mode after the power is on. PAGE TABLE ENTRY instruction may not operate
according to the definitions given in this publica-
Rate Control tion.
The I/O instructions include all instructions that are subsystem-identification word. The format of the
provided for the control of channel-subsystem subsystem-identification word is as follows:
operations. The I/O instructions are listed in
Figure 14-1 on page 14-3. All of the I/O /
Subchannel
instructions are privileged instructions. ///1 Number
/
Several I/O instructions result in the channel sub- 32 48 63
system being signaled to perform functions asyn-
chronous to the execution of the instructions. The Bits 48-63 of general register 1 form the binary
description of each instruction of this type contains number of the subchannel to be used for the func-
a section called Associated Functions, which tion specified by the instruction. Bits 0-31 of
summarizes the asynchronous functions. general register 1 are ignored and bits 32-47
specify the binary number one.
I/O-Instruction Formats
Most I/O instructions use the S format: I/O-Instruction Execution
Op Code B D Serialization
Explanation:
Causes serialization and checkpoint synchronization.
A Access exceptions for logical addresses.
A When the effective address is zero, it is not used to access storage, and no access
exceptions can occur, except that access exceptions may occur during access-register
translation.
B B field designates an access register in the access-register mode.
C Condition code is set.
G1 Instruction execution includes the implied use of general register 1
as a parameter.
GM Instruction execution includes the implied use of multiple general
registers. General register 1 is used as a parameter, and general
register 2 may be used as a parameter depending on the contents of
general register 1.
GS Instruction execution includes the implied use of general register 1
as the subsystem-identification word.
OP Operand exception.
P Privileged-operation exception.
S S instruction format.
SP Specification exception.
ST PER storage-alteration event.
Subsequent to the execution of HALT SUB- If measurement data is being accumulated when a
CHANNEL, the channel subsystem asynchro- start function is terminated by HALT SUB-
nously performs the halt function. If conditions CHANNEL, the measurement data continues to be
allow, the channel subsystem chooses a channel accumulated for the subchannel and reflects the
path and attempts to issue the halt signal to the extent of subchannel and device usage required, if
device to terminate the I/O operation, if any. The any, while performing the currently terminated
subchannel then becomes status-pending. start function. The measurement data, if any, is
accumulated in the measurement block for the
When the subchannel becomes status-pending as
subchannel or placed in the extended-status word,
a result of performing the halt function, data
as appropriate, when the subchannel becomes
transfer, if any, with the associated device has
status-pending with primary or secondary status.
been terminated. The SCSW stored when the
(See Channel-Subsystem Monitoring on
resulting status is cleared by TEST SUB-
page 17-1.)
CHANNEL has the halt-function bit stored as one.
If the halt signal was issued to the device, the Special Conditions
halt-pending bit is stored as zero. Otherwise, the
halt-pending bit is stored as one, and other indi- Condition code 1 is set and no other action is
cations are provided that describe in greater detail taken when the subchannel is status-pending
the condition that was encountered. (See alone or is status-pending with any combination of
Interruption-Response Block on page 16-6 and alert, primary, or secondary status.
Halt Function on page 15-14.)
Condition code 2 is set and no other action is
In some models, path availability is tested as part taken when the subchannel is busy for HALT
of the halt function (rather than as part of the exe- SUBCHANNEL. The subchannel is busy for
cution of the instruction). In these models, when HALT SUBCHANNEL when a halt function or
no channel path is available for selection, the halt clear function is already in progress at the sub-
signal is not issued, and the subchannel is made channel.
16 2 31 0 CRW stored
1 Zeros stored
A CRW containing information affecting the 2 --
channel subsystem is stored at the designated 3 --
location.
Program Exceptions:
The second-operand address is the logical Access (store, operand 2)
address of the location where the CRW is to be Privileged operation
stored and is designated on a word boundary. Specification
1 --
'B234' B D 2 --
3 Not operational
16 2 31
Program Exceptions:
Control and status information for the designated Access (store, operand 2)
subchannel is stored in the designated SCHIB. Operand
Privileged operation
General register 1 contains the subsystem-
Specification
identification word, which designates the sub-
channel for which the information is to be stored. Programming Notes:
The second-operand address is the logical
address of the SCHIB and is designated on a 1. Device status that is stored in the SCSW may
word boundary. include device-busy, control-unit-busy, or
control-unit-end indications.
The information that is stored in the SCHIB con- 2. The information that is stored in the SCHIB is
sists of the path-management-control word, the obtained from the subchannel. The STORE
SCSW, and three words of model-dependent infor- SUBCHANNEL instruction does not cause the
mation. (See Subchannel-Information Block on channel subsystem to interrogate the
page 15-1.) addressed device.
The execution of STORE SUBCHANNEL does not 3. STORE SUBCHANNEL may be executed at
change any information contained in the sub- any time to sample conditions existing at the
channel. subchannel, without causing any pending
status conditions to be cleared.
Condition code 0 is set to indicate that control and
4. Repeated execution of STORE SUB-
status information for the designated subchannel
CHANNEL without an intervening delay (for
has been stored in the SCHIB. Whenever the
example, to determine when a subchannel
execution of STORE SUBCHANNEL results in the
changes state) should be avoided because
setting of condition code 0, the information in the
repeated accesses of the subchannel by the
SCHIB indicates a consistent state of the sub-
CPU may delay or prohibit access of the sub-
channel.
channel by the channel subsystem to update
the subchannel.
Special Conditions
STORE SUBCHANNEL can encounter the The I/O-interruption code for a pending I/O inter-
program exceptions listed below. Bit positions ruption at the subchannel is stored at the location
32-47 of general register 1 must contain the value designated by the second-operand address, and
0001 hex; otherwise, an operand exception is the pending I/O-interruption request is cleared.
recognized.
The second-operand address, when nonzero, is
The second operand must be designated on a the logical address of the location where the two-
word boundary; otherwise, a specification excep- word I/O-interruption code, consisting of words 0
tion is recognized. and 1, is to be stored. The second-operand
If the second-operand address is zero, the three- Interruption-Identification Word: Word 2, when
word I/O-interruption code, consisting of words stored, contains the interruption-identification
0-2, is stored at real locations 184-195. In this word, which further identifies the source of the
case, low-address protection and key-controlled I/O-interruption. Word 2 is stored only when the
protection do not apply. second-operand address is zero. The interruption-
identification word is defined as follows:
In the access-register mode, when the second-
operand address is zero, it is unpredictable
ISC
whether access-register translation occurs for
access register B. If the translation occurs, the 2 5 31
resulting address-space-control element is not
used; that is, the interruption code still is stored at Interruption Subclass (ISC): Bit positions 2-4 of
real locations 184-195. the interruption-identification word contain a value
in the range 0-7 that specifies the I/O-interruption
Pending I/O-interruption requests are accepted
subclass associated with the subchannel for which
only for those I/O-interruption subclasses allowed
the pending I/O-interruption request was cleared.
by the I/O-interruption subclass mask in control
register 6 of the CPU executing the instruction. If Special Conditions
no I/O-interruption requests exist that are allowed
by control register 6, the I/O-interruption code is TEST PENDING INTERRUPTION can encounter
not stored, the second-operand location is not the program exceptions listed below. The exe-
modified, and condition code 0 is set. cution of TEST PENDING INTERRUPTION is sup-
pressed on all addressing and protection
If a pending I/O-interruption request is accepted, exceptions. The second operand must be desig-
the I/O-interruption code is stored, the pending nated on a word boundary; otherwise, a specifica-
I/O-interruption request is cleared, and condition tion exception is recognized.
code 1 is set. The I/O-interruption code that is
stored is the same as would be stored if an I/O Resulting Condition Code:
interruption had occurred. However, PSWs are
not swapped, as when an I/O-interruption occurs. 0 Interruption code not stored
1 Interruption code stored
The I/O-interruption code that is stored during exe- 2 --
cution of the instruction is defined as follows: 3 --
Program Exceptions:
Word Subsystem-Identification Word
Access (store, operand 2, second-operand
1 Interruption Parameter address nonzero only)
2Interruption-Identification Word Privileged operation
Specification
31
Programming Notes:
Subsystem-Identification Word (SID): See 1. TEST PENDING INTERRUPTION should only
I/O-Instruction Formats on page 14-1. be executed with a second-operand address
of zero when I/O interruptions are masked off.
Interruption Parameter: Word 1 contains a four- Otherwise, an I/O-interruption code stored by
byte parameter which is specified by the program the instruction may be lost if an I/O inter-
and which previously was passed to the sub- ruption occurs. The I/O-interruption code that
channel in word 0 of the ORB or the PMCW. identifies the source of an I/O interruption
When a device presents alert status and the inter- taken subsequent to TEST PENDING INTER-
ruption parameter was not passed previously to RUPTION is also stored at real locations
the subchannel by executing START SUB-
The POM can contain any value when MODIFY Different devices that are accessible by the same
SUBCHANNEL is executed. Initially, each of the physical channel path have, in their respective
eight possible channel paths associated with each subchannels, the same CHPID value. The CHPID
subchannel is considered to be operational, value may, however, appear in each subchannel
regardless of whether the respective channel in different locations in the CHPID fields 0-7.
paths are installed or available; therefore, unless a
path-not-operational condition is recognized during Subchannels that share an identical set of channel
initial program loading, the PMCW, if stored, con- paths have the same corresponding PIM bits set
tains a POM of all ones if stored prior to executing to ones. The channel-path identifiers (CHPIDs)
a CLEAR SUBCHANNEL, HALT SUBCHANNEL, for these channel paths are the same and occupy
RESUME SUBCHANNEL, or START SUB- the same respective locations in each SCHIB.
CHANNEL instruction.
Reserved: Bits 0-30 of word 6 are reserved and
Path-Available Mask (PAM): Bits 24-31 of word are stored as zeros by STORE SUBCHANNEL.
3 indicate the physical availability of installed They must be zeros when MODIFY SUB-
channel paths. Each bit of the PAM corresponds CHANNEL is executed; otherwise, an operand
one-for-one, by relative bit position, with a CHPID exception condition is recognized.
located in an associated byte of words 4 and 5 of
the SCHIB. A PAM bit of one indicates that the Concurrent Sense (S): Bit 31 of word 6, when
corresponding channel path is physically available one, indicates that the subchannel is in
for use in accessing the device. A PAM bit of concurrent-sense mode. When the subchannel is
zero indicates the channel path is not physically in concurrent-sense mode, whenever the sub-
available for use in accessing the device. When a channel becomes status-pending with alert status,
channel path is not physically available, it may, and the status byte accepted from the device con-
depending upon the model and the extent of tains the unit-check indication, then the channel
failure, be used during performance of the reset- subsystem may attempt to retrieve sense informa-
channel-path function. A channel path which is tion from the associated device and place that
physically available may become not physically sense information in the extended-control word.
available as a result of reconfiguring the system,
or this may occur as a result of the performance Subchannel-Status Word
of the channel-path-reset function. The initial Words 7-9 of the SCHIB contain a copy of the
value of the PAM reflects the set of channel paths SCSW. The format of the SCSW is described in
by which the I/O device is physically accessible at Subchannel-Status Word on page 16-6. The
the time of initialization. SCSW is stored by executing either STORE SUB-
CHANNEL or TEST SUBCHANNEL (see STORE
Note: The change in the availability of a channel
SUBCHANNEL on page 14-17 and TEST
path affects all subchannels having access to that
SUBCHANNEL on page 14-19).
channel path. Whenever the setting of a PAM bit
is referred to in conjunction with the availability
status of a channel path, for brevity, reference is
Model-Dependent Area
Words 10-12 of the SCHIB contain model-
made in this chapter to a single PAM bit instead of
dependent information.
to the respective PAM bits in all of the affected
subchannels.
Summary of Modifiable Fields
Channel-Path Identifiers (CHPIDs): Words 4 Figure 15-3 on page 15-8 lists the initial settings
and 5 contain eight one-byte channel-path identi- for fields in a subchannel whose device-number-
fiers corresponding to channel paths 0-7 of the valid bit is one and indicates what modifies the
PIM. A CHPID is valid if the corresponding PIM fields.
bit is one. Each valid CHPID contains the identi-
All of the PMCW fields contain meaningful infor-
Modified
Program Modifies by Channel
Subchannel Field Initial Value by Executing Subsystem
For example, if the POM bit for every channel Performing the clear function at a subchannel
path available for selection is one and the clears any currently existing allegiance condition in
device appears not operational on all corre- the subchannel for all channel paths.
sponding channel paths while the channel
subsystem is attempting to initiate a start func- Performing the reset-channel-path function clears
tion at the device, the channel subsystem all currently existing allegiances for that channel
makes the subchannel status-pending, with path in all subchannels.
deferred condition code 3 and with the N bit
stored as one. The PNOM in the SCHIB indi- When a channel path becomes not physically
cates the channel path or channel paths that available, all internal indications of prior allegiance
appeared not operational, for which the corre- conditions are cleared in all subchannels having
access to the designated channel path.
A subchannel has an active allegiance established A dedicated allegiance can become an active alle-
for a channel path no later than when active com- giance. While a dedicated allegiance exists, an
munication has been initiated on that channel path active allegiance can only occur for the same
with an I/O device. The subchannel can have an channel path.
active allegiance to only one channel path at a
time. While the subchannel has an active alle- A currently existing dedicated allegiance is cleared
giance for a channel path, the channel subsystem at any subchannel having access to a channel
path when the channel path becomes not phys-
For item 4, for item 5 under the specified condi- 4. The associated subchannel is status-pending
tions, and for item 6, the channel subsystem with other than intermediate status alone.
chooses a channel path from a set of channel 5. The device to be signaled is attached to a
paths. In these cases, the channel subsystem type-1 control unit, and the subchannel for
The data address is the first location referred to in Suspend (S) Flag: Bit 38 (format 0) or bit 14
the area designated by the CCW. When a byte (format 1), when one, specifies suspension of
count of zero is specified, this field is not checked. channel-program execution. When valid, it causes
See the section CCW Indirect Data Addressing channel-program execution to be suspended prior
for information regarding the specification of data to execution of the CCW containing the S flag.
addresses greater than 2G bytes. The S flag is valid when bit 4, word 1 of the asso-
ciated ORB is one.
Chain-Data (CD) Flag: Bit 32 (format 0) or bit 8
(format 1), when one, specifies chaining of data. Count: Bits 48-63 (format 0) or bits 16-31
It causes the storage area designated by the next (format 1) specify the number of bytes in the
CCW to be used with the current I/O operation. storage area designated by the CCW.
When the CD flag is one in a CCW, the chain- Programming Note: Bit 39 of a format-0 CCW
command and suppress-length-indication flags or bit 15 of a format-1 CCW, which presently must
(see below) are ignored. be zero, may in the future be assigned for the
control of new functions. It is recommended,
Chain-Command (CC) Flag: Bit 33 (format 0) or therefore, that this bit position not be set to one
bit 9 (format 1), when one, and when the CD flag for the purpose of obtaining an intentional
and S flag are both zeros, specifies chaining of program-check indication.
Commands that initiate I/O operations (write, read, Whenever the channel subsystem detects an
read backward, control, sense, and sense ID) invalid command code during the initiation of
cause all eight bits of the command code to be command execution, the program-check-
transferred to the control unit. In these command interruption condition is generated and channel-
codes, the leftmost bit positions contain modifier program execution is terminated. The command
bits. The modifier bits specify to the device how code is ignored during data chaining, unless it
the command is to be executed. They may, for specifies transfer in channel.
example, cause the device to compare data
received during a write operation with data previ-
ously recorded, and they may specify such condi-
Designation of Storage Area
tions as recording density and parity. For the
Note: For a description of the storage area associ-
control command, the modifier bits may contain
ated with a CCW when indirect data addressing is
the order code specifying the control function to
invoked, see the section CCW Indirect Data
be executed. The meaning of the modifier bits
Addressing later in this chapter.
depends on the type of I/O device and is specified
in the System Library publication for the device. The main-storage area associated with an I/O
operation is defined by one or more CCWs. A
The command-code assignment is listed in
CCW defines an area by specifying the address of
Figure 15-5. The symbol x indicates that the bit
the first byte to be transferred and the number of
position is ignored; m identifies a modifier bit.
consecutive bytes contained in the area. The
address of the first byte appears in the data-
address field of the CCW. The number of bytes
contained in the storage area is specified in the
count field.
End, NIL End, NIL End, IL End, NIL Stop, IL End, NIL End, IL
1 End, NIL End, NIL End, NIL End, NIL Stop,NIL End, NIL End, NIL
1 CC CC End, IL CC Stop, IL CC End, IL
1 1 CC CC CC CC Stop, CC CC CC
1 - - End, NIL PC End, IL PC CD \ End, IL
Explanation:
- The selected bit is ignored and may be either zero or one.
\ These situations cannot validly occur. When data chaining is specified, the new
CCW takes control of the operation after transferring the last byte of data
designated by the current CCW, but before the next request for data or status
transfer from the device. The new CCW (which cannot contain a count of zero
unless a program-check condition is also recognized) is in control of the
operation.
The count field must contain a nonzero value when format- CCWs are specified;
otherwise, the operation is terminated with a program-check condition.
CC Command chaining is performed by the channel subsystem upon receipt of device
end.
CD The chain-data flag causes the channel subsystem to immediately fetch a new CCW
for the same operation. The operation continues unless the CCW thus fetched has
a count field of zero, in which case the operation is terminated with a
program-check condition.
CE Channel end from the device which indicates end of block.
End Operation is terminated.
IL Incorrect length is indicated with the subsequent interruption condition
generated at the subchannel.
NIL Incorrect length is not indicated with the subsequent interruption condition
generated at the subchannel.
PC These situations cannot validly occur. The channel subsystem recognizes a
program-check condition when a CCW is fetched that has the chain-data flag set to
one and a count field of zero.
Stop Device is signaled to terminate data transfer, but subchannel remains
subchannel-active until channel end is received.
Programming Note: Command chaining makes The value of the PCI flag can be one either in the
it possible for the program to initiate transfer of first CCW designated for the current start or
multiple blocks of data by executing a single resume function or in a CCW fetched during
START SUBCHANNEL instruction. It also permits chaining. If the PCI flag is one in a CCW that has
a subchannel to be set up for execution of other become current, the subchannel becomes status-
commands, such as positioning the disk-access pending with intermediate status, and an
mechanism, and for data-transfer operations I/O-interruption request is generated. The point at
without interference by the program at the end of which the subchannel becomes status-pending
each operation. Command chaining, in conjunc- depends on the progress of the current start or
tion with the status-modifier condition, permits the resume function as follows:
channel subsystem to modify the normal
sequence of operations in response to signals pro- 1. If the PCI flag is one in the first CCW associ-
vided by the I/O device. ated with a start function or a resume function,
the subchannel becomes status-pending with
intermediate status only after the command
Skipping has been accepted.
Skipping causes the suppression of main-storage 2. If the PCI flag is one in a CCW which has
references during an I/O operation. It is defined become current while data chaining, the sub-
only for read, read-backward, sense-ID, and sense channel becomes status-pending with interme-
operations, and is controlled by the skip flag, diate status after all data designated by the
which can be specified individually for each CCW. preceding CCW has been transferred.
When the skip flag is one, skipping occurs; when 3. If the PCI flag is one in a CCW which has
it is zero, normal operation takes place. The become current while command chaining, the
setting of the skip flag is ignored in all other oper- subchannel becomes status-pending with
ations. intermediate status as that CCW becomes
current.
When an I/O operation or sequence of I/O oper- Normally an I/O operation is in execution until the
ations initiated by the execution of START SUB- device signals primary interruption status. Primary
CHANNEL is ended, the channel subsystem and interruption status can be signaled during initiation
the device generate status conditions. The gener- of an I/O operation, or later. An I/O operation can
ation of these conditions can be brought to the be terminated by the channel subsystem per-
attention of the program by means of an I/O inter- forming a clear or halt function when it detects an
ruption or by means of the execution of the TEST equipment malfunction, a program check, a
PENDING INTERRUPTION instruction. (During chaining check, a protection check, or an
certain abnormal situations, these conditions can incorrect-length condition, or by performing a
be brought to the attention of the program by clear, halt, or channel-path-reset function as a
means of a machine-check interruption. See result of the execution of CLEAR SUBCHANNEL,
Channel-Subsystem Recovery on page 17-19 HALT SUBCHANNEL, or RESET CHANNEL
for details.) The status conditions, as well as an PATH, respectively.
address and a count indicating the extent of the
operation sequence, are presented to the program I/O interruptions provide a means for the CPU to
in the form of a subchannel-status word (SCSW). change its state in response to conditions that
The SCSW is stored in an interruption-response occur at I/O devices or subchannels. These con-
block (IRB) during the execution of TEST SUB- ditions can be caused by the program, by the
CHANNEL. channel subsystem, or by an external event at the
device.
Alert 1 1 1 1 1 1 1 1
Primary 1 1 1 1 1 1 1 1
Secondary 1 1 1 1 1 1 1 1
Intermediate 1 1 1 1 1 1 1 1
Status-pending 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Resulting interrup- E S S S S S - S S S S S S - S S
tion condition
Explanation:
- Combination does not occur.
E Unsolicited or solicited interruption condition.
S Solicited interruption condition.
Indicates the bit stored as zero.
1 Indicates the bit stored as one.
Hex. Dec.
The length of the subchannel-status and
B8 184 Subsystem-Identification Word extended-status words is 12 bytes and 20 bytes,
respectively. The length of the extended-control
BC 188 Interruption Parameter word is 32 bytes. When the extended-control bit
C 192 Interruption-Identification (bit 14, word 0) of the SCSW is zero, words 8-15
Word of the interruption-response block may or may not
be stored.
31
2. When the CPU is operating in ESA/390 mode, The SCSW is stored when TEST SUBCHANNEL
an I/O interruption causes the current PSW to is executed and the designated subchannel is
be stored at real locations 56-63 and the operational. The SCSW is placed in words 0-2 of
I/O-new PSW to be loaded from real locations the IRB that is designated as the TEST SUB-
120-127. When the CPU is operating in CHANNEL operand. When STORE SUB-
z/Architecture mode, an I/O interruption CHANNEL is executed, the SCSW is stored in
causes the current PSW to be stored at real words 7-9 of the subchannel-information block
locations 368-383 and the I/O-new PSW to be (described in Subchannel-Information Block on
loaded from real locations 496-511. page 15-1). Figure 16-2 on page 16-7 shows the
format of the SCSW and summarizes its contents.
BITS NAME
Word
-3 Subchannel key
4 Suspend control (S)
5 ESW Format (L)
6-7 Deferred condition code (CC)
8 Format (F)
9 Prefetch (P)
1 Initial-status interruption control (I)
11 Address-limit-checking control (A)
12 Suppress-suspended interruption (U)
13 Zero condition code (Z)
14 Extended control (E)
15 Path not operational (N)
16 Reserved
17-19 Function control (FC)
(bit 17, start function; bit 18, halt function;
bit 19, clear function)
2-26 Activity control (AC)
(bit 2, resume-pending; bit 21, start-pending;
bit 22, halt-pending; bit 23, clear-pending;
bit 24, subchannel-active; bit 25, device-active;
bit 26, suspended)
27-31 Status control (SC)
(bit 27, alert status; bit 28, intermediate status;
bit 29, primary status; bit 3, secondary status;
bit 31, status-pending)
Word 1
-31 CCW address
Word 2
-7 Device status
(bit , attention; bit 1, status modifier;
bit 2, control-unit end; bit 3, busy;
bit 4, channel end; bit 5, device end;
bit 6, unit check; bit 7, unit exception)
8-15 Subchannel status (Sch Status)
(bit 8, program-controlled interruption; bit 9, incorrect length;
bit 1, program check; bit 11, protection check;
bit 12, channel-data check; bit 13, channel-control check;
bit 14, interface-control check; bit 15, chaining check)
16-31 Count
Figure 16-2. SCSW Format
1 Reserved Reserved
Explanation:
- Bit is zero.
The allowed combinations of status-control-bit settings when the
start-function bit is one in the function-control field.
The condition is encountered after the execution of HALT SUBCHANNEL when the
subchannel is currently suspended.
The condition is encountered after the execution of HALT SUBCHANNEL when the
subchannel is currently start-pending.
A Alert status.
I Intermediate status.
P Primary status.
S Secondary status.
X Status-pending.
Clear Function (Bit 19): When one, bit 19 indi- Resume-Pending (Bit 20): When one, bit 20
cates that a clear function has been requested indicates that the subchannel is resume-pending.
and is either pending or in progress at the sub- The channel subsystem may or may not be in the
channel. A clear function is requested by exe- process of performing the start function. The sub-
cuting CLEAR SUBCHANNEL. A clear function is channel becomes resume-pending when condition
indicated at the subchannel when condition code 0 code 0 is set for RESUME SUBCHANNEL. The
is set for CLEAR SUBCHANNEL (see CLEAR point at which the subchannel is no longer
SUBCHANNEL on page 14-4). The clear- resume-pending is a function of the subchannel
function indication is cleared at the subchannel state existing when the resume-pending condition
when the resulting status-pending condition is is recognized and the state of the device if
cleared by TEST SUBCHANNEL. channel-program execution is resumed.
The subchannel is no longer suspended when any Alert Status (Bit 27): When one (and when the
of the following occurs: status-pending bit is also one), bit 27 indicates an
1. As part of the resume function following the alert interruption condition exists. In such a case,
execution of RESUME SUBCHANNEL when the subchannel is said to be status-pending with
the subchannel becomes subchannel-and- alert status. An alert interruption condition is
device-active or device-active only, or the first recognized when alert status is present at the sub-
command is accepted for channel-end and channel. Alert status may be subchannel status
device-end initial status, with or without status or device status. Alert status is status generated
modifier, and the CCW does not specify by either the channel subsystem or the device
command chaining. under any of the following conditions:
Invalid CCW-Address Specification: The 2. The ORB specifies format-2 IDAWs and the
channel-program address (CPA) or the transfer-in- contents of the data-address field in the CCW
channel command does not designate the CCW do not designate the first IDAW on an integral
on a doubleword boundary, or bit 0 of the CPA or doubleword boundary; that is, bits 29-31
bit 32 of a format-1 CCW specifying the transfer- (format-0 CCW) or bits 61-63 (format-1 CCW)
in-channel command is not zero. are not zeros.
Invalid CCW Address: The channel subsystem Invalid IDAW Address: The channel subsystem
has attempted to fetch a CCW from a main- has attempted to fetch an IDAW from a main-
storage location which is not available. An invalid storage location which is not available. An invalid
CCW address can occur because the program IDAW address can occur because the program
has designated an invalid address in the channel- has designated an invalid address in a CCW that
program-address field of the ORB or in the specifies indirect data addressing or because the
transfer-in-channel command or because, on channel subsystem, on sequentially fetching
chaining, the channel subsystem attempts to fetch IDAWs, attempts to fetch from an unavailable
a CCW from an unavailable location. A main- location. A main-storage location is unavailable
storage location is unavailable when any of the when any of the following conditions are detected:
following conditions are detected: 1. The absolute IDAW address does not corre-
spond to a physical location.
Explanation:
In situations where more than a single condition exists because of, for example,
alert status that is described by program check and unit check, the entry
appearing first in the table takes precedence.
The meaning of the notation in this column is as follows:
A Alert status
I Intermediate status
P Primary status
S Secondary status
X Status-pending
The allowed combination of status-control-bit settings is shown to the left of
the / symbol.
Bit settings are specified as follows:
Corresponding condition is not indicated.
1 Corresponding condition is indicated.
U Unpredictable. The corresponding condition is not meaningful when the
subchannel is not status-pending.
Y Corresponding condition is not significant and is indicated as a function
of the subchannel state.
The subchannel may also be resume-pending.
The contents of the count field are not meaningful because the count field is
not valid when the SCSW is stored and the subchannel is in the given state.
Notes:
1. The count is unpredictable unless IDAW check is indicated, in which case the
count may not correctly reflect the number of bytes transferred to or from main
storage but will (when used in conjunction with the CCW address) designate a
byte location within the page in which the channel-control-check condition was
recognized.
2. During a storage access, the maximum number of bytes that can be stored by a
channel subsystem is model-dependent. If a channel-data-check condition is
recognized during that access, the number of bytes transferred to or from
storage may not be detectable by the channel subsystem. Consequently, the
number of bytes transferred to or from storage may not be correctly reflected by
the residual count. However, the residual count that is stored when used in
conjunction with the storage-access code and the CCW address designates a byte
location within the page in which the channel-data-check condition was
recognized.
APTFSCRSCNT
3 8 1 16 21 31
If the above conditions for the storing of the DCTI Last-Path-Used Mask (LPUM): For a definition
value in the ESW are met but the device-connect- of the LPUM, see Last-Path-Used Mask (LPUM)
time-measurement mode was made active by SET on page 16-34.
CHANNEL MONITOR subsequent to execution of
START SUBCHANNEL for this subchannel, the An X in the format indicates the bit may be zero
DCTI value stored is greater than or equal to zero or one.
and less than or equal to the correct DCTI value.
Extended-Report Word (ERW): For a definition
Note: The DCTI value stored in the ESW is the
of the ERW, see Extended-Report Word on
same as that used to update the corresponding
page 16-36.
measurement-block data for the subchannel if the
measurement-block-update mode is in use for the Figure 16-7 on page 16-40 summarizes the con-
subchannel. If the measurement-block-update ditions at the subchannel under which each type
mode for the channel subsystem is active and the of information is stored in the ESW.
Extended-Control Word
Subchannel- Path-Management- Extended-
Status Word Control Word Status The extended-control word provides additional
Word (ESW),
Device- Word information to the program describing conditions
Connect-
Status- Device- Time-
that may exist at the channel subsystem, sub-
Control Sus-Connect- Msrmnt- Contents channel, or device. The extended-control (E) bit
Field pen-Time- Timing- Mode-
L ded Msrmnt FacilityEnable For- Bytes (bit 14, word 0 of the SCSW), when one, indicates
AIPSX BitBit Mode Bit Bit mat ,1,2,3
that model-dependent information or concurrent-
---- /////////////////////////////////// sense information has been stored in the
///////////////////////////////
1 /////////////////////////////// U \\\\ extended-control word.
//////////////////////////
//////////////////////////
The information provided in the extended-control
Inactive/////////////////
//////// word is as follows:
11 //////// 1 ZMZZ
1
Active
1 SCSW ERW ERW
1 2 ZMDD Bits Bit Bits ECW
////Inactive/////////////////
5 14 7 1-15 Words -7
////////////
//// //////// 1 ZMZZ Zeros Unpredictable
\\1\1 //// 1 () ()
//// Active
//// 1 1 1 () Concurrent-sense information
//// 1 2 ZMDD 1 Zeros Unpredictable
1 1 Zeros Model-dependent information
\\11 ///////////////////////////////
/////////////////////////////// 3 ZM\\
1 1 1 () Concurrent-sense information
1\1 ///////////////////////////////
If stored, the value of these words is
\\\\1 1 /////////////////////////////// RRRR unpredictable.
Explanation:
Unused bits in the model-dependent information
- Defined to be not meaningful when X is zero. are stored as zeros.
\ Bits may be zeros or ones.
/ Information not relevant in this situation.
A Alert status. Bits 1-15 contain a value equal to the number
D Accumulated device-connect-time-interval (DCTI) of sense bytes returned.
value stored in bytes 2 and 3.
I Intermediate status.
L Extended-status-word format. Unused bytes in the concurrent-sense information
M Last-path-used mask (LPUM) stored in byte 1. are stored as zeros.
P Primary status.
R Subchannel-logout information stored in word .
S Secondary status.
The combination of SCSW bit 5 as , SCSW bit 14
U No format defined. as one, and ERW bit 7 as zero does not occur.
X Status-pending.
Z Bits are stored as zeros.
The I/O support functions are those functions of enabled to use the facilities by means of the exe-
the channel subsystem that are not directly related cution of the MODIFY SUBCHANNEL instruction.
to the initiation or control of I/O operations. The
following I/O support functions are described in The channel-subsystem-monitoring facilities
this chapter: include the channel-subsystem-timing facility,
measurement-block-update facility, control-unit-
channel-subsystem monitoring
queuing-measurement facility, control-unit-defer-
signals and resets
time facility, and
externally initiated functions
device-connect-time-measurement facility. The
status verification
measurement-block-update facility and the device-
address-limit checking
connect-time-measurement facility are logically
configuration alert
distinct and operate independent of one another.
incorrect-length-indication suppression
Each of the facilities that constitute the channel-
concurrent sense
subsystem-monitoring facilities is described in this
channel-subsystem recovery
chapter.
I/O-priority facility
Channel-Subsystem Timing
Channel-Subsystem Monitoring
The channel-subsystem-timing facility provides the
Monitoring facilities are provided in the channel channel subsystem with the capability of meas-
subsystem so that the program can retrieve meas- uring the elapsed time required for performing
ured values on performance for a designated sub- several different phases in processing a start func-
channel. The use of these facilities is under tion initiated by START SUBCHANNEL. These
program control by means of the execution of the elapsed-time measurements are used by both the
SET CHANNEL MONITOR instruction. Addi- measurement-block-update facility and the device-
tionally, each subchannel can be selectively connect-time-measurement facility to provide sub-
channel performance information to the program.
The System Library publication for the system When channel-program execution is suspended
model specifies the conditions, if any, that pre- because of a suspend flag in the first CCW of a
clude the updating of the sample count and time- channel program, the suspension occurs prior to
accumulation fields of the measurement block. transferring the first command to the device. In
this case, the function-pending time accumulated
Device-Connect Time: Bits 0-31 of word 1 up to that point is added to the value in the
contain the accumulation of measured device- function-pending-time field of the measurement
connect-time intervals. The device-connect-time block. Function-pending time is not accrued while
interval (DCTI) is the sum of the time intervals the subchannel is suspended. Function-pending
measured whenever the device is logically con- time begins to be accrued again, in this case,
nected to a channel path while the subchannel is when RESUME SUBCHANNEL is subsequently
subchannel active and the device is actively com- executed while the designated subchannel is in
municating with the channel path. The device- the suspended state.
connect time does not include the intervals when
a device is logically connected to a channel path The function-pending-time interval is measured
but is not actively communicating with the using a resolution of 128 microseconds. The
channel. The device reports the accumulation of accumulated value is modulo approximately
time intervals when the device is logically con- 152.71 hours, and the program is not alerted
nected but not actively communicating with the when an overflow occurs. This field is not
channel path as control-unit-defer time. The updated if the channel-subsystem-timing facility is
control-unit-defer time is not included in the not provided for the subchannel.
device-connect-time measurement but, rather, is
added to the accrued device-disconnect-time Device-Disconnect Time: Bits 0-31 of word 3
measurement for the operation. contain the accumulated device-disconnect time.
Device-disconnect time is the sum of the time
The time intervals are measured using a resol- intervals measured whenever the device is log-
ution of 128 microseconds. The accumulated ically disconnected from the channel subsystem
value is modulo approximately 152.71 hours, and while the subchannel is subchannel-active. The
the program is not alerted when an overflow device-disconnect time also includes the sum of
occurs. This field is not updated if (1) the control-unit-defer-time intervals reported by the
channel-subsystem-timing facility is not provided device during the I/O operation.
for the subchannel, (2) the measurement-block-
update mode is inactive, or (3) any of the time Device-disconnect time is not accrued while the
values accrued for the current start function has subchannel is in the suspended state. Device-
been detected to exceed the internal storage in disconnect time begins to be accrued again, in
which it was accrued. this case, on the first device disconnection after
channel-program execution has been resumed at
The control-unit-queuing-time field is updated such Reserved: The remaining words of the measure-
that bit 31 represents 128 microseconds. The ment block, along with any words associated with
accumulated value is modulo approximately facilities that are not provided by the channel sub-
152.71 hours; the program is not alerted when an system or the subchannel, are reserved for future
overflow occurs. This field is not updated if the use. They are not updated by the measurement-
channel-subsystem-timing facility is not provided block-update facility.
for the subchannel, or if the control unit does not
provide a queuing time. Measurement-Block Origin
The measurement-block origin specifies the abso-
Device-active-only time: Bits 0-31 of word 5 lute address of the beginning of the measurement-
contain the accumulated device-active-only time. block area on a 32-byte boundary in main storage.
Device-active-only time is the sum of the time The measurement-block origin is passed from
intervals when the subchannel is device-active but general register 2 to the measurement-block-
not subchannel-active at the end of an I/O opera- update facility when SET CHANNEL MONITOR is
tion or chain of I/O operations initiated by a start executed with bit 62 of general register 1 set to
function or resume function. one.
Channel Paths: I/O-system reset causes a reset The initial value of the path-operational mask is all
signal to be sent on all configured channel paths ones.
and causes the channel subsystem to be placed
in the reset and initialized state, as described in The device-number-valid bit is one for all subchan-
the previous sections. As a result of these nels having an assigned I/O device.
actions, all communication between the channel
subsystem and its attached control units and The initial value of the model-dependent area of
devices is terminated and the components reset, the subchannel-information block is described in
and all configured channel paths are made the System Library publication for the system
quiescent or are deconfigured. model.
Subchannels: I/O-system reset causes all oper- The initial value of the subchannel-status word
ations on all subchannels to be concluded. Status and extended-status word is all zeros.
information, all interruption conditions (but not
pending interruptions), dedicated-allegiance condi- The initialized state of the subchannel is the state
tions, and internal indications regarding prior con- specified by the initial values for the subchannel
ditions and operations in all subchannels are parameters described above. The description of
reset, and all valid subchannels are placed in the the subchannel parameters can be found in
initialized state. Subchannel-Information Block on page 15-1;
Subchannel-Status Word on page 16-6; and in
In the initialized state, the subchannel parameters Extended-Status Word on page 16-32.
of all valid subchannels are set to their initial
values. The initial values of the following sub- Channel-Path-Reset Facility: I/O-system reset
channel parameters are zeros: causes the channel-path-reset facility to be reset.
A channel-path-reset function initiated by RESET
Interruption parameter CHANNEL PATH, either pending or in progress, is
I/O-interruption subclass code (ISC) overridden by I/O-system reset. The machine-
Enabled check-interruption condition, which normally
Limit mode signals the completion of a channel-path-reset
Measurement mode
Explanation:
For a detailed description of the effect of I/O-system reset
on each area, see the text.
Initialized value.
Also subject to model-dependent configuration controls, if any.
If the IPL I/O operation or the PSW loading is not 1. The information read and placed at absolute
completed successfully, the CPU remains in the locations 8-15 and 16-23 may be used as
load state, and the load indicator remains on. CCWs for reading additional information
during the IPL I/O operation: the CCW at
IPL does not complete when any of the following location 8 may specify reading additional
occurs: CCWs elsewhere in storage, and the CCW at
absolute location 16 may specify the transfer-
No subchannel contains a valid device in-channel command, causing transfer to
number equal to the IPL device number speci- these CCWs.
fied by the load-unit-address controls.
2. The status-modifier bit has its normal effect
A malfunction is detected in the CPU, main during the IPL I/O operation, causing the
storage, or channel subsystem which pre- channel subsystem to fetch and chain to the
cludes the completion of IPL. CCW whose address is 16 higher than that of
Unsolicited alert status is presented by the the current CCW. This applies also to the
device subsequent to the subchannel initial chaining that occurs after completion of
becoming start-pending for the IPL read and the read operation specified by the implicit
before the IPL subchannel becomes CCW.
subchannel-active. The IPL read operation is 3. The PSW that is loaded at the completion of
not initiated in this case. the IPL operation may be provided by the first
The IPL device appeared not operational on eight bytes of the IPL I/O operation or may be
all available channel paths to the device, or placed at absolute locations 0-7 by a subse-
there were no available channel paths. quent CCW.
All other bit combinations in the error-recovery- Installed Parameters Modified: One or more
code field are reserved. parameters of the specified facility have been
changed.
The specific meaning of each error-recovery code
depends on the particular reporting-source code Reporting-Source ID (RSID): Bit 16-31 contain
that accompanies it in a CRW. The error-recovery the reporting-source ID which may, depending
codes are defined as follows: upon the condition that caused the channel report
and the reporting-source code, either further iden-
Event-Information Pending: Event information for tify the affected channel-subsystem facility or
the identified facility is available for retrieval by the provide additional information describing the con-
program. This CRW does not indicate the state of dition that caused the channel report. The RSID
the identified facility. field has the following format as a function of the
bit settings of the reporting-source code.
Available: The identified facility is in the same
state that the program would expect if the CRW Reporting-Source
had not been generated. Code Reporting-Source ID
4 5 6 7 Bits 16-31
Initialized: The identified facility is in the same 0 0 1 0 0000 0000 0000 0000
state that existed immediately following the 0 0 1 1 xxxx xxxx xxxx xxxx
I/O-system reset that was part of the most recent 0 1 0 0 0000 0000 yyyy yyyy
system IPL. 1 0 0 1 0000 0000 yyyy yyyy
1 0 1 1 0000 0000 0000 0000
Temporary: The identified facility is not operating Note:
in a normal manner or has recognized the occur-
xxxx xxxx xxxx xxxx Subchannel number
rence of an abnormal event. It is expected that
yyyy yyyy Channel-path ID
subsequent actions either will restore the facility to
(CHPID)
normal operation or will record the appropriate
information describing the abnormal event.
HFP Number Representation A true zero is an HFP number with a zero charac-
teristic and zero fraction. A true zero may arise
A hexadecimal-floating-point (HFP) number con- as the normal result of an arithmetic operation
sists of a sign bit, a hexadecimal fraction, and an because of the particular magnitude of the oper-
unsigned seven-bit binary integer called the char- ands. For HFP operations, the result is forced to
acteristic. The characteristic represents a signed be a positive true zero when:
exponent and is obtained by adding 64 to the 1. An HFP exponent underflow occurs and the
exponent value (excess-64 notation). The range HFP-exponent-underflow mask bit in the PSW
of the characteristic is 0 to 127, which corre- is zero.
sponds to an exponent range of 64 to +63. The
magnitude of an HFP number is the product of its 2. The result fraction of an addition or sub-
fraction and the number 16 raised to the power of traction operation is zero and the
the exponent that is represented by its character- HFP-significance mask bit in the PSW is zero.
istic. The number is positive or negative 3. The operand of the CONVERT FROM FIXED
depending on whether the sign bit is zero or one, instruction is zero.
respectively.
4. The dividend in the DIVIDE instruction has a
The fraction of an HFP number is treated as a zero fraction.
hexadecimal number because it is considered to 5. The operand of the HALVE, LOAD FP
be multiplied by a number which is a power of 16. INTEGER, or SQUARE ROOT instruction has
The name, fraction, indicates that the radix point is a zero fraction.
assumed to be immediately to the left of the left-
most fraction digit. 6. One or both operands of a multiplication oper-
ation has a zero fraction.
When an HFP operation would cause the result Item 2, above, applies to normalized and unnor-
exponent to exceed 63, the characteristic wraps malized instructions.
around from 127 to 0, and an
HFP-exponent-overflow condition exists. The When a program interruption for HFP exponent
result characteristic is then too small by 128. underflow occurs, a true zero is not forced;
When an operation would cause the exponent to instead, the fraction and sign remain correct, and
be less than 64, the characteristic wraps around the characteristic is too large by 128. When a
from 0 to 127, and an HFP-exponent-underflow program interruption for HFP significance occurs,
condition exists. The result characteristic is then
Figure 18-1. Normalization and Zero Handling for Instructions with HFP Results
the fraction remains zero, the sign is positive, and FIXED, or the result of LOAD FP INTEGER with a
the characteristic remains correct. zero fraction is positive. The sign for a zero frac-
tion resulting from other HFP operations is estab-
The sign of a sum, difference, product, quotient,
square root, the result of CONVERT FROM
Access (fetch, operand 2 of AU and AW only) The comparison is algebraic and follows the pro-
Data with DXC 1, AFP register cedure for normalized subtraction, except that the
HFP exponent overflow difference is discarded after setting the condition
HFP significance code and both operands remain unchanged.
When the difference, including the guard digit, is
Programming Notes: zero, the operands are equal. When a nonzero
1. An example of the use of the ADD UNNOR- difference is positive or negative, the first operand
MALIZED instruction (AU) is given in is high or low, respectively.
Appendix A.
An HFP-exponent-overflow, HFP-exponent-under-
2. Except when the result is made a true zero, flow, or HFP-significance exception cannot occur.
the characteristic of the result of ADD
UNNORMALIZED is equal to the greater of For CXR, the R fields must designate valid
the two operand characteristics, increased by floating-point-register pairs; otherwise, a specifica-
one if the fraction addition produced a carry, tion exception is recognized.
or set to zero if HFP exponent overflow
occurred. Resulting Condition Code:
0 Operands equal
COMPARE 1 First operand low
2 First operand high
Mnemonic1 R,R [RR]
3 --
The M field must designate a valid modifier; oth- The first operand (the dividend) is divided by the
erwise, a specification exception is recognized. second operand (the divisor), and the normalized
For CFXR and CGXR, the R field must designate quotient is placed at the first-operand location. No
a valid floating-point-register pair; otherwise, a remainder is preserved.
specification exception is recognized.
HFP division consists in characteristic subtraction
Resulting Condition Code: and fraction division. The operands are first nor-
malized to eliminate leading hexadecimal zeros.
0 Source was zero The difference between the dividend and divisor
1 Source was less than zero characteristics of the normalized operands, plus
2 Source was greater than zero 64, is used as the characteristic of an intermediate
3 Special case quotient.
1. An example of the use of the HALVE instruc- For LTXR, the R fields must designate valid
tion (HDR) is given in Appendix A. floating-point-register pairs; otherwise, a specifica-
2. With short and long operands, the halve oper- tion exception is recognized.
ation is identical to a divide operation with the
Resulting Condition Code:
number 2 as divisor. Similarly, the result of
HDR is identical to that of MD or MDR with 0 Result is zero
one-half as a multiplier, and the result of HER 1 Result is less than zero
is identical to that of MEE or MEER with one- 2 Result is greater than zero
half as a multiplier. 3 --
Program Exceptions:
LOAD AND TEST
Data with DXC 1, AFP register
Mnemonic1 R,R [RR] Specification (LTXR only)
Programming Note: When, for LTER and LTDR,
Op Code R R the same register is designated as the first-
operand and second-operand location, the opera-
8 12 15
tion is equivalent to a test without data movement.
Mnemonic1 Op Code Operands
LTER '32' Short HFP LOAD COMPLEMENT
LTDR '22' Long HFP
Mnemonic1 R,R [RR]
Mnemonic2 R,R [RRE]
Op Code R R
Op Code //////// R R
8 12 15
16 24 28 31
Mnemonic1 Op Code Operands
Mnemonic2 Op Code Operands LCER '33' Short HFP
LTXR 'B362' Extended HFP LCDR '23' Long HFP
For extended operands, the high-order sign and The second operand is placed at the first-operand
the entire fraction of the source are placed location with the sign bit inverted.
unchanged in the result, and the low-order sign is
set equal to the high-order sign. If the extended- The sign bit is inverted even if the operand is
operand fraction is nonzero, the high-order char- zero. For all operand lengths, the source fraction
acteristic is placed unchanged in the result is placed unchanged in the result.
high-order characteristic, and the low-order char-
acteristic is set to 14 less than the high-order For short and long operands, the source charac-
teristic is placed unchanged in the result.
LOAD POSITIVE
Op Code R R
Mnemonic1 R,R [RR]
8 12 15
Mnemonic1 Op Code Operands Op Code R R
LNER '31' Short HFP
LNDR '21' Long HFP 8 12 15
If the operand characteristic is odd, the 2. The result fraction is correctly normalized
operand fraction is shifted right one digit posi- without any further left or right shifts of the
tion, the rightmost digit entering the guard-digit intermediate-result fraction and without any
position. further exponent adjustment. Rounding
cannot cause a carry out of the leftmost digit.
An intermediate-result fraction is produced by
computing without rounding the square root of 3. Although a characteristic greater than 127 or
the operand fraction, after any right shift as less than zero may temporarily be generated
described. The intermediate-result fraction during the operation, the result characteristic
consists of the 29 most significant is always within the representable range, and
hexadecimal digits of the square-root result in no HFP exponent overflow or underflow
the extended format, 15 in the long format, or occurs.
seven in the short format, where all three Specifically, the smallest nonzero operand in
formats include a guard digit on the right. the long format consists of a one bit, preceded
A one is added to the leftmost bit of the guard on the left by 63 zeros. This operand is an
digit of the intermediate result, any carry is unnormalized number with a value of 16-78,
propagated to the left, and the guard digit is and its square root is 16-39. The normalized
dropped to produce the result fraction. representation of this result has a character-
istic of 26 (decimal). Similarly, the square root
The result sign is made plus. of the largest representable operand has a
If the second operand is unnormalized and greater characteristic of 96 (decimal). The instruction,
than zero, the operand is first normalized. The therefore, cannot produce a nonzero result
operation then proceeds as for normalized oper- with a characteristic outside the range of 26 to
ands. 96.
Op Code R R Op Code R R
8 12 15 8 12 15
I I I I I S S S S S
M M M M M F F F F F i z o u x y RM
i z o u x i z o u x
When a number or NaN in the BFP long format is Values of Nonzero Numbers
loaded into a floating-point register, it occupies the The values of nonzero numbers in the various
entire register. formats are shown in Figure 19-8.
format but does not include details. The BFP All finite nonzero numbers within the normalized
extended format meets these requirements, far range permitted by a given format have a unique
exceeding them in the area of precision. BFP representation. There are no unnormalized
numbers, which numbers might allow multiple
Classes of BFP Data representations for the same values, and there are
no unnormalized arithmetic operations. Tiny
There are six classes of BFP data, which include numbers of a magnitude below the minimum nor-
numeric and related nonnumeric entities. Each malized number in a given format are represented
data item consists of a sign, an exponent, and a as denormalized numbers, but those values are
significand. The exponent is biased such that all also represented uniquely. The implied unit bit of
biased exponents are nonnegative unsigned a normalized number is one, and that of a a
numbers and the minimum biased exponent is denormalized number or a zero is zero.
zero. The significand consists of an explicit frac-
The six classes of BFP data are summarized in
tion and an implicit unit bit to the left of the binary
Figure 19-9 on page 19-6.
point. The sign bit is zero for plus and one for
minus.
Programming Notes:
BFP Comparison
1. Rounding a finite result toward zero cannot Comparisons are always exact and cannot cause
give infinity. an IEEE-inexact condition.
2. Rounding a result toward + can give + but
Comparison ignores the sign of zero, that is, +0
not .
equals 0.
3. Rounding a result toward can give but
not +. Infinities with like sign compare equal, that is, +
equals +, and equals .
Normalization and A NaN compares as unordered with any other
Denormalization operand, whether a finite number, an infinity, or
another NaN, including itself.
Every arithmetic or conversion operation is consid-
ered to produce an intermediate result as if the Two sets of instructions are provided: COMPARE
precision and exponent range were unbounded, and COMPARE AND SIGNAL. In the absence of
unless the result is defined to be zero, infinity, or QNaNs, these instructions work the same. These
NaN. The final result is produced by normalizing instructions work differently only when both of the
and then rounding this intermediate result. When following are true:
there is exponent underflow, that is, the biased
Neither operand of the instruction is an SNaN
exponent of the normalized intermediate result is
less than one, then the intermediate result is At least one operand of the instruction is a
denormalized to produce the final result, as QNaN
described below.
In this case, COMPARE simply sets condition
code 3, but COMPARE AND SIGNAL recognizes
Denormalization consists in shifting the
the IEEE-invalid-operation condition. If any
significand, including the units bit, to the right
For arithmetic operations with finite or infinite If the integer quotient has a value that lies outside
numeric results, condition codes 0, 1, and 2 are the range of the operand format, a wrapped result
set to indicate that the result is a zero of either is provided.
sign, less than zero, or greater than zero, respec-
tively. The condition-code setting depends only In certain cases where the number of bits in the
on an inspection of the rounded result. For com- integer quotient exceeds or may exceed the
parison operations, condition codes 0, 1, and 2 maximum number of bits provided in the precision
indicate equal, low, or high, respectively. These of the operand format, partial results are
settings are the same as for the HFP instructions. produced, and more than one execution of the
instruction is required to obtain the final result; this
Condition code 3 can also be set. After an arith- may be done with a simple instruction loop.
metic operation, condition code 3 indicates a NaN
result of either sign. After a comparison, it indi- Partial results are produced when the precise quo-
cates that a NaN was involved in the comparison tient is not an integer and the two integers closest
(the unordered condition). See Figure 19-10. to this precise quotient cannot both be repres-
ented exactly in the precision of the quotient. This
situation exists when the precise quotient is
CC Arithmetic Comparison greater than 2P, where P is the precision of the
operand format, and the remainder is not zero.
0 0 Equal
1 <0 Low
When the remainder is zero, then the quotient is
2 >0 High an integer, and the number of bits required to rep-
3 NaN Unordered resent the quotient is never more than the preci-
sion of the target.
Figure 19-10. Condition Codes Programming Note: The remainder result of
DIVIDE TO INTEGER with a specified quotient
rounding mode of round to nearest corresponds to
the Remainder function in the IEEE standard.
This function is similar to the MOD function found
in some languages and to the mathematical
Remainder
b=+4: n -2 -2 -2 -1 -1 -1 - - - + + + +1 +1 +1 +2 +2 +2
r - +1 +2 -1 - 1 -2 -1 - + +1 +2 -1 + +1 -2 -1 +
b=-4: n +2 +2 +2 +1 +1 +1 + + + - - - -1 -1 -1 -2 -2 -2
r - +1 +2 -1 - +1 -2 -1 - + +1 +2 -1 + +1 -2 -1 +
MOD
b=+4: n -2 -1 -1 -1 -1 +1 +1 +1 +1 +2
r -3 -2 -1 -3 -2 -1 +1 +2 +3 +1 +2 +3
b=-4: n +2 +1 +1 +1 +1 -1 -1 -1 -1 -2
r -3 -2 -1 -3 -2 -1 +1 +2 +3 +1 +2 +3
modulo
b=+4: n -2 -2 -2 -2 -1 -1 -1 -1 +1 +1 +1 +1 +2
r +1 +2 +3 +1 +2 +3 +1 +2 +3 +1 +2 +3
b=-4: n +2 +1 +1 +1 +1 -1 -1 -1 -1 -2 -2 -2 -2
r -3 -2 -1 -3 -2 -1 -3 -2 -1 -3 -2 -1
Explanation:
a Dividend.
b Divisor.
n Integer quotient.
r Result (Remainder, MOD, or modulo).
If the instruction performs a comparison and no sign that is the EXCLUSIVE OR of the dividend
program interruption occurs, the comparison result and divisor signs.
is unordered.
If the IEEE-division-by-zero mask bit in the FPC
If the instruction is one that produces a BFP register is one, the operation is suppressed, and
result, if no program interruption occurs, and if the condition is reported as a program interruption
none of the operands is a NaN, the result is the for a data exception with DXC 40 hex.
default QNaN. If one of the operands is a NaN,
that operand becomes the result unchanged, IEEE Overflow
except that an SNaN is first converted to the cor- An IEEE-overflow condition is recognized when
responding QNaN by setting the leftmost fraction the exponent of the rounded result of a BFP oper-
bit to one. ation would be greater than the maximum expo-
nent of the target format if the exponent range
If the IEEE-invalid-operation mask bit in the FPC were unbounded.
register is one, the operation is suppressed, and
the condition is reported as a program interruption If the IEEE-overflow mask bit in the FPC register
for a data exception with DXC 80 hex. is zero, the IEEE-overflow flag bit in the FPC reg-
ister is set to one. The result of the operation
IEEE Division-By-Zero depends on the sign of the intermediate result and
An IEEE-division-by-zero condition is recognized on the current rounding mode:
when in BFP division the divisor is zero and the
1. When rounding to nearest, the result is infinity
dividend is a finite nonzero number.
with the sign of the intermediate result.
If the IEEE-division-by-zero mask bit in the FPC 2. When rounding toward 0, the result is the
register is zero, the IEEE-division-by-zero flag bit largest finite number of the format, with the
in the FPC register is set to one. The operation is sign of the intermediate result.
completed using as the result an infinity with a
DXC
Abbr. (Hex) Data-Exception-Code Name Instruction Ending
PIDx 08 IEEE inexact and truncated Complete
PIDy 0C IEEE inexact and incremented Complete
PIDu 10 IEEE underflow, exact Complete, wrap exponent
PIDux 18 IEEE underflow, inexact and truncated Complete, wrap exponent
PIDuy 1C IEEE underflow, inexact and incremented Complete, wrap exponent
PIDo 20 IEEE overflow, exact Complete, wrap exponent
PIDox 28 IEEE overflow, inexact and truncated Complete, wrap exponent
PIDoy 2C IEEE overflow, inexact and incremented Complete, wrap exponent
PIDz 40 IEEE division by zero Suppress
PIDi 80 IEEE invalid operation Suppress
Explanation:
A Access exceptions for logical addresses.
B B field designates an access register in the access-register mode.
BF BFP facility.
C Condition code is set.
Db BFP-instruction data exception.
N Instruction is new in z/Architecture as compared to ESA/39.
RRE RRE instruction format.
RRF RRF instruction format.
RXE RXE instruction format.
RXF RXF instruction format.
SP Specification exception.
ST PER storage-alteration event.
Xi IEEE invalid-operation condition.
Xo IEEE overflow condition.
Xu IEEE underflow condition.
Xx IEEE inexact condition.
Xz IEEE division-by-zero condition.
/
Mnemonic1 R,R [RRE] Op Code R X B D ////////Op Code
/
8 12 16 2 32 4 47
Op Code //////// R R
Mnemonic2 Op Code Operands
16 24 28 31 AEB 'EDA' Short BFP
ADB 'ED1A' Long BFP
Mnemonic1 Op Code Operands
AEBR 'B3A' Short BFP
ADBR 'B31A' Long BFP
AXBR 'B34A' Extended BFP
Figure 19-17 (Part 1 of 2). Action for R(v): Rounding and Range Function
Figure 19-17 (Part 2 of 2). Action for R(v): Rounding and Range Function
Op Code //////// R R Op Code M //// R R
16 24 28 31 16 2 24 28 31
Mnemonic Op Code Operands Mnemonic Op Code Operands
CEFBR 'B394' 32-bit binary-integer CFEBR 'B398' Short BFP operand, 32-bit
operand, short BFP result binary-integer result
CDFBR 'B395' 32-bit binary-integer CFDBR 'B399' Long BFP operand, 32-bit
operand, long BFP result binary-integer result
CXFBR 'B396' 32-bit binary-integer CFXBR 'B39A' Extended BFP operand, 32-
operand, extended BFP bit binary-integer result
result CGEBR 'B3A8' Short BFP operand, 64-bit
CEGBR 'B3A4' 64-bit binary-integer binary-integer result
operand, short BFP result CGDBR 'B3A9' Long BFP operand, 64-bit
CDGBR 'B3A5' 64-bit binary-integer binary-integer result
operand, long BFP result CGXBR 'B3AA' Extended BFP operand, 64-
CXGBR 'B3A6' 64-bit binary-integer bit binary-integer result
operand, extended BFP
result The BFP second operand is rounded to an integer
value and then converted to the fixed-point format.
The fixed-point second operand is converted to The result is placed at the first-operand location.
the BFP format, and the result is placed at the
first-operand location. The result is a signed binary integer that is placed
in the general register designated by R. A 32-bit
The second operand is a signed binary integer result replaces bits 32-63 of the register, and bits
that is located in the general register designated 0-31 of the register remain unchanged.
by R. A 32-bit operand is in bit positions 32-63
of the register. If the second operand is numeric and finite, it is
rounded to an integer value by rounding as speci-
The result is rounded according to the current fied by the modifier in the M field:
rounding mode before it is placed at the first-
operand location. M Rounding Method
0 According to current rounding mode
See Figure 19-21 on page 19-27 for a detailed 1 Biased round to nearest
description of the results of this instruction. 4 Round to nearest
5 Round toward 0
For CXFBR and CXGBR, the R field must desig-
6 Round toward +
nate a valid floating-point-register pair; otherwise,
7 Round toward
a specification exception is recognized.
A modifier other than 0, 1, or 4-7 is invalid.
Condition Code: The code remains unchanged.
When the modifier field is zero, rounding is con-
IEEE Exception Conditions:
trolled by the current rounding mode specified in
Inexact (CEFBR, CDGBR, CEGBR) the FPC register. When the field is not zero,
rounding is performed as specified by the modifier,
Program Exceptions: regardless of the current rounding mode.
Data with DXC 2, BFP instruction Rounding for modifiers 4-7 is the same as for
Data with DXC for IEEE exception condition rounding modes 0-3 (binary 00-11), respectively.
Operation (if the BFP facility is not installed) Biased round to nearest (modifier 1) is the same
Specification (CXFBR and CXGBR) as round to nearest (modifier 4), except when the
second operand is exactly halfway between two
integers, in which case the result for biased
rounding is the next integer that is greater in mag- IEEE Exception Conditions:
nitude.
Invalid operation
Inexact
The sign of the result is the sign of the second
operand, except that a zero result has a plus sign.
Program Exceptions:
See Figure 19-22 on page 19-28 for a detailed Data with DXC 2, BFP instruction
description of the results of this instruction. Data with DXC for IEEE exception condition
Operation (if the BFP facility is not installed)
The M field must designate a valid modifier; oth- Specification
erwise, a specification exception is recognized.
For CFXBR and CGXBR, the R field must desig-
nate a valid floating-point-register pair; otherwise,
a specification exception is recognized.
If the divisor is zero but the dividend is nonzero The remainder result is
and finite, an IEEE-division-by-zero condition is r = abn
recognized. If the dividend and divisor are both
zero, or if both are infinite, regardless of sign, an where a is the dividend, b the divisor, and n an
IEEE-invalid-operation condition is recognized. integer obtained by rounding the precise quotient
q = ab.
See Figure 19-23 on page 19-30 for a detailed
description of the results of this instruction. The first-operand result is r with the sign deter-
mined by the above expression. The third-
For DXBR, the R fields must designate valid operand result is n with a sign that is the
floating-point-register pairs; otherwise, a specifica- EXCLUSIVE OR of the dividend and divisor signs.
tion exception is recognized.
If the precise quotient is not an integer and the
Condition Code: The code remains unchanged. two integers closest to this precise quotient cannot
both be represented exactly in the precision of the
quotient, then a partial quotient and partial quotient rounding mode affects only the final quo-
remainder are formed. This partial quotient n and tient; partial quotients are rounded toward zero.
the corresponding partial remainder
Since the partial quotient is rounded toward zero,
r = abn
the partial remainder is always exact. For the
are used as the results. The sign of a partial specified quotient rounding modes of round toward
remainder is the same as the sign of the dividend. 0, round to nearest, and biased round to nearest,
The sign of a partial quotient is the EXCLUSIVE the final remainder is exact. For the specified
OR of the dividend and divisor signs. quotient rounding modes of round toward + and
round toward , the final remainder may not be
If the remainder is zero, then the precise quotient exact.
is an integer and can be represented exactly in
the precision of the quotient. The final quotient is rounded to an integer by
rounding as specified by the modifier in the M
The M field, called the modifier field, specifies field:
rounding of the final quotient. This rounding is
called the specified quotient rounding mode as M Rounding Method
contrasted to the current rounding mode speci- 0 According to current rounding mode
fied by the rounding-mode bits in the FPC register. 1 Biased round to nearest
The final quotient is rounded according to the 4 Round to nearest
specified quotient rounding mode. The specified 5 Round toward 0
If the quotient exponent is greater than the largest 4. In the case when the resulting remainder is
exponent that can be represented in the operand denormalized, the IEEE standard requires that
format, the correct remainder or partial remainder if traps are implemented and the underflow
still is produced, and the third-operand result is mask is one, then an underflow trap must
the correct value, but with the exponent reduced occur. To accomplish this, DIVIDE TO
by 192 or 1536 for short or long operands, respec- INTEGER recognizes underflow on the final
tively. The condition code indicates this out-of- remainder but not on the partial remainder.
range condition. Since in all cases when underflow occurs on
the partial remainder it will occur again on the
The M field must designate a valid modifier, and final remainder, recognizing overflow on only
the R, R, and R fields must designate different the final remainder avoids two underflow traps
registers; otherwise, a specification exception is to be reported for what the standard considers
recognized. a single Remainder operation.
Op Code //////// R R Op Code //////// R R
16 24 28 31 16 24 28 31
The second operand is placed at the first-operand The second operand is placed at the first-operand
location, and its sign and magnitude are tested to location with the sign bit inverted.
determine the setting of the condition code. The
condition code is set the same as for a compar- The sign bit is inverted even if the operand is
ison of the second operand with zero. zero. The rest of the second operand is placed
unchanged at the first-operand location. The sign
The second operand is placed unchanged at the is inverted for any operand, including a QNaN or
first-operand location. If the second operand is an SNaN, without causing an arithmetic exception.
SNaN, an IEEE-invalid-operation condition is
recognized; if there is no interruption, the result is For LCXBR, the R fields must designate valid
the corresponding QNaN. floating-point-register pairs; otherwise, a specifica-
tion exception is recognized.
See Figure 19-21 on page 19-27 for a detailed
description of the results of this instruction. Resulting Condition Code:
0 Result is zero
For LTXBR, the R fields must designate valid
1 Result is less than zero
floating-point-register pairs; otherwise, a specifica-
2 Result is greater than zero
tion exception is recognized.
3 Result is a NaN
Resulting Condition Code:
IEEE Exception Conditions: None.
0 Result is zero
1 Result is less than zero Program Exceptions:
2 Result is greater than zero Data with DXC 2, BFP instruction
3 Result is a NaN Operation (if the BFP facility is not installed)
Specification (LCXBR only)
IEEE Exception Conditions:
Programming Note: The IEEE standard makes
Invalid operation
it optional whether operations such as LOAD
COMPLEMENT signal invalid operation when the
Program Exceptions:
operand is an SNaN. LOAD AND TEST may be
Data with DXC 2, BFP instruction used in conjunction with this instruction if signal-
Data with DXC for IEEE exception condition ling is desired.
Operation (if the BFP facility is not installed)
Specification (LTXBR only)
Programming Note: The IEEE standard makes
it optional whether operations such as LOAD AND
TEST signal invalid operation when the operand is
an SNaN. TEST DATA CLASS may be used to
test an operand if signaling is not desired.
Mnemonic Op Code Operands The sign of the result is the sign of the second
FIEBR 'B357' Short BFP operand, even when the result is zero.
FIDBR 'B35F' Long BFP
FIXBR 'B347' Extended BFP See Figure 19-25 on page 19-37 for a detailed
description of the results of this instruction.
The second operand is rounded to an integer
value in the same floating-point format, and the The M field must designate a valid modifier, and,
result is placed at the first-operand location. for FIXBR, the R fields must designate valid
floating-point-register pairs. Otherwise, a specifi-
The second operand, if numeric, is rounded to an cation exception is recognized.
integer value as specified by the modifier in the
M field: Condition Code: The code remains unchanged.
Mnemonic Op Code Operands The second operand, in the format of the source,
LPEBR 'B3' Short BFP is rounded to the precision of the target, and the
LPDBR 'B31' Long BFP
LPXBR 'B34' Extended BFP result is placed at the first-operand location. The
sign of the result is the same as the sign of the
The second operand is placed at the first-operand second operand.
location with the sign bit made zero.
The second operand, if numeric, is rounded to the
The sign bit is made zero, and the rest of the precision of the target fraction according to the
second operand is placed unchanged at the first- current rounding mode. Normally, the result is in
operand location. The sign is set for any operand, the format and length of the target. However,
including a QNaN or SNaN, without causing an when an IEEE overflow or an IEEE underflow
arithmetic exception. occurs and the corresponding mask bit is one, the
operation is completed by producing a wrapped
For LPXBR, the R fields must designate valid result in the same format and length as the source
floating-point-register pairs; otherwise, a specifica- but rounded to the precision of the target.
tion exception is recognized.
See Figure 19-21 on page 19-27 for a detailed
Resulting Condition Code: description of the results of this instruction.
Mnemonic1 Op Code Operands If one operand is a zero and the other an infinity,
MEEBR 'B317' Short BFP an IEEE-invalid-operation condition is recognized.
MDBR 'B31C' Long BFP
MXBR 'B34C' Extended BFP See Figure 19-26 on page 19-41 for a detailed
MDEBR 'B3C' Short BFP multiplier and
description of the results of this instruction.
multiplicand, long BFP
product
MXDBR 'B37' Long BFP multiplier and The R field for MXDB, MXDBR, and MXBR, and
multiplicand, extended the R field for MXBR, must designate valid
BFP product floating-point-register pairs. Otherwise, a specifi-
cation exception is recognized.
Op Code R //// R R When the operands are numeric and finite, the
third and second BFP operands are multiplied,
16 2 24 28 31
forming an intermediate product, and the first
Mnemonic1 Op Code Operands operand is then added (or subtracted) algebra-
MAEBR 'B3E' Short BFP ically to (or from) the intermediate product, forming
MADBR 'B31E' Long BFP an intermediate sum. The intermediate sum, if
nonzero, is normalized and rounded to the
Mnemonic2 R,R,D(X,B) [RXF] operand format according to the current rounding
/ mode and then placed at the first-operand
Op Code R X B D R ////Op Code location. The exponent and fraction of the inter-
/ mediate product are maintained exactly; rounding
8 12 16 2 32 36 4 47 and range checking occur only on the intermediate
sum.
Mnemonic2 Op Code Operands
MAEB 'EDE' Short BFP
See Figure 19-27 on page 19-43 for a detailed
MADB 'ED1E' Long BFP
description of the results of MULTIPLY AND ADD.
The results of MULTIPLY AND SUBTRACT are
MULTIPLY AND SUBTRACT the same, except that the first operand partic-
ipates in the operation with its sign bit inverted.
Mnemonic1 R,R,R [RRF]
Condition Code: The code remains unchanged. See Figure 19-21 on page 19-27 for a detailed
description of the results of this instruction.
IEEE Exception Conditions: None.
For SQXBR, the R fields must designate valid
Program Exceptions: floating-point-register pairs; otherwise, a specifica-
Data with DXC 2, BFP instruction tion exception is recognized.
Operation (if the BFP facility is not installed)
Condition Code: The code remains unchanged.
/
STORE FPC
Op Code R X B D ////////Op Code
/ STFPC D(B) [S]
8 12 16 2 32 4 47
'B29C' B D
Mnemonic2 Op Code Operands
SQEB 'ED14' Short BFP 16 2 31
SQDB 'ED15' Long BFP
The contents of the FPC (floating-point-control)
The square root of the second operand is placed register are placed in storage at the second-
at the first-operand location. operand location.
The result rounded according to the current The operand is four bytes in length. All 32 bits of
rounding mode is placed at the first-operand the FPC register are stored.
location.
Condition Code: The code remains unchanged.
If the second operand is a finite positive number,
the result is the square root of that number with a IEEE Exception Conditions: None.
plus sign. If the operand is a zero of either sign,
the result is a zero of the same sign. If the Program Exceptions:
operand is +, the result is +. Access (store, operand 2)
Data with DXC 2, BFP instruction
Operation (if the BFP facility is not installed)
This appendix is the same as in Enterprise Negative binary integers are formed in two's-
Systems Architecture/390 Principles of Operation, complement notation by inverting each bit of the
SA22-7201; it has not been revised to show the positive binary integer and adding one. As an
enlargement of register sizes or the 64-bit example using the halfword format, the binary
addressing mode. number with the decimal value +26 is made nega-
tive (-26) in the following manner:
+26 1 11
Number Representation Invert 1 111 1111 111 11
Add 1 1
Binary Integers -26 1 111 1111 111 11 (Two's comple-
ment form)
Signed Binary Integers (S is the sign bit.)
Signed binary integers are most commonly repres- This is equivalent to subtracting the number:
ented as halfwords (16 bits) or words (32 bits). In
111
both lengths, the leftmost bit (bit 0) is the sign of from
the number. The remaining bits (bits 1-15 for 1
halfwords and 1-31 for words) are used to specify
the magnitude of the number. Binary integers are Negative binary integers are changed to positive
also referred to as fixed-point numbers, because in the same manner.
the radix point (binary point) is considered to be
The following addition examples illustrate two's-
fixed at the right, and any scaling is done by the
complement arithmetic and overflow conditions.
programmer.
Only eight bit positions are used.
Positive binary integers are in true binary notation 1. +57 = 11 11
with a zero sign bit. Negative binary integers are +35 = 1 11
in two's-complement notation with a one bit in the
+92 = 11 11
sign position. In all cases, the bits between the
sign bit and the leftmost significant bit of the 2. +57 = 11 11
integer are the same as the sign bit (that is, all -35 = 111 111
zeros for positive numbers, all ones for negative +22 = 1 11 No overflow -- carry into
numbers). leftmost position and
carry out
2-1 = 2 147 483 647 = 111 1111 1111 1111 1111 1111 1111 1111
2 = 65 536 = 1
2 = 1 = 1
= =
-2 = -1 = 1 111 1111 1111 1111 1111 1111 1111 1111
-2 = -2 = 1 111 1111 1111 1111 1111 1111 1111 111
-2 = -65 536 = 1 111 1111 1111 1111
-2+1 = -2 147 483 647 = 1 1
-2 = -2 147 483 648 = 1
Unsigned Binary Integers are used. The examples are numbered the same
Certain instructions, such as ADD LOGICAL, treat as the corresponding examples for signed binary
binary integers as unsigned rather than signed. integers.
Unsigned binary integers have the same format as 1. 57 = 11 11
signed binary integers, except that the leftmost bit 35 = 1 11
is interpreted as another numeric bit rather than a
sign bit. There is no complement notation 92 = 11 11
because all unsigned binary integers are consid- 2. 57 = 11 11
ered positive. 221 = 111 111
The following examples illustrate the addition of 278 =\1 11 \Carry out of leftmost
position
unsigned binary integers. Only eight bit positions
2-1 = 4 294 967 295 = 1111 1111 1111 1111 1111 1111 1111 1111
2 = 2 147 483 648 = 1
2-1 = 2 147 483 647 = 111 1111 1111 1111 1111 1111 1111 1111
2 = 65 536 = 1
2 = 1 = 1
= =
-7 7D D7
Extended HFP Number
C F F F F C High-Order Part
or or /
F F F F F F High-Order Leftmost 14 Digits
SCharacteristicof 28-Digit Fraction
Under some circumstances, a zero with a minus /
sign (negative zero) is produced. For example, 1 8 63
the multiplicand:
Low-Order Part
12 3D (-123) /
Low-Order Rightmost 14 Digits
times the multiplier: SCharacteristicof 28-Digit Fraction
C (+) /
64 72 127
generates the product:
D (-) An HFP number has two signs: one for the frac-
because the product sign follows the algebraic tion and one for the exponent. The fraction sign,
rule of signs even when the value is zero. A neg- which is also the sign of the entire number, is the
ative zero, however, is equivalent to a positive leftmost bit of each format (0 for plus, 1 for
zero in that they compare equal in a decimal com- minus). The numeric part of the fraction is in true
parison. notation regardless of the sign. The numeric part
is contained in bits 8-31 for the short format, in
bits 8-63 for the long format, and in bits 8-63 fol-
Hexadecimal-Floating-Point lowed by bits 72-127 for the extended format.
Numbers
The exponent sign is obtained by expressing the
A hexadecimal-floating-point (HFP) number is exponent in excess-64 notation; that is, the expo-
expressed as a hexadecimal fraction multiplied by nent is added as a signed number to 64. The
a separate power of 16. The term floating point resulting number is called the characteristic. It is
indicates that the placement, of the radix located in bits 1-7 for all formats. The character-
(hexadecimal) point, or scaling, is automatically istic can vary from 0 to 127, permitting the expo-
maintained by the machine. nent to vary from -64 through 0 to +63. This
provides a scale multiplier in the range of 16- to
The part of an HFP number which represents the 16+. A nonzero fraction, if normalized, has a
significant digits of the number is called the frac- value less than one and greater than or equal to
tion. A second part specifies the power (expo- 1/16, so that the range covered by the magnitude
nent) to which 16 is raised and indicates the M of a normalized floating-point number is:
location of the radix point of the number. The
16- M < 16
fraction and exponent may be represented by 32
bits (short format), 64 bits (long format), or 128 In decimal terms:
bits (extended format). 16- is approximately 5.4 x 1-
16 is approximately 7.2 x 1
1. = +1/16x16 = 1 1 1
.5 = +8/16x16 = 1 1
1/64 = +4/16x16- = 11 1111 1
. = + x16- =
-15. = -15/16x16 = 1 1 1 1111
5.4x1- +1/16x16- = 1
7.2x1 (1-16-)x16 = 111 1111 1111 1111 1111 1111 1111 1111
BCR 15,6 BB BB BB BB 82 46 8A CE
Assembler Format BAL 5,(,6) 8 1 DA 82 46 8A CE
Op Code R,D(X,B) BAS 5,(,6) 8 1 DA 82 46 8A CE
BALR 5,6 8 1 D8 82 46 8A CE
BAL 5,(,6) BASR 5,6 8 1 D8 82 46 8A CE
BASSM 5,6 8 1 D8 82 46 8A CE
BSM 5,6 BB BB BB BB 82 46 8A CE
The BAS instruction has the same format, but the
op code is 4D.
Note that a value of zero in the R field of any of
The BCR instruction specifies only one register: the RR-format instructions indicates that the
branching function is not to be performed; it does
Machine Format not refer to register 0. Likewise, a value of zero in
Op Code M R the R field of the BSM instruction indicates that
the old value of PSW bit 32 is not to be saved and
7 F 6
that register 0 is to be left unchanged. Register 0
can be designated by the R field of instructions
BAL, BALR, BAS, BASR, and BASSM, however.
Assembler Format In the RX-format branch instructions, branching
Op Code M,R
occurs independent of whether there is a value of
BAKR 5, 1. 1 D6 99 99
2. 1 D6 86 99 99
3. 1 D6 99 99
Assume four cases of initial values, as follows: 4. 1 D6 86 99 99
5. 84 1 D6 99 99
Register 5 PSW (32-63) 6. 84 1 D6 86 99 99
7. 84 1 D6 99 99
1. 4 1 D6 46 8A CE 8. 84 1 D6 86 99 99
2. 4 1 D6 82 46 8A CE
3. 84 1 D6 46 8A CE
4. 84 1 D6 82 46 8A CE BRANCH ON CONDITION (BC,
BCR)
The results in the four cases are as follows:
The BRANCH ON CONDITION instruction tests
Return Branch Value the condition code to see whether a branch should
Value and PSW (32-63) or should not occur. The branch occurs only if the
1. 1 D6 46 8A D2 current condition code corresponds to a one bit in
2. 1 D6 82 46 8A D2 a mask specified by the instruction.
3. 84 1 D6 46 8A D2
4. 84 1 D6 82 46 8A D2 Condition Instruction
Code (Mask) Bit Mask Value
0 8 8
BAKR Example 3
1 9 4
This example shows BAKR used in a called
2 10 2
program. BAKR performs a branch, and the
3 11 1
return is to be as specified in general register R.
For example, assume that an ADD (A or AR)
The format of the BAKR instruction is:
operation has been performed and that a branch
Machine Format to address 6050 is desired if the sum is zero or
Op Code R R less (condition code is 0 or 1). Also assume:
Register 10 contains 00 00 50 00.
B24 5 6
Register 11 contains 00 00 10 00.
The RX form of the instruction performs the
Assembler Format required test (and branch if necessary) when
Op Code R,R written as:
BAKR 5,6
A mask of 12 means that there are ones in BRANCH ON INDEX HIGH (BXH)
instruction bits 8 and 9 and zeros in bits 10 and
11, so that branching takes place when the condi- BXH Example 1
tion code is either 0 or 1. The BRANCH ON INDEX HIGH instruction is an
index-incrementing and loop-controlling instruction
A mask of 15 would indicate a branch on any con- that causes a branch whenever the sum of an
dition (an unconditional branch). A mask of zero index value and an increment value is greater
would indicate that no branch is to occur (a no- than some compare value. For example, assume
operation). that:
Register 4 contains 00 00 00 8A = 138 =
(See also Linkage Instructions (BAL, BALR, BAS, the index.
BASR, BASSM, BSM) on page A-8 for an
example of the BCR instruction.) Register 6 contains 00 00 00 02 = 2 = the
increment.
BRANCH ON COUNT (BCT, Register 7 contains 00 00 00 AA = 170 =
BCTR) the compare value.
Register 10 contains 00 00 71 30 = the
The BRANCH ON COUNT instruction is often branch address.
used to execute a program loop for a specified
number of times. For example, assume that the The format of the BXH instruction is:
following represents some lines of coding in an
Machine Format
assembler-language program: Op Code R R B D
..
.
LUPE AR 8,1 86 4 6 A
..
.
BACK BCT 6,LUPE
..
. Assembler Format
Op Code R,R,D(B)
where register 6 contains 00 00 00 03 and the
address of LUPE is 6826. Assume that, in order BXH 4,6,(1)
to address this location, register 10 is used as a
base register and contains 00 00 68 00. When the instruction is executed, first the contents
of register 6 are added to register 4, second the
The format of the BCT instruction is:
sum is compared with the contents of register 7,
and third the decision whether to branch is made.
Machine Format
Op Code R X B D After execution:
Register 4 contains 00 00 00 8C = 140.
46 6 A 26
Registers 6 and 7 are unchanged.
Since the new value in register 4 is not yet greater
than the value in register 7, the branch to address
7130 is not taken. Repeated use of the instruction
2 Bytes 2 Bytes
The BRANCH ON INDEX LOW OR EQUAL
ARG1 FUNCT1 instruction performs the same operation as
ARG2 FUNCT2 BRANCH ON INDEX HIGH, except that branching
ARG3 FUNCT3 occurs when the sum is lower than or equal to
ARG4 FUNCT4 (instead of higher than) the compare value. As
ARG5 FUNCT5
ARG6 FUNCT6 the instruction which increments and tests an
index value in a program loop, BXLE is useful at
the end of the loop and BXH at the beginning.
Assume that: The following assembler-language routines illus-
Register 8 contains the search argument. trate loops with BXLE.
Register 9 contains the width of the table in
bytes (00 00 00 04).
BXLE Example 1
Assume that a group of ten 32-bit signed binary
Register 10 contains the length of the table in integers are stored at consecutive locations,
bytes (00 00 00 18). starting at location GROUP. The integers are to
Register 11 contains the starting address of be added together, and the sum is to be stored at
the table. location SUM.
SR 5,5 Set sum to zero
Register 14 contains the return address to the
LA 6,GROUP Load first address
main program.
SR 7,7 Set index to zero
As the following subroutine is executed, the argu- LA 8,4 Load increment 4
ment in register 8 is successively compared with LA 9,39 Load compare value
the arguments in the table, starting with argument LOOP A 5,(7,6) Add integer to sum
6 and working backward to argument 1. If an BXLE 7,8,LOOP Test end of loop
equality is found, the corresponding function ST 5,SUM Store sum
replaces the argument in register 8. If an equality The two-instruction loop contains an ADD (A)
is not found, zero replaces the argument in reg- instruction which adds each integer to the con-
ister 8. tents of general register 5. The ADD instruction
SEARCH LNR 9,9 uses the contents of general register 7 as an
NOTEQUAL BXH 1,9,LOOP index value to modify the starting address
NOTFOUND SR 8,8 obtained from register 6. Next, BXLE increments
BCR 15,14 the index value by 4, the increment previously
LOOP CH 8,(1,11) loaded into register 8, and compares it with the
BC 7,NOTEQUAL compare value in register 9, the odd register of
LH 8,2(1,11) this even-odd pair. The compare value was previ-
BCR 15,14 ously set to 39, which is one less than the number
The first instruction (LNR) causes the value in reg- of bytes in the data area; this is also the address,
ister 9 to be made negative. After execution of relative to the starting address, of the rightmost
this instruction, register 9 contains FF FF FF FC = byte of the last integer to be added. When the
-4. Considering the case when no equality is last integer has been added, BXLE increments the
index value to the next relative address (40),
Machine Format
Op Code R R
Assembler Format
Op Code D(L,B),D(B) 15 4 7
CLC 6(12,9),(7)
Assembler Format
sets condition code 1, indicating that the contents Op Code R,R
of field 1 are lower in value than the contents of
field 2. CLR 4,7
Because the collating sequence of the EBCDIC sets condition code 1. Condition code 1 indicates
code is determined simply by a logical comparison that the first operand is lower than the second.
of the bits in the code, the CLC instruction can be
used to collate EBCDIC-coded fields. For If, instead, the signed-binary comparison instruc-
example, in EBCDIC, the above two data fields tion COMPARE (CR) had been executed, the con-
are: tents of register 4 would have been interpreted as
Field 1: JOHNSON,A.B. +1 and the contents of register 7 as -1. Thus, the
Field 2: JOHNSON,A.C. first operand would have been higher, so that con-
dition code 2 would have been set.
Condition code 1 indicates that JOHNSON,A.B.
should precede JOHNSON,A.C. for the fields to
be in alphabetic sequence. COMPARE LOGICAL
CHARACTERS UNDER MASK
CLI Example (CLM)
The COMPARE LOGICAL (CLI) instruction com-
pares a byte from the instruction stream with a The COMPARE LOGICAL CHARACTERS
byte from storage. For example, assume that: UNDER MASK (CLM) instruction provides a
Register 10 contains 00 00 17 00. means of comparing bytes selected from a
general register to a contiguous field of bytes in
Storage location 1703 contains 7E. storage. The M field of the CLM instruction is a
Execution of the instruction:
BD 6 D C 2
R ////////Second-Operand Address
(even)
Assembler Format 8 31
Op Code R,M,D(B)
CLM 6,B'111',X'2'(12)
R+1 Pad ByteSecond-Operand Length
(odd)
causes the following comparison: 8 31
Register 6: F BC 5C 7B
Mask M: 1 1 1 In the 31-bit addressing mode, the operand
-- -- --
addresses would be in bit positions 1-31 of the
F BC 7B even registers shown above.
Storage Since the CLCL instruction may be interrupted
locations during execution, the interrupting program must
12-122: F BC 7B preserve the contents of the four registers for use
when the instruction is resumed.
Because the selected bytes are equal, condition
code 0 is set. The following instructions set up two register pairs
to control a text-string comparison. For example,
assume:
COMPARE LOGICAL LONG
Operand 1
(CLCL) Address: 28
Length: 1
The COMPARE LOGICAL LONG instruction is
used to compare two operands in storage, byte by Operand 2
byte. Each operand can be of any length. Two Address: 2A
even-odd pairs of general registers (four registers Length: 132
in all) are used to locate the operands and to Padding Byte
control the execution of the CLCL instruction, as Address: 23
illustrated in the following diagram. The first reg- Length: 1
ister of each pair must be an even register, and it Value: 4
contains the storage address of an operand. The Register 12 contains 00 02 00 00.
odd register of each pair contains the length of the
The setup instructions are:
If this CLCL instruction is interrupted after 60 When condition code 1 or 2 is set, the addresses
bytes have compared equal, the operand lengths of the last bytes processed in the first and second
in registers 5 and 9 will have been decremented operands are placed in general registers R and
to 40 and 72, respectively. The operand R, respectively. These are the addresses of
addresses in registers 4 and 8 will have been unequal bytes in the two operands, or they are the
Following are examples of first and second oper- CC: ; (R): 1; (R): 2
ands beginning at decimal locations 1000 and
2000, respectively. The addresses in general reg-
CONVERT TO BINARY (CVB)
isters R and R are 1000 and 2000, respectively.
The ending character in general register 0 is 00 The CONVERT TO BINARY instruction converts
hex (as in the C programming language). The an eight-byte, packed-decimal number into a
values of the operand bytes are shown in hex, signed binary integer and loads the result into a
and the resulting condition code and final contents general register. After the conversion operation is
of general registers R and R are shown. completed, the number is in the proper form for
Example 1 use as an operand in signed binary arithmetic.
1 2 For example, assume:
C1 C2 C3 C1 C2 C3
Storage locations 7608-760F contain a
CC: ; (R): 1; (R): 2 decimal number in the packed format: 00 00
Example 2 00 00 00 25 59 4C (+25,594).
1 2
4 4 4 C1 4 4 4 C2 The contents of register 7 are not significant.
Register 13 contains 00 00 76 00.
CC: 1; (R): 13; (R): 23
The format of the conversion instruction is:
Example 3
1 2
4 4 4 C2 4 4 4 C1 Machine Format
Op Code R X B D
CC: 2; (R): 13; (R): 23
4F 7 D 8
Example 4
1 2
C1 C2 C3 C1 C2 C3 C4
Assembler Format
CC: 1; (R): 13; (R): 23 Op Code R,D(X,B)
Example 5 CVB 7,8(,13)
1 2
C1 C2 C3 C4 C1 C2 C3
After the instruction is executed, register 7 con-
CC: 2; (R): 13; (R): 23 tains 00 00 63 FA.
Example 6
Assuming that the CPU-determined number of
bytes compared is 256: CONVERT TO DECIMAL (CVD)
1 1256 2 2256 The CONVERT TO DECIMAL instruction is the
4 .. 4 4 .. 4 opposite of the CONVERT TO BINARY instruc-
tion. CVD converts a signed binary integer in a
CC: 3; (R): 1256; (R): 2256
register to packed decimal and stores the eight-
Example 7 byte result. For example, assume:
1 2
4 4 4 4 4 4 4 Register 1 contains the signed binary integer:
00 00 0F 0F.
CC: 1; (R): 1; (R): 2
Register 13 contains 00 00 76 00.
The DIVIDE instruction divides the dividend in an When the Boolean operator EXCLUSIVE OR is
even-odd register pair by the divisor in a register applied to two bits, the result is one when either,
or in storage. Since the instruction assumes the but not both, of the two bits is one; otherwise, the
dividend to be 64 bits long, it is important first to result is zero. When two bytes are EXCLUSIVE
extend a 32-bit dividend on the left with bits equal ORed, each pair of bits is handled separately;
to the sign bit. For example, assume that: there is no connection from one bit position to
another. The following is an example of the
Storage locations 3550-3553 contain 00 00 08 EXCLUSIVE OR of two bytes:
DE = 2270 (the dividend).
First-operand byte: 11 11
Storage locations 3554-3557 contain 00 00 00 Second-operand byte: 11 11
32 = 50 (the divisor).
Result byte: 11 11
The initial contents of registers 6 and 7 are
not significant. XC Example
Register 8 contains 00 00 35 50. The EXCLUSIVE OR (XC) instruction can be used
to exchange the contents of two areas in storage
The following assembler-language statements load without the use of an intermediate storage area.
the registers properly and perform the divide oper- For example, assume two three-byte fields in
ation: storage:
359 35B
Statement Comments
Field 1 179
L 6,(,8) Places 8 DE into reg-
ister 6.
SRDA 6,32() Shifts 8 DE into reg- 36 362
ister 7. Register 6 is
filled with zeros (sign Field 2 141
bits).
D 6,4(,8) Performs the division.
Execution of the instruction (assume that register
The machine format of the above DIVIDE instruc- 7 contains 00 00 03 58):
tion is:
D7 2 7 8 7 1 Machine Format
Op Code I B D
97 81 9 2
Assembler Format
Op Code D(L,B),D(B)
MVC 3(1,12),(13)
INSERT CHARACTERS UNDER
where register 12 contains 00 00 89 13 and reg-
MASK (ICM)
ister 13 contains 00 00 90 A0.
The INSERT CHARACTERS UNDER MASK
(ICM) instruction may be used to replace all or
Further assume that at storage address 5000, the
selected bytes in a general register with bytes
following EXECUTE instruction is located:
from storage and to set the condition code to indi-
Machine Format cate the value of the inserted field.
Op Code R X B D
For example, if it is desired to insert a three-byte
44 1 A address from FIELDA into register 5 and leave the
leftmost byte of the register unchanged, assume:
Machine Format
When the mask field contains 1111, the ICM Op Code R X B D
instruction produces the same result as LOAD (L)
(provided that the indexing capability of the RX 41 1 8
format is not needed), except that ICM also sets
the condition code. The condition-code setting is
useful when an all-zero field (condition code 0) or Assembler Format
a leftmost one bit (condition code 1) is used as a Op Code R,D(X,B)
flag.
LA 1,248(,)
LA 5,1(,5)
MOVE (MVC, MVI)
adds 10 (decimal) to the contents of register 5 as MVC Example
follows: The MOVE (MVC) instruction can be used to
Register 5 (old): 12 34 56 move data from one storage location to another.
D field: A For example, assume that the following two fields
are in storage:
Register 5 (new): 12 34 6
248 252
The register may be specified as either B or X. Field
Thus, the instruction LA 5,10(5,0) produces the 1 C1C2C3C4C5C6C7C8C9CACB
same result.
384 3848
As the most general example, the instruction LA Field
6,10(5,4) forms the sum of three values: the con- 2 F1F2F3F4F5F6F7F8F9
tents of register 4, the contents of register 5, and
a displacement of 10 and places the 24-bit or Also assume:
31-bit sum with zeros appended on the left in reg-
Register 1 contains 00 00 20 48.
ister 6.
Register 2 contains 00 00 38 40.
LOAD HALFWORD (LH) With the following instruction, the first eight bytes
of field 2 replace the first eight bytes of field 1:
The LOAD HALFWORD instruction places
unchanged a halfword from storage into the right Machine Format
half of a register. The left half of the register is Op Code L B D B D
loaded with zeros or ones according to the sign
D2 7 1 2
(leftmost bit) of the halfword.
For example, assume that the two bytes in
storage locations 1803-1804 are to be loaded into Assembler Format
register 6. Also assume: Op Code D(L,B),D(B)
The contents of register 6 are not significant. MVC (8,1),(2)
Register 14 contains 00 00 18 03.
After the instruction is executed, field 1 becomes:
Locations 1803-1804 contain 00 20.
248 252
The instruction required to load the register is: Field
1 F1F2F3F4F5F6F7F8C9CACB
Machine Format
Op Code R X B D
Field 2 is unchanged.
48 6 E
MVC can also be used to propagate a byte
through a field by starting the first-operand field
one byte location to the right of the second-
Assembler Format
Op Code R,D(X,B) operand field. For example, suppose that an area
in storage starting with address 358 contains the
LH 6,(,14) following data:
92 5B 1 Field 2 is unchanged.
F1F2F3F4F5F6
multiplies the number in register 7 by itself and
places the result in the pair of registers 6 and 7:
MULTIPLY (M, MR) Register 6 contains 00 00 00 01.
Register 7 contains 00 0A 00 19.
Assume that a number in register 5 is to be multi-
plied by the contents of a four-byte field at
address 3750. Initially: MULTIPLY HALFWORD (MH)
The contents of register 4 are not significant. The MULTIPLY HALFWORD instruction is used to
Register 5 contains 00 00 00 9A = 154 = multiply the contents of a register by a two-byte
the multiplicand. field in storage. For example, assume that:
Register 11 contains 00 00 06 00. Register 11 contains 00 00 00 15 =21 = the
multiplicand.
Register 12 contains 00 00 30 00.
Register 14 contains 00 00 01 00.
Storage locations 3750-3753 contain 00 00 00
83 = 131 = the multiplier. Register 15 contains 00 00 20 00.
Machine Format
Op Code R X B D When this instruction is executed, the byte in
storage is ORed with the immediate byte (the I
4C B E F 2 field of the instruction):
Location 4891: 1 1
Immediate byte: 1
Assembler Format
Op Code R,D(X,B) Result: 1 11
The resulting byte with bit 7 set to one is stored
MH 11,2(14,15)
back in location 4891. Condition code 1 is set.
Register Format
SHIFT LEFT SINGLE (SLA) Op Code R,M,S
The SHIFT LEFT SINGLE instruction is similar to STCM 8,B'111',FIELD3
SHIFT LEFT DOUBLE, except that it shifts only
the 31 numeric bits of a single register. There- Register 8: 12 34 56 78
fore, this instruction performs an algebraic left shift FIELD3 (before): not significant
of a 32-bit signed binary integer. FIELD3 (after): 34 56 78
As another example:
For example, if the contents of register 2 are:
7F A 72 = 1111111 11 1111 Machine Format
Op Code R M S
The instruction:
BE 9 5 \ \ \ \
Machine Format
Op Code R B D
STM 14,1,X'5'(6) 3C = 11 11
Mask = 11 11
After the instruction is executed: Test = xx xx
Locations 4050-4053 contain 00 00 25 63. Condition code 0 is set: all selected bits are
zeros.
Locations 4054-4057 contain 00 01 27 36.
Note: Storage location 9999 remains unchanged.
Locations 4058-405B contain 12 43 00 62.
Locations 405C-405F contain 73 26 12 57. TRANSLATE (TR)
TEST UNDER MASK (TM) The TRANSLATE instruction can be used to trans-
late data from any character code to any other
The TEST UNDER MASK instruction examines desired code, provided that each character code
selected bits of a byte and sets the condition code consists of eight bits or fewer. An appropriate
accordingly. For example, assume that: translation table is required in storage.
Storage location 9999 contains FB.
In the following example, EBCDIC code is trans-
Register 7 contains 00 00 99 90. lated to ASCII code. The first step is to create a
256-byte table in storage locations 1000-10FF.
Assume the instruction to be:
This table contains the characters of the ASCII
Machine Format code in the sequence of the binary representation
Op Code I B D of the EBCDIC code; that is, the ASCII represen-
tation of a character is placed in storage at the
91 C3 7 9 starting address of the table plus the binary value
of the EBCDIC representation of the same char-
acter.
Assembler Format
Op Code D(B),I For simplicity, the example shows only the part of
the table containing the decimal digits:
TM 9(7),B'1111'
1F 1F9
The instruction tests only those bits of the byte in 3313233343536373839
storage for which the mask bits are ones:
FB = 1111 111 Assume that the four-byte field at storage location
Mask = 11 11 2100 contains the EBCDIC code for the digits
1984:
Test = 11xx xx11
Locations 2100-2103 contain F1 F9 F8 F4.
Condition code 3 is set: all selected bits in the
test result are ones. (The bits marked x are Register 12 contains 00 00 21 00.
ignored.) Register 15 contains 00 00 10 00.
If location 9999 had contained B9, the test would As the instruction:
have been:
Machine Format
B9 = 111 11 Op Code L B D B D
Mask = 11 11
DC 3 C F
Test = 1xx xx1
Condition code 1 is set: the selected bits are both
zeros and ones.
used to scan a data field for characters with a Note: If the character codes in the statement
special meaning. To indicate which characters being translated occupy a range smaller than 00
have a special meaning, a table similar to the one through FF, a table of fewer than 256 bytes can
used for the TRANSLATE instruction is set up, be used.
except that zeros in the table indicate characters Figure A-4. Translate and Test Table
without any special meaning and nonzero values
indicate characters with a special meaning. The table entries for the alphameric characters in
EBCDIC are 00; thus, the letter A (code C1) corre-
Figure A-4 has been set up to distinguish alpha- sponds to byte location 20C1, which contains 00.
meric characters (A to Z and 0 to 9) from blanks,
certain special symbols, and all other characters The 15 special symbols have nonzero entries from
which are considered invalid. EBCDIC coding is 04 to 3C in increments of 4. Thus, the blank
assumed. The 256-byte table is assumed stored (code 40) has the entry 04, the period (code 4B)
at locations 2000-20FF. has the entry 08, and so on.
FA 2 3 C D
Assume that the signed, packed-decimal number
at storage locations 2000-2004 (the dividend) is to
be divided by the signed, packed-decimal number
Assembler Format
Op Code D(L,B),D(L,B) at locations 3000-3001 (the divisor). Also
assume:
AP (3,12),(4,13) Register 12 contains 00 00 20 00.
Register 13 contains 00 00 30 00.
is executed, the storage locations 2000-2002
contain 73 88 5C; condition code 2 is set to indi- Storage locations 2000-2004 contain 01 23 45
cate that the result is greater than zero. Note 67 8C.
that: Storage locations 3000-3001 contain 32 1D.
1. Because the two numbers had different signs, After the instruction:
they were in effect subtracted.
2. Although the second operand is longer than Machine Format
the first operand, no overflow interruption Op Code L L B D B D
occurs because the result can be entirely con- FD 4 1 C D
tained within the first operand.
Before decimal data in the packed format can be alters the pattern field as follows:
used in a printed report, digits and signs must be
converted to printable characters. Moreover, Significance
punctuation marks, such as commas and decimal Indicator
points, may have to be inserted in appropriate (Before/ Location
PatternDigit After) Rule 1-1C
places. The highly flexible EDIT instruction per-
forms these functions in a single instruction exe- b off/off leave(1)bdd,d(d.ddbCR
cution. d off/off fill bbd,d(d.ddbCR
d 2 off/on(2) digit bb2,d(d.ddbCR
, on/on leave same
This example shows step-by-step one way that d 5 on/on digit bb2,5(d.ddbCR
the EDIT instruction can be used. The field to be ( 7 on/on digit bb2,57d.ddbCR
edited (the source) is four bytes long; it is edited d 4 on/on digit bb2,574.ddbCR
. on/on leave same
against a pattern 13 bytes long. The following d 2 on/on digit bb2,574.2dbCR
symbols are used: d 6+ on/off(3) digit bb2,574.26bCR
b off/off fill same
C off/off fill bb2,574.26bbR
Symbol Meaning R off/off fill bb2,574.26bbb
b (Hexadecimal 4) Blank character Notes:
( (Hexadecimal 21) Significance starter
d (Hexadecimal 2) Digit selector 1. This character is the fill byte.
2. First nonzero decimal source digit turns on
Assume that register 12 contains: significance indicator.
1 3. Plus sign in the four rightmost bits of the
byte turns off significance indicator.
b b b b b b . 2 6 b C R
This pattern field prints as:
This pattern field prints as: $2,574.26
.26 CR Condition code 2 is set to indicate that the number
edited was greater than zero.
The significance starter forces the significance
indicator to the on state and hence causes a
Pattern
leading zero and the decimal point to be pre- 1 1C
served. Because the minus-sign code has no
effect on the significance indicator, the characters 444445BF4BF2F64C3D9
CR are printed to show a negative (credit)
amount. b b b b b $ . 2 6 b C R
Condition code 1 is set (number less than zero). This pattern field prints as:
$.26 CR
EDIT AND MARK (EDMK) Condition code 1 is set because the number is
less than zero.
The EDIT AND MARK instruction may be used, in
addition to the functions of EDIT, to insert a cur-
rency symbol, such as a dollar sign, at the appro- MULTIPLY DECIMAL (MP)
priate position in the edited result. Assume the
same source in storage locations 1200-1203, the Assume that the signed, packed-decimal number
same pattern in locations 1000-100C, and the in storage locations 1202-1204 (the multiplicand)
same contents of general register 12 as for the is to be multiplied by the signed, packed-decimal
EDIT instruction above. The previous contents of number in locations 500-501 (the multiplier).
general register 1 (GR1) are not significant; a 122 124
LOAD ADDRESS instruction is used to set up the
Multiplicand 3846D
Machine Format
Assembler Format Op Code L I S B D
Op Code D(L,B),D(L,B)
F 4 \\\\ 3F
MP X'1'(5,4),(2,6)
is executed, storage locations 1300-1304 contain
the product: 01 23 45 66 0C.
111111
SHIFT AND ROUND DECIMAL
(SRP) 6-bit two's
complement
The SHIFT AND ROUND DECIMAL (SRP) for -1
instruction can be used for shifting decimal
numbers in storage to the left or right. When a Assembler Format
number is shifted right, rounding can also be Op Code S(L),S,I
done.
SRP FIELD2(5),64-1,
Decimal Left Shift
In this example, the contents of storage location FIELD 2 (before): 1 23 45 67 8C
FIELD1 are shifted three places to the left, effec-
tively multiplying the contents of FIELD1 by 1000. FIELD 2 (after): 12 34 56 7C
FIELD1 is six bytes long. The following instruction
performs the operation:
78 90.
SRP FIELD3(4),64-3,5
Storage locations 4500-4502 contain 38 46
FIELD 3 (before): 12 39 6 D 0D.
After the instruction:
FIELD 3 (after): 1 24 D
Machine Format
The shift amount (three places) is specified in the Op Code L L B D B D
D field. The I field specifies a rounding digit of
5. The rounding digit is added to the last digit F8 4 2 9 9 5
shifted out (which is a 6), and the carry is propa-
gated to the left. The sign is ignored during the
addition. Assembler Format
Op Code D(L,B),D(L,B)
Condition code 1 is set because the result is less
ZAP (5,9),X'5'(3,9)
than zero.
7A 6 D Machine Format
Op Code R X B D
7E 6 D
Assembler Format
Op Code R,D(X,B)
COMPARE (CD, CDR, CE, CER) However, when two normalized HFP numbers are
compared, the relationship between numbers that
Assume that FPR4 contains 43 00 00 00 00 00 00 compare equal is unique: each digit in one
00 (zero), and FPR6 contains 35 12 34 56 78 9A number must be the same as the corresponding
BC DE (a positive number). The contents of the digit in the other number.
two registers are to be compared using a long-
precision COMPARE instruction.
DIVIDE (DD, DDR, DE, DER)
Machine Format
Op Code R R Assume that the first operand (the dividend) is in
FPR2 and the second operand (the divisor) in
29 4 6 FPR0. If the operands are in the short-precision
format, the resulting quotient is returned to FPR2
by the instruction:
Assembler Format
Op Code R,R Machine Format
Op Code R R
CDR 4,6
3D 2
The number with the smaller characteristic, which
is in register FPR6, is right-shifted 43 - 35 hex
Assembler Format
(67 - 53 decimal) or 14 digit positions, so that the
Op Code R,R
two characteristics agree. The shifted number is
43 00 00 00 00 00 00 00, with a guard digit of DER 2,
one. Therefore, when the two numbers are com-
pared, condition code 1 is set, indicating that
Several examples of short-precision HFP division,
operand 1 in FPR4 is less than operand 2 in
with the dividend in FPR2 and the divisor in FPR0,
FPR6.
are shown below. For case A, the result, which
replaces the dividend, is obtained in the following
If the example is changed to a second operand
steps.
with a characteristic of 34 instead of 35, so that
HDR 2,2
LIFO UNLOCK Error Some program isThe list is POST (1) Yes, post the "last in"
waiting for theempty. Store element
SRR. Move the zeros into the
pointer from header. The SRR BC 15,EXIT Continue
the "last in" is free. B SR , The header contains a neg-
element into
the header. CS 1,,(2) ative value; free the
POST; the ECB BC 7,A header and continue
is in the "last EXIT [Any instruction]
in" element.
The PERFORM LOCKED OPERATION instruction The enqueueing of N can be done by means of
can be used in a multiprogramming or multiproc- the following steps:
essing environment to perform compare, load, 1. Obtain consistent values of S, H, and C,
compare-and-swap, and store operations on two meaning obtain S and obtain the H and C that
or more discontiguous locations that can be words are consistent with that value of S.
or doublewords. The operations are performed as
an atomic set of operations under the control of a 2. Store H in N.F.
lock that is held only for the duration of the exe- 3. By means of PLO.csdst (PERFORM LOCKED
cution of a single PERFORM LOCKED OPERA- OPERATION performing compare and swap
TION instruction, as opposed to across the and double store), with S as the swap variable
execution of multiple instructions. Since lock con- and H and C as the store variables, add one
tention is resolved by the CPU and is very brief, to S, set H to A(N), and add one to C, pro-
the program need not include a method for vided that S still has the value obtained in
dealing with the case when the lock to be used is step 1. If S has already been changed, go
held by a program being executed by another back to step 1.
CPU. Also, there need be no concern that the
program may be interrupted while it holds a lock, Consistent values of S, H, and C cannot neces-
since PERFORM LOCKED OPERATION will com- sarily be obtained simply by using three LOAD
plete its operation and release its lock before an instructions because a PERFORM LOCKED
interruption can occur. OPERATION instruction being executed by
another CPU may have completed an update of S
PERFORM LOCKED OPERATION can be thought but not yet of H or C. In this case, the three
of as performing concurrent interlocked updates of LOAD instructions will obtain the new S but the
multiple operands. However, the instruction does old H or C. However, as will be described, it may
not actually perform any interlocked update, and a be possible to use three LOAD instructions.
serially reusable resource cannot be updated pre-
dictably through the use of both PERFORM If S is obtained while holding the lock, meaning by
LOCKED OPERATION and conditional-swapping means of PERFORM LOCKED OPERATION, then
instructions (CS and CDS). H and C can be obtained by LOAD instructions
since no other CPU can subsequently change H
Following is an example of how PERFORM or C without changing S, as observed when the
LOCKED OPERATION can be used to add an lock is held.
element at the beginning of a queue.
The parameter list used by the PLO.csdst is as
Assume the following variables associated with follows, assuming the access-register mode is not
the queue: S, which is a sequence number that is used:
2
3
C-F This chaining field is initially
zero. At the completion of the
merge, this field is to contain the
address of the next record in the
6 6 6 6
merged sequence.
4 5 6 7
The merge process forms a single sorted
sequence from five input sequences, each of
6 6 6 6 6 6 6 6
which is in sorted order. This process can be
8 9 1 11 12 13 14 15 subdivided into three steps:
1. A priming step takes the first record from each
6 6 6 6 6 6 of the five input sequences and places them
in the tree data structure. For each record to
16171819221
be introduced into the tree, first its codeword
Figure A-5. Schematic Diagram of Merge Control Tree value is computed with respect to the lowest
with 21 Nodes possible key value of all zeros. This
codeword, with a second word which contains
the address of the actual record, forms a
Example of Use of Sort doubleword node value that can be placed at
Instructions the appropriate node. After priming, the node
values, one each from each of the five input
An example illustrates how the instructions sequences, will have been placed in the tree
UPDATE TREE and COMPARE AND FORM so that each of the four internal nodes con-
CODEWORD may be used in the merge operation tains one node value and the node value for a
within a sort program. A five-way merge requires winner record has emerged from the root of
a tree data structure with four internal nodes and the tree.
five terminal-node positions. The schematic
diagram shown later in this section illustrates such 2. After each winner emerges from the tree, the
a tree, containing four internal nodes (not counting main merge process is performed repeatedly.
the dummy node) and five input sequences for a Each iteration introduces the node value for
merge, one sequence at each terminal-node posi- one new record into the tree and produces a
tion. Each record in an input sequence in the node value for a new winner record. The tree
diagram is indicated by its address. The actual plus the winner must at all times contain pre-
record contents are shown in Figure A-7 on cisely one node value from each input
page A-57. Each record contains 16 bytes, con- sequence being merged. Therefore, the new
sisting of the following fields: node value that is introduced into the tree on
each iteration must come from the same input
sequence from which the winner node value in
the preceding iteration originated.
3. When the node value for the last record of an
input sequence emerges as a winner, there is
no successor record from that input sequence
to be introduced into the tree on the next iter-
ation. Hence, the order of the merge must be
reduced by one for each such occurrence.
13 3 2 8 1 7 1 4
14 4 3 1 B 1 5
15 5 3 8 1 9 1 6
16 F 4 8 1 A 1 8
17 1F F F F 2 8 1 D 1 9
18 1F F F F 4 1 F 1 7
19 F F F F 3 8 1 E 1 A
1A F F F F 1 4 8 1 1 1 B
1B F F F F 2 3 1 C 1 C
1C F F F F 2 3 1 1 4 1 D
1D 1 2 8 1 1 1 1 E
1E 8 3 8 1 1 3 1 F
1F 8 2 4 4 1 1 2 1 1
11 8 2 5 4 8 1 1 4 1 1 1
111 8 3 2 8 1 1 4 1 1 2
112 9 4 1 1 4 1 1 3
113 F F F FF F F FF F F E 3 8 1 5
114 F F F FF F F FF F F F 1 3
Loc INSTR GR GR1 GR2 GR3 GR4 GR5 GR6 Loc Instruction
4FFFE186FFFA156FFF166FFFB146FFFC13
1738215Branch
EXECUTE EX RX AI SP EX 44 7-8
EXTRACT ACCESS EAR RRE UB24F7-81
EXTRACT AND SET EXTENDED AUTHORITY ESEA RRE N P B99D1-2
EXTRACT FPC EFPC RRE Db B38C19-34
EXTRACT PRIMARY ASN EPAR RRE Q SO B2261-2
OR (32) OR RR C 16 7-11
OR (32) O RX C A B56 7-11
OR (64) OGR RRE C N B9817-11
OR (64) OG RXE C N A BE3817-11
OR IMMEDIATE (high high) OIHH RI C N A58 7-111
CXFR CONVERT FROM FIXED (32 to ext. HFP) RRE SPDa B3B618-11
CXGBRCONVERT FROM FIXED (64 to ext. BFP) RRE N SPDb B3A619-26
CXGR CONVERT FROM FIXED (64 to ext. HFP) RRE N SPDa B3C618-11
CXR COMPARE (extended HFP) RRE C SPDa B36918-1
D DIVIDE (32<64) RX A SP IK B5D 7-77