IBM Library Server Print Preview
DOCNUM = SA22-7201-04 DATETIME = 06/13/97 13:18:22 BLDVERS = 1.3.0 TITLE = ESA/390 Principles of Operation AUTHOR = COPYR = © Copyright IBM Corp. 1990, 1991, 1993, 1994, 1996, 1997 PATH = /home/webapps/epubs/htdocs/book
Enterprise Systems Architecture/390Principles of Operation
Document Number SA22-7201-04
File Number S390-01
___ Note: __________________________________________________________ | | | Before using this information and the product it supports, be sure | | to read the general information under "Notices" in topic FRONT_1. | | | |____________________________________________________________________|
___ 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 edition obsoletes and replaces Enterprise Systems Architecture/390 Principles of Operation, SA22-7201-03.
Fifth Edition (June 1997)
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:
© Copyright International Business Machines Corporation 1990, 1991, 1993, 1994, 1996, 1997. All rights reserved.
Note to U.S. Government Users -- Documentation related to restricted rights -- Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp.
Summarize COVER Book Cover NOTICES Notices EDITION Edition Notice CONTENTS Table of Contents FRONT_1 Notices FRONT_1.1 Trademarks PREFACE Preface PREFACE.1 Size Notation PREFACE.2 Bytes, Characters, and Codes PREFACE.3 Other Publications PREFACE.4 Summary of Changes in Fifth Edition PREFACE.5 Summary of Changes in Fourth Edition PREFACE.6 Summary of Changes in Third Edition PREFACE.7 Summary of Changes in Second Edition 1.0 Chapter 1. Introduction 1.1 Highlights of ESA/390 1.1.1 The ESA/370 and 370-XA Base 1.2 System Program 1.3 Compatibility 1.3.1 Compatibility among ESA/390 Systems 1.3.2 Compatibility among ESA/390, ESA/370, 370-XA, and System/370 1.3.2.1 Control-Program Compatibility 1.3.2.2 Problem-State Compatibility 1.4 Availability 2.0 Chapter 2. Organization 2.1 Main Storage 2.2 Expanded Storage 2.3 CPU 2.3.1 PSW 2.3.2 General Registers 2.3.3 Floating-Point Registers 2.3.4 Control Registers 2.3.5 Access Registers 2.3.6 Vector Facility 2.3.7 Cryptographic Facility 2.4 External Time Reference 2.5 I/O 2.5.1 Channel Subsystem 2.5.2 Channel Paths 2.5.3 I/O Devices and Control Units 2.6 Operator Facilities 3.0 Chapter 3. Storage 3.1 Storage Addressing 3.1.1 Information Formats 3.1.2 Integral Boundaries 3.2 Address Types and Formats 3.2.1 Address Types 3.2.1.1 Absolute Address 3.2.1.2 Real Address 3.2.1.3 Virtual Address 3.2.1.4 Primary Virtual Address 3.2.1.5 Secondary Virtual Address 3.2.1.6 AR-Specified Virtual Address 3.2.1.7 Home Virtual Address 3.2.1.8 Logical Address 3.2.1.9 Instruction Address 3.2.1.10 Effective Address 3.2.2 Address Size and Wraparound 3.2.2.1 Address Wraparound 3.3 Storage Key 3.4 Protection 3.4.1 Key-Controlled Protection 3.4.1.1 Storage-Protection-Override Control 3.4.1.2 Fetch-Protection-Override Control 3.4.2 Access-List-Controlled Protection 3.4.3 Page Protection 3.4.4 Low-Address Protection 3.4.5 Suppression on Protection 3.5 Reference Recording 3.6 Change Recording 3.7 Prefixing 3.8 Address Spaces 3.8.1 Changing to Different Address Spaces 3.8.2 Address-Space Number 3.9 ASN Translation 3.9.1 ASN-Translation Controls 3.9.1.1 Control Register 14 3.9.1.2 Control Register 0 3.9.2 ASN-Translation Tables 3.9.2.1 ASN-First-Table Entries 3.9.2.2 ASN-Second-Table Entries 3.9.3 ASN-Translation Process 3.9.3.1 ASN-First-Table Lookup 3.9.3.2 ASN-Second-Table Lookup 3.9.3.3 Recognition of Exceptions during ASN Translation 3.10 ASN Authorization 3.10.1 ASN-Authorization Controls 3.10.1.1 Control Register 4 3.10.1.2 ASN-Second-Table Entry 3.10.2 Authority-Table Entries 3.10.3 ASN-Authorization Process 3.10.3.1 Authority-Table Lookup 3.10.3.2 Recognition of Exceptions during ASN Authorization 3.11 Dynamic Address Translation 3.11.1 Translation Control 3.11.1.1 Translation Modes 3.11.1.2 Control Register 0 3.11.1.3 Control Register 1 3.11.1.4 Control Register 7 3.11.1.5 Control Register 13 3.11.2 Translation Tables 3.11.2.1 Segment-Table Entries 3.11.2.2 Page-Table Entries 3.11.2.3 Summary of Segment-Table and Page-Table Sizes 3.11.3 Translation Process 3.11.3.1 Effective Segment-Table Designation 3.11.3.2 Inspection of Control Register 0 3.11.3.3 Segment-Table Lookup 3.11.3.4 Page-Table Lookup 3.11.3.5 Formation of the Real Address 3.11.3.6 Recognition of Exceptions during Translation 3.11.4 Translation-Lookaside Buffer 3.11.4.1 TLB Structure 3.11.4.2 Formation of TLB Entries 3.11.4.3 Use of TLB Entries 3.11.4.4 Modification of Translation Tables 3.12 Address Summary 3.12.1 Addresses Translated 3.12.2 Handling of Addresses 3.13 Assigned Storage Locations 4.0 Chapter 4. Control 4.1 Stopped, Operating, Load, and Check-Stop States 4.1.1 Stopped State 4.1.2 Operating State 4.1.3 Load State 4.1.4 Check-Stop State 4.2 Program-Status Word 4.2.1 Program-Status-Word Format 4.3 Control Registers 4.4 Tracing 4.4.1 Control-Register Allocation 4.4.2 Trace Entries 4.4.3 Operation 4.5 Program-Event Recording 4.5.1 Control-Register Allocation and Segment-Table Designation 4.5.2 Operation 4.5.2.1 Identification of Cause 4.5.2.2 Priority of Indication 4.5.3 Storage-Area Designation 4.5.4 PER Events 4.5.4.1 Successful Branching 4.5.4.2 Instruction Fetching 4.5.4.3 Storage Alteration 4.5.4.4 General-Register Alteration 4.5.4.5 Store Using Real Address 4.5.5 Indication of PER Events Concurrently with Other Interruption Conditions 4.6 Timing 4.6.1 Time-of-Day Clock 4.6.1.1 Format 4.6.1.2 States 4.6.1.3 Changes in Clock State 4.6.1.4 Setting and Inspecting the Clock 4.6.2 TOD-Clock Synchronization 4.6.3 Clock Comparator 4.6.4 CPU Timer 4.7 Externally Initiated Functions 4.7.1 Resets 4.7.1.1 CPU Reset 4.7.1.2 Initial CPU Reset 4.7.1.3 Subsystem Reset 4.7.1.4 Clear Reset 4.7.1.5 Power-On Reset 4.7.2 Initial Program Loading 4.7.3 Store Status 4.8 Multiprocessing 4.8.1 Shared Main Storage 4.8.2 CPU-Address Identification 4.9 CPU Signaling and Response 4.9.1 Signal-Processor Orders 4.9.2 Conditions Determining Response 4.9.2.1 Conditions Precluding Interpretation of the Order Code 4.9.2.2 Status Bits 5.0 Chapter 5. Program Execution 5.1 Instructions 5.1.1 Operands 5.1.2 Instruction Formats 5.1.2.1 Register Operands 5.1.2.2 Immediate Operands 5.1.2.3 Storage Operands 5.2 Address Generation 5.2.1 Bimodal Addressing 5.2.2 Sequential Instruction-Address Generation 5.2.3 Operand-Address Generation 5.2.3.1 Formation of the Intermediate Value 5.2.3.2 Formation of the Operand Address 5.2.4 Branch-Address Generation 5.2.4.1 Formation of the Intermediate Value 5.2.4.2 Formation of the Branch Address 5.3 Instruction Execution and Sequencing 5.3.1 Decision Making 5.3.2 Loop Control 5.3.3 Subroutine Linkage without the Linkage Stack 5.3.4 Interruptions 5.3.5 Types of Instruction Ending 5.3.5.1 Completion 5.3.5.2 Suppression 5.3.5.3 Nullification 5.3.5.4 Termination 5.3.6 Interruptible Instructions 5.3.6.1 Point of Interruption 5.3.6.2 Unit of Operation 5.3.6.3 Execution of Interruptible Instructions 5.3.6.4 Condition-Code Alternative to Interruptibility 5.3.7 Exceptions to Nullification and Suppression 5.3.7.1 Storage Change and Restoration for DAT-Associated Access Exceptions 5.3.7.2 Modification of DAT-Table Entries 5.3.7.3 Trial Execution for Editing Instructions and Translate Instruction 5.4 Authorization Mechanisms 5.4.1 Mode Requirements 5.4.2 Extraction-Authority Control 5.4.3 PSW-Key Mask 5.4.4 Secondary-Space Control 5.4.5 Subsystem-Linkage Control 5.4.6 ASN-Translation Control 5.4.7 Authorization Index 5.4.8 Access-Register and Linkage-Stack Mechanisms 5.5 PC-Number Translation 5.5.1 PC-Number Translation Control 5.5.1.1 Control Register 0 5.5.1.2 Control Register 5 5.5.2 PC-Number Translation Tables 5.5.2.1 Linkage-Table Entries 5.5.2.2 Entry-Table Entries 5.5.3 PC-Number-Translation Process 5.5.3.1 Obtaining the Linkage-Table Designation 5.5.3.2 Linkage-Table Lookup 5.5.3.3 Entry-Table Lookup 5.5.3.4 Recognition of Exceptions during PC-Number Translation 5.6 Home Address Space 5.7 Access-Register Introduction 5.7.1 Summary 5.7.2 Access-Register Functions 5.7.2.1 Access-Register-Specified Address Spaces 5.7.2.2 Access-Register Instructions 5.8 Access-Register Translation 5.8.1 Access-Register-Translation Control 5.8.1.1 Address-Space-Function Control 5.8.1.2 Control Register 2 5.8.1.3 Control Register 5 5.8.1.4 Control Register 8 5.8.2 Access Registers 5.8.3 Access-Register-Translation Tables 5.8.3.1 Access-List Designations 5.8.3.2 Access-List Entries 5.8.3.3 Extended ASN-Second-Table Entries 5.8.4 Access-Register-Translation Process 5.8.4.1 Selecting the Access-List-Entry Token 5.8.4.2 Obtaining the Primary or Secondary Segment-Table Designation 5.8.4.3 Checking the First Byte of the ALET 5.8.4.4 Obtaining the Effective Access-List Designation 5.8.4.5 Access-List Lookup 5.8.4.6 Locating the ASN-Second-Table Entry 5.8.4.7 Authorizing the Use of the Access-List Entry 5.8.4.8 Checking for Access-List-Controlled Protection 5.8.4.9 Obtaining the Segment-Table Designation from the ASN-Second-Table Entry 5.8.4.10 Recognition of Exceptions during Access-Register Translation 5.8.5 ART-Lookaside Buffer 5.8.5.1 ALB Structure 5.8.5.2 Formation of ALB Entries 5.8.5.3 Modification of ART Tables 5.9 Subspace Groups 5.9.1 Subspace-Group Tables 5.9.1.1 Subspace-Group Dispatchable-Unit Control Table 5.9.1.2 Subspace-Group ASN-Second-Table Entries 5.9.2 Subspace-Replacement Operations 5.10 Linkage-Stack Introduction 5.10.1 Summary 5.10.2 Linkage-Stack Functions 5.10.2.1 Transferring Program Control 5.10.2.2 Branching Using the Linkage Stack 5.10.2.3 Adding and Retrieving Information 5.10.2.4 Testing Authorization 5.10.2.5 Program-Problem Analysis 5.11 Extended Entry-Table Entries 5.12 Linkage-Stack Operations 5.12.1 Linkage-Stack-Operations Control 5.12.1.1 Control Register 0 5.12.1.2 Control Register 15 5.12.2 Linkage Stack 5.12.2.1 Entry Descriptors 5.12.2.2 Header Entries 5.12.2.3 Trailer Entries 5.12.2.4 State Entries 5.12.3 Stacking Process 5.12.3.1 Locating Space for a New Entry 5.12.3.2 Forming the New Entry 5.12.3.3 Updating the Current Entry 5.12.3.4 Updating Control Register 15 5.12.3.5 Recognition of Exceptions during the Stacking Process 5.12.4 Unstacking Process 5.12.4.1 Locating the Current Entry and Processing a Header Entry 5.12.4.2 Checking for a State Entry 5.12.4.3 Restoring Information 5.12.4.4 Updating the Preceding Entry 5.12.4.5 Updating Control Register 15 5.12.4.6 Recognition of Exceptions during the Unstacking Process 5.13 Sequence of Storage References 5.13.1 Conceptual Sequence 5.13.2 Overlapped Operation of Instruction Execution 5.13.3 Divisible Instruction Execution 5.13.4 Interlocks for Virtual-Storage References 5.13.4.1 Interlocks between Instructions 5.13.4.2 Interlocks within a Single Instruction 5.13.5 Instruction Fetching 5.13.6 ART-Table and DAT-Table Fetches 5.13.7 Storage-Key Accesses 5.13.8 Storage-Operand References 5.13.8.1 Storage-Operand Fetch References 5.13.8.2 Storage-Operand Store References 5.13.8.3 Storage-Operand Update References 5.13.9 Storage-Operand Consistency 5.13.9.1 Single-Access References 5.13.9.2 Multiple-Access References 5.13.9.3 Block-Concurrent References 5.13.9.4 Consistency Specification 5.13.10 Relation between Operand Accesses 5.13.11 Other Storage References 5.14 Serialization 5.14.1 CPU Serialization 5.14.2 Channel-Program Serialization 6.0 Chapter 6. Interruptions 6.1 Interruption Action 6.1.1 Interruption Code 6.1.2 Enabling and Disabling 6.1.3 Handling of Floating Interruption Conditions 6.1.4 Instruction-Length Code 6.1.4.1 Zero ILC 6.1.4.2 ILC on Instruction-Fetching Exceptions 6.1.5 Exceptions Associated with the PSW 6.1.5.1 Early Exception Recognition 6.1.5.2 Late Exception Recognition 6.2 External Interruption 6.2.1 Clock Comparator 6.2.2 CPU Timer 6.2.3 Emergency Signal 6.2.4 External Call 6.2.5 Interrupt Key 6.2.6 Malfunction Alert 6.2.7 Service Signal 6.2.8 TOD-Clock Sync Check 6.3 I/O Interruption 6.4 Machine-Check Interruption 6.5 Program Interruption 6.5.1 Exception-Extension Code 6.5.2 Program-Interruption Conditions 6.5.2.1 Addressing Exception 6.5.2.2 AFX-Translation Exception 6.5.2.3 ALEN-Translation Exception 6.5.2.4 ALE-Sequence Exception 6.5.2.5 ALET-Specification Exception 6.5.2.6 ASN-Translation-Specification Exception 6.5.2.7 ASTE-Sequence Exception 6.5.2.8 ASTE-Validity Exception 6.5.2.9 ASX-Translation Exception 6.5.2.10 Data Exception 6.5.2.11 Decimal-Divide Exception 6.5.2.12 Decimal-Overflow Exception 6.5.2.13 Execute Exception 6.5.2.14 Exponent-Overflow Exception 6.5.2.15 Exponent-Underflow Exception 6.5.2.16 EX-Translation Exception 6.5.2.17 Extended-Authority Exception 6.5.2.18 Fixed-Point-Divide Exception 6.5.2.19 Fixed-Point-Overflow Exception 6.5.2.20 Floating-Point-Divide Exception 6.5.2.21 LX-Translation Exception 6.5.2.22 Monitor Event 6.5.2.23 Operand Exception 6.5.2.24 Operation Exception 6.5.2.25 Page-Translation Exception 6.5.2.26 PC-Translation-Specification Exception 6.5.2.27 PER Event 6.5.2.28 Primary-Authority Exception 6.5.2.29 Privileged-Operation Exception 6.5.2.30 Protection Exception 6.5.2.31 Secondary-Authority Exception 6.5.2.32 Segment-Translation Exception 6.5.2.33 Significance Exception 6.5.2.34 Space-Switch Event 6.5.2.35 Special-Operation Exception 6.5.2.36 Specification Exception 6.5.2.37 Square-Root Exception 6.5.2.38 Stack-Empty Exception 6.5.2.39 Stack-Full Exception 6.5.2.40 Stack-Operation Exception 6.5.2.41 Stack-Specification Exception 6.5.2.42 Stack-Type Exception 6.5.2.43 Trace-Table Exception 6.5.2.44 Translation-Specification Exception 6.5.2.45 Unnormalized-Operand Exception 6.5.2.46 Vector-Operation Exception 6.5.3 Collective Program-Interruption Names 6.5.4 Recognition of Access Exceptions 6.5.5 Multiple Program-Interruption Conditions 6.5.5.1 Access Exceptions 6.5.5.2 ASN-Translation Exceptions 6.5.5.3 Subspace-Replacement Exceptions 6.5.5.4 Trace Exceptions 6.6 Restart Interruption 6.7 Supervisor-Call Interruption 6.8 Priority of Interruptions 7.0 Chapter 7. General Instructions 7.1 Data Format 7.2 Binary-Integer Representation 7.3 Binary Arithmetic 7.3.1 Signed Binary Arithmetic 7.3.1.1 Addition and Subtraction 7.3.1.2 Fixed-Point Overflow 7.3.2 Unsigned Binary Arithmetic 7.4 Signed and Logical Comparison 7.5 Instructions 7.5.1 ADD 7.5.2 ADD HALFWORD 7.5.3 ADD HALFWORD IMMEDIATE 7.5.4 ADD LOGICAL 7.5.5 AND 7.5.6 BRANCH AND LINK 7.5.7 BRANCH AND SAVE 7.5.8 BRANCH AND SAVE AND SET MODE 7.5.9 BRANCH AND SET MODE 7.5.10 BRANCH ON CONDITION 7.5.11 BRANCH ON COUNT 7.5.12 BRANCH ON INDEX HIGH 7.5.13 BRANCH ON INDEX LOW OR EQUAL 7.5.14 BRANCH RELATIVE AND SAVE 7.5.15 BRANCH RELATIVE ON CONDITION 7.5.16 BRANCH RELATIVE ON COUNT 7.5.17 BRANCH RELATIVE ON INDEX HIGH 7.5.18 BRANCH RELATIVE ON INDEX LOW OR EQUAL 7.5.19 CHECKSUM 7.5.20 COMPARE 7.5.21 COMPARE AND FORM CODEWORD 7.5.22 COMPARE AND SWAP 7.5.23 COMPARE DOUBLE AND SWAP 7.5.24 COMPARE HALFWORD 7.5.25 COMPARE HALFWORD IMMEDIATE 7.5.26 COMPARE LOGICAL 7.5.27 COMPARE LOGICAL CHARACTERS UNDER MASK 7.5.28 COMPARE LOGICAL LONG 7.5.29 COMPARE LOGICAL LONG EXTENDED 7.5.30 COMPARE LOGICAL STRING 7.5.31 COMPARE UNTIL SUBSTRING EQUAL 7.5.32 CONVERT TO BINARY 7.5.33 CONVERT TO DECIMAL 7.5.34 COPY ACCESS 7.5.35 DIVIDE 7.5.36 EXCLUSIVE OR 7.5.37 EXECUTE 7.5.38 EXTRACT ACCESS 7.5.39 INSERT CHARACTER 7.5.40 INSERT CHARACTERS UNDER MASK 7.5.41 INSERT PROGRAM MASK 7.5.42 LOAD 7.5.43 LOAD ACCESS MULTIPLE 7.5.44 LOAD ADDRESS 7.5.45 LOAD ADDRESS EXTENDED 7.5.46 LOAD AND TEST 7.5.47 LOAD COMPLEMENT 7.5.48 LOAD HALFWORD 7.5.49 LOAD HALFWORD IMMEDIATE 7.5.50 LOAD MULTIPLE 7.5.51 LOAD NEGATIVE 7.5.52 LOAD POSITIVE 7.5.53 MONITOR CALL 7.5.54 MOVE 7.5.55 MOVE INVERSE 7.5.56 MOVE LONG 7.5.57 MOVE LONG EXTENDED 7.5.58 MOVE NUMERICS 7.5.59 MOVE PAGE (Facility 1) 7.5.60 MOVE STRING 7.5.61 MOVE WITH OFFSET 7.5.62 MOVE ZONES 7.5.63 MULTIPLY 7.5.64 MULTIPLY HALFWORD 7.5.65 MULTIPLY HALFWORD IMMEDIATE 7.5.66 MULTIPLY SINGLE 7.5.67 OR 7.5.68 PACK 7.5.69 PERFORM LOCKED OPERATION 7.5.70 SEARCH STRING 7.5.71 SET ACCESS 7.5.72 SET PROGRAM MASK 7.5.73 SHIFT LEFT DOUBLE 7.5.74 SHIFT LEFT DOUBLE LOGICAL 7.5.75 SHIFT LEFT SINGLE 7.5.76 SHIFT LEFT SINGLE LOGICAL 7.5.77 SHIFT RIGHT DOUBLE 7.5.78 SHIFT RIGHT DOUBLE LOGICAL 7.5.79 SHIFT RIGHT SINGLE 7.5.80 SHIFT RIGHT SINGLE LOGICAL 7.5.81 STORE 7.5.82 STORE ACCESS MULTIPLE 7.5.83 STORE CHARACTER 7.5.84 STORE CHARACTERS UNDER MASK 7.5.85 STORE CLOCK 7.5.86 STORE HALFWORD 7.5.87 STORE MULTIPLE 7.5.88 SUBTRACT 7.5.89 SUBTRACT HALFWORD 7.5.90 SUBTRACT LOGICAL 7.5.91 SUPERVISOR CALL 7.5.92 TEST AND SET 7.5.93 TEST UNDER MASK 7.5.94 TEST UNDER MASK HIGH 7.5.95 TEST UNDER MASK LOW 7.5.96 TRANSLATE 7.5.97 TRANSLATE AND TEST 7.5.98 UNPACK 7.5.99 UPDATE TREE 8.0 Chapter 8. Decimal Instructions 8.1 Decimal-Number Formats 8.1.1 Zoned Format 8.1.2 Packed Format 8.1.3 Decimal Codes 8.2 Decimal Operations 8.2.1 Decimal-Arithmetic Instructions 8.2.2 Editing Instructions 8.2.3 Execution of Decimal Instructions 8.2.4 Other Instructions for Decimal Operands 8.3 Instructions 8.3.1 ADD DECIMAL 8.3.2 COMPARE DECIMAL 8.3.3 DIVIDE DECIMAL 8.3.4 EDIT 8.3.5 EDIT AND MARK 8.3.6 MULTIPLY DECIMAL 8.3.7 SHIFT AND ROUND DECIMAL 8.3.8 SUBTRACT DECIMAL 8.3.9 ZERO AND ADD 9.0 Chapter 9. Floating-Point Instructions 9.1 Floating-Point Number Representation 9.2 Normalization 9.3 Floating-Point-Data Format 9.4 Instructions 9.4.1 ADD NORMALIZED 9.4.2 ADD UNNORMALIZED 9.4.3 COMPARE 9.4.4 DIVIDE 9.4.5 HALVE 9.4.6 LOAD 9.4.7 LOAD AND TEST 9.4.8 LOAD COMPLEMENT 9.4.9 LOAD NEGATIVE 9.4.10 LOAD POSITIVE 9.4.11 LOAD ROUNDED 9.4.12 MULTIPLY 9.4.13 SQUARE ROOT 9.4.14 STORE 9.4.15 SUBTRACT NORMALIZED 9.4.16 SUBTRACT UNNORMALIZED 10.0 Chapter 10. Control Instructions 10.1 BRANCH AND SET AUTHORITY 10.2 BRANCH AND STACK 10.3 BRANCH IN SUBSPACE GROUP 10.4 DIAGNOSE 10.5 EXTRACT PRIMARY ASN 10.6 EXTRACT SECONDARY ASN 10.7 EXTRACT STACKED REGISTERS 10.8 EXTRACT STACKED STATE 10.9 INSERT ADDRESS SPACE CONTROL 10.10 INSERT PSW KEY 10.11 INSERT STORAGE KEY EXTENDED 10.12 INSERT VIRTUAL STORAGE KEY 10.13 INVALIDATE PAGE TABLE ENTRY 10.14 LOAD ADDRESS SPACE PARAMETERS 10.15 LOAD CONTROL 10.16 LOAD PSW 10.17 LOAD REAL ADDRESS 10.18 LOAD USING REAL ADDRESS 10.19 MODIFY STACKED STATE 10.20 MOVE PAGE (Facility 2) 10.21 MOVE TO PRIMARY 10.22 MOVE TO SECONDARY 10.23 MOVE WITH DESTINATION KEY 10.24 MOVE WITH KEY 10.25 MOVE WITH SOURCE KEY 10.26 PROGRAM CALL 10.27 PROGRAM RETURN 10.28 PROGRAM TRANSFER 10.29 PURGE ALB 10.30 PURGE TLB 10.31 RESET REFERENCE BIT EXTENDED 10.32 SET ADDRESS SPACE CONTROL 10.33 SET ADDRESS SPACE CONTROL FAST 10.34 SET CLOCK 10.35 SET CLOCK COMPARATOR 10.36 SET CPU TIMER 10.37 SET PREFIX 10.38 SET PSW KEY FROM ADDRESS 10.39 SET SECONDARY ASN 10.40 SET STORAGE KEY EXTENDED 10.41 SET SYSTEM MASK 10.42 SIGNAL PROCESSOR 10.43 STORE CLOCK COMPARATOR 10.44 STORE CONTROL 10.45 STORE CPU ADDRESS 10.46 STORE CPU ID 10.47 STORE CPU TIMER 10.48 STORE PREFIX 10.49 STORE THEN AND SYSTEM MASK 10.50 STORE THEN OR SYSTEM MASK 10.51 STORE USING REAL ADDRESS 10.52 TEST ACCESS 10.53 TEST BLOCK 10.54 TEST PROTECTION 10.55 TRACE 11.0 Chapter 11. Machine-Check Handling 11.1 Machine-Check Detection 11.2 Correction of Machine Malfunctions 11.2.1 Error Checking and Correction 11.2.2 CPU Retry 11.2.2.1 Effects of CPU Retry 11.2.2.2 Checkpoint Synchronization 11.2.2.3 Handling of Machine Checks during Checkpoint Synchronization 11.2.2.4 Checkpoint-Synchronization Operations 11.2.2.5 Checkpoint-Synchronization Action 11.2.3 Channel-Subsystem Recovery 11.2.4 Unit Deletion 11.3 Handling of Machine Checks 11.3.1 Validation 11.3.2 Invalid CBC in Storage 11.3.2.1 Programmed Validation of Storage 11.3.3 Invalid CBC in Storage Keys 11.3.4 Invalid CBC in Registers 11.4 Check-Stop State 11.4.1 System Check Stop 11.5 Machine-Check Interruption 11.5.1 Exigent Conditions 11.5.2 Repressible Conditions 11.5.3 Interruption Action 11.5.4 Point of Interruption 11.6 Machine-Check-Interruption Code 11.6.1 Subclass 11.6.1.1 System Damage 11.6.1.2 Instruction-Processing Damage 11.6.1.3 System Recovery 11.6.1.4 Timing-Facility Damage 11.6.1.5 External Damage 11.6.1.6 Vector-Facility Failure 11.6.1.7 Degradation 11.6.1.8 Warning 11.6.1.9 Channel Report Pending 11.6.1.10 Service-Processor Damage 11.6.1.11 Channel-Subsystem Damage 11.6.2 Subclass Modifiers 11.6.2.1 Vector-Facility Source 11.6.2.2 Backed Up 11.6.2.3 Delayed Access Exception 11.6.2.4 Ancillary Report 11.6.3 Synchronous Machine-Check-Interruption Conditions 11.6.3.1 Processing Backup 11.6.3.2 Processing Damage 11.6.4 Storage Errors 11.6.4.1 Storage Error Uncorrected 11.6.4.2 Storage Error Corrected 11.6.4.3 Storage-Key Error Uncorrected 11.6.4.4 Storage Degradation 11.6.4.5 Indirect Storage Error 11.6.5 Machine-Check Interruption-Code Validity Bits 11.6.5.1 PSW-MWP Validity 11.6.5.2 PSW Mask and Key Validity 11.6.5.3 PSW Program-Mask and Condition-Code Validity 11.6.5.4 PSW-Instruction-Address Validity 11.6.5.5 Failing-Storage-Address Validity 11.6.5.6 External-Damage-Code Validity 11.6.5.7 Floating-Point-Register Validity 11.6.5.8 General-Register Validity 11.6.5.9 Control-Register Validity 11.6.5.10 Storage Logical Validity 11.6.5.11 Access-Register Validity 11.6.5.12 CPU-Timer Validity 11.6.5.13 Clock-Comparator Validity 11.7 Machine-Check Extended Interruption Information 11.7.1 Register-Save Areas 11.7.2 External-Damage Code 11.7.3 Failing-Storage Address 11.8 Handling of Machine-Check Conditions 11.8.1 Floating Interruption Conditions 11.8.1.1 Floating Machine-Check-Interruption Conditions 11.8.1.2 Floating I/O Interruptions 11.9 Machine-Check Masking 11.9.1 Channel-Report-Pending Subclass Mask 11.9.2 Recovery Subclass Mask 11.9.3 Degradation Subclass Mask 11.9.4 External-Damage Subclass Mask 11.9.5 Warning Subclass Mask 11.10 Machine-Check Logout 11.11 Summary of Machine-Check Masking 12.0 Chapter 12. Operator Facilities 12.1 Manual Operation 12.2 Basic Operator Facilities 12.2.1 Address-Compare Controls 12.2.2 Alter-and-Display Controls 12.2.3 Architectural-Mode Indicator 12.2.4 Architectural-Mode-Selection Controls 12.2.5 Check-Stop Indicator 12.2.6 IML Controls 12.2.7 Interrupt Key 12.2.8 Load Indicator 12.2.9 Load-Clear Key 12.2.10 Load-Normal Key 12.2.11 Load-Unit-Address Controls 12.2.12 Manual Indicator 12.2.13 Power Controls 12.2.14 Rate Control 12.2.15 Restart Key 12.2.16 Start Key 12.2.17 Stop Key 12.2.18 Store-Status Key 12.2.19 System-Reset-Clear Key 12.2.20 System-Reset-Normal Key 12.2.21 Test Indicator 12.2.22 TOD-Clock Control 12.2.23 Wait Indicator 12.3 Multiprocessing Configurations 13.0 Chapter 13. I/O Overview 13.1 Input/Output (I/O) 13.2 The Channel Subsystem 13.2.1 Subchannels 13.3 Attachment of Input/Output Devices 13.3.1 Channel Paths 13.3.2 Control Units 13.3.3 I/O Devices 13.4 I/O Addressing 13.4.1 Channel-Path Identifier 13.4.2 Subchannel Number 13.4.3 Device Number 13.4.4 Device Identifier 13.5 Execution of I/O Operations 13.5.1 Start-Function Initiation 13.5.2 Path Management 13.5.3 Channel-Program Execution 13.5.4 Conclusion of I/O Operations 13.5.5 I/O Interruptions 14.0 Chapter 14. I/O Instructions 14.1 I/O-Instruction Formats 14.2 I/O-Instruction Execution 14.2.1 Serialization 14.2.2 Operand Access 14.2.3 Condition Code 14.2.4 Program Exceptions 14.3 Instructions 14.3.1 CLEAR SUBCHANNEL 14.3.2 HALT SUBCHANNEL 14.3.3 MODIFY SUBCHANNEL 14.3.4 RESET CHANNEL PATH 14.3.5 RESUME SUBCHANNEL 14.3.6 SET ADDRESS LIMIT 14.3.7 SET CHANNEL MONITOR 14.3.8 START SUBCHANNEL 14.3.9 STORE CHANNEL PATH STATUS 14.3.10 STORE CHANNEL REPORT WORD 14.3.11 STORE SUBCHANNEL 14.3.12 TEST PENDING INTERRUPTION 14.3.13 TEST SUBCHANNEL 15.0 Chapter 15. Basic I/O Functions 15.1 Control of Basic I/O Functions 15.1.1 Subchannel-Information Block 15.1.1.1 Path-Management-Control Word 15.1.1.2 Subchannel-Status Word 15.1.1.3 Model-Dependent Area 15.1.1.4 Summary of Modifiable Fields 15.2 Channel-Path Allegiance 15.2.1 Working Allegiance 15.2.2 Active Allegiance 15.2.3 Dedicated Allegiance 15.2.4 Channel-Path Availability 15.2.5 Control-Unit Type 15.3 Clear Function 15.3.1 Clear-Function Path Management 15.3.2 Clear-Function Subchannel Modification 15.3.3 Clear-Function Signaling and Completion 15.4 Halt Function 15.4.1 Halt-Function Path Management 15.4.2 Halt-Function Signaling and Completion 15.5 Start Function and Resume Function 15.5.1 Start-Function and Resume-Function Path Management 15.6 Execution of I/O Operations 15.6.1 Blocking of Data 15.6.2 Operation-Request Block 15.6.3 Channel-Command Word 15.6.4 Command Code 15.6.5 Designation of Storage Area 15.6.6 Chaining 15.6.6.1 Data Chaining 15.6.6.2 Command Chaining 15.6.7 Skipping 15.6.8 Program-Controlled Interruption 15.6.9 CCW Indirect Data Addressing 15.6.10 Suspension of Channel-Program Execution 15.6.11 Commands and Flags 15.6.12 Branching in Channel Programs 15.6.12.1 Transfer in Channel 15.6.13 Command Retry 15.7 Concluding I/O Operations during Initiation 15.8 Immediate Conclusion of I/O Operations 15.9 Concluding I/O Operations During Data Transfer 15.10 Channel-Path-Reset Function 15.10.1 Channel-Path-Reset-Function Signaling 15.10.2 Channel-Path-Reset Function-Completion Signaling 16.0 Chapter 16. I/O Interruptions 16.1 Interruption Conditions 16.1.1 Intermediate Interruption Condition 16.1.2 Primary Interruption Condition 16.1.3 Secondary Interruption Condition 16.1.4 Alert Interruption Condition 16.2 Priority of Interruptions 16.3 Interruption Action 16.4 Interruption-Response Block 16.5 Subchannel-Status Word 16.5.1 Subchannel Key 16.5.2 Suspend Control (S) 16.5.3 Extended-Status-Word Format (L) 16.5.4 Deferred Condition Code (CC) 16.5.5 Format (F) 16.5.6 Prefetch (P) 16.5.7 Initial-Status-Interruption Control (I) 16.5.8 Address-Limit-Checking Control (A) 16.5.9 Suppress-Suspended Interruption (U) 16.5.10 Subchannel-Control Field 16.5.10.1 Zero Condition Code (Z) 16.5.10.2 Extended Control (E) 16.5.10.3 Path Not Operational (N) 16.5.10.4 Function Control (FC) 16.5.10.5 Activity Control (AC) 16.5.10.6 Status Control (SC) 16.5.11 CCW-Address Field 16.5.12 Device-Status Field 16.5.13 Subchannel-Status Field 16.5.13.1 Program-Controlled Interruption 16.5.13.2 Incorrect Length 16.5.13.3 Program Check 16.5.13.4 Protection Check 16.5.13.5 Channel-Data Check 16.5.13.6 Channel-Control Check 16.5.13.7 Interface-Control Check 16.5.13.8 Chaining Check 16.5.14 Count Field 16.6 Extended-Status Word 16.6.1 Extended-Status Format 0 16.6.1.1 Subchannel Logout 16.6.1.2 Extended-Report Word 16.6.1.3 Failing-Storage Address 16.6.2 Extended-Status Format 1 16.6.3 Extended-Status Format 2 16.6.4 Extended-Status Format 3 16.7 Extended-Control Word 17.0 Chapter 17. I/O Support Functions 17.1 Channel-Subsystem Monitoring 17.1.1 Channel-Subsystem Timing 17.1.1.1 Channel-Subsystem Timer 17.1.2 Measurement-Block Update 17.1.2.1 Measurement Block 17.1.2.2 Measurement-Block Origin 17.1.2.3 Measurement-Block Key 17.1.2.4 Measurement-Block Index 17.1.2.5 Measurement-Block-Update Mode 17.1.2.6 Measurement-Block-Update Enable 17.1.2.7 Control-Unit-Queuing Measurement 17.1.2.8 Time-Interval-Measurement Accuracy 17.1.3 Device-Connect-Time Measurement 17.1.3.1 Device-Connect-Time-Measurement Mode 17.1.3.2 Device-Connect-Time-Measurement Enable 17.2 Signals and Resets 17.2.1 Signals 17.2.1.1 Halt Signal 17.2.1.2 Clear Signal 17.2.1.3 Reset Signal 17.2.2 Resets 17.2.2.1 Channel-Path Reset 17.2.2.2 I/O-System Reset 17.3 Externally Initiated Functions 17.3.1 Initial Program Loading 17.3.2 Reconfiguration of the I/O System 17.4 Status Verification 17.5 Address-Limit Checking 17.6 Configuration Alert 17.7 Incorrect-Length-Indication Suppression 17.8 Concurrent Sense 17.9 Channel-Subsystem Recovery 17.9.1 Channel Report 17.9.2 Channel-Report Word A.0 Appendix A. Number Representation and Instruction-Use Examples A.1 Number Representation A.1.1 Binary Integers A.1.1.1 Signed Binary Integers A.1.1.2 Unsigned Binary Integers A.1.2 Decimal Integers A.1.3 Floating-Point Numbers A.1.4 Conversion Example A.2 Instruction-Use Examples A.2.1 Machine Format A.2.2 Assembler-Language Format A.2.2.1 Addressing Mode in Examples A.3 General Instructions A.3.1 ADD HALFWORD (AH) A.3.2 AND (N, NC, NI, NR) A.3.2.1 NI Example A.3.3 Linkage Instructions (BAL, BALR, BAS, BASR, BASSM, BSM) A.3.3.1 Other BALR and BASR Examples A.3.4 BRANCH AND STACK (BAKR) A.3.4.1 BAKR Example 1 A.3.4.2 BAKR Example 2 A.3.4.3 BAKR Example 3 A.3.5 BRANCH ON CONDITION (BC, BCR) A.3.6 BRANCH ON COUNT (BCT, BCTR) A.3.7 BRANCH ON INDEX HIGH (BXH) A.3.7.1 BXH Example 1 A.3.7.2 BXH Example 2 A.3.8 BRANCH ON INDEX LOW OR EQUAL (BXLE) A.3.8.1 BXLE Example 1 A.3.8.2 BXLE Example 2 A.3.9 COMPARE AND FORM CODEWORD (CFC) A.3.10 COMPARE HALFWORD (CH) A.3.11 COMPARE LOGICAL (CL, CLC, CLI, CLR) A.3.11.1 CLC Example A.3.11.2 CLI Example A.3.11.3 CLR Example A.3.12 COMPARE LOGICAL CHARACTERS UNDER MASK (CLM) A.3.13 COMPARE LOGICAL LONG (CLCL) A.3.14 COMPARE LOGICAL STRING (CLST) A.3.15 CONVERT TO BINARY (CVB) A.3.16 CONVERT TO DECIMAL (CVD) A.3.17 DIVIDE (D, DR) A.3.18 EXCLUSIVE OR (X, XC, XI, XR) A.3.18.1 XC Example A.3.18.2 XI Example A.3.19 EXECUTE (EX) A.3.20 INSERT CHARACTERS UNDER MASK (ICM) A.3.21 LOAD (L, LR) A.3.22 LOAD ADDRESS (LA) A.3.23 LOAD HALFWORD (LH) A.3.24 MOVE (MVC, MVI) A.3.24.1 MVC Example A.3.24.2 MVI Example A.3.25 MOVE INVERSE (MVCIN) A.3.26 MOVE LONG (MVCL) A.3.27 MOVE NUMERICS (MVN) A.3.28 MOVE STRING (MVST) A.3.29 MOVE WITH OFFSET (MVO) A.3.30 MOVE ZONES (MVZ) A.3.31 MULTIPLY (M, MR) A.3.32 MULTIPLY HALFWORD (MH) A.3.33 OR (O, OC, OI, OR) A.3.33.1 OI Example A.3.34 PACK (PACK) A.3.35 SEARCH STRING (SRST) A.3.35.1 SRST Example 1 A.3.35.2 SRST Example 2 A.3.36 SHIFT LEFT DOUBLE (SLDA) A.3.37 SHIFT LEFT SINGLE (SLA) A.3.38 STORE CHARACTERS UNDER MASK (STCM) A.3.39 STORE MULTIPLE (STM) A.3.40 TEST UNDER MASK (TM) A.3.41 TRANSLATE (TR) A.3.42 TRANSLATE AND TEST (TRT) A.3.43 UNPACK (UNPK) A.3.44 UPDATE TREE (UPT) A.4 Decimal Instructions A.4.1 ADD DECIMAL (AP) A.4.2 COMPARE DECIMAL (CP) A.4.3 DIVIDE DECIMAL (DP) A.4.4 EDIT (ED) A.4.5 EDIT AND MARK (EDMK) A.4.6 MULTIPLY DECIMAL (MP) A.4.7 SHIFT AND ROUND DECIMAL (SRP) A.4.7.1 Decimal Left Shift A.4.7.2 Decimal Right Shift A.4.7.3 Decimal Right Shift and Round A.4.7.4 Multiplying by a Variable Power of 10 A.4.8 ZERO AND ADD (ZAP) A.5 Floating-Point Instructions A.5.1 ADD NORMALIZED (AD, ADR, AE, AER, AXR) A.5.2 ADD UNNORMALIZED (AU, AUR, AW, AWR) A.5.3 COMPARE (CD, CDR, CE, CER) A.5.4 DIVIDE (DD, DDR, DE, DER) A.5.5 HALVE (HDR, HER) A.5.6 MULTIPLY (MD, MDR, ME, MER, MXD, MXDR, MXR) A.5.7 Floating-Point-Number Conversion A.5.7.1 Fixed Point to Floating Point A.5.7.2 Floating Point to Fixed Point A.6 Multiprogramming and Multiprocessing Examples A.6.1 Example of a Program Failure Using OR Immediate A.6.2 Conditional Swapping Instructions (CS, CDS) A.6.2.1 Setting a Single Bit A.6.2.2 Updating Counters A.6.3 Bypassing Post and Wait A.6.3.1 Bypass Post Routine A.6.3.2 Bypass Wait Routine A.6.4 Lock/Unlock A.6.4.1 Lock/Unlock with LIFO Queuing for Contentions A.6.4.2 Lock/Unlock with FIFO Queuing for Contentions A.6.5 Free-Pool Manipulation A.7 Sorting Instructions A.7.1 Tree Format A.7.2 Example of Use of Sort Instructions B.0 Appendix B. Lists of Instructions C.0 Appendix C. Condition-Code Settings D.0 Appendix D. Comparison between ESA/370 and ESA/390 D.1 New Facilities in ESA/390 D.1.1 Access-List-Controlled Protection D.1.2 Branch and Set Authority D.1.3 Called-Space Identification D.1.4 Checksum D.1.5 Compare and Move Extended D.1.6 Concurrent Sense D.1.7 Immediate and Relative Instruction D.1.8 Move-Page Facility 2 D.1.9 PER 2 D.1.10 Perform Locked Operation D.1.11 Set Address Space Control Fast D.1.12 Square Root D.1.13 Storage-Protection Override D.1.14 String Instruction D.1.15 Subspace Group D.1.16 Suppression on Protection D.2 Comparison of Facilities E.0 Appendix E. Comparison between 370-XA and ESA/370 E.1 New Facilities in ESA/370 E.1.1 Access Registers E.1.2 Compare until Substring Equal E.1.3 Home Address Space E.1.4 Linkage Stack E.1.5 Load and Store Using Real Address E.1.6 Move Page Facility 1 E.1.7 Move with Source or Destination Key E.1.8 Private Space E.2 Comparison of Facilities E.3 Summary of Changes E.3.1 New Instructions Provided E.3.2 Comparison of PSW Formats E.3.3 New Control-Register Assignments E.3.4 New Assigned Storage Locations E.3.5 New Exceptions E.3.6 Change to Secondary-Space Mode E.3.7 Changes to ASN-Second-Table Entry and ASN Translation E.3.8 Changes to Entry-Table Entry and PC-Number Translation E.3.9 Changes to PROGRAM CALL E.3.10 Changes to SET ADDRESS SPACE CONTROL E.4 Effects in New Translation Modes E.4.1 Effects on Interlocks for Virtual-Storage References E.4.2 Effect on INSERT ADDRESS SPACE CONTROL E.4.3 Effect on LOAD REAL ADDRESS E.4.4 Effect on TEST PENDING INTERRUPTION E.4.5 Effect on TEST PROTECTION F.0 Appendix F. Comparison between System/370 and 370-XA F.1 New Facilities in 370-XA F.1.1 Bimodal Addressing F.1.2 31-Bit Logical Addressing F.1.3 31-Bit Real and Absolute Addressing F.1.4 Page Protection F.1.5 Tracing F.1.6 Incorrect-Length-Indication Suppression F.1.7 Status Verification F.2 Comparison of Facilities F.3 Summary of Changes F.3.1 Changes in Instructions Provided F.3.2 Input/Output Comparison F.3.3 Comparison of PSW Formats F.3.4 Changes in Control-Register Assignments F.3.5 Changes in Assigned Storage Locations F.3.6 Changes to SIGNAL PROCESSOR F.3.7 Machine-Check Changes F.3.8 Changes to Addressing Wraparound F.3.9 Changes to LOAD REAL ADDRESS F.3.10 Changes to 31-Bit Real Operand Addresses G.0 Appendix G. Table of Powers of 2 H.0 Appendix H. Hexadecimal Tables I.0 Appendix I. EBCDIC and Other Codes INDEX Index
References in this publication to IBM products, programs or services do not imply that IBM intends to make these available in all countries in which IBM operates. Any reference to an IBM product, program, or service is not intended to state or imply that only IBM's product, program, or service may be used. Any functionally equivalent product, program, or service that does not infringe any of IBM's intellectual property rights may be used instead of the IBM product, program, or service. Evaluation and verification of operation in conjunction with other products, except those expressly designated by IBM, is the user's responsibility.
IBM may have patents or pending patent applications covering subject matter in this document. The furnishing of this document does not give you any license to these patents. You can send license inquiries, in writing, to the IBM Director of Licensing, IBM Corporation, 500 Columbus Avenue, Thornwood, NY, 10594 USA.
Subtopics:
The following terms, denoted by an asterisk (*) at the first or most prominent occurrence in this publication, are trademarks of the International Business Machines Corporation in the United States or other countries:
This publication provides, for reference purposes, a detailed Enterprise Systems Architecture/390* (ESA/390*) ( ) description.
The publication applies only to systems operating as defined by ESA/390. For systems operating in accordance with the System/370* or System/370 extended-architecture (370-XA) definitions, the IBM System/370 Principles of Operation, GA22-7000, or the IBM 370-XA Principles of Operation, SA22-7085, should be consulted. For systems operating in accordance with the Enterprise Systems Architecture/370* (ESA/370*) definition, the IBM ESA/370 Principles of Operation, SA22-7200, should be consulted.
The publication describes each function at the level of detail needed to prepare an assembler-language program that relies on that function. It does not, however, describe the notation and conventions that must be employed in preparing such a program, for which the user must instead refer to the appropriate assembler-language publication.
The information in this publication is provided principally for use by assembler-language programmers, although anyone concerned with the functional details of ESA/390 will find it useful.
This publication is written as a reference and should not be considered an introduction or a textbook. It assumes the user has a basic knowledge of data-processing systems.
All facilities discussed in this publication are not necessarily available on every model. Furthermore, in some instances the definitions have been structured to allow for some degree of extendibility, and therefore certain capabilities may be described or implied that are not offered on any model. Examples of such capabilities are the use of a 16-bit field in the subsystem-identification word to identify the channel subsystem, the size of the CPU address, and the number of CPUs sharing main storage. The allowance for this type of extendibility should not be construed as implying any intention by IBM to provide such capabilities. For information about the characteristics and availability of facilities on a specific model, see the functional characteristics publication for that model.
Largely because this publication is arranged for reference, certain words and phrases appear, of necessity, earlier in the publication than the principal discussions explaining them. The reader who encounters a problem because of this arrangement should refer to the index, which indicates the location of the key description.
The information presented in this publication is grouped in 17 chapters and several appendixes:
Chapter 1, Introduction, highlights the major facilities of the ESA/390 architecture.
Chapter 2, Organization, describes the major groupings within the system--main storage, expanded storage, the central processing unit (CPU), the external time reference (ETR), and input/output--with some attention given to the composition and characteristics of those groupings.
Chapter 3, Storage, explains the information formats, the addressing of storage, and the facilities for storage protection. It also deals with dynamic address translation (DAT), which, coupled with special programming support, makes the use of a virtual storage possible.
Chapter 4, Control, describes the facilities for the switching of system status, for special externally initiated operations, for debugging, and for timing. It deals specifically with CPU states, control modes, the program-status word (PSW), control registers, tracing, program-event recording, timing facilities, resets, store status, and initial program loading.
Chapter 5, Program Execution, explains the role of instructions in program execution, looks in detail at instruction formats, and describes briefly the use of the program-status word (PSW), of branching, and of interruptions. It contains the principal description of the advanced address-space facilities that were introduced in ESA/370. It also details the aspects of program execution on one CPU as observed by other CPUs and by channel programs.
Chapter 6, Interruptions, details the mechanism that permits the CPU to change its state as a result of conditions external to the system, within the system, or within the CPU itself. Six classes of interruptions are identified and described: machine-check interruptions, program interruptions, supervisor-call interruptions, external interruptions, input/output interruptions, and restart interruptions.
Chapter 7, General Instructions, contains detailed descriptions of logical and binary-integer data formats and of all unprivileged instructions except the decimal and floating-point instructions.
Chapter 8, Decimal Instructions, describes in detail decimal data formats and the decimal instructions.
Chapter 9, Floating-Point Instructions, contains detailed descriptions of floating-point data formats and the floating-point instructions.
Chapter 10, Control Instructions, contains detailed descriptions of all of the semiprivileged and privileged instructions except for the I/O instructions.
Chapter 11, Machine-Check Handling, describes the mechanism for detecting, correcting, and reporting machine malfunctions.
Chapter 12, Operator Facilities, describes the basic manual functions and controls available for operating and controlling the system.
Chapters 13-17 of this publication provide a detailed definition of the functions performed by the channel subsystem and the logical interface between the CPU and the channel subsystem.
Chapter 13, I/O Overview, provides a brief description of the basic components and operation of the channel subsystem.
Chapter 14, I/O Instructions, contains the description of the I/O instructions.
Chapter 15, Basic I/O Functions, describes the basic I/O functions performed by the channel subsystem, including the initiation, control, and conclusion of I/O operations.
Chapter 16, I/O Interruptions, covers I/O interruptions and interruption conditions.
Chapter 17, I/O Support Functions, describes such functions as channel-subsystem usage monitoring, resets, initial-program loading, reconfiguration, and channel-subsystem recovery.
The Appendixes include:
Subtopics:
In this publication, the letters K, M, G, and T denote the multipliers 2¹0, 2²0, 2³0, and 240, respectively. Although the letters are borrowed from the decimal system and stand for kilo (10³), mega (106), giga (109), and tera (10¹²), they do not have the decimal meaning but instead represent the power of 2 closest to the corresponding power of 10. Their meaning in this publication is as follows:
__________ _________________________ | Symbol | Value | |__________|_________________________| | K (kilo) | 1,024 = 2¹0 | | | | | M (mega) | 1,048,576 = 2²0 | | | | | G (giga) | 1,073,741,824 = 2³0 | | | | | T (tera) | 1,099,511,627,776 = 240 | |__________|_________________________|The following are some examples of the use of K, M, G, and T:
In this publication, unless otherwise specified, the value given for a byte is the value obtained by considering the bits of the byte to represent a binary code. Thus, when a byte is said to contain a zero, the value 00000000 binary, or 00 hex, is meant, and not the value for an EBCDIC character "0," which would be F0 hex.
Although the System/360 architecture was originally designed to support the Extended Binary-Coded-Decimal Interchange Code (EBCDIC), the instructions and data formats of the architecture are for the most part independent of the external code which is to be processed by the machine. For most instructions, all 256 possible combinations of bit patterns for a particular byte can be processed, independent of the character which the bit pattern is intended to represent. For instructions which use the zoned format, and for those few instructions which are dependent on a particular external code, the instruction TRANSLATE may be used to convert data from one code to another code. Thus, a machine operating in accordance with ESA/390 can process EBCDIC, ASCII, or any other code which can be represented in eight or fewer bits per character.
The parallel-I/O channel-to-channel adapter is described in the publication IBM Enterprise Systems Architecture/390 Channel-to-Channel Adapter for the System/360 and System/370 I/O Interface, SA22-7091.
The parallel-I/O interface is described in the publication IBM System/360 and System/370 I/O Interface Channel to Control Unit Original Equipment Manufacturers' Information, GA22-6974.
The Enterprise Systems Connection Architecture* (ESCON*) ( ) I/O interface, referred to in this publication as the serial-I/O interface, is described in the publication IBM Enterprise Systems Architecture/390 ESCON I/O Interface, SA22-7202.
The channel-to-channel adapter for the serial-I/O interface is described in the publication IBM Enterprise Systems Architecture/390 ESCON Channel-to-Channel-Adapter, SA22-7203.
The commands, status, and sense data that are common to all I/O devices that comply with ESA/390 are described in the publication IBM Enterprise Systems Architecture/390 Common I/O-Device Commands, SA22-7204.
Vector operations are described in the publication IBM Enterprise Systems Architecture/390 Vector Operations, SA22-7207.
The compression facility is described in the publication IBM Enterprise Systems Architecture/390 Data Compression, SA22-7208.
The interpretive-execution facility is described in the publication IBM 370-XA Interpretive Execution, SA22-7095.
The mathematical assists are described in the publication IBM System/370 Mathematical Assists, SA22-7094, which describes the instructions ARCTANGENT, COMMON LOGARITHM, COSINE, EXPONENTIAL, MULTIPLY AND ADD, NATURAL LOGARITHM, RAISE TO POWER, SINE, and SQUARE ROOT.
| The current, fifth edition of this publication differs from the previous
| edition principally by containing the definitions of the
| branch-and-set-authority facility and the perform-locked-operation
| facility. The fifth edition contains minor clarifications and corrections
| and also the following significant changes relative to the previous
| edition:
The fourth edition of this publication differs from the previous edition principally by containing the definitions of the following facilities: called-space identification, checksum, compare and move extended, and immediate and relative instruction. The fourth edition also contains additional information about the PER-2 facility, and it describes the ancillary-report bit in certain fields. The fourth edition contains minor clarifications and corrections and also the following significant changes relative to the previous edition:
The third edition of this publication differs from the previous edition principally by containing the definition of the subspace-group facility. The third edition contains minor clarifications and corrections and also the following significant changes relative to the previous edition:
( ) BookMaster is a trademark of the International Business
Machines Corporation.
The second edition of this publication contains minor clarifications and corrections and also the following significant changes relative to the previous edition with TNL SN22-5400:
This publication provides, for reference purposes, a detailed Enterprise Systems Architecture/390 (ESA/390) description.
The architecture of a system defines its attributes as seen by the programmer, that is, the conceptual structure and functional behavior of the machine, as distinct from the organization of the data flow, the logical design, the physical design, and the performance of any particular implementation. Several dissimilar machine implementations may conform to a single architecture. When the execution of a set of programs on different machine implementations produces the results that are defined by a single architecture, the implementations are considered to be compatible for those programs.
Subtopics:
All extensions to ESA/370 that form ESA/390 are summarized below. For those extensions described in detail in this publication, a comparison of the differences among ESA/390, ESA/370, 370-XA, and System/370 appears in Appendixes D, E, and F.
ESA/390 is the next step in the evolution from the System/360 to the System/370, System/370 extended architecture (370-XA), and Enterprise Systems Architecture/370 (ESA/370). ESA/390 includes all of the facilities of ESA/370 and provides a broad range of extensions. Some of these extensions either apply directly to application-program development or are basic machine interfaces, and they are described in detail in either this publication or another generally available publication. The remaining extensions are suitable for use only by means of specialized control or support programs, and detailed descriptions of these extensions are not provided.
ESA/390 was announced in September, 1990. Any extension added subsequently has the date of its announcement in parentheses at the end of its summary.
The following extensions are described in detail in this publication:
PER 2 includes extensions that provide additional information about PER events. The extensions are described in detail beginning in the current, fourth edition of this publication.
Subtopics:
The CPU-related facilities that were new in 370-XA are as follows:
ESA/390 includes the complete set of facilities of ESA/370 as its base. This section briefly outlines most of the facilities that were additions in 370-XA as compared to System/370 and that were additions in ESA/370 as compared to 370-XA.
The facilities that were new in ESA/370 are as follows:
ESA/390 is designed to be used with a control program that coordinates the use of system resources and executes all I/O instructions, handles exceptional conditions, and supervises scheduling and execution of multiple programs.
Subtopics:
Although systems operating as defined by ESA/390 may differ in implementation and physical capabilities, logically they are upward and downward compatible. Compatibility provides for simplicity in education, availability of system backup, and ease in system growth. Specifically, any program written for ESA/390 gives identical results on any ESA/390 implementation, provided that the program:
Subtopics:
Control programs written for System/370 cannot be directly transferred to systems operating as defined by ESA/390. This is because in the 370-XA base of ESA/390 the basic-control mode is not present and the facilities for I/O and dynamic address translation are changed. (See Appendixes D, E, and F for a detailed comparison among ESA/390, ESA/370, 370-XA, and System/370.)
Control programs written for 370-XA or ESA/370 can be directly transferred to systems operating as defined by ESA/390. Almost all of the new functions that were introduced in ESA/370 are enabled only when a control-register bit assigned in ESA/370 and ESA/390 is set to one. When this bit is zero, the machine operates essentially as specified for 370-XA; the most significant exceptions are (1) instructions that load and store the contents of the access registers can be executed successfully, and (2) certain previously unassigned real and absolute storage locations below address 512 are stored in during the store-status operation, certain program interruptions, and the machine-check interruption. When the new control-register bit is zero, no unprivileged or semiprivileged instruction can place the CPU in the access-register mode, and so the access registers cannot be used to specify address spaces.
A problem-state program written for ESA/370, 370-XA, or System/370 operates with ESA/390, provided that the program:
A high degree of compatibility exists at the problem-state level in going forward from ESA/370, 370-XA, or System/370 to ESA/390. Because the majority of a user's applications are written for the problem state, this problem-state compatibility is useful in many installations.
To ensure that existing programs operate if and when such new facilities are installed, programs should not depend on an indication of an exception as a result of invalid values that are currently defined as being checked. If a value must be placed in unassigned positions that are not checked, the program should enter zeros. When the machine provides a code or field, the program should take into account that new codes and bits may be assigned in the future. The program should not use unassigned low-storage locations for keeping information since these locations may be assigned in the future in such a way that the machine causes the contents of the locations to be changed.
Several design aspects make this possible.
Availability is the capability of a system to accept and successfully process an individual job. Systems operating in accordance with ESA/390 permit substantial availability by (1) allowing a large number and broad range of jobs to be processed concurrently, thus making the system readily accessible to any particular job, and (2) limiting the effect of an error and identifying more precisely its cause, with the result that the number of jobs affected by errors is minimized and the correction of the errors facilitated.
Logically, a system consists of main storage, one or more central processing units (CPUs), operator facilities, a channel subsystem, and I/O devices. I/O devices are attached to the channel subsystem through control units. The connection between the channel subsystem and a control unit is called a channel path.
A channel path employs either a parallel-transmission protocol or a serial-transmission protocol and, accordingly, is called either a parallel or 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 connections between the ports of the switch.
Expanded storage may also be available in the system, a vector or cryptographic unit may be included in a CPU, and an external time reference (ETR) may be connected to the system.
The physical identity of the above functions may vary among implementations, called "models." Figure 2-1 depicts the logical structure of a two-CPU multiprocessing system that includes expanded storage, a vector unit, and a cryptographic unit and that is connected to an ETR.
Specific processors may differ in their internal characteristics, the installed facilities, the number of subchannels, channel paths, and control units which can be attached to the channel subsystem, the size of main and expanded storage, and the representation of the operator facilities.
___ /__________|ETR|__________/ |_ _| | __________________ | | | _|_________ ______________ | | | |______| | | |____| CPU |__ | | | | | ______| | | | | | | |Vector| | | | | | |_ __|______| | | | | | | | | | | Expanded Storage | _|_________ | | Main Storage | | | | |__|___| | | |____| CPU |__| | | | | | ______| | | | | | | |Crypto| | | | | | |____|______| | | | | | | |_______ ______| | | ___________| | |__________________| | | | ___________________| | | _________________________|___|________________________ | | | Channel | | Subsystem | |_ ___ ___ ______ ___ ________ _ _ _ ___ ______________| |...|...|......|...| | | | |...| | | | | | | | | | | Serial Channel Paths Parallel Channel Paths | | | | | | | | | | | | | | | | | / / |__________ _______/ | _|___|_ _|___|_ | | | | |Dynamic| |Dynamic| | |__ _________/ | | |Switch | |Switch | | _| _| | |_ ___ _| | _ ___ | | |CU| |CU|_ _ _ _/ | |...| | |...| | |_ | _ |_ | O O O | | |_____| | | | |__| | | | | ________||| | | __| |_ _ _ _/ | | || || | | _| |_| O O O | |_ || || | | |CU| | |CU||CU| |CU| | | |_ | | | _|| _| | _| | |____|______ ________|_______/ | | | |_ _| | |_ _ _ _/ | |CU|_ _ _ _/ |CU|_ _ _ _/ | O O O | |__| O O O |__| O O O |_ _ _ _/ |_ _ _ _/ O O O O O OFigure 2-1. Logical Structure of an ESA/390 System with Two CPUs
A system viewed without regard to its I/O devices is referred to as a configuration. All of the physical equipment, whether in the configuration or not, is referred to as the installation.Model-dependent reconfiguration controls may be provided to change the amount of main and expanded storage and the number of CPUs and channel paths in the configuration. In some instances, the reconfiguration controls may be used to partition a single configuration into multiple configurations. Each of the configurations so reconfigured has the same structure, that is, main and expanded storage, one or more CPUs, and one or more subchannels and channel paths in the channel subsystem.
Each configuration is isolated in that the main and expanded storage in one configuration is not directly addressable by the CPUs and the channel subsystem of another configuration. It is, however, possible for one configuration to communicate with another by means of shared I/O devices or a channel-to-channel adapter. At any one time, the storage, CPUs, subchannels, and channel paths connected together in a system are referred to as being in the configuration. Each CPU, subchannel, channel path, main-storage location, and expanded-storage location can be in only one configuration at a time.
Subtopics:
Main storage may include a faster-access buffer storage, sometimes called a cache. Each CPU may have an associated cache. The effects, except on performance, of the physical construction and the use of distinct storage media are not observable by the program.
Main storage, which is directly addressable, provides for high-speed processing of data by the CPUs and the channel subsystem. Both data and programs must be loaded into main storage from input devices before they can be processed. The amount of main storage available on the system depends on the model, and, depending on the model, the amount in the configuration may be under control of model-dependent configuration controls. The storage is available in multiples of 4K-byte blocks. At any instant, the channel subsystem and all CPUs in the configuration have access to the same blocks of storage and refer to a particular block of main-storage locations by using the same absolute address.
Each 4K-byte block in expanded storage is addressed by means of a 32-bit unsigned binary integer called an expanded-storage block number.
Expanded storage may be available on some models. Expanded storage, when available, can be accessed by all CPUs in the configuration by means of instructions that transfer 4K-byte blocks of data from expanded storage to main storage or from main storage to expanded storage. These instructions are not described. Another capability for accessing expanded storage is described in the definition of the MOVE PAGE instruction in Chapter 7, "General Instructions," and Chapter 10, "Control Instructions."
Expanded storage is not further described.
The physical implementation of the CPU may differ among models, but the logical function remains the same. The result of executing an instruction is the same for each model, providing that the program complies with the compatibility rules.
The central processing unit (CPU) is the controlling center of the system. It contains the sequencing and processing facilities for instruction execution, interruption action, timing functions, initial program loading, and other machine-related functions.
The CPU, in executing instructions, can process binary integers and floating-point numbers of fixed length, decimal integers of variable length, and logical information of either fixed or variable length. Processing may be in parallel or in series; the width of the processing elements, the multiplicity of the shifting paths, and the degree of simultaneity in performing the different types of arithmetic differ from one CPU to another without affecting the logical results.
Instructions which the CPU executes fall into five classes: general, decimal, floating-point, control, and I/O instructions. The general instructions are used in performing binary-integer-arithmetic operations and logical, branching, and other nonarithmetic operations. The decimal instructions operate on data in the decimal format, and the floating-point instructions on data in the floating-point format. The privileged control instructions and the I/O instructions can be executed only when the CPU is in the supervisor state; the semiprivileged control instructions can be executed in the problem state, subject to the appropriate authorization mechanisms.
To perform its functions, the CPU may use a certain amount of internal storage. Although this internal storage may use the same physical storage medium as main storage, it is not considered part of main storage and is not addressable by programs.
The CPU provides registers which are available to programs but do not have addressable representations in main storage. They include the current program-status word (PSW), the general registers, the floating-point registers, the control registers, the access registers, the prefix register, and the registers for the clock comparator and the CPU timer. Each CPU in an installation provides access to a time-of-day (TOD) clock, which may be local to that CPU or shared with other CPUs in the installation. The instruction operation code determines which type of register is to be used in an operation. See Figure 2-2 in topic 2.3.5 for the format of those registers.
Subtopics:
The CPU has an interruption capability, which permits the CPU to switch rapidly to another program in response to exceptional conditions and external stimuli. When an interruption occurs, the CPU places the current PSW in an assigned storage location, called the old-PSW location, for the particular class of interruption. The CPU fetches a new PSW from a second assigned storage location. This new PSW determines the next program to be executed. When it has finished processing the interruption, the interrupting program may reload the old PSW, making it again the current PSW, so that the interrupted program can continue.
The program-status word (PSW) includes the instruction address, condition code, and other information used to control instruction sequencing and to determine the state of the CPU. The active or controlling PSW is called the current PSW. It governs the program currently being executed.
There are six classes of interruption: external, I/O, machine check, program, restart, and supervisor call. Each class has a distinct pair of old-PSW and new-PSW locations permanently assigned in real storage.
For some operations, two adjacent general registers are coupled, providing a 64-bit format. In these operations, the program must designate an even-numbered register, which contains the leftmost (high-order) 32 bits. The next higher-numbered register contains the rightmost (low-order) 32 bits.
Instructions may designate information in one or more of 16 general registers. The general registers may be used as base-address registers and index registers in address arithmetic and as accumulators in general arithmetic and logical operations. Each register contains 32 bits. The general registers are identified by the numbers 0-15 and are designated by a four-bit R field in an instruction. Some instructions provide for addressing multiple general registers by having several R fields. For some instructions, the use of a specific general register is implied rather than explicitly designated by an R field of the instruction.
In addition to their use as accumulators in general arithmetic and logical operations, 15 of the 16 general registers are also used as base-address and index registers in address generation. In these cases, the registers are designated by a four-bit B field or X field in an instruction. A value of zero in the B or X field specifies that no base or index is to be applied, and, thus, general register 0 cannot be designated as containing a base address or index.
Four floating-point registers are available for floating-point operations. They are identified by the numbers 0, 2, 4, and 6 and are designated by a four-bit R field in floating-point instructions. Each floating-point register is 64 bits long and can contain either a short (32-bit) or a long (64-bit) floating-point operand. A short operand occupies the leftmost bit positions of a floating-point register. The rightmost portion of the register is ignored in operations that use short operands and remains unchanged in operations that produce short results. Two pairs of adjacent floating-point registers can be used for extended operands: registers 0 and 2, and registers 4 and 6. Each of these pairs, identified by the numbers 0 and 4, provides for a 128-bit format.
The control registers are identified by the numbers 0-15 and are designated by four-bit R fields in the instructions LOAD CONTROL and STORE CONTROL. Multiple control registers can be addressed by these instructions.
The CPU has 16 control registers, each having 32 bit positions. The bit positions in the registers are assigned to particular facilities in the system, such as program-event recording, and are used either to specify that an operation can take place or to furnish special information required by the facility.
Each of access registers 1-15 can designate any address space, including the current instruction space (the primary address space). Access register 0 always designates the current instruction space. When one of access registers 1-15 is used to designate an address space, the CPU determines which address space is designated by translating the contents of the access register. When access register 0 is used to designate an address space, the CPU treats the access register as designating the current instruction space, and it does not examine the actual contents of the access register. Therefore, the 16 access registers can designate, at any one time, the current instruction space and a maximum of 15 other spaces.
The CPU has 16 access registers numbered 0-15. An access register consists of 32 bit positions containing an indirect specification (not described here in detail) of a segment-table designation. A segment-table designation is a parameter used by the dynamic-address-translation (DAT) mechanism to translate references to a corresponding address space. When the CPU is in a mode called the access-register mode (controlled by bits in the PSW), an instruction B field, used to specify a logical address for a storage-operand reference, designates an access register, and the segment-table designation specified by the access register is used by DAT for the reference being made. For some instructions, an R field is used instead of a B field. Instructions are provided for loading and storing the contents of the access registers and for moving the contents of one access register to another.
R Field Control Access General Floating-Point and Registers Registers Registers Registers Register Number |_32 bits_ÿ| |_32 bits_ÿ| |_32 bits_ÿ| |______64 bits______ÿ|___________ ___________ _ ___________ _ _____________________ 0000 0 | | | | | | | | | | |___________| |___________| | |___________| | |_____________________| | | ___________ ___________ | ___________ | 0001 1 | | | | | | | | |___________| |___________| |_|___________| | | ___________ ___________ _ ___________ | _____________________ 0010 2 | | | | | | | | | | |___________| |___________| | |___________| |_|_____________________| | ___________ ___________ | ___________ 0011 3 | | | | | | | |___________| |___________| |_|___________|
___________ ___________ _ ___________ _ _____________________ 0100 4 | | | | | | | | | | |___________| |___________| | |___________| | |_____________________| | | ___________ ___________ | ___________ | 0101 5 | | | | | | | | |___________| |___________| |_|___________| | | ___________ ___________ _ ___________ | _____________________ 0110 6 | | | | | | | | | | |___________| |___________| | |___________| |_|_____________________| | ___________ ___________ | ___________ 0111 7 | | | | | | | |___________| |___________| |_|___________|
___________ ___________ _ ___________ 1000 8 | | | | | | | |___________| |___________| | |___________| | ___________ ___________ | ___________ 1001 9 | | | | | | | |___________| |___________| |_|___________|
___________ ___________ _ ___________ Note: The brackets 1010 10 | | | | | | | indicate that the two |___________| |___________| | |___________| registers may be coupled | as a double-register ___________ ___________ | ___________ pair, designated by 1011 11 | | | | | | | specifying the lower- |___________| |___________| |_|___________| numbered register in the R field. For ex- ___________ ___________ _ ___________ ample, the general- 1100 12 | | | | | | | register pair 14 and |___________| |___________| | |___________| 15 is designated by | 1110 binary in the R ___________ ___________ | ___________ field. 1101 13 | | | | | | | |___________| |___________| |_|___________|
___________ ___________ _ ___________ 1110 14 | | | | | | | |___________| |___________| | |___________| | ___________ ___________ | ___________ 1111 15 | | | | | | | |___________| |___________| |_|___________|
Figure 2-2. Control, Access, General, and Floating-Point Registers
Depending on the model, a vector facility may be provided as an extension of the CPU. When the vector facility is provided on a CPU, it functions as an integral part of that CPU. The functions of the vector facility and its registers are described in the publication IBM Enterprise Systems Architecture/390 Vector Operations, SA22-7207.
Depending on the model, an integrated cryptographic facility may be provided as an extension of the CPU. When the cryptographic facility is provided on a CPU, it functions as an integral part of that CPU. A summary of the benefits of the cryptographic facility is given in "Highlights of ESA/390" in topic 1.1; the facility is otherwise not described.
Depending on the model, an external time reference (ETR) may be connected to the configuration. A summary of the benefits of the ETR is given in "Highlights of ESA/390" in topic 1.1; the facility is otherwise not described.
Input/output (I/O) operations involve the transfer of information between main storage and an I/O device. I/O devices and their control units attach to the channel subsystem, which controls this data transfer.
Subtopics:
The channel subsystem directs the flow of information between I/O devices and main storage. It relieves CPUs of the task of communicating directly with I/O devices and permits data processing to proceed concurrently with I/O processing. The channel subsystem uses one or more channel paths as the communication link in managing the flow of information to or from I/O devices. As part of I/O processing, the channel subsystem also performs the path-management function of testing for channel-path availability, selecting an available channel path, and initiating execution of the operation with the I/O device. Within the channel subsystem are subchannels.
One subchannel is provided for and dedicated to each I/O device accessible to the channel subsystem. Each subchannel contains storage for information concerning the associated I/O device and its attachment to the channel subsystem. The subchannel also provides storage for information concerning I/O operations and other functions involving the associated I/O device. Information contained in the subchannel can be accessed by CPUs using I/O instructions as well as by the channel subsystem and serves as the means of communication between any CPU and the channel subsystem concerning the associated I/O device. The actual number of subchannels provided depends on the model and the configuration; the maximum number of subchannels is 65,536.
A channel path can use one of two types of communication links:
I/O devices are attached through control units to the channel subsystem via channel paths. Control units may be attached to the channel subsystem via more than one channel path, and an I/O device may be attached to more than one control unit. In all, an individual I/O device may be accessible to a channel subsystem by as many as eight different channel paths, depending on the model and the configuration. The total number of channel paths provided by a channel subsystem depends on the model and the configuration; the maximum number of channel paths is 256.
Each serial-I/O interface consists of two optical-fiber conductors between any two of a channel subsystem, a dynamic switch, and a control unit. A dynamic switch can be connected by means of multiple serial-I/O interfaces to either the same or different channel subsystems and to multiple control units. The number of control units which can be connected on one channel path depends on the channel-subsystem and dynamic-switch capabilities. Up to 256 devices can be attached to each control unit that uses the serial-I/O interface, depending on the control unit. The serial-I/O interface is described in the publication ESA/390 ESCON I/O Interface, SA22-7202.
I/O devices include such equipment as printers, magnetic-tape units, direct-access-storage devices, displays, keyboards, communications controllers, teleprocessing devices, and sensor-based equipment. Many I/O devices function with an external medium, such as paper or magnetic tape. Other I/O devices handle only electrical signals, such as those found in displays and communications networks. In all cases, I/O-device operation is regulated by a control unit that provides the logical and buffering capabilities necessary to operate the associated I/O device. From the programming point of view, most control-unit functions merge with I/O-device functions. The control-unit function may be housed with the I/O device or in the CPU, or a separate control unit may be used.
The main functions provided by the operator facilities include resetting, clearing, initial program loading, start, stop, alter, and display.
The operator facilities provide the functions necessary for operator control of the machine. Associated with the operator facilities may be an operator-console device, which may also be used as an I/O device for communicating with the program.
Main storage provides the system with directly addressable fast-access storage of data. Both data and programs must be loaded into main storage (from input devices) before they can be processed.
This chapter discusses the representation of information in main storage, as well as addressing, protection, and reference and change recording. The aspects of addressing which are covered include the format of addresses, the concept of address spaces, the various types of addresses, and the manner in which one type of address is translated to another type of address. A list of permanently assigned storage locations appears at the end of the chapter.
Main storage may include one or more smaller faster-access buffer storages, sometimes called caches. A cache is usually physically associated with a CPU or an I/O processor. The effects, except on performance, of the physical construction and use of distinct storage media are not observable by the program.
Fetching and storing of data by a CPU are not affected by any concurrent channel-subsystem activity or by a concurrent reference to the same storage location by another CPU. When concurrent requests to a main-storage location occur, access normally is granted in a sequence determined by the system. If a reference changes the contents of the location, any subsequent storage fetches obtain the new contents.
Main storage may be volatile or nonvolatile. If it is volatile, the contents of main storage are not preserved when power is turned off. If it is nonvolatile, turning power off and then back on does not affect the contents of main storage, provided all CPUs are in the stopped state and no references are made to main storage when power is being turned off. In both types of main storage, the contents of the storage key are not necessarily preserved when the power for main storage is turned off.
Note: Because most references in this publication apply to virtual storage, the abbreviated term "storage" is often used in place of "virtual storage." The term "storage" may also be used in place of "main storage," "absolute storage," or "real storage" when the meaning is clear. The terms "main storage" and "absolute storage" are used to describe storage which is addressable by means of an absolute address. The terms describe fast-access storage, as opposed to auxiliary storage, such as provided by direct-access storage devices. "Real storage" is synonymous with "absolute storage" except for the effects of prefixing.
Subtopics:
Each byte location in storage is identified by a unique nonnegative integer, which is the address of that byte location or, simply, the byte address. Adjacent byte locations have consecutive addresses, starting with 0 on the left and proceeding in a left-to-right sequence. Addresses are either 24-bit or 31-bit unsigned binary integers and are described in "Address Size and Wraparound" in topic 3.2.2.
Storage is viewed as a long horizontal string of bits. For most operations, accesses to storage proceed in a left-to-right sequence. The string of bits is subdivided into units of eight bits. An eight-bit unit is called a byte, which is the basic building block of all information formats.
Subtopics:
Within each group of bytes, bits are numbered in a left-to-right sequence. The leftmost bits are sometimes referred to as the "high-order" bits and the rightmost bits as the "low-order" bits. Bit numbers are not storage addresses, however. Only bytes can be addressed. To operate on individual bits of a byte in storage, it is necessary to access the entire byte.
Information is transmitted between storage and a CPU or the channel subsystem one byte, or a group of bytes, at a time. Unless otherwise specified, a group of bytes in storage is addressed by the leftmost byte of the group. The number of bytes in the group is either implied or explicitly specified by the operation to be performed. When used in a CPU operation, a group of bytes is called a field.
The bits in a byte are numbered 0 through 7, from left to right.
The bits in an address are numbered 8 through 31 for 24-bit addresses and 1 through 31 for 31-bit addresses. Within any other fixed-length format of multiple bytes, the bits making up the format are consecutively numbered starting from 0.
For purposes of error detection, and in some models for correction, one or more check bits may be transmitted with each byte or with a group of bytes. Such check bits are generated automatically by the machine and cannot be directly controlled by the program. References in this publication to the length of data fields and registers exclude mention of the associated check bits. All storage capacities are expressed in number of bytes.
When the length of a storage-operand field is implied by the operation code of an instruction, the field is said to have a fixed length, which can be one, two, four, or eight bytes. Larger fields may be implied for some instructions.
When the length of a storage-operand field is not implied but is stated explicitly, the field is said to have a variable length. Variable-length operands can vary in length by increments of one byte.
When information is placed in storage, the contents of only those byte locations are replaced that are included in the designated field, even though the width of the physical path to storage may be greater than the length of the field being stored.
When storage addresses designate halfwords, words, and doublewords, the binary representation of the address contains one, two, or three rightmost zero bits, respectively.
Certain units of information must be on an integral boundary in storage. A boundary is called integral for a unit of information when its storage address is a multiple of the length of the unit in bytes. Special names are given to fields of two, four, and eight bytes on an integral boundary. A halfword is a group of two consecutive bytes on a two-byte boundary and is the basic building block of instructions. A word is a group of four consecutive bytes on a four-byte boundary. A doubleword is a group of eight consecutive bytes on an eight-byte boundary. (See Figure 3-1.)
Instructions must be on two-byte integral boundaries, and CCWs, IDAWs, and the storage operands of certain instructions must be on other integral boundaries. The storage operands of most instructions do not have boundary-alignment requirements.
· · ______ÿ Storage Addresses · · ___ ___ ___ ___ ___ ___ ___ ___ ___ _ Bytes | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | |___|___|___|___|___|___|___|___|___|_ · · · · · · · · · · · · · · · ___ ___ ___ ___ ___ ___ ___ ___ ___ _ Halfwords | 0 | 2 | 4 | 6 | 8 |___|___|___|___|___|___|___|___|___|_ · · · · · · · · · ___ ___ ___ ___ ___ ___ ___ ___ ___ _ Words | 0 | 4 | 8 |___|___|___|___|___|___|___|___|___|_ · · · · · · ___ ___ ___ ___ ___ ___ ___ ___ ___ _ Doublewords | 0 | 8 |___|___|___|___|___|___|___|___|___|_Figure 3-1. Integral Boundaries with Storage Addresses
Programming Note: For fixed-field-length operations with field lengths that are a power of 2, significant performance degradation is possible when storage operands are not positioned at addresses that are integral multiples of the operand length. To improve performance, frequently used storage operands should be aligned on integral boundaries.
Subtopics:
For purposes of addressing main storage, three basic types of addresses are recognized: absolute, real, and virtual. The addresses are distinguished on the basis of the transformations that are applied to the address during a storage access. Address translation converts virtual to real, and prefixing converts real to absolute. In addition to the three basic address types, additional types are defined which are treated as one or another of the three basic types, depending on the instruction and the current mode.
Subtopics:
The channel subsystem and all CPUs in the configuration refer to a shared main-storage location by using the same absolute address. Available main storage is usually assigned contiguous absolute addresses starting at 0, and the addresses are always assigned in complete 4K-byte blocks on integral boundaries. An exception is recognized when an attempt is made to use an absolute address in a block which has not been assigned to physical locations. On some models, storage-reconfiguration controls may be provided which permit the operator to change the correspondence between absolute addresses and physical locations. However, at any one time, a physical location is not associated with more than one absolute address.
An absolute address is the address assigned to a main-storage location. An absolute address is used for a storage access without any transformations performed on it.
Storage consisting of byte locations sequenced according to their absolute addresses is referred to as absolute storage.
At any instant there is one real-address to absolute-address mapping for each CPU in the configuration. When a real address is used by a CPU to access main storage, it is converted to an absolute address by prefixing. The particular transformation is defined by the value in the prefix register for the CPU.
A real address identifies a location in real storage. When a real address is used for an access to main storage, it is converted, by means of prefixing, to an absolute address.
Storage consisting of byte locations sequenced according to their real addresses is referred to as real storage.
A virtual address identifies a location in virtual storage. When a virtual address is used for an access to main storage, it is translated by means of dynamic address translation to a real address, which is then further converted by prefixing to an absolute address.
A primary virtual address is a virtual address which is to be translated by means of the primary segment-table designation. Logical addresses are treated as primary virtual addresses when in the primary-space mode. Instruction addresses are treated as primary virtual addresses when in the primary-space mode, secondary-space mode, or access-register mode. The first-operand address of MOVE TO PRIMARY and the second-operand address of MOVE TO SECONDARY are always treated as primary virtual addresses.
A secondary virtual address is a virtual address which is to be translated by means of the secondary segment-table designation. Logical addresses are treated as secondary virtual addresses when in the secondary-space mode. The second-operand address of MOVE TO PRIMARY and the first-operand address of MOVE TO SECONDARY are always treated as secondary virtual addresses.
An AR-specified virtual address is a virtual address which is to be translated by means of an access-register-specified segment-table designation. Logical addresses are treated as AR-specified addresses when in the access-register mode.
A home virtual address is a virtual address which is to be translated by means of the home segment-table designation. Logical addresses and instruction addresses are treated as home virtual addresses when in the home-space mode.
Except where otherwise specified, the storage-operand addresses for most instructions are logical addresses. Logical addresses are treated as real addresses in the real mode, as primary virtual addresses in the primary-space mode, as secondary virtual addresses in the secondary-space mode, as AR-specified virtual addresses in the access-register mode, and as home virtual addresses in the home-space mode. Some instructions have storage-operand addresses or storage accesses associated with the instruction which do not follow the rules for logical addresses. In all such cases, the instruction definition contains a definition of the type of address.
Addresses used to fetch instructions from storage are called instruction addresses. Instruction addresses are treated as real addresses in the real mode, as primary virtual addresses in the primary-space mode, secondary-space mode, or access-register mode, and as home virtual addresses in the home-space mode. The instruction address in the current PSW and the target address of EXECUTE are instruction addresses.
In some situations, it is convenient to use the term "effective address." An effective address is the address which exists before any transformation by dynamic address translation or prefixing is performed. An effective address may be specified directly in a register or may result from address arithmetic. Address arithmetic is the addition of the base and displacement or of the base, index, and displacement.
The bits of the address are numbered 8-31 and 1-31, respectively, corresponding to the numbering of base-address and index bits in a general register:
Two sizes of addresses are provided: 24-bit and 31-bit. A 24-bit address can accommodate a maximum of 16,777,216 (16M) bytes; with a 31-bit address, 2,147,483,648 (2G) bytes of storage can be addressed.
________ _______________________ | | 24-Bit Address | |________|_______________________| 0 8 31Unless specifically stated to the contrary, the following definition applies in this publication: whenever the machine generates and provides to the program an address, a 31-bit value imbedded in a 32-bit field is made available (placed in storage or loaded into a register). For 24-bit addresses, bits 0-7 are set to zeros, and the address appears in bit positions 8-31; for 31-bit addresses, bit 0 is set to zero, and the address appears in bit positions 1-31._ ______________________________ | | 31-Bit Address | |_|______________________________| 0 1 31
A 24-bit virtual address is expanded to 31 bits by appending seven zeros on the left before it is translated by means of the DAT process, and a 24-bit real address is similarly expanded to 31 bits before it is transformed by prefixing. A 24-bit absolute address is expanded to 31 bits before main storage is accessed. Thus, the 24-bit address always designates the first 16M-byte block of the 2G-byte storage addressable by a 31-bit address.
The size of effective addresses is controlled by bit 32 of the PSW, the addressing-mode bit. When the bit is zero, the CPU is in the 24-bit addressing mode, and 24-bit operand and instruction effective addresses are specified. When the bit is one, the CPU is in the 31-bit addressing mode, and 31-bit operand and instruction effective addresses are specified (see "Address Generation" in topic 5.2).
The size of the real addresses yielded by the ASN-translation, PC-number-translation, ASN-authorization, access-register translation, and tracing processes, and the real (or absolute) addresses yielded by the DAT process, is always 31 bits.
The size of the data address in a CCW is under control of the format-control bit in the operation-request block designated by a START SUBCHANNEL instruction. The CCWs with 24-bit and 31-bit addresses are called format-0 and format-1 CCWs, respectively. Format-0 and format-1 CCWs are described in Chapter 15, "Basic I/O Functions."
Subtopics:
When, during the generation of the address, an address is obtained that exceeds the value allowed for the address size (2²4 - 1 or 2³¹ - 1), one of the following two actions is taken:
The CPU performs address generation when it forms an operand or instruction address or when it generates the address of a table entry from the appropriate table origin and index. It also performs address generation when it increments an address to access successive bytes of a field. Similarly, the channel subsystem performs address generation when it increments an address (1) to fetch a CCW, (2) to fetch an IDAW, (3) to transfer data, or (4) to compute the address of an I/O measurement block.
Addresses generated by the CPU that may be virtual addresses always wrap. Wraparound also occurs when the linkage-stack-entry address in control register 15 is decremented below 0 by PROGRAM RETURN. For CPU table entries that are addressed by real or absolute addresses, it is unpredictable whether the address wraps or an addressing exception is recognized.
For channel-program execution, when the generated address exceeds the value for the address size (or, for the read-backward command is decremented below 0), an I/O program-check condition is recognized.
Figure 3-2 identifies what limit values apply to the generation of different addresses and how addresses are handled when they exceed the allowed value.
_______________________________________________ _______ _______________ | | | Handling When | | |Address| Address Would | | Address Generation for | Type | Wrap | |_______________________________________________|_______|_______________| |Instructions and operands when AM is zero |L,I,R,V| W24 | | | | | |Successive bytes of instructions and operands |I,L,V¹ | W24 | | when AM is zero | | | | | | | |Instructions and operands when AM is one |L,I,R,V| W31 | | | | | |Successive bytes of instructions and operands |I,L,V¹ | W31 | | when AM is one | | | | | | | |DAT-table entries when used for implicit |A or R²| X31 | | translation | | | | | | | |DAT-table entries when used for LRA |A or R²| X31 | | | | | | |ASN-second-table, authority-table (during ASN | R | X31 | | | authorization), linkage-table, and entry- | | | | | table entries | | | | | | | | | |Authority-table (during access-register |A or R²| X31 | | | translation) and access-list entries | | | | | | | |Linkage-stack entry | V | W31 | | | | | |I/O measurement block | A | P31 | | | | | |For a channel program with format-0 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 IDAWs) | A | P31 | | | | | |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 IDAWs) | A | P31 | |_______________________________________________|_______|_______________| _______________________________________________________________________ |Explanation: | | | | ¹ Real addresses do not apply in this case since the instructions | | which designate operands by means of real addresses cannot des- | | ignate operands that cross boundaries 2²4 and 2³¹. | | ² It is unpredictable whether the address is absolute or real. | | A Absolute address. | | AM Addressing-mode bit in the PSW. | | I Instruction address. | | L Logical address. | | P24 An I/O program-check condition is recognized when the address | | exceeds 2²4 - 1 or is decremented below zero. | | P31 An I/O program-check condition is recognized when the address | | exceeds 2³¹ - 1 or is decremented below zero. | | R Real address. | | V Virtual address. | | W24 Wrap to location 0 after location 2²4 - 1 and vice versa. | | W31 Wrap to location 0 after location 2³¹ - 1 and vice versa. | | X31 When the address exceeds 2³¹ - 1, it is unpredictable whether | | the address wraps to location 0 after location 2³¹ - 1 or | | whether an addressing exception is recognized. | |_______________________________________________________________________|Figure 3-2. Address Wraparound
A storage key is associated with each 4K-byte block of storage that is available in the configuration. The storage key has the following format:
____ _ _ _ |ACC |F|R|C| |____|_|_|_| 0 4 6Access-Control Bits (ACC): If a reference is subject to key-controlled protection, the four access-control bits, bits 0-3, are matched with the four-bit access key when information is stored, or when information is fetched from a location that is protected against fetching.The bit positions in the storage key are allocated as follows:
Fetch-Protection Bit (F): If a reference is subject to key-controlled protection, the fetch-protection bit, bit 4, controls whether key-controlled protection applies to fetch-type references: a zero indicates that only store-type references are monitored and that fetching with any access key is permitted; a one indicates that key-controlled protection applies to both fetching and storing. No distinction is made between the fetching of instructions and of operands.
Reference Bit (R): The reference bit, bit 5, normally is set to one each time a location in the corresponding storage block is referred to either for storing or for fetching of information.
Change Bit (C): The change bit, bit 6, is set to one each time information is stored at a location in the corresponding storage block.
Storage keys are not part of addressable storage. The entire storage key is set by SET STORAGE KEY EXTENDED and inspected by INSERT STORAGE KEY EXTENDED. Additionally, the instruction RESET REFERENCE BIT EXTENDED provides a means of inspecting the reference and change bits and of setting the reference bit to zero. Bits 0-4 of the storage key are inspected by the INSERT VIRTUAL STORAGE KEY instruction. The contents of the storage key are unpredictable during and after the execution of the usability test of the TEST BLOCK instruction.
Key-controlled protection affords protection against improper storing or against both improper storing and fetching, but not against improper fetching alone.
Four protection facilities are provided to protect the contents of main storage from destruction or misuse by programs that contain errors or are unauthorized: key-controlled protection, access-list-controlled protection, page protection, and low-address protection. The protection facilities are applied independently; access to main storage is only permitted when none of the facilities prohibit the access.
Subtopics:
The keys are said to match when the four access-control bits of the storage key are equal to the access key, or when the access key is zero.
When key-controlled protection applies to a storage access, a store is permitted only when the storage key matches the access key associated with the request for storage access; a fetch is permitted when the keys match or when the fetch-protection bit of the storage key is zero.
The protection action is summarized in Figure 3-3.
_____________________________ __________________ | Conditions | Is Access to | |________________ ____________|Storage Permitted?| |Fetch-Protection| |_________ ________| | Bit of | | | | | Storage Key |Key Relation| Fetch | Store | |________________|____________|_________|________| | 0 | Match | Yes | Yes | | 0 | Mismatch | Yes | No | | 1 | Match | Yes | Yes | | 1 | Mismatch | No | No | |________________|____________|_________|________| |Explanation: | | | | Match The four access-control bits of the | | storage key are equal to the access | | key, or the access key is zero. | | | | Yes Access is permitted. | | | | No Access is not permitted. On fetching, | | the information is not made available | | to the program; on storing, the con- | | tents of the storage location are not | | changed. | |________________________________________________|Figure 3-3. Summary of Protection Action
When the access to storage is initiated by the CPU and key-controlled protection applies, the PSW key is the access key, except that the access key is specified in a general register for the first operand of MOVE TO SECONDARY and MOVE WITH DESTINATION KEY and for the second operand of MOVE TO PRIMARY, MOVE WITH KEY, and MOVE WITH SOURCE KEY. The PSW key occupies bit positions 8-11 of the current PSW.
When the access to storage is for the purpose of channel-program execution, the subchannel key associated with that channel program is the access key. The subchannel key for a channel program is specified in the operation-request block (ORB). When, for purposes of channel-subsystem monitoring, an access to the measurement block is made, the measurement-block key is the access key. The measurement-block key is specified by the SET CHANNEL MONITOR instruction.
When a CPU access is prohibited because of key-controlled protection, the unit of operation is suppressed or the instruction is terminated, and a program interruption for a protection exception takes place. However, if the suppression-on-protection facility is installed, the execution of the instruction may be suppressed. When a channel-program access is prohibited, the start function is ended, and the protection-check condition is indicated in the associated interruption-response block (IRB). When a measurement-block access is prohibited, the I/O measurement-block protection-check condition is indicated.
When a store access is prohibited because of key-controlled protection, the contents of the protected location remain unchanged. When a fetch access is prohibited, the protected information is not loaded into a register, moved to another storage location, or provided to an I/O device. For a prohibited instruction fetch, the instruction is suppressed, and an arbitrary instruction-length code is indicated.
Key-controlled protection is independent of whether the CPU is in the problem or the supervisor state and, except as described below, does not depend on the type of CPU instruction or channel-command word being executed.
Except where otherwise specified, all accesses to storage locations that are explicitly designated by the program and that are used by the CPU to store or fetch information are subject to key-controlled protection.
Key-controlled protection does not apply when the storage-protection-override control is one and the value of the four access-control bits of the storage key is 9. Key-controlled protection for fetches may or may not apply when the fetch-protection-override control is one, depending on the effective address and the private-space control.
Accesses to the second operand of TEST BLOCK are not subject to key-controlled protection.
All storage accesses by the channel subsystem to access the I/O measurement block, or by a channel program to fetch a CCW or IDAW or to access a data area designated during the execution of a CCW, are subject to key-controlled protection. However, if a CCW, an IDAW, or output data is prefetched, a protection check is not indicated until the CCW or IDAW is due to take control or until the data is due to be written.
Key-controlled protection is not applied to accesses that are implicitly made for any of such sequences as:
Subtopics:
Storage-protection override applies to instruction fetch and to the fetch and store accesses of instructions whose operand addresses are logical, virtual, or real. It does not apply to accesses made for the purpose of channel-program execution or for the purpose of channel-subsystem monitoring.
Bit 7 of control register 0 is the storage-protection-override control. When the storage-protection-override facility is installed and this bit is set to one, storage-protection override is active. When the storage-protection-override facility is not installed or this bit is set to zero, storage-protection override is inactive. When storage-protection override is active, key-controlled storage protection is ignored for storage locations having an associated storage-key value of 9. When storage-protection override is inactive, no special action is taken for a storage-key value of 9.
Storage-protection override applies to the operands of MOVE PAGE even when the operand is in expanded storage.
Storage-protection override has no effect on accesses which are not subject to key-controlled protection.
Programming Notes:
Fetch-protection override applies to instruction fetch and to the fetch accesses of instructions whose operand addresses are logical, virtual, or real. It does not apply to fetch accesses made for the purpose of channel-program execution or for the purpose of channel-subsystem monitoring. When this bit is set to zero, fetch protection of locations at effective addresses 0-2047 is determined by the state of the fetch-protection bit of the storage key associated with those locations.
Bit 6 of control register 0 is the fetch-protection-override control. When the bit is one, fetch protection is ignored for locations at effective addresses 0-2047. An effective address is the address which exists before any transformation by dynamic address translation or prefixing. However, fetch protection is not ignored if the effective address is subject to dynamic address translation and the private-space control, bit 23, is one in the segment-table designation used in the translation.
Fetch-protection override has no effect on accesses which are not subject to key-controlled protection.
Programming Note: The fetch-protection-override control allows fetch protection of locations at addresses 2048-4095 along with no fetch protection of locations at addresses 0-2047.
The fetch-only bit is included in the ALB access-list entry. A change to the fetch-only bit in an access-list entry in main storage does not necessarily have an immediate, if any, effect on whether a protection exception is recognized. However, this change to the bit will have an effect immediately after PURGE ALB is executed.
In the access-register mode, bit 6 of the access-list entry, the fetch-only bit, controls which types of operand references are permitted to the address space specified by the access-list entry. When the entry is used in the access-register-translation part of a reference and bit 6 is zero, both fetch-type and store-type references are permitted; when bit 6 is one, only fetch-type references are permitted, and an attempt to store causes a protection exception to be recognized and the execution of the instruction to be suppressed.
TEST PROTECTION is changed to take into consideration access-list-controlled protection when the CPU is in the access-register mode. A violation of access-list-controlled protection causes condition code 1 to be set, except that it does not prevent condition code 2 or 3 from being set when the conditions for those codes are satisfied.
Access-list-controlled protection does not affect LOAD REAL ADDRESS.
Programming Note: A violation of access-list-controlled protection always causes suppression. A violation of any of the other protection types may cause termination.
The page-protection bit, bit 22 of the page-table entry, controls whether storing is allowed into the corresponding 4K-byte page. When the bit is zero, both fetching and storing are permitted; when the bit is one, only fetching is permitted. When an attempt is made to store into a protected page, the contents of the page remain unchanged, the unit of operation is suppressed or the instruction is terminated, and a program interruption for protection takes place. However, if the suppression-on-protection facility is installed, the execution of the instruction is suppressed.
The page-protection facility controls access to virtual storage by using the page-protection bit in each page-table entry. It provides protection against improper storing.
Page protection applies to all store-type references that use a virtual address.
Low-address protection is under control of bit 3 of control register 0, the low-address-protection-control bit. When the bit is zero, low-address protection is off; when the bit is one, low-address protection is on.
The low-address-protection facility provides protection against the destruction of main-storage information used by the CPU during interruption processing. This is accomplished by prohibiting instructions from storing with effective addresses in the range 0 through 511. The range criterion is applied before address transformation, if any, of the address by dynamic address translation or prefixing. However, the range criterion is not applied, with the result that low-address protection does not apply, if the effective address is subject to dynamic address translation and the private-space control, bit 23, is one in the segment-table designation used in the translation. Low-address protection does not apply if the segment-table designation to be used is not available due to another type of exception.
If an access is prohibited because of low-address protection, the contents of the protected location remain unchanged, the unit of operation is suppressed or the instruction is terminated, and a program interruption for a protection exception takes place. However, if the suppression-on-protection facility is installed, the execution of the instruction may be suppressed.
Any attempt by the program to store by using effective addresses in the range 0 through 511 is subject to low-address protection. Low-address protection is applied to the store accesses of instructions whose operand addresses are logical, virtual, or real. Low-address protection is also applied to the trace table.
Low-address protection is not applied to accesses made by the CPU or the channel subsystem for such sequences as interruptions, CPU logout, the storing of the I/O-interruption code in real locations 184-191 by TEST PENDING INTERRUPTION, and the initial-program-loading and store-status functions, nor is it applied to data stores during I/O data transfer. However, explicit stores by a program at any of these locations are subject to low-address protection.
Programming Notes:
If the suppression-on-protection facility is installed, then, during a program interruption due to a protection exception, either a one or a zero is stored in bit position 29 of real locations 144-147. The storing of a one in bit position 29 indicates that:
Bit 29 is set to one if the protection exception was due to access-list-controlled protection or page protection. Bit 29 may be set to one if the protection exception was due to low-address protection or key-controlled protection.
If a protection-exception condition exists due to either access-list-controlled protection or page protection but also exists due to either low-address protection or key-controlled protection, it is unpredictable for which reason the protection exception is recognized, and it is unpredictable whether bit 29 is set to zero or one.
Programming Notes:
_____ ____ _____ _____ ______ ____ __________ |LA or| |ALC | |Virt. | |Bits 30,31| |Key- | |or | |Addr. | |and Loc. | |Cont.| |Page |Eff. |Enhmt.|Bit |160 if | |Prot.|DAT |Prot.|Addr.|Instl.|29 |Bit 29 One| |_____|____|_____|_____|______|____|__________| | No |On | Yes |Log. | - | 1 | P | | Yes |On | Yes |Log. | - | U1 | P | | | | | | | | | | Yes |Off | No |Log. | - | U2 | U3 | | Yes |Off | No |Real | - | U2 | U3 | | Yes |On | No |Log. | - | U2 | P | | Yes |On | No |Real | No | U2 | U3 | | Yes |On | No |Real | Yes | 0A | - | |_____|____|_____|_____|______|____|__________| |Explanation: | | | | - Immaterial or not applicable. | | ALC Access-list-controlled. | | LA Low-address. | | Log. Logical. | | P Predictable. | | U1 Unpredictable because low-address or | | key-controlled protection may be | | recognized instead of access-list- | | controlled or page protection. | | U2 Unpredictable because bit 29 is only | | required to be set to one for access-| | list-controlled or page protection. | | U3 Unpredictable because effective | | address is not to be translated by | | DAT. | | 0A Zero because DAT is on and a virtual | | effective address would not be | | stored. | |_____________________________________________|Figure 3-4. Suppression-on-Protection Results
Reference recording is always active and takes place for all storage accesses, including those made by any CPU, any operator facility, or the channel subsystem. It takes place for implicit accesses made by the machine, such as those which are part of interruptions and I/O-instruction execution.
Reference recording provides information for use in selecting pages for replacement. Reference recording uses the reference bit, bit 5 of the storage key. The reference bit is set to one each time a location in the corresponding storage block is referred to either for fetching or storing information, regardless of whether DAT is on or off.
Reference recording does not occur for operand accesses of the following instructions since they directly refer to a storage key without accessing a storage location:
The change bit is set to one each time a store access causes the contents in the corresponding storage block to be changed. A store access that does not change the contents of storage may or may not set the change bit to one.
Change recording provides information as to which pages have to be saved in auxiliary storage when they are replaced in main storage. Change recording uses the change bit, bit 6 of the storage key.
The change bit is not set to one for an attempt to store if the access is prohibited. In particular:
Change recording does not take place for the operands of the following instructions since they directly modify a storage key without modifying a storage location:
Prefixing causes real addresses in the range 0-4095 to correspond to the block of 4K-byte absolute addresses identified by the value in the prefix register for the CPU, and the block of real addresses identified by the value in the prefix register to correspond to absolute addresses 0-4095. The remaining real addresses are the same as the corresponding absolute addresses. This transformation allows each CPU to access all of main storage, including the first 4K bytes and the locations designated by the prefix registers of other CPUs.
Prefixing provides the ability to assign the range of real addresses 0-4095 (the prefix area) to a different block in absolute storage for each CPU, thus permitting more than one CPU sharing main storage to operate concurrently with a minimum of interference, especially in the processing of interruptions.
The relationship between real and absolute addresses is graphically depicted in Figure 3-5.
The prefix is a 19-bit quantity contained in bit positions 1-19 of the prefix register. The register has the following format:
_ ___________________ ____________ |/| Prefix |////////////| |_|___________________|____________| 0 1 20 31When prefixing is applied, the real address is transformed into an absolute address by using one of the following rules, depending on bits 1-19 of the real address:The contents of the register can be set and inspected by the privileged instructions SET PREFIX and STORE PREFIX, respectively. On setting, bits corresponding to bit positions 0 and 20-31 of the prefix register are ignored. On storing, zeros are provided for these bit positions. When the contents of the prefix register are changed, the change is effective for the next sequential instruction.
Only the address presented to storage is translated by prefixing. The contents of the source of the address remain unchanged.
The distinction between real and absolute addresses is made even when the prefix register contains all zeros, in which case a real address and its corresponding absolute address are identical.
Prefixing Prefixing _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | | | | | | |______|_No Change___________|_____ÿ| | | | | | | / | | / | | / | _| | Apply | |_ | |_____|___________No Change_|______| | | 1|________Zeros_ ______________ÿ|2 | | | | | _| | | | | |_ | | | | | | / | | | | / | | / | | | | | | | | _| | Apply | |_ | | | | | | | 2|______________ _Zeros________|1 | | | | | | | | | _| | | | | |_ | | | |____|____ | | | | | | | | | | | | | | | | | | | | | | / | | | | / | ____|____| | / | |______|_No Change__|____|___|_____ÿ| | | | | | | | | | | | | | | | | | | | | | | | | | | | |_____|___|____|__No Change_|______| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4096 | _| | Apply | | | 4096 |_ | _| | | | Apply | |_ | 4096 | |________Prefix_____| |_________ÿ| | |_________| |_____Prefix________| | 0 | _| | _ _ _ _ _ _ _ _ _ _ | 0 |_ | _| | _ _ _ _ _ _ _ _ _ _ | |_ | 0 Real Addresses Absolute Real Addresses for CPU A Addresses for CPU B
(1) Real addresses in which bits 1-19 are equal to 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-4095.
Figure 3-5. Relationship between Real and Absolute Addresses
When a virtual address is used by a CPU to access main storage, it is first converted, by means of dynamic address translation (DAT), to a real address, and then, by means of prefixing, to an absolute address. DAT uses two levels of tables (segment tables and page tables) as transformation parameters. The designation (origin and length) of a segment table is found for use by DAT in a control register or as specified by an access register.
An address space is a consecutive sequence of integer numbers (virtual addresses), together with the specific transformation parameters which allow each number to be associated with a byte location in storage. The sequence starts at zero and proceeds left to right.
DAT uses, at different times, the segment-table designations in different control registers or specified by the access registers. The choice is determined by the translation mode specified in the current PSW. Four translation modes are available: primary-space mode, secondary-space mode, access-register mode, and home-space mode. Different address spaces are addressable depending on the translation mode.
At any instant when the CPU is in the primary-space mode or secondary-space mode, the CPU can translate virtual addresses belonging to two address spaces--the primary address space and the secondary address space. At any instant when the CPU is in the access-register mode, it can translate virtual addresses of up to 16 address spaces--the primary address space and up to 15 AR-specified address spaces. At any instant when the CPU is in the home-space mode, it can translate virtual addresses of the home address space.
The primary address space is identified as such because it consists of primary virtual addresses, which are translated by means of the primary segment-table designation. Similarly, the secondary address space consists of secondary virtual addresses translated by means of the secondary segment-table designation, the AR-specified address spaces consist of AR-specified virtual addresses translated by means of AR-specified segment-table designations, and the home address space consists of home virtual addresses translated by means of the home segment-table designation. The primary and secondary segment-table designations are in control registers 1 and 7, respectively. The AR-specified segment-table designations are in control registers 1 and 7 and in table entries called ASN-second-table entries. The home segment-table designation is in control register 13.
Subtopics:
A program can cause different address spaces to be addressable by using the semiprivileged SET ADDRESS SPACE CONTROL instruction to change the translation mode to the primary-space mode, secondary-space mode, access-register mode, or home-space mode. However, SET ADDRESS SPACE CONTROL can set the home-space mode only in the supervisor state. The program can cause still other address spaces to be addressable by using other semiprivileged instructions to change the segment-table designations in control registers 1 and 7 and by using unprivileged instructions to change the contents of the access registers. Only the privileged LOAD CONTROL instruction is available for changing the home segment-table designation in control register 13.
Under certain circumstances, the semiprivileged instructions which place a new segment-table designation in control register 1 or 7 fetch this segment-table designation from an ASN-second-table entry. Some of these instructions use an ASN-translation mechanism which, given an ASN, can locate the designated ASN-second-table entry.
An address space may be assigned an address-space number (ASN) by the control program. The ASN designates, within a two-level table structure in main storage, an ASN-second-table entry containing information about the address space. If the ASN-second-table entry is marked as valid, it contains the segment-table designation that defines the address space.
The 16-bit unsigned binary format of the ASN permits 64K unique ASNs.
The ASNs for the primary and secondary address spaces are assigned positions in control registers. The ASN for the primary address space, called the primary ASN, is assigned bits 16-31 of control register 4, and that for the secondary address space, called the secondary ASN, is assigned bits 16-31 of control register 3. The registers have the following formats:
Control Register 4 __ ________________ | PASN | __|________________| 16 31 Control Register 3 __ ________________ | SASN | __|________________| 16 31
An instruction that uses ASN translation and loads the primary or secondary segment-table designation into the appropriate control register also loads the corresponding ASN into the appropriate control register.The ASN for the home address space is not assigned a position in a control register.
An access register containing the value 0 or 1 specifies the primary or secondary address space, respectively; and the segment-table designation specified by the access register is in control register 1 or 7, respectively. An access register containing any other value designates an entry in a table called an access list. The designated access-list entry contains the real address of an ASN-second-table entry for the address space specified by the access register. The segment-table designation specified by the access register is in the ASN-second-table entry. Translating the contents of an access register to obtain a segment-table designation for use by DAT does not involve the use of an ASN.
Note: Virtual storage consisting of byte locations ordered according to their virtual addresses in an address space is usually referred to as "storage."
Programming Note: Because an ASN-second-table entry is located from an access-list entry by means of its address instead of by means of its ASN, the ASN-second-table entries designated by access-list entries can be "pseudo" ASN-second-table entries, that is, entries which are not in the two-level structure able to be indexed by means of the ASN-translation process. The number of unique pseudo ASN-second-table entries can be greater than the number of unique ASNs and is limited only by the amount of storage available to be occupied by the ASN-second-table entries. Thus, in a sense, there is no limit on the number of possible address spaces.
ASN translation may also be performed as part of PROGRAM RETURN. Primary ASN translation is performed as part of PROGRAM RETURN with space switching (PR-ss). Secondary ASN translation is performed if the secondary ASN restored by PROGRAM RETURN (PR-ss or PROGRAM RETURN to current primary) does not equal the primary ASN restored by PROGRAM RETURN.
ASN translation is the process of translating the 16-bit ASN to locate the address-space-control parameters. ASN translation may be performed as part of PROGRAM CALL with space switching (PC-ss), it is performed as part of PROGRAM TRANSFER with space switching (PT-ss) and SET SECONDARY ASN with space switching (SSAR-ss), and it may be performed as part of LOAD ADDRESS SPACE PARAMETERS. For PC-ss and PT-ss, the ASN which is translated replaces the primary ASN in control register 4. For SSAR-ss, the ASN which is translated replaces the secondary ASN in control register 3. These two translation processes are called primary ASN translation and secondary ASN translation, respectively, and both can occur for LOAD ADDRESS SPACE PARAMETERS. The ASN-translation process is the same for both primary and secondary ASN translation; only the uses of the results of the process are different.
The ASN-translation process uses two tables, the ASN first table and the ASN second table. They are used to locate the address-space-control parameters and a third table, the authority table, which is used when ASN authorization is performed.
For the purposes of this translation, the 16-bit ASN is considered to consist of two parts: the ASN-first-table index (AFX) is the leftmost 10 bits of the ASN, and the ASN-second-table index (ASX) is the six rightmost bits. The ASN has the following format:
ASN __________ ______ | AFX | ASX | |__________|______| 0 10 15
The AFX is used to select an entry from the ASN first table. The origin of the ASN first table is designated by the ASN-first-table origin in control register 14. The ASN-first-table entry contains the origin of the ASN second table. The ASX is used to select an entry from the ASN second table. This entry contains the address-space-control parameters.
Subtopics:
ASN translation is controlled by the ASN-translation-control bit and the ASN-first-table origin, both of which reside in control register 14. It is also controlled by the address-space-function-control bit in control register 0.
Subtopics:
__ _ ____________________ |T| AFTO | __|_|____________________| 12 31ASN-Translation Control (T): Bit 12 of control register 14 is the ASN-translation-control bit. This bit provides a mechanism whereby the control program can indicate whether ASN translation can occur while a particular program is being executed. Bit 12 must be one to allow completion of these instructions:
When the address-space-function-control bit in control register 0 is one,
PROGRAM CALL with space switching (PC-ss) may omit performing ASN
translation and instead obtain the address of an ASN-second-table entry
directly from an entry-table entry. The ASN-translation control must be
one whether or not PC-ss performs ASN translation; otherwise, a
special-operation exception is recognized.
ASN-First-Table Origin (AFTO): Bits 13-31 of control register 14, with 12
zeros appended on the right, form a 31-bit real address that designates
the beginning of the ASN first table.
The ASF control has other effects also. A complete description of the effects of the ASF control is in "Address-Space-Function Control" in topic 5.8.1.1.
Bit 15 of control register 0 is the address-space-function (ASF) control. When the ASF control is zero, the ASN-second table begins on a 16-byte boundary, an ASN-second-table entry has a length of 16 bytes, and PROGRAM CALL with space switching (PC-ss) always performs ASN translation. When the ASF control is one, the ASN-second table begins on a 64-byte boundary, an ASN-second-table entry has a length of 64 bytes, and PC-ss may obtain an ASN-second-table-entry address from an entry-table entry instead of by performing ASN translation.
The ASN-translation process consists in a two-level lookup using two tables: an ASN first table and an ASN second table. These tables reside in real storage.
Subtopics:
When the ASF control, bit 15 of control register 0, is zero, an entry in the ASN first table has the following format:
_ ___________________________ ____ |I| ASTO |0000| |_|___________________________|____| 0 1 28 31The fields in the entry are allocated as follows:When the ASF control is one, an entry has the following format:
_ _________________________ ______ |I| ASTO |000000| |_|_________________________|______| 0 1 26 31
AFX-Invalid Bit (I): Bit 0 controls whether the ASN second table associated with the ASN-first-table entry is available. When bit 0 is zero, ASN translation proceeds by using the designated ASN second table. When the bit is one, the ASN translation cannot continue.
ASN-Second-Table Origin (ASTO): Bits 1-27, with four zeros appended on the right, or bits 1-25, 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.
Bits 28-31 of the AFT entry, or bits 26-31, must be zeros; otherwise, an ASN-translation-specification exception may be recognized as part of the execution of the instruction using that entry for ASN translation.
The 16-byte ASN-second-table entry has the following format:
When the ASF control in control register 0 is zero, the ASN-second-table entry has a length of 16 bytes. When the ASF control is one, the entry has a length of 64 bytes. The format of the 16-byte ASN-second-table entry is identical to that of the first 16 bytes of the 64-byte entry. Only the first 16 bytes of the ASN-second-table entry (16-byte entry or 64-byte entry) are used in or as a result of ASN translation. The 16-byte ASN-second-table entry is described below. The 64-byte entry as used by access-register translation for other than the BRANCH IN SUBSPACE GROUP instruction is described in "Extended ASN-Second-Table Entries" in topic 5.8.3.3. The 64-byte entry as used by BRANCH IN SUBSPACE GROUP is described in "Subspace-Group ASN-Second-Table Entries" in topic 5.9.1.2.
_ ___________________________ _ _ |I| ATO |0|B| |_|___________________________|_|_| 0 1 30 31 _______________ ____________ ____ | AX | ATL |0000| |_______________|____________|____| 32 48 60 63 _______________STD_______________ _ ______________ __ _ _ _ _______ |X| STO | |G|P|S| STL | |_|______________|__|_|_|_|_______| 64 84 86 89 95 _______________LTD_______________ _ _______________________ _______ |V| LTO | LTL | |_|_______________________|_______| 96 121 127
The fields in the entry are allocated as follows:ASX-Invalid Bit (I): Bit 0 controls whether the address space associated with the ASN-second-table entry is available. When bit 0 is zero, ASN translation proceeds. When the bit is one, the ASN translation cannot continue.
Authority-Table Origin (ATO): Bits 1-29, with two zeros appended on the right, are used to form a 31-bit real address that designates the beginning of the authority table.
Base-Space Bit (B): Bit 31 is ignored during ASN translation if the subspace-group facility is installed and the ASF control is one. If the subspace-group facility is not installed or the ASF control is zero, bit 31 must be zero; otherwise, an ASN-translation-specification exception may be recognized. Bit 31 is further described in "Subspace-Group ASN-Second-Table Entries" in topic 5.9.1.2.
Authorization Index (AX): Bits 32-47 are used as a result of primary ASN translation by PROGRAM CALL, PROGRAM RETURN, and PROGRAM TRANSFER and may be used by LOAD ADDRESS SPACE PARAMETERS. The AX field is ignored for secondary ASN translation.
Authority-Table Length (ATL): Bits 48-59 specify the length of the authority table in units of four bytes, thus making the authority table variable in multiples of 16 entries. The length of the authority table, in units of four bytes, is one more than the ATL value. The contents of the ATL field are used to establish whether the entry designated by a particular AX falls within the authority table.
Segment-Table Designation (STD): Bits 64-95 are used as a result of ASN translation to replace the primary-segment-table designation (PSTD) or the secondary-segment-table designation (SSTD). For SET SECONDARY ASN, the STD field replaces the SSTD, bits 0-31 of control register 7. For PROGRAM CALL, the STD field replaces the PSTD, bits 0-31 of control register 1. Each of these actions may occur independently for LOAD ADDRESS SPACE PARAMETERS. For PROGRAM TRANSFER, the STD field replaces both the PSTD and the SSTD. For PROGRAM RETURN, as a result of primary ASN translation, the STD field replaces the PSTD, and, as a result of secondary ASN translation, the STD field replaces the SSTD. The contents of the entire STD field are placed in the appropriate control registers without being inspected for validity.
The subspace-group-control bit (G) (bit 86, or bit 22 of the STD field) is an extension provided by the subspace-group facility. The bit indicates, when one, that the STD specifies an address space that is the base space or a subspace of a subspace group. If (1) G is one in the STD placed in a control register as described above, (2) the current dispatchable unit last had control in a subspace of its subspace group instead of in the base space, as indicated by the subspace-active bit being one in the dispatchable-unit control table, and (3) the STD specifies the base space of the group, as indicated by the origin of this AST entry being equal to the base-AST-entry origin in the dispatchable-unit control table, then bits 1-23 and 25-31 of the STD in the control register are replaced by bits 1-23 and 25-31 of the STD for that last entered subspace. The STD for the subspace is obtained from the AST entry designated by the subspace-AST-entry origin in the dispatchable-unit control table.
The storage-alteration-event bit (S) (bit 88, or bit 24 of the STD field) is an extension provided by the program-event-recording-2 (PER-2) facility.
Space-Switch-Event Control (X): Bit 0 of the segment-table designation is the space-switch-event-control bit. When, in PC-ss, PR-ss, or PT-ss, this bit is one in control register 1 either before or after the execution of the instruction, a program interruption for a space-switch event occurs after the execution of the instruction is completed. A space-switch-event program interruption also occurs after the completion of a SET ADDRESS SPACE CONTROL instruction that changes the translation mode either to or from the home-space mode when this bit is one in either control register 1 or control register 13. When, in LOAD ADDRESS SPACE PARAMETERS, this bit is one during primary ASN translation, this fact is indicated by the condition code.
Linkage-Table Designation (LTD): Bits 96-127 may be used as a result of primary ASN translation and they are used in PC-number translation. The linkage-table-designation field contains the subsystem-linkage-control bit (V) (bit 96), the linkage-table origin (LTO) (bits 97-120), and the linkage-table length (LTL) (bits 121-127). When the ASF control is zero, the contents of the LTD field are placed in control register 5 as a result of primary ASN translation, and the PC-number-translation process obtains the LTD from control register 5. When the ASF control is one, control register 5 contains the origin of an ASN-second-table entry called the primary AST entry. The primary-AST-entry origin is replaced in control register 5 as a result of primary ASN translation, and PC-number translation obtains the LTD from the LTD field in the primary AST entry. PC-number translation is described in Chapter 5, "Program Execution."
Bits 30, 31, and 60-63 of the AST entry must be zeros; otherwise, an ASN-translation-specification exception may be recognized as part of the execution of the instruction using that entry for ASN translation. However, ASN translation does not require bit 31 to be zero if the subspace-group facility is installed and the ASF control is one.
Programming Note: The unused portion of the STD field, bits 84 and 85 of the AST entry, which corresponds to bits 20 and 21 of the STD, should be set to zeros. These bits are reserved for future expansion, and programs which place nonzero values in these bit positions may not operate compatibly on future machines.
The ASN first index is used to select an entry from the ASN first table. This entry designates the ASN second table to be used.
This section describes the ASN-translation process as it is performed during the execution of the space-switching forms of PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, and SET SECONDARY ASN, and also in PROGRAM RETURN when the restored secondary ASN does not equal the restored primary ASN. ASN translation for LOAD ADDRESS SPACE PARAMETERS is the same, except that AFX-translation and ASX-translation exceptions do not occur; such situations are instead indicated by the condition code. Translation of an ASN is performed by means of two tables, an ASN first table and an ASN second table, both of which reside in main storage.
The ASN second index is used to select an entry from the ASN second table. This entry contains the address-space-control parameters. When the ASF control is one, the ASN second table begins on a 64-byte boundary, and its entries are each 64 bytes in length; otherwise, the table begins on a 16-byte boundary, and the entries are 16 bytes in length.
If the I bit is one in either the ASN-first-table entry or ASN-second-table entry, the entry is invalid, and the ASN-translation process cannot be completed. An AFX-translation exception or ASX-translation exception is recognized.
Whenever access to main storage is made during the ASN-translation process for the purpose of fetching an entry from an ASN first table or ASN second table, key-controlled protection does not apply.
The ASN-translation process is shown in Figure 3-6.
ASN ____ _ _________ _____ ___ CR14 | |T| AFTO | | AFX |ASX| |____|_|_____ ___| |__ __|_ _| (x4096)| (x4)| |(xN) | | | _________________| | | | | | | _______________________| | | | | | | | _ ASN First Table | |____ÿ|+| _________________ | | | | | | | | | | | | | | |_ÿ|_ _____________ _| | R |I| ASTO |0| | |_|______ ______|_| | | |(xN) | | | | | | |________|________| | | | __________________| | | | | ____________________________| | | | | _ ASN Second Table |____ÿ|+| _____________________________________________________________________ | | | | | | | | | | |_ÿ|_ ____________ __ ________ ______ _ ________________ ________________| R |I| ATO |0B| AX | ATL |0| STD | LTD |* |_|____________|__|________|______|_|________________|________________| | | | | |_____________________________________________________________________|N: 16 if ASF control, bit 15 of control register 0, is zero; 64 if ASF control is one R: Address is real *: ASTE is 64 bytes if ASF control is one; last 48 bytes are not shown
Figure 3-6. ASN Translation
Subtopics:
The 31-bit real address of the ASN-first-table entry is obtained by appending 12 zeros on the right to the AFT origin contained in bit positions 13-31 of control register 14 and adding the AFX portion with two rightmost and 19 leftmost zeros appended. This addition cannot cause a carry into bit position 0. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The AFX portion of the ASN, in conjunction with the ASN-first-table origin, is used to select an entry from the ASN first table.
All four bytes of the ASN-first-table entry appear to be fetched concurrently as observed by other CPUs. The fetch access is not subject to protection. When the storage address which is generated for fetching the ASN-first-table entry designates a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
Bit 0 of the four-byte AFT entry specifies whether the corresponding AST is available. If this bit is one, an AFX-translation exception is recognized. When the AST-entry size is 16 bytes and bit positions 28-31 of the AFT entry do not contain zeros, or when the AST-entry size is 64 bytes and bit positions 26-31 of the AFT entry do not contain zeros, an ASN-translation-specification exception may be recognized. When no exceptions are recognized, the entry fetched from the AFT is used to access the AST.
When the address-space-function (ASF) control, bit 15 of control register 0, is zero, the ASN second table begins on a 16-byte boundary, and its entries are each 16 bytes in length. When the ASF control is one, the ASN second table begins on a 64-byte boundary, and its entries are 64 bytes in length.
The ASX portion of the ASN, in conjunction with the ASN-second-table origin contained in the ASN-first-table entry, is used to select an entry from the ASN second table.
The 31-bit real address of the ASN-second-table entry is obtained as follows. When the AST-entry size is 16 bytes, the address is obtained by appending four zeros on the right to bits 1-27 of the ASN-first-table entry and adding the ASX with four rightmost and 21 leftmost zeros appended. When the AST-entry size is 64 bytes, the address is obtained by appending six zeros on the right to bits 1-25 of the ASN-first-table entry and adding the ASX with six rightmost and 19 leftmost zeros appended. In both of these cases, a carry, if any, into bit position 0 is ignored. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The fetch of the 16 or 64 bytes of the ASN-second-table entry appears to be word-concurrent as observed by other CPUs, with the leftmost word fetched first. The order in which the remaining 3 or 15 words are fetched is unpredictable. The fetch access is not subject to protection. When the storage address which is generated for fetching the ASN-second-table entry designates a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
Bit 0 of the 16-byte or 64-byte ASN-second-table entry specifies whether the address space is accessible. If this bit is one, an ASX-translation exception is recognized. If bit positions 30, 31, and 60-63 of the ASN-second-table entry do not contain zeros, an ASN-translation-specification exception may be recognized. A one in bit position 31 does not cause an ASN-translation-specification exception to be recognized if the subspace-group facility is installed and the ASF control is one.
The exceptions which can be encountered during the ASN-translation process are collectively referred to as ASN-translation exceptions. A list of these exceptions and their priorities is given in Chapter 6, "Interruptions."
ASN authorization is also performed as part of PROGRAM RETURN when the restored secondary ASN does not equal the restored primary ASN. ASN authorization of the restored secondary ASN is performed after ASN translation of the restored secondary ASN.
ASN authorization is the process of testing whether the program associated with the current authorization index is permitted to establish a particular address space. The ASN authorization is performed as part of PROGRAM TRANSFER with space switching (PT-ss) and SET SECONDARY ASN with space switching (SSAR-ss) and may be performed as part of LOAD ADDRESS SPACE PARAMETERS. ASN authorization is performed after the ASN-translation process for these instructions.
When performed as part of PT-ss, the ASN authorization tests whether the ASN can be established as the primary ASN and is called primary-ASN authorization. When performed as part of LOAD ADDRESS SPACE PARAMETERS, PROGRAM RETURN, or SSAR-ss, the ASN authorization tests whether the ASN can be established as the secondary ASN and is called secondary-ASN authorization.
The ASN authorization is performed by means of an authority table in real storage which is designated by the authority-table-origin and authority-table-length fields in the ASN-second-table entry.
Subtopics:
ASN authorization uses the authority-table origin and the authority-table length from the ASN-second-table entry, together with an authorization index.
Subtopics:
For PT-ss and SSAR-ss, the current contents of control register 4 include the authorization index. For LOAD ADDRESS SPACE PARAMETERS and PROGRAM RETURN, the value which will become the new contents of control register 4 is used. The register has the following format:
________________ __ | AX | |________________|__ 0 15Authorization Index (AX): Bits 0-15 of control register 4 are used as an index to locate the authority bits in the authority table.
The ASN-second-table entry which is fetched as part of the ASN translation process contains information which is used to designate the authority table. An entry in the ASN second table has the following format:
_ ______________________________ __ | | ATO |0B| |_|______________________________|__| 0 1 31 _________________ ____________ ____ __ | | ATL |0000| |_________________|____________|____|__ 32 48 60 64
Authority-Table Origin (ATO): Bits 1-29, with two zeros appended on the right, are used to form a 31-bit real address that designates the beginning of the authority table.
Authority-Table Length (ATL): Bits 48-59 specify the length of the authority table in units of four bytes, thus making the authority table variable in multiples of 16 entries. The length of the authority table, in units of four bytes, is equal to one more than the ATL value. The contents of the length field are used to establish whether the entry designated by the authorization index falls within the authority table.
The authority table consists of entries of two bits each; accordingly, each byte of the authority table contains four entries in the following format:
__ __ __ __ |PS|PS|PS|PS| |__|__|__|__| 0 7Primary Authority (P): The left bit of an authority-table entry controls whether the program with the authorization index corresponding to the entry is permitted to establish the address space as a primary address space. If the P bit is one, the establishment is permitted. If the P bit is zero, the establishment is not permitted.
Secondary Authority (S): The right bit of an authority-table entry controls whether the program with the corresponding authorization index is permitted to establish the address space as a secondary address space. If the S bit is one, the establishment is permitted. If the S bit is zero, the establishment is not permitted.
The authority table is also used in the extended-authorization process, as part of access-register translation. Extended authorization is described in "Authorizing the Use of the Access-List Entry" in topic 5.8.4.7.
The ASN-authorization process is performed by using the authorization index, in conjunction with the authority-table origin and length from the AST entry, to select an authority-table entry. The entry is fetched, and either the primary- or secondary-authority bit is examined, depending on whether the primary- or secondary-ASN-authorization process is being performed. The ASN-authorization process is shown in Figure 3-7.
This section describes the ASN-authorization process as it is performed during the execution of PROGRAM TRANSFER with space switching and SET SECONDARY ASN with space switching. For these two instructions, the ASN-authorization process is performed by using the authorization index currently in control register 4. Secondary authorization for PROGRAM RETURN, when the restored secondary ASN does not equal the restored primary ASN, and for LOAD ADDRESS SPACE PARAMETERS is the same, except that the value which will become the new contents of control register 4 is used for the authorization index. Also, for LOAD ADDRESS SPACE PARAMETERS, a secondary-authority exception does not occur. Instead, such a situation is indicated by the condition code.
_______ _______ CR4 | AX | | |___ ___|_______| |(x1/4) | _____________| | | | ASN Second Table | _____________________________________________________________________ | | | | | | | |ASN-Second-Table Entry | | |_ ____________ __ ________ ______ _ ________________ ________________| | |I| ATO |0B| AX | ATL |0| STD | LTD |* | |_|______ _____|__|________|______|_|________________|________________| | | |(x4) | | | | | | |________|____________________________________________________________| _____|____________| | | | | | | | | _ Authority Table |___ÿ|+| ___ | | | | For primary ASN authorization (PT-ss only): | | | Primary-authority exception if P bit | | | zero or table length exceeded. |_ÿ|_ _| R |P|S| 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 *: ASTE is 64 bytes if ASF control is one; last 48 bytes are not shown
Figure 3-7. ASN Authorization
Subtopics:
The authorization index is contained in bit positions 0-15 of control register 4.
The authorization index, in conjunction with the authority-table origin contained in the ASN-second-table entry, is used to select an entry from the authority table.
Bit positions 1-29 of the AST entry contain the leftmost 29 bits of the 31-bit real address of the authority table (ATO), and bit positions 48-59 contain the length of the authority table (ATL).
The 31-bit real address of a byte in the authority table is obtained by appending two zeros on the right to the authority-table origin and adding the 14 leftmost bits of the authorization index with 17 zeros appended on the left. A carry, if any, into bit position 0 is ignored. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
As part of the authority-table-entry-lookup process, bits 0-11 of the authorization index are compared against the authority-table length. If the compared portion is greater than the authority-table length, a primary-authority exception or secondary-authority exception is recognized for PT-ss or SSAR-ss, respectively. For LOAD ADDRESS SPACE PARAMETERS, when the authority-table length is exceeded, condition code 2 is set.
The fetch access to the byte in the authority table is not subject to protection. When the storage address which is generated for fetching the byte designates a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
The byte contains four authority-table entries of two bits each. The rightmost two bits of the authorization index, bits 14 and 15 of control register 4, are used to select one of the four entries. The left or right bit of the entry is then tested, depending on whether the authorization test is for a primary ASN or a secondary ASN. The following table shows the bit which is selected from the byte as a function of bits 14 and 15 of the authorization index and the instruction PT-ss, SSAR-ss, PROGRAM RETURN, or LOAD ADDRESS SPACE PARAMETERS.
________________ ___________________________ | | Bit Selected from | | | Authority-Table Byte | | | for Test | | Authorization- |____________ ______________| | Index Bits | | S Bit | | | P Bit | (SSAR-ss, | | 14 15 | (PT-ss) | PR, or LASP) | |________________|____________|______________| | 0 0 | 0 | 1 | | | | | | 0 1 | 2 | 3 | | | | | | 1 0 | 4 | 5 | | | | | | 1 1 | 6 | 7 | |________________|____________|______________|If the selected bit is one, the ASN is authorized, and the appropriate address-space-control parameters from the AST entry are loaded into the appropriate control registers. If the selected bit is zero, the ASN is not authorized, and a primary-authority exception is recognized for PT-ss or a secondary-authority exception is recognized for SSAR-ss or PROGRAM RETURN. For LOAD ADDRESS SPACE PARAMETERS, when the ASN is not authorized, condition code 2 is set.
Programming Note: The primary- and secondary-authority exceptions cause nullification in order to permit dynamic modification of the authority table. Thus, when an address space is created or "swapped in," the authority table can first be set to all zeros and the appropriate authority bits set to one only when required.
The exceptions which can be encountered during the primary-and secondary-ASN-authorization processes and their priorities are described in the definitions of the instructions in which ASN authorization is performed.
With appropriate support by an operating system, the dynamic-address-translation facility may be used to provide to a user a system wherein storage appears to be larger than the main storage which is available in the configuration. This apparent main storage is referred to as virtual storage, and the addresses used to designate locations in the virtual storage are referred to as virtual addresses. The virtual storage of a user may far exceed the size of the main storage which is available in the configuration and normally is maintained in auxiliary storage. The virtual storage is considered to be composed of blocks of addresses, called pages. Only the most recently referred-to pages of the virtual storage are assigned to occupy blocks of physical main storage. As the user refers to pages of virtual storage that do not appear in main storage, they are brought in to replace pages in main storage that are less likely to be needed. The swapping of pages of storage may be performed by the operating system without the user's knowledge.
Dynamic address translation (DAT) provides the ability to interrupt the execution of a program at an arbitrary moment, record it and its data in auxiliary storage, such as a direct-access storage device, and at a later time return the program and the data to different main-storage locations for resumption of execution. The transfer of the program and its data between main and auxiliary storage may be performed piecemeal, and the return of the information to main storage may take place in response to an attempt by the CPU to access it at the time it is needed for execution. These functions may be performed without change or inspection of the program and its data, do not require any explicit programming convention for the relocated program, and do not disturb the execution of the program except for the time delay involved.
The sequence of virtual addresses associated with a virtual storage is called an address space. With appropriate support by an operating system, the dynamic-address-translation facility may be used to provide a number of address spaces. These address spaces may be used to provide degrees of isolation between users. Such support can consist of a completely different address space for each user, thus providing complete isolation, or a shared area may be provided by mapping a portion of each address space to a single common storage area. Also, instructions are provided which permit a semiprivileged program to access more than one such address space. Dynamic address translation provides for the translation of virtual addresses from multiple different address spaces without requiring that the translation parameters in the control registers be changed. These address spaces are called the primary address space, secondary address space, and AR-specified address spaces. A privileged program can access also the home address space.
In the process of replacing blocks of main storage by new information from an external medium, it must be determined which block to replace and whether the block being replaced should be recorded and preserved in auxiliary storage. To aid in this decision process, a reference bit and a change bit are associated with the storage key.
Dynamic address translation may be specified for instruction and data addresses generated by the CPU but is not available for the addressing of data and of CCWs and IDAWs in I/O operations. The CCW-indirect-data-addressing facility is provided to aid I/O operations in a virtual-storage environment.
Address computation can be carried out in either the 24-bit or 31-bit addressing mode. When address computation is performed in the 24-bit addressing mode, seven zeros are appended on the left to form a 31-bit address. Therefore, the resultant logical address is always 31 bits in length. All real and absolute addresses are 31 bits in length.
Dynamic address translation is the process of translating a virtual address during a storage reference into the corresponding real address. The virtual address may be a primary virtual address, secondary virtual address, AR-specified virtual address, or home virtual address. These addresses are translated by means of the primary, the secondary, an AR-specified, or the home segment-table designation, respectively. After selection of the appropriate segment-table designation, the translation process is the same for all of the four types of virtual address.
In the process of translation, two types of units of information are recognized--segments and pages. A segment is a block of sequential virtual addresses spanning 1M bytes and beginning at a 1M-byte boundary. A page is a block of sequential virtual addresses spanning 4K bytes and beginning at a 4K-byte boundary.
The virtual address, accordingly, is divided into three fields. Bits 1-11 are called the segment index (SX), bits 12-19 are called the page index (PX), and bits 20-31 are called the byte index (BX). The virtual address has the following format:
_ ___________ ________ ____________ |/| SX | PX | BX | |_|___________|________|____________| 0 1 12 20 31Virtual addresses are translated into real addresses by means of two translation tables: a segment table and a page table. These reflect the current assignment of real storage. The assignment of real storage occurs in units of pages, the real locations being assigned contiguously within a page. The pages need not be adjacent in real storage even though assigned to a set of sequential virtual addresses.
Subtopics:
Additional controls are provided as described in Chapter 5, "Program Execution." These controls determine whether the contents of each access register can be used to obtain a segment-table designation for use by DAT.
Address translation is controlled by three bits in the PSW and by a set of bits referred to as the translation parameters. The translation parameters are in control registers 0, 1, 7, and 13. Additional controls are located in the translation tables.
Subtopics:
The three bits in the PSW that control dynamic address translation are bit 5, the DAT-mode bit, and bits 16 and 17, the address-space-control bits. When the DAT-mode bit is zero, then DAT is off, and the CPU is in the real mode. When the DAT-mode bit is one, then DAT is on, and the CPU is in the translation mode designated by the address-space-control bits: 00 designates the primary-space mode, 01 designates the access-register mode, 10 designates the secondary-space mode, and 11 designates the home-space mode. The various modes are shown in Figure 3-8, along with the handling of addresses in each mode.
________ ___ _____________________ _____________________ | | | |Handling of Addresses| |PSW Bit | | |___________ _________| |__ __ __| | |Instruction| Logical | | 5|16|17|DAT| Mode | Addresses |Addresses| |__|__|__|___|_____________________|___________|_________| | 0| 0| 0|Off|Real mode | Real |Real | | 0| 0| 1|Off|Real mode | Real |Real | | 0| 1| 0|Off|Real mode | Real |Real | | 0| 1| 1|Off|Real mode | Real |Real | | 1| 0| 0|On |Primary-space mode | Primary |Primary | | | | | | | virtual | virtual| | 1| 0| 1|On |Access-register mode | Primary |AR-speci-| | | | | | | virtual | fied | | | | | | | | virtual| | 1| 1| 0|On |Secondary-space mode | Primary |Secondary| | | | | | | virtual | virtual| | 1| 1| 1|On |Home-space mode | Home |Home | | | | | | | virtual | virtual| |__|__|__|___|_____________________|___________|_________|Figure 3-8. Translation Modes
Six bits are provided in control register 0 for use in controlling dynamic address translation. The bits are assigned as follows:
__ _ __ _____ __ __ |D| | TF | | __|_|__|_____|__|__ 5 8 13Secondary-Space Control (D): Bit 5 of control register 0 is the secondary-space-control bit. When this bit is zero and execution of MOVE TO PRIMARY, MOVE TO SECONDARY, or SET ADDRESS SPACE CONTROL is attempted, a special-operation exception is recognized. When this bit is one, it indicates that the secondary segment table is attached when the CPU is in the primary-space mode.
Translation Format (TF): Bits 8-12 of control register 0 specify the translation format, with only one combination of the five control bits valid; all other combinations are invalid.
The control bits are encoded as follows: _____________________________ _______ | Bits of Control Register 0 | | |_____ _____ _____ _____ _____| | | 8 | 9 | 10 | 11 | 12 | Valid | |_____|_____|_____|_____|_____|_______| | 1 0 1 1 0 | Yes | | | | | All others | No | |_____________________________|_______|
When an invalid bit combination is detected in bit positions 8-12, a translation-specification exception is recognized as part of the execution of an instruction using address translation.
Control register 1 contains the primary segment-table designation (PSTD). The register has the following format:
_ __________________ __ _ _ _ _______ | | Primary Segment- | | | | | | |X| Table Origin | |G|P|S| PSTL | |_|__________________|__|_|_|_|_______| 0 1 20 22 25 31Primary Space-Switch-Event Control (X): When bit 0 of control register 1 is one:
Primary Subspace-Group Control (G): Bit 22, when one, indicates that the address space specified by the STD is the base space or a subspace of a subspace group. When bit 22 is zero, the address space is not in a subspace group.
Primary Private-Space Control (P): If bit 23 of control register 1 is one, then (1) a one value of the common-segment bit in a translation-lookaside-buffer (TLB) segment-table entry prevents the entry and the TLB page-table copy it designates from being used when translating references to the primary address space, even with a match of segment-table origins; (2) low-address protection and fetch-protection override do not apply to the primary address space; and (3) a translation-specification exception is recognized if a reference to the primary address space is translated by means of a segment-table entry in storage and the common-segment bit is one in the entry.
Primary Storage-Alteration-Event Control (S): With PER 2 when the storage-alteration-space control in control register 9 is one, bit 24 of control register 1 specifies, when one, that the primary address space is one for which storage-alteration events can occur. Bit 24 is examined when the segment-table designation is used to perform dynamic-address translation for a storage-operand store reference. Bit 24 is ignored when the storage-alteration-space control is zero, and it is always ignored by PER 1.
Primary Segment-Table Length (PSTL): Bits 25-31 of control register 1 specify the length of the primary segment table in units of 64 bytes, thus making the length of the segment table variable in multiples of 16 entries. The length of the primary segment table, in units of 64 bytes, is one more than the PSTL value. The contents of the length field are used to establish whether the entry designated by the segment-index portion of a primary virtual address falls within the primary segment table.
Bits 20 and 21 of control register 1 are not assigned and are ignored. Bit 22 is ignored if the subspace-group facility is not installed. Bit 24 is ignored if the PER-2 facility is not installed.
Control register 7 contains the secondary segment-table designation (SSTD). The register has the following format:
_ __________________ __ _ _ _ _______ | |Secondary Segment-| | | | | | | | Table Origin | |G|P|S| SSTL | |_|__________________|__|_|_|_|_______| 0 1 20 22 25 31The secondary segment-table origin, secondary subspace-group control (G), secondary private-space control (P), secondary storage-alteration-event control (S), and secondary segment-table length (SSTL) in control register 7 are defined the same as the fields in the same bit positions in control register 1, except that control register 7 applies to the secondary address space.
Bits 0, 20, and 21 of control register 7 are not assigned and are ignored. Bit 22 is ignored if the subspace-group facility is not installed. Bit 24 is ignored if the PER-2 facility is not installed.
Control register 13 contains the home segment-table designation (HSTD). The register has the following format:
_ __________________ __ _ _ _ _______ | | Home Segment- | | | | | | |X| Table Origin | |G|P|S| HSTL | |_|__________________|__|_|_|_|_______| 0 1 20 22 25 31Home Space-Switch-Event Control (X): When bit 0 of control register 13 is one, a space-switch-event program interruption occurs upon completion of a SET ADDRESS SPACE CONTROL instruction that changes the address space from which instructions are fetched either to or from the home address space; that is, when instructions are fetched from the home address space either before or after the operation but not both before and after the operation.
The home segment-table origin, home private-space control (P), home storage-alteration-event control (S), and home segment-table length (HSTL) in control register 13 are defined the same as the fields in the same bit positions in control register 1, except that control register 13 applies to the home address space.
Bits 20 and 21 of control register 13 are not assigned and are ignored. Bit 22 (G) is ignored. Bit 24 is ignored if the PER-2 facility is not installed.
Programming Notes:
The translation process consists in a two-level lookup using two tables: a segment table and a page table. These tables reside in real or absolute storage.
Subtopics:
The entry fetched from the segment table has the following format:
_ _________________________ _ _ ____ |0| Page-Table Origin |I|C|PTL | |_|_________________________|_|_|____| 0 1 26 28 31Page-Table Origin (PTO): Bits 1-25, with six zeros appended on the right, form the address that designates the beginning of a page table. It is unpredictable whether the address is real or absolute.The fields in the segment-table entry are allocated as follows:
Segment-Invalid Bit (I): Bit 26 controls whether the segment associated with the segment-table entry is available. When the bit is zero, address translation proceeds by using the segment-table entry. When the bit is one, the segment-table entry cannot be used for translation.
Common-Segment Bit (C): Bit 27 controls the use of the translation-lookaside-buffer (TLB) copies of the segment-table entry and of the page table which it designates. A zero identifies a private segment; in this case, the segment-table entry and the page table it designates may be used only in association with the segment-table origin that designates the segment table in which the segment-table entry resides. A one identifies a common segment; in this case, the segment-table entry and the page table it designates may continue to be used for translating addresses corresponding to the segment index, even though a different segment table is specified. However, TLB copies of the segment-table entry and page table for a common segment are not usable if the private-space control, bit 23, is one in the segment-table designation used in the translation. The common-segment bit must be zero if the segment-table entry is fetched from storage during a translation when the private-space control is one in the segment-table designation being used; otherwise, a translation-specification exception is recognized.
Page-Table Length (PTL): Bits 28-31 specify the length of the page table in units of 64 bytes (16 entries). The length of the page table, in units of 64 bytes, is one more than the PTL value. The contents of the length field are used to establish whether the entry designated by the page-index portion of the virtual address falls within the page table.
Bit 0 of the segment-table entry must be zero; if it is not zero, a translation-specification exception is recognized as part of the execution of an instruction using that entry for address translation.
The entry fetched from the page table entry has the following format:
_ ___________________ _ _ _ _ ________ |0| PFRA |0|I|P|0|////////| |_|___________________|_|_|_|_|________| 0 1 20 24 31Page-Frame Real Address (PFRA): Bits 1-19 provide the leftmost bits of a real storage address. When these bits are concatenated with the 12-bit byte-index field of the virtual address on the right, a 31-bit real address is obtained.The fields in the page-table entry are allocated as follows:
Page-Invalid Bit (I): Bit 21 controls whether the page associated with the page-table entry is available. When the bit is zero, address translation proceeds by using the page-table entry. When the bit is one, the page-table entry cannot be used for translation.
Page-Protection Bit (P): Bit 22 controls whether store accesses can be made in the page. This protection mechanism is in addition to the key-controlled-protection and low-address-protection mechanisms. The bit has no effect on fetch accesses. If the bit is zero, stores are permitted to the page, subject to the other protection mechanisms. If the bit is one, stores are disallowed. An attempt to store when the page-protection bit is one causes a protection exception to be recognized.
Bit positions 0, 20, and 23 of the entry must contain zeros; otherwise, a translation-specification exception is recognized as part of the execution of an instruction using that entry for address translation. Bit positions 24-31 are unassigned and are not checked for zeros.
The sizes of segment tables and page tables are summarized in Figure 3-9.
________________________________________________________ | Segment-Table Parameters | |_______ ____________ ________________________ __________| | | | Corresponding | | |Virtual| | Segment Table | Segment- | |Address| Number of |____________ ___________| Table | | Size | Addressable| Maximum | Usable |Increment | |(Bits) | Segments |Size (Bytes)|Length Code| (Bytes) | |_______|____________|____________|___________|__________| | 24¹ | 16 | 64 | 0 | -- | | 31 | 2,048 | 8,192 | 127 | 64 | |_______|____________|____________|___________|__________|________________________________________________ | Page-Table Parameters² | |____________ ________________________ __________| | | Corresponding | | | | Page Table | Page- | | Number of |____________ ___________| Table | | Pages | Maximum | Usable |Increment | | in Segment |Size (Bytes)|Length Code| (Bytes) | |____________|____________|___________|__________| | 256 | 1,024 | 15 | 64 | |____________|____________|___________|__________| Explanation:
¹ A virtual address specified by the program in the 24-bit addressing mode consists of a 24-bit value embedded in a 31-bit address.
² The page-table size is independent of the virtual address size.
Figure 3-9. Sizes of Segment Tables and Page Tables
Translation of a virtual address is performed by means of a segment table and a page table, both of which reside in real or absolute storage. It is controlled by the DAT-mode bit and the address-space-control bits, all in the PSW. The translation tables are designated by fields in control registers 1, 7, and 13 and as specified by the access registers.
This section describes the translation process as it is performed implicitly before a virtual address is used to access main storage. Explicit translation, which is the process of translating the operand address of LOAD REAL ADDRESS and TEST PROTECTION, is the same, except that segment-translation and page-translation exceptions do not occur; such situations are instead indicated by the condition code. Translation of the operand address of LOAD REAL ADDRESS also differs in that the CPU may be in the real mode and the translation-lookaside buffer is not used.
Subtopics:
The segment-index portion of the virtual address is used to select an entry from the segment table, the starting address and length of which are specified by the effective segment-table designation. This entry designates the page table to be used.
The segment-table designation used for a particular address translation is called the effective segment-table designation. Accordingly, when a primary virtual address is translated, the contents of control register 1 are used as the effective segment-table designation. Similarly, for a secondary virtual address, the contents of control register 7 are used; for an AR-specified virtual address, the segment-table designation specified by the access register is used; and for a home virtual address, the contents of control register 13 are used.
The page-index portion of the virtual address is used to select an entry from the page table. This entry contains the leftmost bits of the real address that represents the translation of the virtual address and provides the page-protection bit.
The byte-index field of the virtual address is used unchanged as the rightmost bit positions of the real address.
If the I bit is one in either the segment-table entry or the page-table entry, the entry is invalid, and the translation process cannot be completed for this virtual address. A segment-translation or a page-translation exception is recognized.
In order to eliminate the delay associated with references to translation tables in real or absolute storage, the information fetched from the tables normally is also placed in a special buffer, the translation-lookaside buffer (TLB), and subsequent translations involving the same table entries may be performed by using the information recorded in the TLB. The operation of the TLB is described in "Translation-Lookaside Buffer" in topic 3.11.4.
Whenever access to real or absolute storage is made during the address-translation process for the purpose of fetching an entry from a segment table or page table, key-controlled protection does not apply.
The translation process, including the effect of the TLB, is shown graphically in Figure 3-10.
Control Register ASN-Second Table 1, 7, or 13 Entry Virtual Address ___________________ __________________ ______ ____ ______ |PSTD, SSTD, or HSTD| | AR-Specified STD | | SX | PX | BX | |_________ _________| |________ _________| |___ __|_ __|___ __| | _ | (x4)| |(x4) | |__________ÿ|1|________| | | |______ | | | | | | | | | | | | ___________°__ÿ________________ | | | | | | | | | | | | __________________ _______________|_____°_______| | | Effective STD | | | | __________ ___ ___ | | | | | | STO | |STL| | | | | | |_____ ____|___|___| | | | | | |(x4096) | | | | | _____| | | | | | | | | | | | | ___________________| _____|______|_____________| | | | | | | | | | | | | | _ Segment Table | | | | |____ÿ|+| __________________ | | | | | | | | | | | | _ | | | | | | | |4| |_ÿ|____________ _ ___| | | | | |_| R/A | PTO | |PTL| | | | | |______ _____|_|___| | | | | | |(x64) | | | | | | | | | | | | |______|___________| | | | | | | | | | ________________| | | | | | | | | | _ | | | ____________________________°___ÿ|2|____| | | | | | Translation | | | | Lookaside | | | Buffer (TLB) | | _ Page Table | ____________________ | |____ÿ|+| __________________ | | | | | | | | _______|_________|_____________ | | _ | | | | | | | | |4| |_ÿ|__________ _______| | |________ÿ|_________ __________| | |_| R/A | PFRA | | | | | PFRA | | |_____ ____|_______| | |_________|___ ______| | | | | | _ | | | | | | | | |4| | | | | |_____|____________| | |_| |_____________|______| | | | | _ | | " |3| | |_________________ÿ°__ÿ___________________________ÿ° |_| | _ |4| ________ ________ |_| _________ _________ | | | |_________|_________| R/A: Address is either real or absolute Real Address _ |1| Control register 1 provides the primary segment-table designation for |_| translation of a primary virtual address, control register 7 provides the secondary segment-table designation for translation of a secondary virtual address, and control register 13 provides the home segment-table designation for translation of a home virtual address. An ASN-second- table entry provides an AR-specified (access-register-specified) segment- table designation for translation of an AR-specified virtual address._ |2| Information, which may include portions of the virtual address and the |_| effective segment-table origin, is used to search the TLB.
_ |3| If a match exists, the page-frame real address from the TLB is used in |_| forming the real address.
_ |4| If no match exists, table entries in real or absolute storage are fetched. |_| The resulting fetched entries, in conjunction with the search information, are used to translate the address and may be used to form an entry in the TLB.
Figure 3-10. Translation Process
The interpretation of the virtual address for translation purposes requires that there be a valid translation format specified by bits 8-12 of control register 0. If bits 8-12 contain an invalid code, a translation-specification exception is recognized.
The 31-bit address of the segment-table entry in real or absolute storage is obtained by appending 12 zeros to the right of bits 1-19 of the effective segment-table designation and adding the segment index with two rightmost and 18 leftmost zeros appended. When a carry into bit position 0 occurs during the addition, an addressing exception may be recognized, or the carry may be ignored, causing the table to wrap from 2³¹ - 1 to zero. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The segment-index portion of the virtual address, in conjunction with the segment-table origin contained in the effective segment-table designation, is used to select an entry from the segment table.
As part of the segment-table-lookup process, bits 1-7 of the virtual address are compared against the segment-table length, bit positions 25-31 of the effective segment-table designation, to establish whether the addressed entry is within the segment table. If the value in the segment-table-length field is less than the value in the corresponding bit positions of the virtual address, a segment-translation exception is recognized. The comparison against the segment-table length may be omitted if a segment-table entry in the translation-lookaside buffer is used in the translation.
All four bytes of the segment-table entry appear to be fetched concurrently as observed by other CPUs. The fetch access is not subject to protection. When the storage address generated for fetching the segment-table entry designates a location which is not available in the configuration, an addressing exception is recognized, and the unit of operation is suppressed.
Bit 26 of the entry fetched from the segment table specifies whether the corresponding segment is available. This bit is inspected, and, if it is one, a segment-translation exception is recognized. If bit 0 of the entry is one, a translation-specification exception is recognized. A translation-specification exception is also recognized if (1) the private-space control, bit 23, in the effective segment-table designation is one, and (2) the common-segment bit, bit 27, in the entry fetched from the segment table is one.
When no exceptions are recognized in the process of segment-table lookup, the entry fetched from the segment table designates the beginning and specifies the length of the corresponding page table.
The common-segment bit in the entry fetched from the segment table is further used only for the purpose of forming a TLB entry (see "Use of TLB Entries" in topic 3.11.4.3).
The 31-bit address of the page-table entry in real or absolute storage is obtained by appending six zeros to the right of the page-table origin and adding the page index, with two rightmost and 21 leftmost zeros appended. A carry into bit position 0 may cause an addressing exception to be recognized, or the carry may be ignored, causing the page table to wrap from 2³¹ - 1 to zero. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The page-index portion of the virtual address, in conjunction with the page-table origin contained in the segment-table entry, is used to select an entry from the page table.
As part of the page-table-lookup process, the four leftmost bits of the page index are compared against the page-table length, bits 28-31 of the segment-table entry, to establish whether the addressed entry is within the table. If the value in the page-table-length field is less than the value in the four leftmost bit positions of the page-index field, a page-translation exception is recognized.
All four bytes of the page-table entry appear to be fetched concurrently as observed by other CPUs. The fetch access is not subject to protection. When the storage address generated for fetching the page-table entry designates a location which is not available in the configuration, an addressing exception is recognized, and the unit of operation is suppressed.
The entry fetched from the page table indicates the availability of the page and contains the leftmost bits of the page-frame real address. The page-invalid bit is inspected to establish whether the corresponding page is available. If this bit is one, a page-translation exception is recognized. If bit position 0, 20, or 23 contains a one, a translation-specification exception is recognized.
When no exceptions in the translation process are encountered, the page-frame real address obtained from the page-table entry and the byte-index portion of the virtual address are concatenated, with the page-frame real address forming the leftmost part. The result is the real storage address which corresponds to the virtual address. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The information pertaining to DAT is considered to be used when an instruction is executed with DAT on or when INVALIDATE PAGE TABLE ENTRY or LOAD REAL ADDRESS is executed. The information is not considered to be used when the PSW specifies DAT on but an I/O, external, restart, or machine-check interruption occurs before an instruction is executed, or when the PSW specifies the wait state. Only that information required in order to translate a virtual address is considered to be in use during the translation of that address, and, in particular, addressing exceptions that would be caused by the use of a segment-table designation are not recognized when that segment-table designation is not the one actually used in the translation.
Invalid addresses and invalid formats can cause exceptions to be recognized during the translation process. Exceptions are recognized when information contained in control registers or table entries is used for translation and is found to be incorrect.
A list of translation exceptions, with the action taken for each exception and the priority in which the exceptions are recognized when more than one is applicable, is provided in "Recognition of Access Exceptions" in topic 6.5.4.
To enhance performance, the dynamic-address-translation mechanism normally is implemented such that some of the information specified in the segment and page tables is maintained in a special buffer, referred to as the translation-lookaside buffer (TLB). The CPU necessarily refers to a DAT-table entry in real or absolute storage only for the initial access to that entry. This information may be placed in the TLB, and subsequent translations may be performed by using the information in the TLB. The presence of the TLB affects the translation process to the extent that (1) a modification of the contents of a table entry in real or absolute storage does not necessarily have an immediate effect, if any, on the translation, and (2) the comparison against the segment-table length in the effective segment-table designation may be omitted if a TLB segment-table entry is used. In a multiple-CPU configuration, each CPU has its own TLB.
Entries within the TLB are not explicitly addressable by the program.
Information is not necessarily retained in the TLB under all conditions for which such retention is permissible. Furthermore, information in the TLB may be cleared under conditions additional to those for which clearing is mandatory.
Subtopics:
Note: The following sections describe the conditions under which information may be placed in the TLB, the conditions under which information from the TLB may be used for address translation, and how changes to the translation tables affect the translation process.
The description of the logical structure of the TLB covers the implementation by all systems operating as defined by ESA/390. The TLB entries are considered as being of two types: TLB segment-table entries and TLB page-table entries. A TLB entry is considered as containing within it both the information obtained from the table entry in real or absolute storage and the attributes used to fetch the entry from storage.
The attached state of a table entry denotes that the CPU to which it is attached can attempt to use the table entry for implicit address translation. The table entry may be attached to more than one CPU at a time.
The formation of TLB entries and the effect of any manipulation of the contents of a table entry in real or absolute storage by the program depend on whether the entry is attached to a particular CPU and on whether the entry is valid.
The valid state of a table entry denotes that the segment or page associated with the table entry is available. An entry is valid when the segment-invalid bit or page-invalid bit in the entry is zero.
A segment-table entry or a page-table entry may be placed in the TLB whenever the entry is attached and valid and would not cause a translation-specification exception if used for translation.
A segment-table entry is attached when all of the following conditions are met:
A TLB segment-table entry is in the usable state when all of the following conditions are met:
The usable state of a TLB entry denotes that the CPU can attempt to use the TLB entry for implicit address translation. Also, the usable state of a TLB segment-table entry is a factor in determining whether a page-table entry is attached.
A TLB page-table entry is in the usable state when the page-table-origin field in the TLB page-table entry matches the page-table-origin field in a usable TLB segment-table entry or an attached and valid segment-table entry which would not cause a translation-specification exception if used for translation, and the page-index field in the TLB page-table entry is within the range permitted by the page-table-length field in the segment-table entry.
A TLB page-table entry may be used for implicit address translation only when the TLB entry is in the usable state as selected by the segment-table entry being used and only when the page index of the TLB page-table entry matches the page index of the virtual address being translated.
The operand address of LOAD REAL ADDRESS is translated without the use of the TLB contents. Translation in this case is performed by the use of the designated tables in real or absolute storage.
Programming Notes:
Conversely, when DAT is on, information may be copied into the TLB from all translation-table entries that could be used for address translation, given the current translation parameters, the setting of the address-space-control bits, the setting of the secondary-space-control bit, and the contents of the access registers. The loading of the TLB does not depend on whether the entry is used for translation as part of the execution of the current instruction, and such loading can occur when the wait state is specified.
When a valid and attached table entry is changed, and when, before the TLB is cleared of entries which qualify for substitution for that entry, an attempt is made to refer to storage by using a virtual address requiring that entry for translation, unpredictable results may occur, to the following extent. The use of the new value may begin between instructions or during the execution of an instruction, including the instruction that caused the change. Moreover, until the TLB is cleared of entries which qualify for substitution for that entry, the TLB may contain both the old and the new values, and it is unpredictable whether the old or new value is selected for a particular access. If both old and new values of a segment-table entry are present in the TLB, a page-table entry may be fetched by using one value and placed in the TLB associated with the other value. If the new value of the entry is a value which would cause an exception, the exception may or may not cause an interruption to occur. If an interruption does occur, the result fields of the instruction may be changed even though the exception would normally cause suppression or nullification.
When an attached and invalid table entry is made valid and no usable entry for the associated virtual address is in the TLB, the change takes effect no later than the end of the current unit of operation. Similarly, when an unattached and valid table entry is made attached and no usable entry for the associated virtual address is in the TLB, the change takes effect no later than the end of the current unit of operation.
Entries are cleared from the TLB in accordance with the following rules:
A change made to an attached and valid entry or a change made to a table entry that causes the entry to become attached and valid is reflected in the translation process for the next instruction, or earlier than the next instruction, unless a TLB entry qualifies for substitution for that table entry. However, a change made to a table entry that causes the entry to become unattached or invalid is not necessarily reflected in the translation process until the TLB is cleared of entries which qualify for substitution for that table entry.
Manipulation of attached table entries may cause spurious table-entry values to be recorded in a TLB. For example, if changes are made piecemeal, modification of a valid attached entry may cause a partially updated entry to be recorded, or, if an intermediate value is introduced in the process of the change, a supposedly invalid entry may temporarily appear valid and may be recorded in the TLB. Such an intermediate value may be introduced if the change is made by an I/O operation that is retried, or if an intermediate value is introduced during the execution of a single instruction.
As another example, if a segment-table entry is changed to designate a different page table and used without clearing the TLB, then the new page-table entries may be fetched and associated with the old page-table origin. In such a case, execution of INVALIDATE PAGE TABLE ENTRY designating the new page-table origin will not necessarily clear the page-table entries fetched from the new page table.
INVALIDATE PAGE TABLE ENTRY is useful for setting the I bit to one in a page-table entry and causing TLB copies of the entry to be cleared from the TLB of each CPU in the configuration. The following aspects of the TLB operation should be considered when using INVALIDATE PAGE TABLE ENTRY. (See also the programming notes following INVALIDATE PAGE TABLE ENTRY.)
The execution of PURGE TLB and SET PREFIX may have an adverse effect on the performance of some models. Use of these instructions should, therefore, be minimized in conformity with the above rules.
Subtopics:
Translation is not applied to quantities that are formed from the values specified in the B and D fields of an instruction but that are not used to address storage. This includes operand addresses in LOAD ADDRESS, MONITOR CALL, and the shifting instructions. This also includes the addresses in control registers 10 and 11 designating the starting and ending locations for PER.
Most addresses that are explicitly specified by the program and are used by the CPU to refer to storage are instruction or logical addresses and are subject to implicit translation when DAT is on. Analogously, the corresponding addresses indicated to the program on an interruption or as the result of executing an instruction are instruction or logical addresses. The operand address of LOAD REAL ADDRESS is explicitly translated, regardless of whether the PSW specifies DAT on or off.
With the exception of INSERT VIRTUAL STORAGE KEY and TEST PROTECTION, the addresses explicitly designating storage keys (operand addresses in SET STORAGE KEY EXTENDED, INSERT STORAGE KEY EXTENDED, and RESET REFERENCE BIT EXTENDED) are real addresses. Similarly, the addresses implicitly used by the CPU for such sequences as interruptions are real addresses.
The addresses used by channel programs to transfer data and to refer to CCWs or IDAWs are absolute addresses.
The handling of storage addresses associated with DIAGNOSE is model-dependent.
The processing of addresses, including dynamic address translation and prefixing, is discussed in "Address Types" in topic 3.2.1. Prefixing, when provided, is applied after the address has been translated by means of the dynamic-address-translation facility. For a description of prefixing, see "Prefixing" in topic 3.7.
The handling of addresses is summarized in Figure 3-11. This figure lists all addresses that are encountered by the program and specifies the address type.
_______________________________________________________________________ | Virtual Addresses | | | | · Address of storage operand for INSERT VIRTUAL STORAGE KEY | | · Operand address in LOAD REAL ADDRESS | | · Addresses of storage operands for MOVE TO PRIMARY and MOVE TO | | SECONDARY | | · Address stored in the word at real location 144 on a program inter- | | ruption for page-translation or segment-translation exception | | · Linkage-stack-entry address in control register 15 | | · Backward stack-entry address in linkage-stack header entry | | · Forward-section-header address in linkage-stack trailer entry | | | | Instruction Addresses | | | | · Instruction address in PSW | | · Branch address | | · Target of EXECUTE | | · Address stored in the word at real location 152 on a program inter- | | ruption for PER | | · Address placed in general register by BRANCH AND LINK, BRANCH AND | | SAVE, BRANCH AND SAVE AND SET MODE, BRANCH AND STACK, BRANCH IN | | SUBSPACE GROUP, BRANCH RELATIVE AND SAVE, and PROGRAM CALL | | | · Address used in general register by BRANCH AND STACK. | | | · Address placed in general register by BRANCH AND SET AUTHORITY | | | executed in reduced-authority state | | | | Logical Addresses | | | | · Addresses of storage operands for instructions not otherwise | | specified | | · Address placed in general register 1 by EDIT AND MARK and TRANSLATE | | AND TEST | | · Addresses in general registers updated by MOVE LONG, MOVE LONG | | EXTENDED, COMPARE LOGICAL LONG, and COMPARE LOGICAL LONG EXTENDED | | · Addresses in general registers updated by CHECKSUM, COMPARE AND FORM| | CODEWORD, and UPDATE TREE | | · Address for TEST PENDING INTERRUPTION when the second-operand ad- | | dress is nonzero | | | | Real Addresses | | | | · Address of storage key for INSERT STORAGE KEY EXTENDED, RESET | | REFERENCE BIT EXTENDED, and SET STORAGE KEY EXTENDED | | · Address of storage operand for LOAD USING REAL ADDRESS, STORE USING | | REAL ADDRESS, and TEST BLOCK | | · The translated address generated by LOAD REAL ADDRESS | |_______________________________________________________________________| _______________________________________________________________________ | Real Addresses (Continued) | | | | · Page-table origin in INVALIDATE PAGE TABLE ENTRY | | · Page-frame real address in page-table entry | | · Trace-entry address in control register 12 | | · ASN-first-table origin in control register 14 | | · ASN-second-table origin in ASN-first-table entry | | | · Authority-table origin in ASN-second-table entry, except when used | | | by access-register translation | | · Linkage-table origin in control register 5 or primary ASN-second- | | table entry¹ | | · Entry-table origin in linkage-table entry | | · Dispatchable-unit-control-table origin in control register 2 | | · Primary-ASN-second-table-entry origin in control register 5¹ | | | · Base-ASN-second-table-entry origin and subspace-ASN-second-table- | | | entry origin in dispatchable-unit control table | | · ASN-second-table-entry address in entry-table entry and access-list | | entry | | | | Permanently Assigned Real Addresses | | | | · Address of the doubleword into which TEST PENDING INTERRUPTION | | stores when the second-operand address is zero | | · Addresses of PSWs, interruption codes, and the associated informa- | | tion used during interruption | | · Addresses used for machine-check logout and save areas | | | | Addresses Which Are Unpredictably Real or Absolute | | | | · Segment-table origin in control registers 1, 7, and 13 and in | | access-register-specified segment-table designation | | · Page-table origin in segment-table entry | | · Address of segment-table entry or page-table entry provided by LOAD | | REAL ADDRESS | | | · The dispatchable-unit or primary-space access-list origin and the | | | authority-table origin (in the ASTE designated by the ALE used) used| | | by access-register translation | |_______________________________________________________________________| _______________________________________________________________________ | Absolute Addresses | | | | · Prefix value | | · Channel-program address in ORB | | · Data address in CCW | | · IDAW address in a CCW specifying indirect data addressing | | · CCW address in a CCW specifying transfer in channel | | · Data address in IDAW | | · Measurement-block origin specified in SET CHANNEL MONITOR | | · Address limit specified in SET ADDRESS LIMIT | | · Addresses used by the store-status-at-address SIGNAL PROCESSOR order| | · Failing-storage address stored in the word at real location 248 | | · CCW address in SCSW | | | | Permanently Assigned Absolute Addresses | | | | · Addresses used for the store-status function | | · Addresses of PSW and first two CCWs used for initial program loading| | | | Addresses Not Used to Reference Storage | | | | · PER starting address in control register 10 | | · PER ending address in control register 11 | | · Address stored in the word at real location 156 for a monitor event | | · Address in shift instructions and other instructions specified not | | to use the address to reference storage | |_______________________________________________________________________| |Explanation: | | | | ¹ When the address-space-function (ASF) control, bit 15 of control | | register 0, is zero, control register 5 contains the linkage-table | | origin. When the ASF control is one, control register 5 contains | | the primary-ASN-second-table-entry origin, and the linkage-table | | origin is in the primary ASN-second-table entry. | |_______________________________________________________________________|Figure 3-11. Handling of Addresses
Figure 3-12 shows the format and extent of the assigned locations in storage. The locations are used as follows.
Initial-Program-Loading PSW: The first eight bytes read during the initial-program-loading (IPL) initial-read operation are stored at locations 0-7. The contents of these locations are used as the new PSW at the completion of the IPL operation. These locations may also be used for temporary storage at the initiation of the IPL operation.
Restart New PSW: The new PSW is fetched from locations 0-7 during a restart interruption.
Initial-Program-Loading CCW1: Bytes 8-15 read during the initial-program-loading (IPL) initial-read operation are stored at locations 8-15. The contents of these locations are ordinarily used as the next CCW in an IPL CCW chain after completion of the IPL initial-read operation.
Restart Old PSW: The current PSW is stored as the old PSW at locations 8-15 during a restart interruption.
Initial-Program-Loading CCW2: Bytes 16-23 read during the initial-program loading (IPL) initial-read operation are stored at locations 16-23. The contents of these locations may be used as another CCW in the IPL CCW chain to follow IPL CCW1.
External Old PSW: The current PSW is stored as the old PSW at locations 24-31 during an external interruption.
Supervisor-Call Old PSW: The current PSW is stored as the old PSW at locations 32-39 during a supervisor-call interruption.
Program Old PSW: The current PSW is stored as the old PSW at locations 40-47 during a program interruption.
Machine-Check Old PSW: The current PSW is stored as the old PSW at locations 48-55 during a machine-check interruption.
Input/Output Old PSW: The current PSW is stored as the old PSW at locations 56-63 during an I/O interruption.
External New PSW: The new PSW is fetched from locations 88-95 during an external interruption.
Supervisor-Call New PSW: The new PSW is fetched from locations 96-103 during a supervisor-call interruption.
Program New PSW: The new PSW is fetched from locations 104-111 during a program interruption.
Machine-Check New PSW: The new PSW is fetched from locations 112-119 during a machine-check interruption.
Input/Output New PSW: The new PSW is fetched from locations 120-127 during an I/O interruption.
External-Interruption Parameter: During an external interruption due to service signal, the parameter associated with the interruption is stored at locations 128-131.
CPU Address: During an external interruption due to malfunction alert, emergency signal, or external call, the CPU address associated with the source of the interruption is stored at locations 132-133. For all other external-interruption conditions, zeros are stored at locations 132-133.
External-Interruption Code: During an external interruption, the interruption code is stored at locations 134-135.
Supervisor-Call-Interruption Identification: During a supervisor-call interruption, the instruction-length code is stored in bit positions 5 and 6 of location 137, and the interruption code is stored at locations 138-139. Zeros are stored at location 136 and in the remaining bit positions of location 137.
Program-Interruption Identification: During a program interruption, the instruction-length code is stored in bit positions 5 and 6 of location 141, and the interruption code is stored at locations 142-143. Zeros are stored at location 140 and in the remaining bit positions of location 141.
Translation-Exception Identification: During a program interruption due to a segment-translation exception or a page-translation exception, the segment-index and page-index portion of the virtual address causing the exception is stored at locations 144-147. This address is sometimes referred to as the translation-exception address. Bits 20-29 of the address are unpredictable. Bits 30-31 of the address are set to identify the segment-table designation (STD) used in the translation, as follows:
Bit Bit 30 31 Meaning 0 0 Primary STD was used. 0 1 CPU was in the access-register mode, and either the access was an instruction fetch or it was a storage-operand reference that used an AR-specified STD (the access was not an implicit reference to the linkage stack). The exception access id, real location 160, can be examined to determine the STD used. However, if the primary, secondary, or home STD was used, bits 30 and 31 may be set to 00, 10, or 11, respectively, instead of to 01. 1 0 Secondary STD was used. 1 1 Home STD was used (includes the case of an implicit reference to the linkage stack).
The CPU may avoid setting bits 30 and 31 to 01 by recognizing that the access was an instruction fetch, that access-list-entry token 00000000 or 00000001 hex was used, or that the access-list-entry token designated, through an access-list entry, an ASN-second-table entry containing an STD equal to the primary STD, secondary STD, or home STD.
Bit 0 of location 144 is set to one if the CPU was in either the primary-space mode or the secondary-space mode and the secondary STD was used; otherwise, bit 0 is set to zero.
During a program interruption due to an AFX-translation, ASX-translation, primary-authority, or secondary-authority exception, the ASN being translated is stored at locations 146-147. Zeros are stored at locations 144-145.
During a program interruption due to a space-switch event, an identification of the old instruction space is stored at locations 146-147, and the old instruction-space space-switch-event-control bit is placed in bit position 0 and zeros are placed in bit positions 1-15 of locations 144-145. The identification and bit stored are as follows:
If the suppression-on-protection facility is installed, then, during a program interruption due to a protection exception, information is stored at locations 144-147 as described in "Suppression on Protection" in topic 3.4.5.
Monitor-Class Number: During a program interruption due to a monitor event, the monitor-class number is stored at location 149, and zeros are stored at location 148.
PER Code: During a program interruption due to a PER event with PER 1, the PER code is stored in bit positions 0-3 of locations 150-151, and zeros are stored in bit positions 4-15. With PER 2, the PER code is stored in bit positions 0-2 and 4 of locations 150-151, and other information is or may be stored as described in "Identification of Cause" in topic 4.5.2.1.
PER Address: During a program interruption due to a PER event, the PER address is stored at locations 152-155. Bit 0 of location 152 is set to zero.
Monitor Code: During a program interruption due to a monitor event, the monitor code is stored at locations 156-159.
Exception Access Identification: During a program interruption due to a segment-translation exception or a page-translation exception, an indication of the address space to which the exception applies may be stored at location 160. If the CPU was in the access-register mode and the access was an instruction fetch, including a fetch of the target of an EXECUTE instruction, zeros are stored at location 160. If the CPU was in the access-register mode and the access was a storage-operand reference that used an AR-specified segment-table designation, the number of the access register used is stored in bit positions 4-7 of location 160, and zeros are stored in bit positions 0-3. (In either of the two cases described so far, storing at location 160 occurs regardless of the value stored in bit positions 30 and 31 of real locations 144-147.) If the CPU was in the access-register mode but the access was an implicit reference to the linkage stack, or if the CPU was not in the access-register mode, the contents of location 160 are unpredictable.
During a program interruption due to an ALEN-translation, ALE-sequence, ASTE-validity, ASTE-sequence, or extended-authority exception recognized during access-register translation, the number of the access register used is stored in bit positions 4-7 of location 160, and zeros are stored in bit positions 0-3. During a program interruption due to an ASTE-validity or ASTE-sequence exception recognized during a subspace-replacement operation, all zeros are stored at location 160.
If the suppression-on-protection facility is installed, then, during a program interruption due to a protection exception, information is stored at location 160 as described in "Suppression on Protection" in topic 3.4.5.
PER Access Identification: During a program interruption due to a PER storage-alteration event, an indication of the address space to which the event applies may be stored at location 161. If the access used an AR-specified segment-table designation, the number of the access register used is stored in bit positions 4-7 of location 161, and zeros are stored in bit positions 0-3. However, with PER 1, the contents of location 161 are unpredictable if the instruction that caused the event turned DAT off. Also, with PER 1 or PER 2, the contents of location 161 are unpredictable if (1) the CPU was in the access-register mode but the access was an implicit reference to the linkage stack, (2) the CPU was not in the access-register mode, or (3) bit 2 of the PER code is one but indicates a store-using-real-address event instead of a storage-alteration event.
Subsystem-Identification Word: During an I/O interruption, the subsystem-identification word is stored at locations 184-187.
I/O-Interruption Parameter: During an I/O interruption, the interruption parameter from the associated subchannel is stored at locations 188-191.
Store-Status CPU-Timer Save Area: During the execution of the store-status operation, the contents of the CPU timer are stored at locations 216-223.
Machine-Check CPU-Timer Save Area: During a machine-check interruption, the contents of the CPU timer are stored at locations 216-223.
Store-Status Clock-Comparator Save Area: During the execution of the store-status operation, the contents of the clock comparator are stored at locations 224-231.
Machine-Check Clock-Comparator Save Area: During a machine-check interruption, the contents of the clock comparator are stored at locations 224-231.
Machine-Check-Interruption Code: During a machine-check interruption, the machine-check-interruption code is stored at locations 232-239.
External-Damage Code: During a machine-check interruption due to certain external-damage conditions, depending on the model, an external-damage code may be stored at locations 244-247.
Failing-Storage Address: During a machine-check interruption, a failing-storage address may be stored at locations 248-251. Bit 0 of location 248 is set to zero.
Store-Status PSW Save Area: During the execution of the store-status operation, the contents of the current PSW are stored at locations 256-263.
Fixed-Logout Area: Depending on the model, logout information may be stored at locations 256-271 during a machine-check interruption.
Store-Status Prefix Save Area: During the execution of the store-status operation, the contents of the prefix register are stored at locations 264-267.
Store-Status Access-Register Save Area: During the execution of the store-status operation, the contents of the access registers are stored at locations 288-351.
Machine-Check Access-Register Save Area: During a machine-check interruption, the contents of the access registers are stored at locations 288-351.
Store-Status Floating-Point-Register Save Area: During the execution of the store-status operation, the contents of the floating-point registers are stored at locations 352-383.
Machine-Check Floating-Point-Register Save Area: During a machine-check interruption, the contents of the floating-point registers are stored at locations 352-383.
Store-Status General-Register Save Area: During the execution of the store-status operation, the contents of the general registers are stored at locations 384-447.
Machine-Check General-Register Save Area: During a machine-check interruption, the contents of the general registers are stored at locations 384-447.
Store-Status Control-Register Save Area: During the execution of the store-status operation, the contents of the control registers are stored at locations 448-511.
Machine-Check Control-Register Save Area: During a machine-check interruption, the contents of the control registers are stored at locations 448-511.
Hex Dec __________ _______________________________________________________________ 0 0 | Initial-Program-Loading PSW; or Restart New PSW | | | 4 4 | | __________|_______________________________________________________________| 8 8 | Initial-Program-Loading CCW1; or Restart Old PSW | | | C 12 | | __________|_______________________________________________________________| 10 16 | Initial-Program Loading CCW2 | | | 14 20 | | __________|_______________________________________________________________| 18 24 | External Old PSW | | | 1C 28 | | __________|_______________________________________________________________| 20 32 | Supervisor-Call Old PSW | | | 24 36 | | __________|_______________________________________________________________| 28 40 | Program Old PSW | | | 2C 44 | | __________|_______________________________________________________________| 30 48 | Machine-Check Old PSW | | | 34 52 | | __________|_______________________________________________________________| 38 56 | Input/Output Old PSW | | | 3C 60 | | __________|_______________________________________________________________| 40 64 | | | | 44 68 | | | | 48 72 | | | | 4C 76 | | | | 50 80 | | | | 54 84 | | __________|_______________________________________________________________| 58 88 | External New PSW | | | 5C 92 | | __________|_______________________________________________________________| 60 96 | Supervisor-Call New PSW | | | 64 100 | | __________|_______________________________________________________________| 68 104 | Program New PSW | | | 6C 108 | | __________|_______________________________________________________________| 70 112 | Machine-Check New PSW | | | 74 116 | | __________|_______________________________________________________________| 78 120 | Input/Output New PSW | | | 7C 124 | | __________|_______________________________________________________________| Hex Dec __________ _______________________________________________________________ 80 128 | External-Interruption Parameter | __________|_______________________________ _______________________________| 84 132 | CPU Address | External-Interruption Code | __________|_________________________ ___ _|_______________________________| 88 136 |0 0 0 0 0 0 0 0 0 0 0 0 0|ILC|0| SVC-Interruption Code | __________|_________________________|___|_|_______________________________| 8C 140 |0 0 0 0 0 0 0 0 0 0 0 0 0|ILC|0| Program-Interruption Code | __________|_________________________|___|_|_______________________________| 90 144 | Translation-Exception Identification | __________|_______________________________ _______ _____ __ ______________| 94 148 | Monitor-Class Number |PER Cde|ATMID|SI| | __________|_______________________________|_______|_____|__|______________| 98 152 | PER Address | __________|_______________________________________________________________| 9C 156 | Monitor Code | __________|_______________ _______________ _______________________________| A0 160 |Exc. Access ID | PER Access ID | | __________|_______________|_______________|_______________________________| A4 164 | | | | A8 168 | | | | AC 172 | | | | B0 176 | | | | B4 180 | | __________|_______________________________________________________________| B8 184 | Subsystem-Identification Word | __________|_______________________________________________________________| BC 188 | I/O-Interruption Parameter | __________|_______________________________________________________________| C0 192 | | | | C4 196 | | | | C8 200 | | | | CC 204 | | | | D0 208 | | | | D4 212 | | __________|_______________________________________________________________| D8 216 | Store-Status CPU-Timer Save Area; or Machine-Check CPU-Timer | | Save Area | DC 220 | | __________|_______________________________________________________________| E0 224 | Store-Status Clock-Comparator Save Area; or Machine-Check | | Clock-Comparator Save Area | E4 228 | | __________|_______________________________________________________________| E8 232 | Machine-Check Interruption Code | | | EC 236 | | __________|_______________________________________________________________| F0 240 | | __________|_______________________________________________________________| F4 244 | External-Damage Code | __________|_______________________________________________________________| F8 248 | Failing-Storage Address | __________|_______________________________________________________________| FC 252 | | __________|_______________________________________________________________| Hex Dec __________ _______________________________________________________________ 100 256 | Store-Status PSW Save Area; or Fixed-Logout Area (Part 1) | | | 104 260 | | __________|_______________________________________________________________| 108 264 | Store-Status Prefix Save Area; or Fixed-Logout Area (Part 2) | __________|_______________________________________________________________| 10C 268 | Fixed-Logout Area (Part 3) | __________|_______________________________________________________________| 110 272 | | | | / / | | 11C 284 | | __________|_______________________________________________________________| 120 288 | Store-Status Access-Register Save Area; or Machine-Check | | Access-Register Save Area | 124 292 | | | | 128 296 | | | | 12C 300 | | | | / / | | 154 340 | | | | 158 344 | | | | 15C 348 | | __________|_______________________________________________________________| 160 352 | Store-Status Floating-Point-Register Save Area; or Machine- | | Check Floating-Point-Register Save Area | 164 356 | | | | 168 360 | | | | 16C 364 | | | | 170 368 | | | | 174 372 | | | | 178 376 | | | | 17C 380 | | __________|_______________________________________________________________| 180 384 | Store-Status General-Register Save Area; or Machine-Check | | General-Register Save Area | 184 388 | | | | 188 392 | | | | 18C 396 | | | | / / | | 1B4 436 | | | | 1B8 440 | | | | 1BC 444 | | __________|_______________________________________________________________| Hex Dec __________ _______________________________________________________________ 1C0 448 | Store-Status Control-Register Save Area; or Machine-Check | | Control-Register Save Area | 1C4 452 | | | | 1C8 456 | | | | 1CC 460 | | | | / / | | 1F4 500 | | | | 1F8 504 | | | | 1FC 508 | | __________|_______________________________________________________________|Figure 3-12. Assigned Storage Locations
This chapter describes in detail the facilities for controlling, measuring, and recording the operation of one or more CPUs.
Subtopics:
A change between these four CPU states can be effected by use of the operator facilities or by acceptance of certain SIGNAL PROCESSOR orders addressed to that CPU. The states are not controlled or identified by bits in the PSW. The stopped, load, and check-stop states are indicated to the operator by means of the manual indicator, load indicator, and check-stop indicator, respectively. These three indicators are off when the CPU is in the operating state.
The stopped, operating, load, and check-stop states are four mutually exclusive states of the CPU. When the CPU is in the stopped state, instructions and interruptions, other than the restart interruption, are not executed. In the operating state, the CPU executes instructions and takes interruptions, subject to the control of the program-status word (PSW) and control registers, and in the manner specified by the setting of the operator-facility rate control. The CPU is in the load state during the initial-program-loading operation. The CPU enters the check-stop state only as the result of machine malfunctions.
The CPU timer is updated when the CPU is in the operating state or the load state. The TOD clock is not affected by the state of any CPU.
Subtopics:
The CPU changes from the operating state to the stopped state by means of the stop function. The stop function is performed when:
Before entering the stopped state by means of the stop function, all pending allowed interruptions occur while the CPU is still in the operating state. They cause the old PSW to be stored and the new PSW to be fetched before the stopped state is entered. While the CPU is in the stopped state, interruption conditions remain pending.
The CPU is also placed in the stopped state when:
If the CPU is in the stopped state when an INVALIDATE PAGE TABLE ENTRY instruction is executed on another CPU in the configuration, the invalidation may be performed immediately or may be delayed until the CPU leaves the stopped state.
The start function is performed if the CPU is in the stopped state and (1) the start key associated with that CPU is activated or (2) that CPU accepts the start order specified by a SIGNAL PROCESSOR instruction addressed to that CPU. The effect of performing the start function is unpredictable when the stopped state has been entered by means of a reset.
The CPU changes from the stopped state to the operating state by means of the start function or when a restart interruption (see Chapter 6, "Interruptions") occurs.
When the rate control is set to the process position and the start function is performed, the CPU starts operating at normal speed. When the rate control is set to the instruction-step position and the wait-state bit is zero, one instruction or, for interruptible instructions, one unit of operation is executed, and all pending allowed interruptions occur before the CPU returns to the stopped state. When the rate control is set to the instruction-step position and the wait-state bit is one, the start function does not cause an instruction to be executed, but all pending allowed interruptions occur before the CPU returns to the stopped state.
The CPU enters the load state when the load-normal or load-clear key is activated. (See "Initial Program Loading" in topic 4.7.2. See also "Initial Program Loading" in topic 17.3.1.) If the initial-program-loading operation is completed successfully, the CPU changes from the load state to the operating state, provided the rate control is set to the process position; if the rate control is set to the instruction-step position, the CPU changes from the load state to the stopped state.
The check-stop state, which the CPU enters on certain types of machine malfunction, is described in Chapter 11, "Machine-Check Handling." The CPU leaves the check-stop state when CPU reset is performed.Programming Notes:
The status of the CPU can be changed by loading a new PSW or part of a PSW.
The current program-status word (PSW) in the CPU contains information required for the execution of the currently active program. The PSW is 64 bits in length and includes the instruction address, condition code, and other control fields. In general, the PSW is used to control instruction sequencing and to hold and indicate much of the status of the CPU in relation to the program currently being executed. Additional control and status information is contained in control registers and permanently assigned storage locations.
Control is switched during an interruption of the CPU by storing the current PSW, so as to preserve the status of the CPU, and then loading a new PSW.
Execution of LOAD PSW, or the successful conclusion of the initial-program-loading sequence, introduces a new PSW. The instruction address is updated by sequential instruction execution and replaced by successful branches. Other instructions are provided which operate on a portion of the PSW. Figure 4-1 summarizes these instructions.
A new or modified PSW becomes active (that is, the information introduced into the current PSW assumes control over the CPU) when the interruption or the execution of an instruction that changes the PSW is completed. The interruption for PER associated with an instruction that changes the PSW occurs under control of the PER mask that is effective at the beginning of the operation.
Bits 0-7 of the PSW are collectively referred to as the system mask.
__________________________ ___________ ___________ ___________ ___________ ___________ ___________ | | | | | | Condition | | | | | | | Address- | Code and | | | | | | Problem | Space | Program |Addressing | | |System Mask| PSW Key | State | Control | Mask | Mode | | | (PSW Bits | (PSW Bits | (PSW | (PSW Bits | (PSW Bits | (PSW | | | 0-7) | 8-11) | Bit 15) | 16-17) | 18-23) | Bit 32) | | |_____ _____|_____ _____|_____ _____|_____ _____|_____ _____|_____ _____| | Instruction |Saved| Set |Saved| Set |Saved| Set |Saved| Set |Saved| Set |Saved| Set | |__________________________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____| |BRANCH AND LINK | No | No | No | No | No | No | No | No | AM | No | AM | No | |BRANCH AND SAVE | No | No | No | No | No | No | No | No | No | No | Yes | No | |BRANCH AND SAVE AND SET | No | No | No | No | No | No | No | No | No | No | Yes | Yes¹| | MODE | | | | | | | | | | | | | | |BRANCH AND SET AUTHORITY | No | No | Yes | Yes | Yes | Yes | No | No | No | No | Yes | Yes | |BRANCH AND SET MODE | No | No | No | No | No | No | No | No | No | No | Yes¹| Yes¹| |__________________________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____| |BRANCH AND STACK | Yes | No | Yes | No | Yes | No | Yes | No | Yes | No | Yes¹| No | |BRANCH IN SUBSPACE GROUP | No | No | No | No | No | No | No | No | No | No | Yes¹| Yes | |INSERT PROGRAM MASK | No | No | No | No | No | No | No | No | Yes | No | No | No | |INSERT PSW KEY | No | No | Yes | No | No | No | No | No | No | No | No | No | |INSERT ADDRESS SPACE | No | No | No | No | No | No | Yes | No | No | No | No | No | | CONTROL | | | | | | | | | | | | | |__________________________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____| |Basic PROGRAM CALL | No | No | No | No | Yes | Yes | No | No | No | No | Yes | Yes | |Stacking PROGRAM CALL | Yes | No | Yes | PKC | Yes | Yes | Yes | Yes | Yes | No | Yes | Yes | |PROGRAM RETURN | No | Yes²| No | Yes | No | Yes | No | Yes | No | Yes³| No | Yes | |PROGRAM TRANSFER | No | No | No | No | No | Yes4| No | No | No | No | No | Yes | |SET ADDRESS SPACE CONTROL | No | No | No | No | No | No | No | Yes | No | No | No | No | |__________________________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____| |SET PROGRAM MASK | No | No | No | No | No | No | No | No | No | Yes | No | No | |SET PSW KEY FROM ADDRESS | No | No | No | Yes | No | No | No | No | No | No | No | No | |SET SYSTEM MASK | No | Yes | No | No | No | No | No | No | No | No | No | No | |STORE THEN AND SYSTEM MASK| Yes | ANDs| No | No | No | No | No | No | No | No | No | No | |STORE THEN OR SYSTEM MASK | Yes | ORs | No | No | No | No | No | No | No | No | No | No | |__________________________|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____|_____| |Explanation: | | | | ¹ The action takes place only if the associated R field in the instruction is nonzero. | | | | ² PROGRAM RETURN does not change the PER mask. | | | | ³ The condition code set by PROGRAM RETURN is unpredictable. | | | | 4 PROGRAM TRANSFER does not change the problem-state bit from one to zero. | | | | AM The action depends on the addressing mode, bit 32 of the current PSW. In the 24-bit | | addressing mode, the condition code and program mask are saved in the leftmost byte of | | the general register. In the 31-bit addressing mode, the addressing mode, along with | | bits 1-7 of the 31-bit address, replace the leftmost byte of the register. | | | | ANDs The logical AND of the immediate field in the instruction and the current system mask | | replaces the current system mask. | | | | ORs The logical OR of the immediate field in the instruction and the current system mask | | replaces the current system mask. | | | | PKC When the PSW-key-control bit, bit 131 of the 32-byte entry-table entry, is zero, the PSW | | key remains unchanged. When the PSW-key-control bit is one, the PSW key is set with the | | entry key, bits 136-139 of the entry-table entry. | |__________________________________________________________________________________________________|Figure 4-1. Operations on PSW Fields
Programming Note: A summary of the operations which save or set the problem state, addressing mode, and instruction address is contained in "Subroutine Linkage without the Linkage Stack" in topic 5.3.3.
Subtopics:
_ _ _____ _ _ _ _____ _ _ _ _ ___ ___ ______ _______________ | | | | |I|E| | | | | | | | Prog | | |0|R|0 0 0|T|O|X| Key |1|M|W|P|A S|C C| Mask |0 0 0 0 0 0 0 0| |_|_|_____|_|_|_|_____|_|_|_|_|___|___|______|_______________| 0 5 8 12 16 18 20 24 31_ __________________________________________________________ | | | |A| Instruction Address | |_|__________________________________________________________| 32 63
Figure 4-2. PSW Format
The following is a summary of the functions of the PSW fields. (See Figure 4-2.)PER Mask (R): Bit 1 controls whether the CPU is enabled for interruptions associated with program-event recording (PER). When the bit is zero, no PER event can cause an interruption. When the bit is one, interruptions are permitted, subject to the PER-event-mask bits in control register 9.
DAT Mode (T): Bit 5 controls whether implicit dynamic address translation of logical and instruction addresses used to access storage takes place. When the bit is zero, DAT is off, and logical and instruction addresses are treated as real addresses. When the bit is one, DAT is on, and the dynamic-address-translation mechanism is invoked.
I/O Mask (IO): Bit 6 controls whether the CPU is enabled for I/O interruptions. When the bit is zero, an I/O interruption cannot occur. When the bit is one, I/O interruptions are subject to the I/O-interruption subclass-mask bits in control register 6. When an I/O-interruption subclass-mask bit is zero, an I/O interruption for that I/O-interruption subclass cannot occur; when the I/O-interruption subclass-mask bit is one, an I/O interruption for that I/O-interruption subclass can occur.
External Mask (EX): Bit 7 controls whether the CPU is enabled for interruption by conditions included in the external class. When the bit is zero, an external interruption cannot occur. When the bit is one, an external interruption is subject to the corresponding external subclass-mask bits in control register 0; when the subclass-mask bit is zero, conditions associated with the subclass cannot cause an interruption; when the subclass-mask bit is one, an interruption in that subclass can occur.
PSW Key: Bits 8-11 form the access key for storage references by the CPU. If the reference is subject to key-controlled protection, the PSW key is matched with a storage key when information is stored or when information is fetched from a location that is protected against fetching. However, for one of the operands of each of MOVE TO PRIMARY, MOVE TO SECONDARY, MOVE WITH KEY, MOVE WITH SOURCE KEY, and MOVE WITH DESTINATION KEY, an access key specified as an operand is used instead of the PSW key.
Machine-Check Mask (M): Bit 13 controls whether the CPU is enabled for interruption by machine-check conditions. When the bit is zero, a machine-check interruption cannot occur. When the bit is one, machine-check interruptions due to system damage and instruction-processing damage are permitted, but interruptions due to other machine-check-subclass conditions are subject to the subclass-mask bits in control register 14.
Wait State (W): When bit 14 is one, the CPU is waiting; that is, no instructions are processed by the CPU, but interruptions may take place. When bit 14 is zero, instruction fetching and execution occur in the normal manner. The wait indicator is on when the bit is one.
Problem State (P): When bit 15 is one, the CPU is in the problem state. When bit 15 is zero, the CPU is in the supervisor state. In the supervisor state, all instructions are valid. In the problem state, only those instructions are valid that provide meaningful information to the problem program and that cannot affect system integrity; such instructions are called unprivileged instructions. The instructions that are never valid in the problem state are called privileged instructions. When a CPU in the problem state attempts to execute a privileged instruction, a privileged-operation exception is recognized. Another group of instructions, called semiprivileged instructions, are executed by a CPU in the problem state only if specific authority tests are met; otherwise, a privileged-operation exception or a special-operation exception is recognized.
Address-Space Control (AS): Bits 16 and 17, in conjunction with PSW bit 5, control the translation mode. See "Translation Modes" in topic 3.11.1.1.
Condition Code (CC): Bits 18 and 19 are the two bits of the condition code. The condition code is set to 0, 1, 2, or 3, depending on the result obtained in executing certain instructions. Most arithmetic and logical operations, as well as some other operations, set the condition code. The instruction BRANCH ON CONDITION can specify any selection of the condition-code values as a criterion for branching. A table in Appendix C summarizes the condition-code values that may be set for all instructions which set the condition code of the PSW.
Program Mask: Bits 20-23 are the four program-mask bits. Each bit is associated with a program exception, as follows:
____________ ________________________ | Program- | | | Mask Bit | Program Exception | |____________|________________________| | 20 | Fixed-point overflow | | 21 | Decimal overflow | | 22 | Exponent underflow | | 23 | Significance | |____________|________________________|Addressing Mode (A): Bit 32 controls the size of effective addresses and effective-address generation. When the bit is zero, 24-bit addressing is specified. When the bit is one, 31-bit addressing is specified. The addressing mode does not control the size of PER addresses or of addresses used to access DAT, ASN, dispatchable-unit-control, linkage, entry, and trace tables or access lists or the linkage stack. See "Address Generation" in topic 5.2 and "Address Size and Wraparound" in topic 3.2.2.When the mask bit is one, the exception results in an interruption. When the mask bit is zero, no interruption occurs. The setting of the exponent-underflow-mask bit or the significance-mask bit also determines the manner in which the operation is completed when the corresponding exception occurs.
Instruction Address: Bits 33-63 form the instruction address. This address designates the location of the leftmost byte of the next instruction to be executed, unless the CPU is in the wait state (bit 14 of the PSW is one).
Bit positions 0, 2-4, and 24-31 are unassigned and must contain zeros. A specification exception is recognized when these bit positions do not contain zeros. When bit 32 of the PSW specifies the 24-bit addressing mode, bits 33-39 of the instruction address must be zeros; otherwise, a specification exception is recognized. A specification exception is also recognized when bit position 12 does not contain a one.
All control-register bit positions in all 16 control registers are installed, regardless of whether the bit position is assigned to a facility. One or more specific bit positions in control registers are assigned to each facility requiring such register space.
The control registers provide for maintaining and manipulating control information outside the PSW. There are sixteen 32-bit control registers.
The LOAD CONTROL instruction causes all control-register positions within those registers designated by the instruction to be loaded from storage. The instructions BRANCH IN SUBSPACE GROUP, LOAD ADDRESS SPACE PARAMETERS, SET SECONDARY ASN, BRANCH AND STACK, PROGRAM CALL, PROGRAM RETURN, and PROGRAM TRANSFER provide specialized functions to place information into certain control-register positions.
Information loaded into the control registers becomes active (that is, assumes control over the system) at the completion of the instruction that causes the information to be loaded.
At the time the registers are loaded, the information is not checked for exceptions, such as invalid translation-format code or an address designating an unavailable or a protected location. The validity of the information is checked and the exceptions, if any, are indicated at the time the information is used.
The STORE CONTROL instruction causes all control-register positions, within those registers designated by the instruction, to be placed in storage. The instructions EXTRACT PRIMARY ASN, EXTRACT SECONDARY ASN, and PROGRAM CALL provide specialized functions to obtain information from certain control-register positions.
Only the general structure of the control registers is described here; the definition of a particular control-register position appears in the description of the facility with which the register position is associated. Figure 4-3 shows the control-register positions which are assigned and the initial value of the field upon execution of initial CPU reset. All control-register positions not listed in the figure are initialized to zero.
Programming Notes:
____ _____ ___________________________________ ___________________________ _______ |Ctrl| | | |Initial| |Reg |Bits | Name of Field | Associated with | Value | |____|_____|___________________________________|___________________________|_______| | 0 | 1 |SSM-suppression control |SET SYSTEM MASK | 0 | | 0 | 2 |TOD-clock-sync control |TOD clock | 0 | | 0 | 3 |Low-address-protection control |Low-address protection | 0 | | 0 | 4 |Extraction-authority control |Instruction authorization | 0 | | 0 | 5 |Secondary-space control |Instruction authorization | 0 | | 0 | 6 |Fetch-protection-override control |Key-controlled protection | 0 | | 0 | 7 |Storage-protection-override control|Key-controlled protection | 0 | | 0 | 8-12|Translation format |Dynamic address translation| 0 | | 0 | 14 |Vector control¹ |Vector operations | 0 | | 0 | 15 |Address-space-function control |Instruction authorization | 0 | | 0 | 16 |Malfunction-alert subclass mask |External interruptions | 0 | | 0 | 17 |Emergency-signal subclass mask |External interruptions | 0 | | 0 | 18 |External-call subclass mask |External interruptions | 0 | | 0 | 19 |TOD-clock sync-check subclass mask |External interruptions | 0 | | 0 | 20 |Clock-comparator subclass mask |External interruptions | 0 | | 0 | 21 |CPU-timer subclass mask |External interruptions | 0 | | 0 | 22 |Service-signal subclass mask |External interruptions | 0 | | 0 | 24 |Unused² | | 1 | | 0 | 25 |Interrupt-key subclass mask |External interruptions | 1 | | 0 | 26 |Unused² | | 1 | |____|_____|___________________________________|___________________________|_______| | 1 | 0 |Primary space-switch-event control |Program interruptions | 0 | | 1 | 1-19|Primary segment-table origin |Dynamic address translation| 0 | | 1 | 22 |Primary subspace-group control |Subspace groups | 0 | | 1 | 23 |Primary private-space control |Dynamic address translation| 0 | | 1 | 24 |Primary storage-alteration-event |Program-event rec. 2 only | 0 | | | | control | | | | 1 |25-31|Primary segment-table length |Dynamic address translation| 0 | |____|_____|___________________________________|___________________________|_______| | 2 | 1-25|Dispatchable-unit-control-table |Access-register translation| 0 | | | | origin | | | |____|_____|___________________________________|___________________________|_______| | 3 | 0-15|PSW-key mask |Instruction authorization | 0 | | 3 |16-31|Secondary ASN |Address spaces | 0 | |____|_____|___________________________________|___________________________|_______| | 4 | 0-15|Authorization index |Instruction authorization | 0 | | 4 |16-31|Primary ASN |Address spaces | 0 | |____|_____|___________________________________|___________________________|_______| | 5 | 0 |Subsystem-linkage control³ |Instruction authorization | 0 | | 5 | 1-24|Linkage-table origin³ |PC-number translation | 0 | | 5 |25-31|Linkage-table length³ |PC-number translation | 0 | | 5 | 1-25|Primary-ASN-second-table-entry |Access-register translation| 0 | | | | origin4 | | | |____|_____|___________________________________|___________________________|_______| ____ _____ ___________________________________ ___________________________ _______ |Ctrl| | | |Initial| |Reg |Bits | Name of Field | Associated with | Value | |____|_____|___________________________________|___________________________|_______| | 6 | 0-7 |I/O-interruption subclass mask |I/O interruptions | 0 | |____|_____|___________________________________|___________________________|_______| | 7 | 1-19|Secondary segment-table origin |Dynamic address translation| 0 | | 7 | 22 |Secondary subspace-group control |Subspace groups | 0 | | 7 | 23 |Secondary private-space control |Dynamic address translation| 0 | | 7 | 24 |Secondary storage-alteration-event |Program-event rec. 2 only | 0 | | | | control | | | | 7 |25-31|Secondary segment-table length |Dynamic address translation| 0 | |____|_____|___________________________________|___________________________|_______| | 8 | 0-15|Extended authorization index |Access-register translation| 0 | | 8 |16-31|Monitor masks |MONITOR CALL | 0 | |____|_____|___________________________________|___________________________|_______| | 9 | 0 |Successful-branching-event mask |Program-event recording | 0 | | 9 | 1 |Instruction-fetching-event mask |Program-event recording | 0 | | 9 | 2 |Storage-alteration-event mask |Program-event recording | 0 | | 9 | 3 |GR-alteration-event mask |Program-event rec. 1 only | 0 | | 9 | 4 |Store-using-real-address-event mask|Program-event recording | 0 | | 9 | 8 |Branch-address control |Program-event rec. 2 only | 0 | | 9 | 10 |Storage-alteration-space control |Program-event rec. 2 only | 0 | | 9 |16-31|PER general-register masks |Program-event rec. 1 only | 0 | |____|_____|___________________________________|___________________________|_______| | 10 | 1-31|PER starting address |Program-event recording | 0 | |____|_____|___________________________________|___________________________|_______| | 11 | 1-31|PER ending address |Program-event recording | 0 | |____|_____|___________________________________|___________________________|_______| | 12 | 0 |Branch-trace control |Tracing | 0 | | 12 | 1-29|Trace-entry address |Tracing | 0 | | 12 | 30 |ASN-trace control |Tracing | 0 | | 12 | 31 |Explicit-trace control |Tracing | 0 | |____|_____|___________________________________|___________________________|_______| | 13 | 0 |Home space-switch-event control |Program interruptions | 0 | | 13 | 1-19|Home segment-table origin |Dynamic address translation| 0 | | 13 | 22 |Ignored | | 0 | | 13 | 23 |Home private-space control |Dynamic address translation| 0 | | 13 | 24 |Home storage-alteration-event |Program-event rec. 2 only | 0 | | | | control | | | | 13 |25-31|Home segment-table length |Dynamic address translation| 0 | |____|_____|___________________________________|___________________________|_______| | 14 | 0 |Unused² | | 1 | | 14 | 1 |Unused² | | 1 | | 14 | 3 |Channel-report-pending subclass |I/O machine-check handling | 0 | | | | mask | | | | 14 | 4 |Recovery subclass mask |Machine-check handling | 0 | | 14 | 5 |Degradation subclass mask |Machine-check handling | 0 | | 14 | 6 |External-damage subclass mask |Machine-check handling | 1 | | 14 | 7 |Warning subclass mask |Machine-check handling | 0 | | 14 | 12 |ASN-translation control |Instruction authorization | 0 | | 14 |13-31|ASN-first-table origin |ASN translation | 0 | |____|_____|___________________________________|___________________________|_______| | 15 | 1-28|Linkage-stack-entry address |Linkage-stack operations | 0 | |____|_____|___________________________________|___________________________|_______| __________________________________________________________________________________ |Explanation: | | | | The fields not listed are unassigned. The initial value for all unlisted | | control-register positions is zero. | | | | ¹ Bit 14 of control register 0, the vector-control bit, is described in the | | publication IBM Enterprise Systems Architecture/390 Vector Operations, | | SA22-7207. | | | | ² This bit is not used but is initialized to one for consistency with the | | System/370 definition. | | | | ³ When the address-space-function control in control register 0 is zero, | | LOAD ADDRESS SPACE PARAMETERS, PROGRAM CALL, and PROGRAM TRANSFER treat | | control register 5 as containing the linkage-table designation (LTD) | | (subsystem-linkage control, linkage-table origin, and linkage-table length). | | | | 4 When the address-space-function control is one, control register 5 is | | treated as containing the primary-ASN-second-table-entry (PASTE) origin, | | and PROGRAM CALL and PROGRAM TRANSFER obtain the LTD from the PASTE. | |__________________________________________________________________________________|Figure 4-3. Assignment of Control-Register Fields
When branch tracing is on, an entry is made in the trace table for each execution of certain branch instructions when they cause branching. The branch address is placed in the trace entry. The trace entry also indicates the addressing mode in effect after branching. The branch instructions that are traced are:
Tracing assists in the determination of system problems by providing an ongoing record in storage of significant events. Tracing consists of three separately controllable functions which cause entries to be made in a trace table: branch tracing, ASN tracing, and explicit tracing. Branch tracing and ASN tracing together are referred to as implicit tracing.
When ASN tracing is on, an entry is made in the trace table for each execution of the following instructions:
When explicit tracing is on, execution of TRACE causes an entry to be made in the trace table. This entry includes bits 16-63 from the TOD clock, the second operand of the TRACE instruction, and the contents of a range of general registers.
Subtopics:
The information to control tracing is contained in control register 12 and has the following format:
_ _____________________________ _ _ |B| Trace-Entry Address |A|E| |_|_____________________________|_|_| 0 1 30 31Branch-Trace-Control Bit (B): Bit 0 of control register 12 controls whether branch tracing is turned on or off. If the bit is zero, branch tracing is off; if the bit is one, branch tracing is on.
Trace-Entry Address: Bits 1-29 of control register 12, with two zero bits appended on the right, form the real address of the next trace entry to be made.
ASN-Trace-Control Bit (A): Bit 30 of control register 12 controls whether ASN tracing is turned on or off. If the bit is zero, ASN tracing is off; if the bit is one, ASN tracing is on.
Explicit-Trace-Control Bit (E): Bit 31 of control register 12 controls whether explicit tracing is turned on or off. If the bit is zero, explicit tracing is off, which causes the TRACE instruction to be executed as a no-operation; if the bit is one, the execution of the TRACE instruction creates an entry in the trace table, except that no entry is made when bit 0 of the second operand of the TRACE instruction is one.
Trace entries are of eight types, as shown in Figure 4-4.
31-Bit Branch _ ________________________________ |1| Branch Address | |_|________________________________| 0 1 31
24-Bit Branch ________ _________________________ |00000000| Branch Address | |________|_________________________| 0 8 31
BRANCH IN SUBSPACE GROUP (if ASN Tracing On) ________ _ _______________________ _ ______________________________ |01000001|P| Bits 9-31 of ALET |A| Branch Address | |________|_|_______________________|_|______________________________| 0 8 32 63
SET SECONDARY ASN ________ ________ ________________ |00010000|00000000| New SASN | |________|________|________________| 0 8 16 31
PROGRAM CALL ________ ____ ____________________ _ ____________________________ _ | |PSW | | | | | |00100001|Key | PC Number |A| Return Address |P| |________|____|____________________|_|____________________________|_| 0 8 12 32 63
PROGRAM RETURN ________ ____ ____ _______________ _ ____________________________ _ | |PSW | | | | | | |00110010|Key |0000| New PASN |A| Return Address |P| |________|____|____|_______________|_|____________________________|_| 0 8 12 16 32 63
_ ________________________________ | | | |A| Updated Instruction Address | |_|________________________________| 64 95
PROGRAM TRANSFER ________ ____ ____ _______________ ________________________________ | |PSW | | | | |00110001|Key |0000| New PASN | R2 Before | |________|____|____|_______________|________________________________| 0 8 12 16 32 63 TRACE ____ ____ ________ ________________________________________________ |0111| N |00000000| TOD-Clock Bits 16-63 | |____|____|________|________________________________________________| 0 4 8 16 63
__________________________________ ________________/_______________ | TRACE Operand | (R1) - (R3) | |__________________________________|________________/_______________| 64 96 95 + 32(N+1)
Branch Address: The branch address is the address of the next instruction to be executed when the branch is taken. In a branch trace entry when the 31-bit addressing mode is in effect after branching, bit positions 1-31 of the trace entry contain the branch address. When the 24-bit addressing mode is in effect after branching, bit positions 8-31 contain the branch address. In a trace entry made on execution of BRANCH IN SUBSPACE GROUP when ASN tracing is on, bit positions 33-63 of the trace entry contain the branch address.
Primary-List Bit (P) and Bits 9-31 of ALET: Bit position 8 of the trace entry made on execution of BRANCH IN SUBSPACE GROUP when ASN tracing is on contains bit 7 of the access-list-entry token (ALET) in the access register designated by the R2 field of the instruction. Bit positions 9-31 of the trace entry contain bits 9-31 of the ALET.
New SASN: Bit positions 16-31 of the trace entry for SET SECONDARY ASN contain the ASN value loaded into control register 3 by the instruction.
PSW Key: Bit positions 8-11 of the trace entries made on execution of PROGRAM CALL, PROGRAM RETURN, and PROGRAM TRANSFER contain the PSW key from the current PSW.
PC Number: Bit positions 12-31 of the trace entry made on execution of PROGRAM CALL contain the value of the rightmost 20 bits of the second-operand address.
Addressing-Mode Bit (A): Bit position 32 of the trace entry made on execution of PROGRAM CALL contains the addressing-mode bit from the current PSW. Bit position 32 of the trace entry made on execution of PROGRAM RETURN contains the addressing-mode bit that replaces bit 32 of the PSW, and bit position 64 of the trace entry contains bit 32 from the PSW before bit 32 is replaced. Bit position 32 of the trace entry made on execution of BRANCH IN SUBSPACE GROUP when ASN tracing is on contains the addressing-mode bit that replaces bit 32 of the PSW.
Return Address: Bit positions 33-62 of the trace entry made on execution of PROGRAM CALL contain bits 1-30 of the updated instruction address in the PSW before that address is replaced from the entry-table entry. Bit positions 33-62 of the trace entry made on execution of PROGRAM RETURN contain bits 1-30 of the instruction address that replaces bits 33-63 of the PSW.
Problem-State Bit (P): Bit position 63 of the trace entry made on execution of PROGRAM CALL contains the problem-state bit from the current PSW. Bit position 63 of the trace entry made on execution of PROGRAM RETURN contains the problem-state bit that replaces bit 15 of the PSW.
New PASN: Bit positions 16-31 of the trace entry made on execution of PROGRAM RETURN contain the new PASN that is restored from the linkage-stack state entry. Bit positions 16-31 of the trace entry made on execution of PROGRAM TRANSFER contain the new PASN (which may be zero) specified in bit positions 16-31 of general register R1.
Updated Instruction Address: Bit positions 65-95 of the trace entry made on execution of PROGRAM RETURN contain bits 1-31 of the updated instruction address in the PSW before that address is replaced from the linkage-stack state entry.
R2 Before: Bit positions 32-63 of the trace entry made on execution of PROGRAM TRANSFER contain the contents of the general register designated by the R2 field of the instruction. Bits 0-30 of the general register designated by the R2 field replace bits 32-62 of the PSW. Bit 31 of the same general register replaces the problem-state bit of the PSW.
Number of Registers (N): Bits 4-7 of the trace entry for TRACE contain a value which is one less than the number of general registers which have been provided in the trace entry. The value of N ranges from zero, meaning the contents of one general register are provided in the trace entry, to 15, meaning the contents of all 16 general registers are provided.
TOD-Clock Bits 16-63: Bits 16-63 of the trace entry for TRACE are obtained from bit positions 16-63 of the TOD clock, as would be provided by a STORE CLOCK instruction executed at the time the TRACE instruction was executed.
TRACE Operand: Bits 64-95 of the trace entry for TRACE contain a copy of the 32 bits of the second operand of the TRACE instruction for which the entry is made.
(R1)-(R3): The four-byte fields starting with bit 96 of the trace entry for TRACE contain the contents of the general registers whose range is specified by the R1 and R3 fields of the TRACE instruction. The general registers are stored in ascending order of register numbers, starting with general register R1 and continuing up to and including general register R3, with general register 0 following general register 15.
Programming Note: The size of the trace entry for TRACE in units of words is 3 + (N + 1). The maximum size of an entry is 19 words, or 76 bytes.
No trace entry is stored if the incrementing of the address in control register 12 would cause a carry to be propagated into bit position 19 (that is, the trace-entry address would be in the next 4K-byte block). If this would be the case for the entry to be made, a trace-table exception is recognized. For the purpose of recognizing the trace-table exception in the case of a TRACE instruction, the maximum length of 76 bytes is used instead of the actual length.
When an instruction which is subject to tracing is executed, and the corresponding tracing function is turned on, a trace entry of the appropriate format is made. The real address of the trace entry is formed by appending two zero bits on the right to the value in bit positions 1-29 of control register 12. The address in control register 12 is subsequently increased by the size of the entry created.
The storing of a trace entry is not subject to key-controlled protection (nor, since the trace-entry address is real, is it subject to
The three exceptions associated with storing a trace entry (addressing, protection, and trace table) are collectively referred to as trace exceptions.
If a program interruption takes place for a condition which is not a trace-exception condition and for which execution of an instruction is not completed, it is unpredictable whether part or all of any trace entry due to be made for such an interrupted instruction is stored in the trace table. Thus, for a condition which would ordinarily cause nullification or suppression of instruction execution, storage locations may have been altered beginning at the location designated by control register 12 and extending up to the length of the entry that would have been created.
When PROGRAM RETURN unstacks a linkage-stack state entry that was formed by BRANCH AND STACK and ASN tracing is on, trace exceptions may be recognized, even though a trace entry is not made and no part of a trace entry is stored.
The order in which information is placed in a trace entry is unpredictable. Furthermore, as observed by other CPUs and by channel programs, the contents of a byte of a trace entry may appear to change more than once before completion of the instruction for which the entry is made.
The trace-entry address in control register 12 is updated only on completion of execution of an instruction for which a trace entry is made.
A serialization and checkpoint-synchronization function is performed before the operation begins and again after the operation is completed.
Unless otherwise noted, the descriptions in this section apply to both PER 1 and PER 2. The differences between PER 1 and PER 2 are pointed out in the section.
There are two versions of the program-event-recording (PER) facility. The version which is the same as PER in ESA/370 is named PER 1, and the other version is named PER 2. A model provides either PER 1 or PER 2.
The purpose of PER (PER 1 or PER 2) is to assist in debugging programs. It permits the program to be alerted to the following types of events:
If a model implements ESA/390 with PER 2 and also System/370, general-register-alteration events may be omitted in System/370, depending on the model.
Subtopics:
The information for controlling PER resides in control registers 9, 10, and 11 and the segment-table designation. The information in the control registers has the following format:
PER-1 Control Register 9 _____ ___________ ________________ | EM | |Gen.-Reg. Masks | |_____|___________|________________| 0 5 16 31 PER-2 Control Register 9 _____ ____ _ _ _ ________________ | EM | |B| |S| | |_____|____|_|_|_|________________| 0 5 8 10 31 Control Register 10 _ _______________________________ | | Starting Address | |_|_______________________________| 0 1 31
Control Register 11 _ _______________________________ | | Ending Address | |_|_______________________________| 0 1 31
PER-Event Masks (EM): With PER 1, bits 0-4 of control register 9 specify which types of events are recognized. With PER 2, bits 0-2 and 4 provide this specification. The bits are assigned as follows:
Branch-Address Control (B): With PER 2, bit 8 of control register 9
specifies, when one, that successful-branching events occur only for branches that are to a location within the designated storage area. With PER 1, or with PER 2 when bit 8 is zero, successful-branching events occur regardless of the branch-target address. Bit 8 is ignored by PER 1.Storage-Alteration-Space Control (S): With PER 2, bit 10 of control register 9 specifies, when one, that storage-alteration events occur as a result of references to the designated storage area only within designated address spaces. An address space is designated as one for which storage-alteration events occur by means of the storage-alteration-event bit in the segment-table designation that is used to translate references to the address space. Bit 10 is ignored when DAT is off. With PER 1, or with PER 2 when DAT is off or bit 10 is zero, storage-alteration events are not restricted to occurring for only particular address spaces. Bit 10 is ignored by PER 1.
PER General-Register Masks: With PER 1, bits 16-31 of control register 9 specify which general registers are designated for recognition of the alteration of their contents. The 16 bits, in the sequence of ascending bit numbers, correspond one for one with the 16 registers, in the sequence of ascending register numbers. When a bit is one, the alteration of the associated register is recognized; when it is zero, the alteration of the register is not recognized. With PER 2, general-register-alteration events do not occur, and bits 16-31 are ignored.
PER Starting Address: Bits 1-31 of control register 10 are the address of the beginning of the designated storage area.
PER Ending Address: Bits 1-31 of control register 11 are the address of the end of the designated storage area.
The segment-table designation has the following format:
Segment-Table Designation _ ____________________ ___ _ _ _______ | |Segment-Table Origin| |P|S| STL | |_|____________________|___|_|_|_______| 0 1 20 23 25 31
Storage-Alteration-Event Bit (S): With PER 2, when the storage-alteration-space control in control register 9 is one, bit 24 of the segment-table designation specifies, when one, that the address space defined by the segment-table designation is one for which storage-alteration events can occur. Bit 24 is examined when the segment-table designation is used to perform dynamic-address translation for a storage-operand store reference. The segment-table designation may be the PSTD, SSTD, or HSTD in control register 1, 7, or 13, respectively, or it may be obtained from an ASN-second-table entry during access-register translation. Instead of being obtained from an ASN-second-table entry in main storage, bit 24 may be obtained from an ASN-second-table entry in the ART-lookaside buffer (ALB). Bit 24 is ignored when the storage-alteration-space control is zero, and it is always ignored by PER 1.
Programming Notes:
An interruption due to a PER event normally occurs after the execution of the instruction responsible for the event. The occurrence of the event does not affect the execution of the instruction, which may be either completed, partially completed, terminated, suppressed, or nullified.
PER is under control of bit 1 of the PSW, the PER mask. When the PER mask, a particular PER-event mask bit, and, for general-register-alteration events (PER 1 only), a particular general-register mask bit are all ones, the CPU is enabled for the corresponding type of event; otherwise, it is disabled. However, the CPU is enabled for the store-using-real-address event only when the storage-alteration mask bit and the store-using-real-address mask bit are both ones.
When the CPU is disabled for a particular PER event at the time it occurs, either by the PER mask in the PSW or by the masks in control register 9, the event is not recognized.
A change to the PER mask in the PSW or to the PER control fields in control registers 9, 10, and 11 affects PER starting with the execution of the immediately following instruction.
A change to the storage-alteration-event bit in a segment-table designation in control register 1, 7, or 13 also affects PER starting with the execution of the immediately following instruction. A change to the storage-alteration-event bit in a segment-table designation that may be obtained, during access-register translation, from an ASN-second-table entry in either main storage or the ALB does not necessarily have an immediate, if any, effect on PER. However, PER is affected immediately after PURGE ALB is executed.
If a PER event occurs during the execution of an instruction which changes the CPU from being enabled to being disabled for that type of event, that PER event is recognized.
PER events may be recognized in a trial execution of an instruction, and subsequently the instruction, DAT-table entries, and operands may be refetched for the actual execution. If any refetched field was modified by another CPU or by a channel program between the trial execution and the actual execution, it is unpredictable whether the PER events indicated are for the trial or the actual execution.
For special-purpose instructions that are not described in this publication, the operation of PER may not be exactly as described in this section.
Subtopics:
A program interruption for PER sets bit 8 of the interruption code to one and places identifying information in real storage locations 150-155, and in location 161 if the PER event is a storage-alteration event. Additional information is provided by means of the instruction address in the program old PSW and the ILC. The information stored in real locations 150-155 and 161 has the following format:
PER-1 Locations 150-151: ____ ____________ |PERC|000000000000| |____|____________| 0 4 15 PER-2 Locations 150-151: _____ ____ _____ __ |PERC |0000|ATMID|SI| |_____|____|_____|__| 0 5 9 13 15
Locations 152-155: _ _______________________________ |0| PER Address | |_|_______________________________| 0 1 31 Location 161: ____ ____ |0000|PAID| |____|____| 0 4 7
PER Code (PERC or PRC): With PER 1, the occurrence of PER events is indicated by ones in bit positions 0-3 of real location 150, the PER code. With PER 2, the PER code is bits 0-2 and 4. The bit position in the PER code for a particular type of event is the same as the bit position for that event in the PER-event-mask field in control register 9, except as follows:
Addressing-and-Translation-Mode Identification (ATMID): With PER 2,
during a program interruption when a PER event is indicated, bits 32, 5, 16, and 17 of the PSW at the beginning of the execution of the instruction that caused the event may be stored in bit positions 10-13, respectively, of real locations 150-151. If bits 32, 5, 16, and 17 are stored, then a one bit is stored in bit position 9 of locations 150-151. If bits 32, 5, 16, and 17 are not stored, then zero bits are stored in bit positions 9-13 of locations 150-151.Bits 9-13 of real locations 150-151 are named the addressing-and-translation-mode identification (ATMID). Bit 9 is named the ATMID-validity bit. When bit 9 is zero, it indicates that an invalid ATMID (all zeros) was stored.
The meanings of the bits of a valid ATMID are as follows:
In the case of an instruction-fetching PER event caused by SET ADDRESS
SPACE CONTROL or SET ADDRESS SPACE CONTROL FAST, bits 12 and 13 of the
ATMID, which correspond to bits 16 and 17 of the PSW, may indicate that
the CPU was in the primary-space mode when it actually was in the
primary-space, secondary-space, or access-register mode. In any of those
modes, the instruction fetch is from the primary address space.
PER STD Identification (SI): With PER 2, if a storage-alteration event is
indicated in the PER code (bit 2 is one and bit 4 is zero) and this event
occurred when DAT was on, bits 14 and 15 of locations 150-151 are set to
identify the segment-table designation (STD) that was used to translate
the reference that caused the event, as follows:
If a storage-alteration event is not indicated in the PER code (bit 2 is zero or bit 4 is one) or DAT was off, zeros are stored in bit positions 14 and 15.
With PER 1, zeros are stored in bit positions 4-15 of locations 150-151. With PER 2, zeros are stored in bit positions 3 and 5-8 of locations 150-151.
PER Address: The PER address at locations 152-155 contains the instruction address used to fetch the instruction in execution when one or more PER events were recognized. When the instruction is the target of EXECUTE, the instruction address used to fetch the EXECUTE instruction is placed in the PER-address field. A zero is stored in bit position 0 of real location 152.
PER Access Identification (PAID): If a storage-alteration event is indicated in the PER code, an indication of the address space to which the event applies may be stored at location 161. If the access used an AR-specified segment-table designation, the number of the access register used is stored in bit positions 4-7 of location 161, and zeros are stored in bit positions 0-3. However, with PER 1 only, the contents of location 161 are unpredictable if the instruction that caused the event turned DAT off. With PER 1 or PER 2, the contents of location 161 are also unpredictable if (1) the CPU was in the access-register mode but the access was an implicit reference to the linkage stack, (2) the CPU was not in the access-register mode, or (3) a store-using-real-address event instead of a storage-alteration event occurred. If bit 2 of the PER code is zero, location 161 remains unchanged.
Instruction Address: The instruction address in the program old PSW is the address of the instruction which would have been executed next, unless another program condition is also indicated, in which case the instruction address is that determined by the instruction ending due to that condition.
ILC: The ILC indicates the length of the instruction designated by the PER address, except when a concurrent specification exception for the PSW introduced by LOAD PSW, PROGRAM RETURN, or a supervisor-call interruption sets an ILC of 0.
Programming Notes:
In the case of an instruction-fetching event for SUPERVISOR CALL, the program interruption occurs immediately after the supervisor-call interruption.
When a program interruption occurs and more than one PER event has been recognized, all recognized PER events are concurrently indicated in the PER code. Additionally, if another program-interruption condition concurrently exists, the interruption code for the program interruption indicates both the PER condition and the other condition.
If a PER event is recognized during the execution of an instruction which also introduces a new PSW with the type of PSW-format error which is recognized early (see "Exceptions Associated with the PSW" in topic 6.1.5), both the specification exception and PER are indicated concurrently in the interruption code of the program interruption. However, for a PSW-format error of the type which is recognized late, only PER is indicated in the interruption code. In both cases, the invalid PSW is stored as the program old PSW.
Recognition of a PER event does not normally affect the ending of instruction execution. However, in the following cases, execution of an interruptible instruction is not completed normally:
Programming Notes:
An instruction-fetching event occurs whenever the first byte of an instruction or the first byte of the target of an EXECUTE instruction is fetched from the designated area. A storage-alteration event occurs when a store access is made to the designated area by using an operand address that is defined to be a logical or a virtual address. However, with PER 2, when DAT is on and the storage-alteration-space control in control register 9 is one, a storage-alteration event occurs only when the storage area is within an address space for which the storage-alteration-event bit in the segment-table designation is one. A storage-alteration event does not occur for a store access made with an operand address defined to be a real address. With PER 2, when the branch-address control in control register 9 is one, a successful-branching event occurs when the first byte of the branch-target instruction is within the designated area.
Two types of PER events.--instruction fetching and storage alteration.--always involve the designation of an area in storage. With PER 2, successful-branching events may involve this designation. The storage area starts at the location designated by the starting address in control register 10 and extends up to and including the location designated by the ending address in control register 11. The area extends to the right of the starting address.
The set of addresses designated for successful-branching, instruction-fetching, and storage-alteration events wraps around at address 2,147,483,647; that is, address 0 is considered to follow address 2,147,483,647. When the starting address is less than the ending address, the area is contiguous. When the starting address is greater than the ending address, the set of locations designated includes the area from the starting address to address 2,147,483,647 and the area from address 0 to, and including, the ending address. When the starting address is equal to the ending address, only that one location is designated.
Address comparison for successful-branching, instruction-fetching, and storage-alteration events is always performed using 31-bit addresses. This is accomplished in the 24-bit addressing mode by extending the virtual, logical, or instruction address on the left with seven zero bits before comparing it with the starting and ending addresses.
Programming Note: In some models, performance of address-range checking is assisted by means of an extension to each page-table entry in the TLB. In such an implementation, changing the contents of control registers 10 and 11 when the successful-branching, instruction-fetching, or storage-alteration-event mask is one, or setting any of these PER-event masks to one, may cause the TLB to be cleared of entries. This degradation may be experienced even when the CPU is disabled for PER events. Thus, when possible, the program should avoid loading control registers 9, 10, or 11.
Subtopics:
Subject to the effect of the branch-address control, a successful-branching event occurs whenever one of the following instructions causes branching:
With PER 1, or with PER 2 when the branch-address control in control register 9 is zero, a successful-branching event occurs independent of the branch-target address. With PER 2 when the branch-address control is one, a successful-branching event occurs only when the first byte of the branch-target instruction is fetched from the storage area designated by control registers 10 and 11.
A successful-branching event causes a PER successful-branching event to be recognized if bit 0 of the PER-event masks is one and the PER mask in the PSW is one.
A PER successful-branching event is indicated by setting bit 0 of the PER code to one.
An instruction-fetching event causes a PER instruction-fetching event to be recognized if bit 1 of the PER-event masks is one and the PER mask in the PSW is one.
An instruction-fetching event occurs if the first byte of the instruction is within the storage area designated by control registers 10 and 11. An instruction-fetching event also occurs if the first byte of the target of EXECUTE is within the designated storage area.
If an instruction-fetching event is the only PER event recognized for an interruptible instruction that is to be interrupted because of an asynchronous condition (I/O, external, restart, or repressible machine-check condition) or the performance of the stop function, and if a unit of operation of the instruction remains to be executed, the instruction-fetching event may be discarded, and whether it is discarded is unpredictable.
The PER instruction-fetching event is indicated by setting bit 1 of the PER code to one.
The contents of storage are considered to have been altered whenever the CPU executes an instruction that causes all or part of an operand to be stored within the designated storage area. Alteration is considered to take place whenever storing is considered to take place for purposes of indicating protection exceptions, except that recognition does not occur for the storing of data by a channel program. (See "Recognition of Access Exceptions" in topic 6.5.4.) Storing constitutes alteration for PER purposes even if the value stored is the same as the original value.
A storage-alteration event occurs whenever a CPU, by using a logical or virtual address, makes a store access without an access exception to the storage area designated by control registers 10 and 11. However, with PER 2 when DAT is on and the storage-alteration-space control in control register 9 is one, the event occurs only if the storage-alteration-event bit is one in the segment-table designation that is used by DAT to translate the reference to the storage location.
Implied locations that are referred to by the CPU in the process of performing an interruption are not monitored. Such locations include PSW and interruption-code locations. These locations, however, are monitored when information is stored there explicitly by an instruction. Similarly, monitoring does not apply to the storing of data by a channel program. Implied locations in the linkage stack, which are stored in by instructions that operate on the linkage stack, are monitored.
The I/O instructions are considered to alter the second-operand location only when storing actually occurs.
When an interruptible vector instruction which performs storing is interrupted, and PER storage alteration applies to storage locations corresponding to elements due to be changed beyond the point of interruption, PER storage alteration is indicated if any such store actually occurred and may be indicated even if such a store did not occur. PER storage alteration is reported for such locations only if no access exception exists at the time that the instruction is executed.
Storage alteration does not apply to instructions whose operands are specified to be real addresses. Thus, storage alteration does not apply to INVALIDATE PAGE TABLE ENTRY, RESET REFERENCE BIT EXTENDED, SET STORAGE KEY EXTENDED, STORE USING REAL ADDRESS, TEST BLOCK, and TEST PENDING INTERRUPTION (when the effective address is zero).
A storage-alteration event causes a PER storage-alteration event to be recognized if bit 2 of the PER-event masks is one and the PER mask in the PSW is one. Bit 4 of the PER-event masks is ignored when determining whether a PER storage-alteration event is to be recognized.
With PER 1, a PER storage-alteration event is indicated by setting bit 2 of the PER code to one. However, when bit 2 of the PER code and bit 4 of the PER-event masks are both ones, a store-using-real-address event, instead of a storage-alteration event, may have occurred. With PER 2, a PER storage-alteration event is indicated by setting bit 2 of the PER code to one and bit 4 of the PER code to zero.
The contents of a general register are considered to have been altered whenever a new value is placed in the register. Recognition of the event is not contingent on the new value being different from the previous one. The execution of an RR-format arithmetic, logical, or movement instruction is considered to fetch the contents of the register, perform the indicated operation, if any, and then replace the value in the register. A register can be designated by an RR, RRE, RS, or RX instruction or implicitly, such as in TRANSLATE AND TEST and EDIT AND MARK.
With PER 1, a general-register-alteration event occurs whenever the contents of a general register are replaced. With PER 2, general-register-alteration events do not occur. The remainder of this description applies only to PER 1.
The instructions MOVE LONG and COMPARE LOGICAL LONG are always considered to alter the contents of the four registers specifying the two operands, including the cases where the padding byte is used, when both operands have zero length. However, when condition code 3 is set for MOVE LONG, the general registers containing the operand lengths may or may not be considered as having been altered.
The instruction COMPARE UNTIL SUBSTRING EQUAL is always considered to alter the contents of the even-numbered registers specifying the two operands. When the operand length or the substring length is zero, the odd-numbered register specifying an operand may or may not be considered as having been altered.
The instruction INSERT CHARACTERS UNDER MASK is not considered to alter the general register when the mask is zero.
The instructions COMPARE AND SWAP and COMPARE DOUBLE AND SWAP are considered to alter the general register, or general-register pair, designated by R1, only when the contents are actually replaced, that is, when the first and second operands are not equal.
It is unpredictable whether general-register-alteration events are indicated for instructions of the vector facility.
A general-register-alteration event causes a PER general-register-alteration event to be recognized if bit 3 of the PER-event masks is one, the PER mask in the PSW is one, and the corresponding bit in the PER general-register mask is one.
The PER general-register-alteration event is indicated by setting bit 3 of the PER code to one.
Programming Note: The following are some examples of general-register alteration:
There is no relationship between the store-using-real-address event and the designated storage area.
A store-using-real-address event occurs whenever the STORE USING REAL ADDRESS instruction is executed.
A store-using-real-address event causes a PER store-using-real-address event to be recognized if bits 2 and 4 of the PER-event mask are ones and the PER mask in the PSW is one.
With PER 1, a PER store-using-real-address event is indicated by setting bit 2 of the PER code to one. However, when bit 2 of the PER code is one, a storage-alteration event, instead of a store-using-real-address event, may have occurred. With PER 2, a PER store-using-real-address event is indicated by setting bits 2 and 4 of the PER code to one.
The following rules govern the indication of PER events caused by an instruction that also causes a program exception, a monitor event, a space-switch event, or a supervisor-call interruption.
_____________________________ ______ ____________________________________ | | | PER Event | | | Type |______ ______ _______ _______ ______| | | of | |Instr |Storage| GR | | | Concurrent Condition |Ending|Branch|Fetch |Alter. |Alter.¹|STURA | |_____________________________|______|______|______|_______|_______|______| |Specification | | | | | | | | Odd instruction address | S | No | No | No | No | No | | in the PSW | | | | | | | |Instruction access |N or S| No | U | No | No | No | |Specification | | | | | | | | EXECUTE target address odd| S | No | U | No | No | - | |EXECUTE target access |N or S| No | U | No | No | - | |Other nullifying | N | No | Yes | No² | No² | - | |Other suppressing | S | No | Yes | No² | No² | No | |All terminating | T | No | Yes | Yes³ | Yes³ | - | |All completing | C | Yes | Yes | Yes | Yes | - | |_____________________________|______|______|______|_______|_______|______| |Explanation: | | | | - The condition does not apply. | | | | ¹ With PER 2, PER general-register-alteration events do not occur | | and are not indicated. | | | | ² 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 or general register were al- | | tered, 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. | |_________________________________________________________________________|Figure 4-5. Indication of PER Events with Other Concurrent Conditions
Programming Notes:
Interruption of such an instruction may cause a PER event to be indicated more than once. It may be necessary, therefore, for a program to remove the redundant event indications from the PER data. The following rules govern the indication of the applicable events during execution of these instructions:
In a multiprocessing configuration, a single TOD clock may be shared by more than one CPU, or each CPU may have a separate TOD clock. However, each CPU has a separate clock comparator and CPU timer.
The timing facilities include three facilities for measuring time: the TOD clock, the clock comparator, and the CPU timer.
Subtopics:
In an installation with more than one CPU, each CPU may have a separate TOD clock, or more than one CPU may share a clock, depending on the model. In all cases, each CPU has access to a single clock.
The time-of-day (TOD) clock provides a high-resolution measure of real time suitable for the indication of date and time of day. The cycle of the clock is approximately 143 years.
Subtopics:
The TOD clock is a binary counter with the format shown in the following illustration. The bit positions of the clock are numbered 0 to 63, corresponding to the bit positions of a 64-bit unsigned binary integer.
1 microsecond___ _____________________________ _ ______ | | | | |_____________________________|_|______| 0 51 63A TOD clock is said to be in a particular multiprocessing configuration if at least one of the CPUs which shares that clock is in the configuration. Thus, it is possible for a single TOD clock to be in more than one configuration. Conversely, if all CPUs having access to a particular TOD clock have been removed from a particular configuration, then the TOD clock is no longer considered to be in that configuration.In the basic form, the TOD clock is incremented by adding a one in bit position 51 every microsecond. In models having a higher or lower resolution, a different bit position is incremented at such a frequency that the rate of advancing the clock is the same as if a one were added in bit position 51 every microsecond. The resolution of the TOD clock is such that the incrementing rate is comparable to the instruction-execution rate of the model.
When more than one TOD clock exists in the configuration, the stepping rates are synchronized such that all TOD clocks in the configuration are incremented at exactly the same rate.
When incrementing of the clock causes a carry to be propagated out of bit position 0, the carry is ignored, and counting continues from zero. The program is not alerted, and no interruption condition is generated as a result of the overflow.
The operation of the clock is not affected by any normal activity or event in the system. Incrementing of the clock does not depend on whether the wait-state bit of the PSW is one or whether the CPU is in the operating, load, stopped, or check-stop state. Its operation is not affected by CPU, initial-CPU, or clear resets or by initial program loading. Operation of the clock is also not affected by the setting of the rate control or by an initial-machine-loading operation. Depending on the model and the configuration, a TOD clock may or may not be powered independent of a CPU that accesses it.
Not-Set State: When the power for the clock is turned on, the clock is set to zero, and the clock enters the not-set state. The clock is incremented when in the not-set state.
The following states are distinguished for the TOD clock: set, not set, stopped, error, and not operational. The state determines the condition code set by execution of STORE CLOCK. The clock is incremented, and is said to be running, when it is in either the set state or the not-set state.
When the clock is in the not-set state, execution of STORE CLOCK causes condition code 1 to be set and the current value of the running clock to be stored.
Stopped State: The clock enters the stopped state when SET CLOCK is executed on a CPU accessing that clock and the clock is set. This occurs when SET CLOCK is executed without encountering any exceptions and any manual TOD-clock control in the configuration is set to the enable-set position. The clock can be placed in the stopped state from the set, not-set, and error states. The clock is not incremented while in the stopped state.
When the clock is in the stopped state, execution of STORE CLOCK on a CPU accessing that clock causes condition code 3 to be set and the value of the stopped clock to be stored.
Set State: The clock enters the set state only from the stopped state. The change of state is under control of the TOD-clock-sync-control bit, bit 2 of control register 0, in the CPU which most recently caused that clock to enter the stopped state. If the bit is zero, the clock enters the set state at the completion of execution of SET CLOCK. If the bit is one, the clock remains in the stopped state until the bit is set to zero on that CPU, until another CPU executes a SET CLOCK instruction affecting the clock, or until any other clock in the configuration is incremented to a value of all zeros in bit positions 32-63. If any clock is set to a value of all zeros in bit positions 32-63 and enters the set state as the result of a signal from another clock, the updating of bits 32-63 of the two clocks is in synchronism.
Incrementing of the clock begins with the first stepping pulse after the clock enters the set state.
When the clock is in the set state, execution of STORE CLOCK causes condition code 0 to be set and the current value of the running clock to be stored.
Error State: The clock enters the error state when a malfunction is detected that is likely to have affected the validity of the clock value. A timing-facility-damage machine-check-interruption condition is generated on each CPU which has access to that clock whenever it enters the error state.
When STORE CLOCK is executed and the clock accessed is in the error state, condition code 2 is set, and the value stored is zero.
Not-Operational State: The clock is in the not-operational state when its power is off or when it is disabled for maintenance. It depends on the model if the clock can be placed in this state. Whenever the clock enters the not-operational state, a timing-facility-damage machine-check-interruption condition is generated on each CPU that has access to that clock.
When the clock is in the not-operational state, execution of STORE CLOCK causes condition code 3 to be set, and zero is stored.
The results of channel-subsystem-monitoring-facility operations may be unpredictable as a result of changes to the TOD clock.
When the TOD clock accessed by a CPU changes value because of the execution of SET CLOCK or changes state, interruption conditions pending for the clock comparator, CPU timer, and TOD-clock-sync check may or may not be recognized for up to 1.048576 seconds (2²0 microseconds) after the change.
The values stored for a running clock always correctly imply the sequence of execution of STORE CLOCK on one or more CPUs for all cases where the sequence can be established by means of the program. Zeros are stored in positions to the right of the bit position that is incremented. In a configuration with more than one CPU, however, when the value of a running clock is stored, nonzero values may be stored in positions to the right of the rightmost position that is incremented. This ensures that a unique value is stored.
The clock can be set to a specific value by execution of SET CLOCK if the manual TOD-clock control of any CPU in the configuration is in the enable-set position. Setting the clock replaces the values in all bit positions from bit position 0 through the rightmost position that is incremented when the clock is running. However, on some models, the rightmost bits starting at or to the right of bit 52 of the specified value are ignored, and zeros are placed in the corresponding positions of the clock. The TOD clock can be inspected by executing STORE CLOCK, which causes a 64-bit value to be stored. Two executions of STORE CLOCK, possibly on different CPUs in the same configuration, always store different values if the clock is running or, if separate clocks are accessed, both clocks are running and are synchronized.
In a configuration where more than one CPU accesses the same clock, SET CLOCK is interlocked such that the entire contents appear to be updated concurrently; that is, if SET CLOCK instructions are executed simultaneously by two CPUs, the final result is either one or the other value. If SET CLOCK is executed on one CPU and STORE CLOCK on the other, the result obtained by STORE CLOCK is either the entire old value or the entire new value. When SET CLOCK is executed by one CPU, a STORE CLOCK executed on another CPU may find the clock in the stopped state even when the TOD-clock-sync-control bit is zero in each CPU. The TOD-clock-sync-control bit is bit 2 of control register 0. Since the clock enters the set state before incrementing, the first STORE CLOCK executed after the clock enters the set state may still find the original value introduced by SET CLOCK.
Programming Notes:
______ __________________________ | TOD- | Stepping Interval | |Clock |____ _____ ____ __________| | Bit |Days|Hours|Min.| Seconds | |______|____|_____|____|__________| | 51 | 0.000 001| | 47 | 0.000 016| | 43 | 0.000 256| | | | | 39 | 0.004 096| | 35 | 0.065 536| | 31 | 1.048 576| | | | | 27 | 16.777 216| | 23 | 4 28.435 456| | 19 | 1 11 34.967 296| | | | | 15 | 19 5 19.476 736| | 11 | 12 17 25 11.627 776| | 7 | 203 14 43 6.044 416| | 3 |3257 19 29 36.710 656| |______|__________________________|
______ ___ ___ ____ _____________________ | | | |Leap| | | Year |Mth|Day|Sec | Clock Setting (Hex) | |______|___|___|____|_____________________| | 1900 | 1 | 1 | | 0000 0000 0000 0000 | | 1972 | 1 | 1 | | 8126 D60E 4600 0000 | | 1972 | 7 | 1 | 1 | 820B A981 1E24 0000 | | 1973 | 1 | 1 | 2 | 82F3 00AE E248 0000 | | 1974 | 1 | 1 | 3 | 84BD E971 146C 0000 | | 1975 | 1 | 1 | 4 | 8688 D233 4690 0000 | | 1976 | 1 | 1 | 5 | 8853 BAF5 78B4 0000 | | 1977 | 1 | 1 | 6 | 8A1F E595 20D8 0000 | | 1978 | 1 | 1 | 7 | 8BEA CE57 52FC 0000 | | 1979 | 1 | 1 | 8 | 8DB5 B719 8520 0000 | | 1980 | 1 | 1 | 9 | 8F80 9FDB B744 0000 | | 1981 | 7 | 1 | 10 | 9230 5C0F CD68 0000 | | 1982 | 7 | 1 | 11 | 93FB 44D1 FF8C 0000 | | 1983 | 7 | 1 | 12 | 95C6 2D94 31B0 0000 | | 1985 | 7 | 1 | 13 | 995D 40F5 17D4 0000 | | 1988 | 1 | 1 | 14 | 9DDA 69A5 57F8 0000 | | 1990 | 1 | 1 | 15 | A171 7D06 3E1C 0000 | | 1991 | 1 | 1 | 16 | A33C 65C8 7040 0000 | | 1992 | 7 | 1 | 17 | A5EC 21FC 8664 0000 | | 1993 | 7 | 1 | 18 | A7B7 0ABE B888 0000 | | 1994 | 7 | 1 | 19 | A981 F380 EAAC 0000 | | 1996 | 1 | 1 | 20 | AC34 336F ECD0 0000 | | | 1997 | 7 | 1 | 21 | AEE3 EFA4 02F4 0000 | |______|___|___|____|_____________________|
The following chart shows various time intervals in clock units expressed in hexadecimal notation.
_____________ __________________ | Interval |Clock Units (Hex) | |_____________|__________________| |1 microsecond| 1000| |1 millisecond| 3E 8000| |1 second | F424 0000| |1 minute | 39 3870 0000| |1 hour | D69 3A40 0000| |1 day | 1 41DD 7600 0000| |365 days |1CA E8C1 3E00 0000| |366 days |1CC 2A9E B400 0000| |1,461 days* |72C E4E2 6E00 0000| |_____________|__________________| |* Number of days in four years, | | including a leap year. Note | | that the year 1900 was not a | | leap year. Thus, the four- | | year span starting in 1900 | | has only 1,460 days. | |________________________________|
The TOD-clock-synchronization facility, in conjunction with a clock-synchronization program, makes it possible to provide the effect of all CPUs in a multiprocessing configuration sharing a single TOD clock. The result is such that, to all programs storing the TOD-clock value, it appears that all CPUs in the configuration read the same TOD clock. The TOD-clock-synchronization facility provides these functions in such a way that even though the number of CPUs sharing a TOD clock is model-dependent, a single model-independent clock-synchronization routine can be written. The following functions are provided:
In an installation with more than one CPU, each CPU may have a separate TOD clock, or more than one CPU may share a TOD clock, depending on the model. In all cases, each CPU has access to a single clock.
In a configuration with more than one CPU, each CPU has a separate clock comparator.
The clock comparator provides a means of causing an interruption when the TOD-clock value exceeds a value specified by the program.
The clock comparator has the same format as the TOD clock. In the basic form, the clock comparator consists of bits 0-47, which are compared with the corresponding bits of the TOD clock. In some models, higher resolution is obtained by providing more than 48 bits. The bits in positions provided in the clock comparator are compared with the corresponding bits of the clock. When the resolution of the clock is less than that of the clock comparator, the contents of the clock comparator are compared with the clock value as this value would be stored by executing STORE CLOCK.
The clock comparator causes an external interruption with the interruption code 1004 hex. A request for a clock-comparator interruption exists whenever either of the following conditions exists:
The clock comparator can be inspected by executing the instruction STORE CLOCK COMPARATOR and can be set to a specific value by executing the SET CLOCK COMPARATOR instruction.
The contents of the clock comparator are initialized to zero by initial CPU reset.
Programming Notes:
In a configuration with more than one CPU, each CPU has a separate CPU timer.
The CPU timer provides a means for measuring elapsed CPU time and for causing an interruption when a specified amount of time has elapsed.
The CPU timer is a binary counter with a format which is the same as that of the TOD clock, except that bit 0 is considered a sign. In the basic form, the CPU timer is decremented by subtracting a one in bit position 51 every microsecond. In models having a higher or lower resolution, a different bit position is decremented at such a frequency that the rate of decrementing the CPU timer is the same as if a one were subtracted in bit position 51 every microsecond. The resolution of the CPU timer is such that the stepping rate is comparable to the instruction-execution rate of the model.
The CPU timer requests an external interruption with the interruption code 1005 hex whenever the CPU-timer value is negative (bit 0 of the CPU timer is one). The request does not remain pending when the CPU-timer value is changed to a nonnegative value.
When both the CPU timer and the TOD clock are running, the stepping rates are synchronized such that both are stepped at the same rate. Normally, decrementing the CPU timer is not affected by concurrent I/O activity. However, in some models the CPU timer may stop during extreme I/O activity and other similar interference situations. In these cases, the time recorded by the CPU timer provides a more accurate measure of the CPU time used by the program than would have been recorded had the CPU timer continued to step.
The CPU timer is decremented when the CPU is in the operating state or the load state. When the manual rate control is set to instruction step, the CPU timer is decremented only during the time in which the CPU is actually performing a unit of operation. However, depending on the model, the CPU timer may or may not be decremented when the TOD clock is in the error, stopped, or not-operational state.
Depending on the model, the CPU timer may or may not be decremented when the CPU is in the check-stop state.
The CPU timer can be inspected by executing the instruction STORE CPU TIMER and can be set to a specific value by executing the SET CPU TIMER instruction.
The CPU timer is set to zero by initial CPU reset.
Programming Notes:
As an example, assume that a program being timed by the CPU timer is interrupted for a cause other than the CPU timer, external interruptions are disallowed by the new PSW, and the CPU-timer value is then saved by STORE CPU TIMER. This value could be negative if the CPU timer went from positive to negative since the interruption. Subsequently, when the program being timed is to continue, the CPU timer may be set to the saved value by SET CPU TIMER. A CPU-timer interruption occurs immediately after external interruptions are again enabled if the saved value was negative.
The persistence of the CPU-timer-interruption request means, however, that after an external interruption for the CPU timer has occurred, the value of the CPU timer has to be replaced, the value in the CPU timer has to wrap to a positive value, or the CPU-timer-subclass mask has to be set to zero before the CPU is again enabled for external interruptions. Otherwise, loops of external interruptions are formed.
Subtopics:
Five reset functions are provided:
Initial CPU reset provides the functions of CPU reset together with initialization of the current PSW, CPU timer, clock comparator, prefix, and control registers.
Subsystem reset provides a means for clearing floating interruption conditions as well as for invoking I/O-system reset.
Clear reset causes initial CPU reset and subsystem reset to be performed and, additionally, clears or initializes all storage locations and registers in all CPUs in the configuration, with the exception of the TOD clock. Such clearing is useful in debugging programs and in ensuring user
The power-on-reset sequences for the TOD clock, main storage, and the channel subsystem may be included as part of the CPU power-on sequence, or the power-on sequence for these units may be initiated separately.
CPU reset, initial CPU reset, subsystem reset, and clear reset may be initiated manually by using the operator facilities (see Chapter 12, "Operator Facilities"). Initial CPU reset is part of the initial-program-loading function. Figure 4-6 summarizes how these four resets are manually initiated. Power-on reset is performed as part of turning power on. The reset actions are tabulated in Figure 4-7. For information concerning what resets can be performed by the SIGNAL PROCESSOR instruction, see "Set Prefix" in topic 4.9.1.
___________________ _______________________________________________ | | Function Performed on¹ | | |__________________ ____________ _______________| | | CPU on Which Key | Other CPUs | Remainder of | | Key Activated | Was Activated | in Config | Configuration | |___________________|__________________|____________|_______________| |System-reset-normal|CPU reset |CPU reset |Subsystem reset| |key | | | | | | | | | |System-reset-clear |Clear reset² |Clear reset²|Clear reset³ | |key | | | | | | | | | |Load-normal key |Initial CPU reset,|CPU reset |Subsystem reset| | |followed by IPL | | | | | | | | |Load-clear key |Clear reset², |Clear reset²|Clear reset³ | | |followed by IPL | | | |___________________|__________________|____________|_______________| |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. | |___________________________________________________________________|Figure 4-6. Manual Initiation of Resets
_____________________________ _________________________________ | | Reset Function | | |______ _____ _______ ______ _____| | | Sub- | |Initial| |Power| | |system| CPU | CPU |Clear | -On | | Area Affected |Reset |Reset| Reset |Reset |Reset| |_____________________________|______|_____|_______|______|_____| |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 | |Control registers | U | U/V | I | I | I | |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 | |Vector-facility 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 | U4 | U4 | U4 | U4 | T² | |Floating interruption | C | U | U | C | C² | | conditions | | | | | | |I/O system | R | U | U | R | R5 | | |PERFORM LOCKED OPERATION | U | U | U | RC | RP | | | locks | | | | | | |_____________________________|______|_____|_______|______|_____| |Explanation: | | | | * Clearing the contents of the PSW to zero causes the PSW | | to be invalid. | | | | ¹ 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. | | | | ³ Access to change expanded storage at the time a reset | | function is performed may cause the contents of the 4K- | | byte block in expanded storage to be unpredictable. | | Access to examine expanded storage does not affect the | | contents of the expanded storage. | | | | 4 Access to the TOD clock by means of STORE CLOCK at the | | time a reset function is performed does not cause the | | value of the TOD clock to be affected. | | | | 5 When the channel subsystem is separately powered or con- | | sists of multiple elements which are separately powered, | | the reset action is applied only to those subchannels, | | channel paths, and I/O control units and devices on those| | paths associated with the element which is being powered | | on. | |_______________________________________________________________| _______________________________________________________________ |Explanation (Continued): | | | | C The condition or contents are cleared. If the area | | affected is a field, the contents are set to zero with | | valid checking-block code. | | | | I The state or contents are initialized. If the area af- | | fected is a field, the contents are set to the initial | | value with valid checking-block code. | | | | R I/O-system reset is performed in the channel subsystem. | | As part of this reset, system reset is signaled to all | | I/O control units and devices attached to the channel | | subsystem. | | | | | RC All locks in the configuration are released. | | | | | | RP All locks in the configuration are released except for | | | ones held by CPUs already powered on. | | | | S The CPU is reset; current operations, if any, are term- | | inated; the ALB and TLB are cleared of entries; inter- | | ruption conditions in the CPU are cleared; and the CPU | | is placed in the stopped state. The effect of perform- | | ing the start function is unpredictable when the stopped | | state has been entered by means of a reset. | | | | T The TOD clock is initialized to zero and validated; it | | enters the not-set state. | | | | U The state, condition, or contents of the field remain | | unchanged. However, the result is unpredictable if an | | operation is in progress that changes the state, con- | | dition, or contents of the field at the time of reset. | | | | U/V The contents remain unchanged, provided the field is not | | being changed at the time the reset function is per- | | formed. However, on some models the checking-block code | | of the contents may be made valid. The result is un- | | predictable if an operation is in progress that changes | | the contents of the field at the time of reset. | |_______________________________________________________________|Figure 4-7. Summary of Reset Actions
Subtopics:
CPU reset causes the following actions:
When the reset function in the CPU is initiated at the time the CPU is executing an I/O instruction or is performing an I/O interruption, the current operation between the CPU and the channel subsystem may or may not be completed, and the resultant state of the associated channel-subsystem facility may be unpredictable.
Programming Note: Most operations which would change a state, a condition, or the contents of a field cannot occur when the CPU is in the stopped state. However, some signal-processor functions and some operator functions may change these fields. To eliminate the possibility of losing a field when CPU reset is issued, the CPU should be stopped, and no operator functions should be in progress.
Initial CPU reset combines the CPU reset functions with the following clearing and initializing functions:
Setting the current PSW to zero causes the PSW to be invalid, since PSW bit 12 must be one. Thus, if the CPU is placed in the operating state after a reset without first introducing a new PSW, a specification exception is recognized.
Subsystem reset operates only on those elements in the configuration which are not CPUs. It performs the following actions:
Clear reset combines the initial-CPU-reset function with an initializing function which causes the following actions:
Programming Notes:
The power-on sequences for the TOD clock, vector facility, main storage, expanded storage, and channel subsystem may be included as part of the CPU power-on sequence, or the power-on sequence for these units may be initiated separately. The following sections describe the power-on resets for the CPU, TOD clock, vector facility, main storage, expanded storage, and channel subsystem. See also Chapter 17, "I/O Support Functions," and the appropriate System Library publication for the channel subsystem, control units, and I/O devices.
The power-on-reset function for a component of the machine is performed as part of the power-on sequence for that component.
CPU Power-On Reset: The power-on reset causes initial CPU reset to be performed and may or may not cause I/O-system reset to be performed in the channel subsystem. The contents of general registers, access registers, and floating-point registers are cleared to zeros with valid
TOD-Clock Power-On Reset: The power-on reset causes the value of the TOD clock to be set to zero with valid checking-block code and causes the clock to enter the not-set state.
Vector-Facility Power-On Reset: The power-on reset causes the registers of the vector facility (vector-status register, vector-mask register, vector-activity count, and all vector registers) to be cleared to zeros with valid checking-block code.
Main-Storage Power-On Reset: For volatile main storage (one that does not preserve its contents when power is off) and for storage keys, power-on reset causes zeros with valid checking-block code to be placed in these fields. The contents of nonvolatile main storage, including the checking-block code, remain unchanged.
Expanded-Storage Power-On Reset: The contents of the expanded storage are cleared to zeros with valid checking-block code.
Channel-Subsystem Power-On Reset: The channel-subsystem power-on reset causes I/O-system reset to be performed in the channel subsystem. (See "I/O-System Reset" in topic 17.2.2.2.)
Some models may provide additional controls and indications relating to IPL; this additional information is specified in the System Library publication for the model.
Initial program loading (IPL) provides a manual means for causing a program to be read from a designated device and for initiating execution of that program.
IPL is initiated manually by setting the load-unit-address controls to a four-digit number to designate an input device and by subsequently activating the load-clear or load-normal key for a particular CPU. In the description which follows, the term "this CPU" refers to the CPU in the configuration for which the load-clear or load-normal key was activated.
Activating the load-clear key causes a clear reset to be performed on the configuration.
Activating the load-normal key causes an initial CPU reset to be performed on this CPU, CPU reset to be propagated to all other CPUs in the configuration, and a subsystem reset to be performed on the remainder of the configuration.
In the loading part of the operation, after the resets have been performed, this CPU then enters the load state. This CPU does not necessarily enter the stopped state during the execution of the reset operations. The load indicator is on while the CPU is in the load state.
Subsequently, a channel-program read operation is initiated from the I/O device designated by the load-unit-address controls. The effect of executing the channel program is as if a format-0 CCW in absolute storage location 0 specified a read command with the modifier bits zeros, a data address of zero, a byte count of 24, the chain-command and SLI flags ones, and all other flags zeros.
The details of the channel-subsystem portion of the IPL operation are defined in "Initial Program Loading" in topic 17.3.1.
When the IPL I/O operation is completed successfully, the subsystem-identification word of the IPL device is stored in absolute storage locations 184-187, zeros are stored in absolute storage locations 188-191, and a new PSW is loaded from absolute storage locations 0-7. If the PSW loading is successful and if no machine malfunctions are detected, this CPU leaves the load state, and the load indicator is turned off. If the rate control is set to the process position, the CPU enters the operating state, and the CPU operation proceeds under control of the new PSW. If the rate control is set to the instruction-step position, the CPU enters the stopped state, with the manual indicator on, after the new PSW is loaded.
If the IPL I/O operation or the PSW loading is not completed successfully, the CPU remains in the load state, and the load indicator remains on. The contents of absolute storage locations 0-7 are unpredictable.
Figure 4-8 lists the fields that are stored, their length, and their location in main storage.
The store-status operation places the contents of the CPU registers, except for the TOD clock, in assigned storage locations.
__________________________ ________ __________ | | Length | Absolute | | Field |in Bytes| Address | |__________________________|________|__________| | CPU timer | 8 | 216 | | Clock comparator | 8 | 224 | | Current PSW | 8 | 256 | | Prefix | 4 | 264 | | Access registers 0-15 | 64 | 288 | | Fl-pt registers 0-6 | 32 | 352 | | General registers 0-15 | 64 | 384 | | Control registers 0-15 | 64 | 448 | |__________________________|________|__________|Figure 4-8. Assigned Storage Locations for Store Status
The contents of the registers are not changed. If an error is encountered during the operation, the CPU enters the check-stop state.
The store-status operation can be initiated manually by use of the store-status key (see Chapter 12, "Operator Facilities"). The store-status operation can also be initiated at the addressed CPU by executing SIGNAL PROCESSOR, specifying the stop-and-store-status order. Execution of SIGNAL PROCESSOR specifying the store-status-at-address order permits the same status information to be stored at a designated address (see "Signal-Processor Orders" in topic 4.9.1).
The multiprocessing facility provides for the interconnection of CPUs, via a common main storage, in order to enhance system availability and to share data and resources. The multiprocessing facility includes the following facilities:
The channel subsystem, including all subchannels, in a multiprocessing configuration can be accessed by all CPUs in the configuration. I/O-interruption conditions are floating and can be accepted by any CPU in the configuration.
Subtopics:
The shared-main-storage facility permits more than one CPU to have access to common main-storage locations. All CPUs having access to a common main-storage location have access to the entire 4K-byte block containing that location and to the associated storage key. The channel subsystem and all CPUs in the configuration refer to a shared main-storage location using the same absolute address.
Each CPU has a number assigned, called its CPU address. A CPU address uniquely identifies one CPU within a configuration. The CPU is designated by specifying this address in the CPU-address field of SIGNAL PROCESSOR. The CPU signaling a malfunction alert, emergency signal, or external call is identified by storing this address in the CPU-address field with the interruption. The CPU address is assigned during system installation and is not changed as a result of reconfiguration changes. The program can determine the address of the CPU by using STORE CPU ADDRESS.
The CPU-signaling-and-response facility consists of SIGNAL PROCESSOR and a mechanism to interpret and act on several order codes. The facility provides for communications among CPUs, including transmitting, receiving, and decoding a set of assigned order codes; initiating the specified operation; and responding to the signaling CPU. A CPU can address SIGNAL PROCESSOR to itself. SIGNAL PROCESSOR is described in Chapter 10, "Control Instructions."
Subtopics:
The signal-processor orders are specified in bit positions 24-31 of the second-operand address of SIGNAL PROCESSOR and are encoded as shown in Figure 4-9.
_______ __________________________ | Code | Order | |_______|__________________________| | 00 | Unassigned | | 01 | Sense | | 02 | External call | | 03 | Emergency signal | | 04 | Start | | 05 | Stop | | 06 | Restart | | 07 | Unassigned | | 08 | Unassigned | | 09 | Stop and store status | | 0A | Unassigned | | 0B | Initial CPU reset | | 0C | CPU reset | | 0D | Set prefix | | 0E | Store status at address | | 0F-FF | Unassigned | |_______|__________________________|Figure 4-9. Encoding of Orders
The orders are defined as follows:Sense: The addressed CPU presents its status to the issuing CPU (see "Status Bits" in topic 4.9.2.2 for a definition of the bits). No other action is caused at the addressed CPU. The status, if not all zeros, is stored in the general register designated by the R1 field of the SIGNAL PROCESSOR instruction, and condition code 1 is set; if all status bits are zeros, condition code 0 is set.
External Call: An external-call external-interruption condition is generated at the addressed CPU. The interruption condition becomes pending during the execution of SIGNAL PROCESSOR. The associated interruption occurs when the CPU is enabled for that condition and does not necessarily occur during the execution of SIGNAL PROCESSOR. The address of the CPU sending the signal is provided with the interruption code when the interruption occurs. Only one external-call condition can be kept pending in a CPU at a time. The order is effective only when the addressed CPU is in the stopped or the operating state.
Emergency Signal: An emergency-signal external-interruption condition is generated at the addressed CPU. The interruption condition becomes pending during the execution of SIGNAL PROCESSOR. The associated interruption occurs when the CPU is enabled for that condition and does not necessarily occur during the execution of SIGNAL PROCESSOR. The address of the CPU sending the signal is provided with the interruption code when the interruption occurs. At any one time the receiving CPU can keep pending one emergency-signal condition for each CPU in the configuration, including the receiving CPU itself. The order is effective only when the addressed CPU is in the stopped or the operating state.
Start: The addressed CPU performs the start function (see "Stopped, Operating, Load, and Check-Stop States" in topic 4.1). The CPU does not necessarily enter the operating state during the execution of SIGNAL PROCESSOR. The order is effective only when the addressed CPU is in the stopped state. The effect of performing the start function is unpredictable when the stopped state has been entered by reset.
Stop: The addressed CPU performs the stop function (see "Stopped, Operating, Load, and Check-Stop States" in topic 4.1). The CPU does not necessarily enter the stopped state during the execution of SIGNAL PROCESSOR. The order is effective only when the CPU is in the operating state.
Restart: The addressed CPU performs the restart operation (see "Restart Interruption" in topic 6.6). The CPU does not necessarily perform the operation during the execution of SIGNAL PROCESSOR. The order is effective only when the addressed CPU is in the stopped or the operating state.
Stop and Store Status: The addressed CPU performs the stop function, followed by the store-status function (see "Store Status" in topic 4.7.3). The CPU does not necessarily complete the operation, or even enter the stopped state, during the execution of SIGNAL PROCESSOR. The order is effective only when the addressed CPU is in the stopped or the operating state.
Initial CPU Reset: The addressed CPU performs initial CPU reset (see "Resets" in topic 4.7.1). The execution of the reset does not affect other CPUs and does not cause I/O to be reset. The reset operation is not necessarily completed during the execution of SIGNAL PROCESSOR.
CPU Reset: The addressed CPU performs CPU reset (see "Resets" in topic 4.7.1). The execution of the reset does not affect other CPUs and does not cause I/O to be reset. The reset operation is not necessarily completed during the execution of SIGNAL PROCESSOR.
Set Prefix: The contents of bit positions 1-19 of the parameter register of the SIGNAL PROCESSOR instruction are treated as a prefix value, which replaces the contents of the prefix register of the addressed CPU. Bit 0 and bits 20-31 of the parameter register are ignored. The order is accepted only if the addressed CPU is in the stopped state, the value to be placed in the prefix register designates a location which is available in the configuration, and no other condition precludes accepting the order. Verification of the stopped state of the addressed CPU and of the availability of the designated storage is performed during execution of SIGNAL PROCESSOR. If accepted, the order is not necessarily completed during the execution of SIGNAL PROCESSOR.
The parameter register has the following format: _ __________________ _____________ |/| Prefix Value |/////////////| |_|__________________|_____________| 0 1 20 31
The set-prefix order is completed as follows:
The order is accepted only if the addressed CPU is in the stopped state, the status-area origin designates a location which is available in the configuration, and no other condition precludes accepting the order. Verification of the stopped state of the addressed CPU and of the availability of the designated storage is performed during execution of SIGNAL PROCESSOR. If accepted, the order is not necessarily completed during the execution of SIGNAL PROCESSOR.
The parameter register has the following format: _ ______________________ _________ |/| Status-Area Origin |/////////| |_|______________________|_________| 0 1 23 31
The store-status-at-address order is completed as follows:
Subtopics:
The following situations preclude the initiation of the order. The sequence in which the situations are listed is the order of priority for indicating concurrently existing situations:
When the conditions described in items 1 and 2 above do not apply and operator-intervening and receiver-check status conditions do not exist at the addressed CPU, reset orders may be accepted regardless of whether the addressed CPU has completed a previously accepted order. This may cause the previous order to be lost when it is only partially completed, making unpredictable whether the results defined for the lost order are obtained.
Various status conditions are defined whereby the issuing and addressed CPUs can indicate their responses to the specified order. The status conditions and their bit positions in the general register designated by the R1 field of the SIGNAL PROCESSOR instruction are shown in Figure 4-10.
__________ __________________________ | Bit | | | Position | Status Condition | |__________|__________________________| | 0 | Equipment check | | 1-21 | Unassigned; zeros stored | | 22 | Incorrect state | | 23 | Invalid parameter | | 24 | External-call pending | | 25 | Stopped | | 26 | Operator intervening | | 27 | Check stop | | 28 | Unassigned; zero stored | | 29 | Inoperative | | 30 | Invalid order | | 31 | Receiver check | |__________|__________________________|Figure 4-10. Status Conditions
The status condition assigned to bit position 0 is generated by the CPU executing SIGNAL PROCESSOR. The remaining status conditions are generated by the addressed CPU.When the equipment-check condition exists, bit 0 of the general register designated by the R1 field of the SIGNAL PROCESSOR instruction is set to one, unassigned bits of the status register are set to zeros, and the contents of other status bits are unpredictable. In this case, condition code 1 is set independent of whether the access path to the addressed CPU is busy and independent of whether the addressed CPU is not operational, is busy, or has presented zero status.
When the access path to the addressed CPU is not busy and the addressed CPU is operational and does not indicate busy to the currently specified order, the addressed CPU presents its status to the issuing CPU. These status bits are of two types:
The status conditions are defined as follows:
Equipment Check: This condition exists when the CPU executing the
instruction detects equipment malfunctioning that has affected only the
execution of this instruction and the associated order. The order code
may or may not have been transmitted and may or may not have been
accepted, and the status bits provided by the addressed CPU may be in
error.
Incorrect State: A set-prefix or store-status-at-address order has been
rejected because the addressed CPU is not stopped. When applicable, this
status is generated during execution of SIGNAL PROCESSOR and is indicated
concurrently with other indications of conditions which preclude execution
of the order.
Invalid Parameter: The parameter value supplied with a set-prefix or
store-status-at-address order designates a storage location which is not
available in the configuration. When applicable, this status is generated
during execution of SIGNAL PROCESSOR, except that it is not necessarily
generated when another condition precluding execution of the order also
exists.
External Call Pending: This condition exists when an external-call
interruption condition is pending in the addressed CPU because of a
previously issued SIGNAL PROCESSOR order. The condition exists from the
time an external-call order is accepted until the resultant external
interruption has been completed or a CPU reset occurs. The condition may
be due to the issuing CPU or another CPU. The condition, when present, is
indicated only in response to sense and to external call.
Stopped: This condition exists when the addressed CPU is in the stopped
state. The condition, when present, is indicated only in response to
sense. This condition cannot be reported as a result of a SIGNAL
PROCESSOR by a CPU addressing itself.
Operator Intervening: This condition exists when the addressed CPU is
executing certain operations initiated from local or remote operator
facilities. The particular manually initiated operations that cause this
condition to be present depend on the model and on the order specified.
The operator-intervening condition may exist when the addressed CPU uses
reloadable control storage to perform an order and the required licensed
internal code has not been loaded by the IML function. The
operator-intervening condition, when present, can be indicated in response
to all orders. Operator intervening is indicated in response to sense if
the condition is present and precludes the acceptance of any of the
installed orders. The condition may also be indicated in response to
unassigned or uninstalled orders. This condition cannot arise as a result
of a SIGNAL PROCESSOR by a CPU addressing itself.
Check Stop: This condition exists when the addressed CPU is in the
check-stop state. The condition, when present, is indicated only in
response to sense, external call, emergency signal, start, stop, restart,
set prefix, store status at address, and stop and store status. The
condition may also be indicated in response to unassigned or uninstalled
orders. This condition cannot be reported as a result of a SIGNAL
PROCESSOR by a CPU addressing itself.
Inoperative: This condition indicates that the execution of the operation
specified by the order code requires the use of a service processor which
is inoperative. The failure of the service processor may have been
previously reported by a service-processor-damage machine-check condition.
The inoperative condition cannot occur for the sense, external-call, or
emergency-signal order code.
Invalid Order: This condition exists during the communications associated
with the execution of SIGNAL PROCESSOR when an unassigned or uninstalled
order code is decoded.
Receiver Check: This condition exists when the addressed CPU detects
malfunctioning of equipment during the communications associated with the
execution of SIGNAL PROCESSOR. When this condition is indicated, the
order has not been initiated, and, since the malfunction may have affected
the generation of the remaining receiver status bits, these bits are not
necessarily valid. A machine-check condition may or may not have been
generated at the addressed CPU.
The following chart summarizes which status conditions are presented to the issuing CPU in response to each order code.
Status ConditionExplanation:31 Receiver check&ne. ____________________ 30 Invalid order ____________________ | 29 Inoperative ____________________ | | 27 Check stop ___________________ | | | 26 Operator intervening# ______ | | | | 25 Stopped __________________ | | | | | 24 External call pending __ | | | | | | 23 Invalid parameter ____ | | | | | | | 22 Incorrect state ____ | | | | | | | | | | | | | | | | | | | | | | | | | | Order | | | | | | | | | Sense 0 0 X X X X 0 0 X External call 0 0 X 0 X X 0 0 X Emergency signal 0 0 0 0 X X 0 0 X Start 0 0 0 0 X X X 0 X Stop 0 0 0 0 X X X 0 X Restart 0 0 0 0 X X X 0 X Stop and store status 0 0 0 0 X X X 0 X Initial CPU reset 0 0 0 0 X 0 X 0 X CPU reset 0 0 0 0 X 0 X 0 X Set prefix X X 0 0 X X X 0 X Store status at addr. X X 0 0 X X X 0 X Unassigned order 0 0 0 0 X E X 1 X
If the presented status bits are all zeros, the order has been accepted, and the issuing CPU sets condition code 0. If one or more ones are presented, the order has been rejected, and the issuing CPU stores the status in the general register designated by the R1 field of the SIGNAL PROCESSOR instruction and sets condition code 1.
Programming Notes:
Normally, operation of the CPU is controlled by instructions in storage that are executed sequentially, one at a time, left to right in an ascending sequence of storage addresses. A change in the sequential operation may be caused by branching, LOAD PSW, interruptions, SIGNAL PROCESSOR orders, or manual intervention.
Subtopics:
Each instruction consists of two major parts:
Subtopics:
Register operands can be located in general, floating-point, access, or control registers, with the type of register identified by the op code. The register containing the operand is specified by identifying the register in a four-bit field, called the R field, in the instruction. For some instructions, an operand is located in an implicitly designated register, the register being implied by the op code.
Operands can be grouped in three classes: operands located in registers, immediate operands, and operands in storage. Operands may be either explicitly or implicitly designated.
Immediate operands are contained within the instruction, and the eight-bit or 16-bit field containing the immediate operand is called the I field.
Operands in storage may have an implied length; be specified by a bit mask; be specified by a four-bit or eight-bit length specification, called the L field, in the instruction; or have a length specified by the contents of a general register. The addresses of operands in storage are specified by means of a format that uses the contents of a general register as part of the address. This makes it possible to:
When the CPU is in the access-register mode, a B or R field may designate an access register in addition to being used to specify an address.
To describe the execution of instructions, operands are designated as first and second operands and, in some cases, third operands.
In general, two operands participate in an instruction execution, and the result replaces the first operand. However, CONVERT TO DECIMAL, TEST BLOCK, and instructions with "store" in the instruction name (other than STORE THEN AND SYSTEM MASK and STORE THEN OR SYSTEM MASK) use the second-operand address to designate a location in which to store. TEST AND SET, COMPARE AND SWAP, and COMPARE DOUBLE AND SWAP may perform an update on the second operand. Except when otherwise stated, the contents of all registers and storage locations participating in the addressing or execution part of an operation remain unchanged.
An instruction is one, two, or three halfwords in length and must be located in storage on a halfword boundary. Each instruction is in one of eleven basic formats: E, RR, RRE, RX, RS, RSI, RI, SI, S, SSE, and SS, with three variations of SS. (See Figure 5-1.)
E Format__________________ | Op Code | |__________________| 0 15 RR Format
________ ____ ____ | Op Code| R1 | R2 | |________|____|____| 0 8 12 15 RRE Format
_________________ ________ ____ ____ | Op Code |////////| R1 | R2 | |_________________|________|____|____| 0 16 24 28 31 RX Format
________ ____ ____ ____ ____________ | Op Code| R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31 RS Format
________ ____ ____ ____ ____________ | Op Code| R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31 RSI Format
________ ____ ____ _________________ | Op Code| R1 | R3 | I2 | |________|____|____|_________________| 0 8 12 16 31 RI Format
________ ____ ____ _________________ | Op Code| R1 |OpCd| I2 | |________|____|____|_________________| 0 8 12 16 31 SI Format
________ _________ ____ ____________ | Op Code| I2 | B1 | D1 | |________|_________|____|____________| 0 8 16 20 31 S Format
__________________ ____ ____________ | Op Code | B2 | D2 | |__________________|____|____________| 0 16 20 31 SS Format
________ _________ ____ _/__ ____ _/__ | Op Code| L | B1 | D1 | B2 | D2 | |________|_________|____|_/__|____|_/__| 0 8 16 20 32 36 47
________ ____ ____ ____ _/__ ____ _/__ | Op Code| L1 | L2 | B1 | D1 | B2 | D2 | |________|____|____|____|_/__|____|_/__| 0 8 12 16 20 32 36 47
________ ____ ____ ____ _/__ ____ _/__ | Op Code| R1 | R3 | B1 | D1 | B2 | D2 | |________|____|____|____|_/__|____|_/__| 0 8 12 16 20 32 36 47 SSE Format
__________________ ____ _/__ ____ _/__ | Op Code | B1 | D1 | B2 | D2 | |__________________|____|_/__|____|_/__| 0 16 20 32 36 47
Figure 5-1. Basic Instruction Formats
Some instructions contain fields that vary slightly from the basic format, and in some instructions the operation performed does not follow the general rules stated in this section. All of these exceptions are explicitly identified in the individual instruction descriptions.Those instruction formats which are unique to instructions associated with the vector facility are described in the publication IBM Enterprise Systems Architecture/390 Vector Operations, SA22-7207.
The format names indicate, in general terms, the classes of operands which participate in the operation:
The first two bits of the first or only byte of the op code specify the length and format of the instruction, as follows:
_________ _____________ _____________________ | Bit | Instruction | | |Positions| Length (in | Instruction | | 0-1 | Halfwords) | Format | |_________|_____________|_____________________| | 00 | One | E/RR | | 01 | Two | RX | | 10 | Two |RI/RRE/RS/RSI/RX/S/SI| | 11 | Three | SS/SSE | |_________|_____________|_____________________|The remaining fields in the format illustration for each instruction are designated by code names, consisting of a letter and possibly a subscript number. The subscript number denotes the operand to which the field applies.In the format illustration for each individual instruction description, the op-code field or fields show the op code as hexadecimal digits within single quotes. The hexadecimal representation uses 0-9 for the binary codes 0000-1001 and A-F for the binary codes 1010-1111.
Subtopics:
The R field designates a general or access register in the general instructions, a general register in the control instructions, and a floating-point register in the floating-point instructions. However, in the instructions EXTRACT STACKED REGISTERS and LOAD ADDRESS EXTENDED, the R field designates both a general register and an access register. In the instructions LOAD CONTROL and STORE CONTROL, the R field designates a control register. (This paragraph refers only to register operands, not to the use of access registers in addressing storage operands.)
In the RR, RRE, RX, RS, RSI, and RI formats, the contents of the register designated by the R1 field are called the first operand. The register containing the first operand is sometimes referred to as the "first-operand location," and sometimes as "register R1." In the RR and RRE formats, the R2 field designates the register containing the second operand, and the R2 field may designate the same register as R1. In the RS and RSI formats, the use of the R3 field depends on the instruction.
Unless otherwise indicated in the individual instruction description, the register operand is one register in length (32 bits for a general, access, or control register and 64 bits for a floating-point register), and the second operand is the same length as the first.
In the RI format for the instructions ADD HALFWORD IMMEDIATE, COMPARE HALFWORD IMMEDIATE, LOAD HALFWORD IMMEDIATE, and MULTIPLY HALFWORD IMMEDIATE, the contents of the 16-bit I2 field of the instruction are used directly as a signed binary integer; and for the instructions TEST UNDER MASK HIGH and TEST UNDER MASK LOW, the contents are used as a mask. The R1 field specifies the first operand, which is one word in length.
In the SI format, the contents of the eight-bit immediate-data field, the I2 field of the instruction, are used directly as the second operand. The B1 and D1 fields specify the first operand, which is one byte in length.
For the relative-branch instructions, which are in the RI and RSI formats, the contents of the 16-bit I2 field are used as a signed binary integer designating a number of halfwords. This number, when added to the address of the branch instruction, specifies the branch address.
In the SI, SS, and SSE formats, the contents of the general register designated by the B1 field are added to the contents of the D1 field to form the first-operand address. In the S, RS, SS, and SSE formats, the contents of the general register designated by the B2 field are added to the contents of the D2 field to form the second-operand address. In the RX format, the contents of the general registers designated by the X2 and B2 fields are added to the contents of the D2 field to form the second-operand address.
The use of B and R fields to designate access registers to refer to storage operands is described in "Access-Register-Specified Address Spaces" in topic 5.7.2.1.
In the SS format with a single, eight-bit length field, L specifies the number of additional operand bytes to the right of the byte designated by the first-operand address. Therefore, the length in bytes of the first operand is 1-256, corresponding to a length code in L of 0-255. Storage results replace the first operand and are never stored outside the field specified by the address and length. In this format, the second operand has the same length as the first operand, except for the following instructions: EDIT, EDIT AND MARK, TRANSLATE, and TRANSLATE AND TEST.
In the SS format, with two length fields given, L1 specifies the number of additional operand bytes to the right of the byte designated by the first-operand address. Therefore, the length in bytes of the first operand is 1-16, corresponding to a length code in L1 of 0-15. Similarly, L2 specifies the number of additional operand bytes to the right of the location designated by the second-operand address. Results replace the first operand and are never stored outside the field specified by the address and length. If the first operand is longer than the second, the second operand is extended on the left with zeros up to the length of the first operand. This extension does not modify the second operand in storage.
In the SS format with two R fields, the contents of the general register specified by the R1 field are a 32-bit unsigned value called the true length. The operands are of the same length, called the effective length. The effective length is equal to the true length or 256, whichever is less. The instructions using this format, which are MOVE TO PRIMARY, MOVE TO SECONDARY, and MOVE WITH KEY, set the condition code to facilitate programming a loop to move the total number of bytes specified by the true length.
Subtopics:
Execution of instructions by the CPU involves generation of the addresses of instructions and operands. This section describes address generation as it applies to most instructions. In some instructions, the operation performed does not follow the general rules stated in this section. All of these exceptions are explicitly identified in the individual instruction descriptions.
Bit 32 of the current PSW is the addressing-mode bit. This bit controls the size of the effective address produced by address generation. When bit 32 of the current PSW is zero, the CPU is in the 24-bit addressing mode, and 24-bit instruction and operand effective addresses are generated. When bit 32 of the current PSW is one, the CPU is in the 31-bit addressing mode, and 31-bit instruction and operand effective addresses are generated.
In the 24-bit addressing mode, instruction addresses wrap around, with the halfword at instruction address 2²4 - 2 being followed by the halfword at instruction address 0. Thus, in the 24-bit addressing mode, any carry out of PSW bit position 40, as a result of updating the instruction address, is lost.
When an instruction is fetched from the location designated by the current PSW, the instruction address is increased by the number of bytes in the instruction, and the instruction is executed. The same steps are then repeated by using the new value of the instruction address to fetch the next instruction in the sequence.
In the 31-bit addressing mode, instruction addresses wrap around, with the halfword at instruction address 2³¹ - 2 being followed by the halfword at instruction address 0. Thus, in the 31-bit addressing mode, any carry out of PSW bit position 33, as a result of updating the instruction address, is lost.
Subtopics:
The base address (B) is a 32-bit number contained in a general register specified by the program in a four-bit field, called the B field, in the instruction. Base addresses can be used as a means of independently addressing each program and data area. In array-type calculations, it can designate the location of an array, and, in record-type processing, it can identify the record. The base address provides for addressing the entire storage. The base address may also be used for indexing.
An operand address that refers to storage is derived from an intermediate value, which either is contained in a register designated by an R field in the instruction or is calculated from the sum of three binary numbers: base address, index, and displacement.
The index (X) is a 32-bit number contained in a general register designated by the program in a four-bit field, called the X field, in the instruction. It is included only in the address specified by the RX-format instructions. The RX-format instructions permit double indexing; that is, the index can be used to provide the address of an element within an array.
The displacement (D) is a 12-bit number contained in a field, called the D field, in the instruction. The displacement provides for relative addressing of up to 4,095 bytes beyond the location designated by the base address. In array-type calculations, the displacement can be used to specify one of many items associated with an element. In the processing of records, the displacement can be used to identify items within a record.
In forming the intermediate sum, the base address and index are treated as 32-bit binary integers. The displacement is similarly treated as a 12-bit unsigned binary integer, and 20 zero bits are appended on the left. The three are added as 32-bit binary numbers, ignoring overflow. The sum is always 32 bits long and is used as an intermediate value to form the generated address. The bits of the intermediate value are numbered 0-31.
A zero in any of the B1, B2, or X2 fields indicates the absence of the corresponding address component. For the absent component, a zero is used in forming the intermediate sum, regardless of the contents of general register 0. A displacement of zero has no special significance.
When an instruction description specifies that the contents of a general register designated by an R field are used to address an operand in storage, the register contents are used as the 32-bit intermediate value.
An instruction can designate the same general register both for address computation and as the location of an operand. Address computation is completed before registers, if any, are changed by the operation.
Unless otherwise indicated in an individual instruction definition, the generated operand address designates the leftmost byte of an operand in storage.
Programming Note: Negative values may be used in index and base-address registers. Bit 0 of these values is always ignored, and, in the 24-bit addressing mode, bits 1-7 of these values are also ignored.
The generated operand address is always 31 bits long, and the bits are numbered 1-31. In some portions of this document, the generated address may be referred to as being 32 bits long, with the bits numbered 0-31. Bit 0 of the generated address is always forced to be zero. The manner in which the generated address is obtained from the intermediate value depends on the current addressing mode. In the 24-bit addressing mode, bits 0-7 of the intermediate value are ignored, bits 0-7 of the generated address are forced to be zeros, and bits 8-31 of the intermediate value become bits 8-31 of the generated address. In the 31-bit addressing mode, bit 0 of the intermediate value is ignored, bit 0 of the generated address is forced to be zero, and bits 1-31 of the intermediate value become bits 1-31 of the generated address.
Subtopics:
In the RS and RX formats, the branch address is specified by a base address, a displacement, and, for RX, an index. In the RS and RX formats, the generation of the intermediate value follows the same rules as for the generation of the operand-address intermediate value.
For branch instructions, the address of the next instruction to be executed when the branch is taken is called the branch address. Depending on the branch instruction, the instruction format may be RI, RR, RS, RSI, or RX.
In the RR format, the contents of the general register designated by the R2 field are used as the intermediate value from which the branch address is formed. General register 0 cannot be designated as containing a branch address. A value of zero in the R2 field causes the instruction to be executed without branching. The relative-branch instructions are in the RI and RSI formats. In the RI and RSI formats for the relative-branch instructions, the contents of the I2 field are treated as a 16-bit signed binary integer designating a number of halfwords. The branch address is the number of halfwords designated by the I2 field added to the address of the relative-branch instruction.
The 32-bit intermediate value for a branch instruction in the RI or RSI format is the sum of two addends, with overflow ignored. The first addend is the contents of the I2 field with one zero bit appended on the right and 15 bits equal to the sign bit of the contents appended on the left. The second addend is the 31-bit address of the branch instruction with one zero bit appended on the left. The address of the branch instruction is the instruction address in the PSW before that 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 EXECUTE is used in the 24-bit addressing mode, the address of the branch instruction is the target address with seven zeros appended on the left.
For several branch instructions, branching depends on satisfying a specified condition. When the condition is not satisfied, the branch is not taken, normal sequential instruction execution continues, and the branch address is not used. When a branch is taken, bits 1-31 of the branch address replace bits 33-63 of the current PSW. The branch address is not used to access storage as part of the branch operation.
The branch address is always 31 bits long, with the bits numbered 1-31. The branch address replaces bits 33-63 of the current PSW. The manner in which the branch address is obtained from the intermediate value depends on the addressing mode. For those branch instructions which change the addressing mode, the new addressing mode is used. In the 24-bit addressing mode, bits 0-7 of the intermediate value are ignored, bits 1-7 of the branch address are made zeros, and bits 8-31 of the intermediate value become bits 8-31 of the branch address. In the 31-bit addressing mode, bit 0 of the intermediate value is ignored, and bits 1-31 of the intermediate value become bits 1-31 of the branch address.
A specification exception due to an odd branch address and access exceptions due to fetching of the instruction at the branch location are not recognized as part of the branch operation but instead are recognized as exceptions associated with the execution of the instruction at the branch location.
A branch instruction, such as BRANCH AND LINK, can designate the same general register for branch-address computation and as the location of an operand. Branch-address computation is completed before the remainder of the operation is performed.
Branch instructions perform the functions of decision making, loop control, and subroutine linkage. A branch instruction affects instruction sequencing by introducing a new instruction address into the current PSW. The relative-branch instructions allow branching to a location at an offset of up to plus 64K - 2 bytes or minus 64K bytes relative to the location of the branch instruction, without the use of a base register.
The program-status word (PSW), described in Chapter 4, "Control" contains information required for proper program execution. The PSW is used to control instruction sequencing and to hold and indicate the status of the CPU in relation to the program currently being executed. The active or controlling PSW is called the current PSW.
Subtopics:
The specific meaning of any setting depends on the operation that sets the condition code. For example, the condition code reflects such conditions as zero, nonzero, first operand high, equal, overflow, and subchannel busy. Once set, the condition code remains unchanged until modified by an instruction that causes a different condition code to be set. See Appendix C, "Condition-Code Settings" in topic C.0 for a summary of the instructions which set the condition code.
Facilities for decision making are provided by BRANCH ON CONDITION and BRANCH RELATIVE ON CONDITION. This instruction inspects a condition code that reflects the result of a majority of the arithmetic, logical, and I/O operations. The condition code, which consists of two bits, provides for four possible condition-code settings: 0, 1, 2, and 3.
Loop control can be performed by the use of BRANCH ON CONDITION and BRANCH RELATIVE ON CONDITION. to test the outcome of address arithmetic and counting operations. For some particularly frequent combinations of arithmetic and tests, BRANCH ON COUNT, BRANCH ON INDEX HIGH, and BRANCH ON INDEX LOW OR EQUAL are provided, and relative-branch equivalents of these instructions are also provided. These branches, being specialized, provide increased performance for these tasks.
Subroutine linkage is provided by the BRANCH AND LINK, BRANCH AND SAVE and BRANCH RELATIVE AND SAVE instructions, which permit not only the introduction of a new instruction address but also the preservation of the return address and associated information. Instructions are also provided which set and save the addressing-mode bit, PSW bit 32. These instructions provide the facility for subroutine linkage between programs using the 24-bit and 31-bit addressing modes. Linkage between a problem-state program and the supervisor or monitoring program is provided by means of the SUPERVISOR CALL and MONITOR CALL instructions.
This section describes only the methods for subroutine linkage that do not use the linkage stack. For the linkage extensions provided by the linkage stack, see "Linkage-Stack Introduction" in topic 5.10.
The instructions PROGRAM CALL and PROGRAM TRANSFER provide the facility for linkage between programs of different authority and in different address spaces. PROGRAM CALL permits linkage to a number of preassigned programs that may be in either the problem or the supervisor state and may be in either the same address space or an address space different from
The operation of PROGRAM CALL is controlled by means of an entry-table entry, which is located as part of a table-lookup process during the
PROGRAM TRANSFER specifies the new addressing mode and the address space which is to become the new primary address space. When the primary address space is changed, the operation is called PROGRAM TRANSFER with space switching (PT-ss). When the primary address space is not changed, the operation is called PROGRAM TRANSFER to current primary (PT-cp).
The BRANCH IN SUBSPACE GROUP instruction is available when the subspace-group facility is installed. The instruction allows linkage within a group of address spaces called a subspace group, where one address space in the group is called the base space and the others are called subspaces. It is intended that each subspace contain a different subset of the storage in the base space, that the base space and each subspace contain a subsystem control program, such as CICS, and application programs, and that each subspace contain the data for a single transaction being processed under the subsystem control program. The placement of the data for each transaction in a different subspace prevents a program that is being executed to process one particular transaction from erroneously damaging the data of other transactions. It is intended that the primary address space be the base space when the control program is being executed, and that it be the subspace for a transaction when an application program is being executed to process that transaction. BRANCH IN SUBSPACE GROUP changes not only the instruction address in the PSW but also the primary segment-table designation in control register 1. BRANCH IN SUBSPACE GROUP does not change the primary ASN in control register 4 or the primary-ASN-second-table-entry origin in control register 5, and, therefore, the base space and the subspaces all are associated with the same ASN, and the programs in those address spaces all are of equal authority.
Although a subspace is intended to be a subset of the base space as described above, the subspace-group facility does not require this, and the facility may be useful in ways other than as described above.
BRANCH IN SUBSPACE GROUP uses an access-list-entry token (ALET) in an access register as an identifier of the address space that is to receive control. The instruction saves the updated instruction address to permit a return linkage, but it does not save an identifier of the address space from which control was transferred. However, an ALET equal to 00000000 hex, called ALET 0, can be used to return from a subspace to the base space, and an ALET equal to 00000001 hex, called ALET 1, can be used to return from the base space to the subspace that last had control.
The linkage instructions provided and the functions performed by each are summarized in Figure 5-2.
___________ ______ _______________ _______________ _______________ _______________ _________ _______ | | | Instruction | Addressing | Problem | PASN | | | | | | Address | Mode | State | CR4 | PSW-Key | | | | |PSW Bits 33-63 | PSW Bit 32 | PSW Bit 15 | Bits 16-31 | Mask | | | | |_______ _______|_______ _______|_______ _______|_______ _______| Changed | | |Instruction|Format| Save | Set | Save | Set | Save | Set | Save | Set | in CR3 | Trace | |___________|______|_______|_______|_______|_______|_______|_______|_______|_______|_________|_______| | BALR* | RR | Yes | R2¹ | AM | - | - | - | - | - | - | R2¹ | | | | | | | | | | | | | | | BAL* | RX | Yes | Yes | AM | - | - | - | - | - | - | - | | | | | | | | | | | | | | | BASR | RR | Yes | R2¹ | Yes | - | - | - | - | - | - | R2¹ | | | | | | | | | | | | | | | BAS | RX | Yes | Yes | Yes | - | - | - | - | - | - | - | | | | | | | | | | | | | | | BASSM | RR | Yes | R2¹ | Yes | R2¹ | - | - | - | - | - | R2¹ | | | | | | | | | | | | | | | BRAS | RI | Yes | Yes | Yes | - | - | - | - | - | - | - | | | | | | | | | | | | | | | | BSA-ba | RRE | Yes | Yes | Yes | Yes | Yes | Yes4 | - | - |"AND" R15| Yes | | | | | | | | | | | | | | | | | BSA-ra | RRE | R1¹ | Yes | R1¹ | Yes | - | Yes | - | - | Yes | Yes | | | | | | | | | | | | | | | BSG | RRE | Yes | Yes | Yes | Yes | - | - | - | -³ | - | Yes | | | | | | | | | | | | | | | BSM | RR | - | R2¹ | R1¹ | R2¹ | - | - | - | - | - | - | | | | | | | | | | | | | | | MC#² | SI | Yes | Yes | Yes | Yes | Yes | Yes | - | - | - | - | | | | | | | | | | | | | | | PC-cp | S | Yes | Yes | Yes | Yes | Yes | Yes | - | - |"OR" EKM | Yes | | | | | | | | | | | | | | | PC-ss | S | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |"OR" EKM | Yes | | | | | | | | | | | | | | | PT-cp | RRE | - | R2 | - | R2 | - | R2** | - | - |"AND" R1 | Yes | | | | | | | | | | | | | | | PT-ss | RRE | - | R2 | - | R2 | - | R2** | - | Yes |"AND" R1 | Yes | | | | | | | | | | | | | | | SVC² | RR | Yes | Yes | Yes | Yes | Yes | Yes | - | - | - | - | |___________|______|_______|_______|_______|_______|_______|_______|_______|_______|_________|_______| |Explanation: | | | | - No | | | | * In the 24-bit addressing mode, the instruction-length code, condition code, program mask, | | and 24-bit instruction address are saved, and the 24-bit instruction address is set; in | | the 31-bit addressing mode, the addressing mode and the 31-bit instruction address are | | saved, and the 31-bit instruction address is set. | | | | ** A change from the supervisor to the problem state is allowed; a privileged-operation excep- | | tion is recognized when a change from the problem to the supervisor state is specified. | | | | # Monitor-mask bits provide a means of disallowing linkage, or enabling linkage, for selected | | classes of events. | | | | ¹ The action takes place only if the associated R field in the instruction is nonzero. | | | | ² MC and SVC, as part of the interruption, save the entire current PSW and load a new PSW. | | | | ³ The primary segment-table designation is set even though the PASN is not set. | |____________________________________________________________________________________________________| ____________________________________________________________________________________________________ |Explanation (Continued): | | | 4 The problem state is set. | | | | | | 5 The PSW key also is set from general register R1. | | | | AM Saved only if the 31-bit addressing mode is specified. | |____________________________________________________________________________________________________|Figure 5-2. Summary of Linkage Instructions without the Linkage Stack
Programming Note: This section describes the linkage instructions that were included in 370-XA and carried forward to ESA/370 and ESA/390. To give the reader a better understanding of the utility and intended usage of these linkage instructions, the following paragraphs in this note describe various program linkages and conventions and the use of the linkage instructions in these situations.
BRANCH RELATIVE AND SAVE, which is not mentioned in the remainder of this section, may be used in place of BRANCH AND SAVE.
The linkage instructions are provided to permit System/370 programs to operate with no modification or only slight modification on ESA/390 systems and also to provide additional function for those programs which are designed to take advantage of the 31-bit addressing of ESA/390. The instructions provide the capability for both old and new programs to coexist in storage and to communicate with each other. It is assumed that old, unmodified programs operate in the 24-bit addressing mode and call, or directly communicate with, other programs operating in the 24-bit addressing mode only. Modified programs normally operate in the 24-bit addressing mode but may call programs which operate in either the 24-bit or 31-bit addressing mode. New programs may be written to operate in either the 24-bit or 31-bit addressing mode, and, in some cases, a program may be written such that it can be invoked in either mode.
SUPERVISOR CALL is provided for compatibility purposes and also because it provides the simplest mechanism to call a program which operates in the supervisor state. It has the advantage over PROGRAM CALL that no general registers are disturbed, that only two bytes in storage are required in line, and that a complete change of PSW status is provided. The return from a routine called by SUPERVISOR CALL normally is accomplished by means of LOAD PSW, which is a privileged instruction.
PROGRAM CALL is provided for fast communication to a program operating in the supervisor state or higher-authority problem state, or even to a program with the same authority. PROGRAM CALL permits a program to call a program operating in a different address space. This would normally be used in the situation where the authorization index associated with the called address space had a higher level of authority than that of the calling address space. The advantage of PROGRAM CALL over SUPERVISOR CALL is in speed, since first-and second-level interruption-handler programs are avoided. It also provides a possible 2²0 different entry points. The authorization key mask in the entry-table entry permits a particular entry point to be available to a limited subset of the programs in the system. Thus, some or all of the authority checking which would otherwise have to be placed in the called program can be eliminated. Return from a routine called by PROGRAM CALL is normally accomplished by means of the PROGRAM TRANSFER instruction; however, LOAD PSW may be used if the called routine is in the supervisor state.
PROGRAM TRANSFER is provided as the return instruction for PROGRAM CALL. It is also useful for calling or transferring to programs with the same authority in another address space. Although PROGRAM TRANSFER does not save the current PASN, the instruction EXTRACT PRIMARY ASN may be used to provide the PASN for return purposes.
BRANCH AND SAVE AND SET MODE (BASSM) is intended to be the principal calling instruction to subroutines outside of an assembler/linkage-editor control section (CSECT), for use by all new programs. BRANCH AND SET MODE (BSM) is intended to be the return instruction used after a BASSM. It is assumed that an extension to the current V-type address constant (VCON) will be established by the assembler and linkage editor which consists of a 31-bit entry-point address and a leftmost bit indicating whether the entry is in the 24-bit or 31-bit addressing mode. This extended VCON is shown here as "VCONE." This calling sequence would normally be:
L 15,VCONE BASSM 14,15It is assumed that the normal return from a subroutine called by BRANCH AND LINK (BAL or BALR) will be:The return from such a routine would normally be:
BSM 0,14
The BRANCH AND LINK (BAL, BALR) instruction is provided primarily for compatibility reasons. It is defined to operate in the 31-bit addressing mode to increase the probability that an old, straightforward program can be modified to operate in the 31-bit addressing mode with minimal or no change. It is recommended, however, that BRANCH AND SAVE (BAS and BASR) be used instead and that BRANCH AND LINK be avoided since it places nonzero information in the left part of the general register in the 24-bit addressing mode, which may lead to problems. Additionally, BRANCH AND LINK is likely to be slower than BRANCH AND SAVE because BRANCH AND SAVE always saves the right half of the PSW, whereas BRANCH AND LINK must take additional time to check the addressing mode, and then even more time, if in the 24-bit addressing mode, to construct the ILC, condition code, and program mask to be placed in the leftmost byte of the link register.
BCR 15,14The BRANCH AND SAVE (BAS, BASR) instruction is provided to be used for subroutine linkage to any program either within the same CSECT or known to be in the same addressing mode. BASR with the R2 field 0 is also useful for obtaining addressability to the instruction stream by getting a 31-bit address, uncluttered by leftmost fields, in the 24-bit addressing mode. BRANCH AND SAVE (BAS, BASR) is the fastest linkage instruction since the linkage information is not addressing-mode sensitive and since the instruction does not change the addressing mode.However, the standard "return instruction":
BSM 0,14
operates correctly for all cases except for a calling BAL executed in the 24-bit addressing mode. In the 24-bit addressing mode, BAL causes an ILC of 10 to be placed in the leftmost two bits of the link register. Thus, a BSM would return in the 31-bit addressing mode. Note that an EXECUTE of BALR in the 24-bit addressing mode also causes the same ILC effect.
The return instruction from a routine called by BRANCH AND SAVE (BAS or BASR) may be either
BCR 15,14Note that the "BSM 14,15" in the glue module causes the addressing mode to be saved in bit position 0 of general register 14 and that bits 1-31 of general register 14 are unchanged. Thus, when "BSM 0,14" is executed in the new program, control passes directly back to the old program without passing through the glue module again.or
BSM 0,14
In some cases, it may be desirable to rewrite a program that is called by an old program which has not been rewritten. In such a case, the old program, which operates in the 24-bit addressing mode, will be given the address of an intermediate program that will set up the correct entry and return modes and then call the rewritten program. Such a program is sometimes referred to as a glue module. The instruction BRANCH AND SET MODE (BSM) with a nonzero R1 field provides the function necessary to perform this operation efficiently. This is shown in Figure 5-3.
___________________________________________________________________ | | | Old Program Glue Module New Program | | | | L 15,OLDVCON | | BALR 14,15 | | ° | | ° | | ° | | OLDVCON DC V(GLUE) | | GLUE USING *,15 | | L 15,NEWVCON | | BSM 14,15 | | NEWVCON DC V(NEW) | | NEW USING *,15 | | ° | | ° | | ° | | BSM 0,14 | | | |___________________________________________________________________|Figure 5-3. Glue Module
Six classes of interruption conditions are provided: external, I/O, machine check, program, restart, and supervisor call. Each class has two related PSWs, called old and new, in permanently assigned real storage locations. In all classes, an interruption involves storing information identifying the cause of the interruption, storing the current PSW at the old-PSW location, and fetching the PSW at the new-PSW location, which becomes the current PSW.
Interruptions permit the CPU to change state as a result of conditions external to the system, in subchannels or input/output (I/O) devices, in other CPUs, or in the CPU itself. Details are to be found in Chapter 6, "Interruptions."
The old PSW contains CPU-status information necessary for resumption of the interrupted program. At the conclusion of the program invoked by the interruption, the instruction LOAD PSW may be used to restore the current PSW to the value of the old PSW.
Partial completion of instruction execution occurs only for interruptible instructions; it is described in "Interruptible Instructions" in topic 5.3.6.
Instruction execution ends in one of five ways: completion, nullification, suppression, termination, and partial completion.
Subtopics:
Completion of instruction execution provides results as called for in the definition of the instruction. When an interruption occurs after the completion of the execution of an instruction, the instruction address in the old PSW designates the next sequential instruction.
Suppression of instruction execution causes the instruction to be executed as if it specified "no operation." The contents of any result fields, including the condition code, are not changed. The instruction address in the old PSW on an interruption after suppression designates the next sequential instruction.
Nullification of instruction execution has the same effect as suppression, except that when an interruption occurs after the execution of an instruction has been nullified, the instruction address in the old PSW designates the instruction whose execution was nullified (or an EXECUTE instruction, as appropriate) instead of the next sequential instruction.
Programming Note: Although the execution of an instruction is treated as a no-operation when suppression or nullification occurs, stores may be performed as the result of the implicit tracing action associated with some instructions. See "Tracing" in topic 4.4.
Termination of instruction execution causes the contents of any fields due to be changed by the instruction to be unpredictable. The operation may replace all, part, or none of the contents of the designated result fields and may change the condition code if such change is called for by the instruction. Unless the interruption is caused by a machine-check condition, the validity of the instruction address in the PSW, the interruption code, and the ILC are not affected, and the state or the operation of the machine is not affected in any other way. The instruction address in the old PSW on an interruption after termination designates the next sequential instruction.
Subtopics:
For the following instructions, referred to as interruptible instructions, an interruption is permitted also after partial completion of the instruction:
For most instructions, the entire execution of an instruction is one operation. An interruption is permitted between operations; that is, an interruption can occur after the performance of one operation and before the start of a subsequent operation.
The execution of an interruptible instruction is considered to consist in the execution of a number of units of operation, and an interruption is permitted between units of operation. The amount of data processed in a unit of operation depends on the particular instruction and may depend on the model and on the particular condition that causes the execution of the instruction to be interrupted.
Whenever points of interruption that include those occurring within the execution of an interruptible instruction are discussed, the term "unit of operation" is used. For a noninterruptible instruction, the entire execution consists, in effect, in the execution of one unit of operation.
When an instruction execution consists of a number of units of operation and an interruption occurs after some, but not all, units of operation have been completed, the instruction is said to be partially completed. In this case, the type of ending (completion, inhibition, nullification, suppression) is associated with the unit of operation. In the case of termination, the entire instruction is terminated, not just the unit of operation.
An exception may exist that causes the first unit of operation of an interruptible instruction not to be completed. In this case when the ending is nullification or suppression, all operand parameters and result locations remain unchanged, except that the condition code is unpredictable if the instruction is defined to set the condition code.
At the time of an interruption, changes to register contents, which are due to be made by an interruptible vector instruction beyond the point of interruption, have not yet been made. Changes to storage locations, however, which are due to be made by an interruptible vector instruction beyond the point of interruption, may have occurred for one or more storage locations beyond the location containing the element identified by the interruption parameters, but not for any location beyond the last element specified by the instruction and not for any locations for which access exceptions exist. Changes to storage locations or register contents which are due to be made by instructions following the interrupted instruction have not yet been made at the time of interruption.
The execution of an interruptible instruction is completed when all units of operation associated with that instruction are completed. When an interruption occurs after completion, inhibition, nullification, or suppression of a unit of operation, all preceding units of operation have been completed, and subsequent units of operation and instructions have not been started. The main difference between these types of ending is the handling of the current unit of operation and whether the instruction address stored in the old PSW identifies the current instruction or the next sequential instruction.
Completion: On completion of the last unit of operation of an interruptible instruction, the instruction address in the old PSW designates the next sequential instruction. The result location for the current unit of operation has been updated. It depends on the particular instruction how the operand parameters are adjusted. On completion of a unit of operation other than the last one, the instruction address in the old PSW designates the interrupted instruction or an EXECUTE instruction, as appropriate. The result location for the current unit of operation has been updated. The operand parameters are adjusted such that the execution of the interrupted instruction is resumed from the point of interruption when the old PSW stored during the interruption is made the current PSW.
Inhibition: When a unit of operation is inhibited, the instruction address in the old PSW designates the interrupted instruction or an EXECUTE instruction, as appropriate. The result location for the current unit of operation is not changed. The operand parameters are adjusted such that, if the instruction is reexecuted, execution of the interrupted instruction is resumed with the next unit of operation. Inhibition occurs only during interruptible vector instructions and is described in more detail in the publication IBM Enterprise Systems Architecture/390 Vector Operations, SA22-7207.
Nullification: When a unit of operation is nullified, the instruction address in the old PSW designates the interrupted instruction or an EXECUTE instruction, as appropriate. The result location for the current unit of operation remains unchanged. The operand parameters are adjusted such that, if the instruction is reexecuted, execution of the interrupted instruction is resumed with the current unit of operation.
Suppression: When a unit of operation is suppressed, the instruction address in the old PSW designates the next sequential instruction. The operand parameters, however, are adjusted so as to indicate the extent to which instruction execution has been completed. If the instruction is reexecuted after the conditions causing the suppression have been removed, the execution is resumed with the current unit of operation.
Termination: When an exception which causes termination occurs as part of a unit of operation of an interruptible instruction, the entire operation is terminated, and the contents, in general, of any fields due to be changed by the instruction are unpredictable. On such an interruption, the instruction address in the old PSW designates the next sequential instruction.
The differences among the five types of ending for a unit of operation are summarized in Figure 5-4.
______________ _____________ _____________ ______________ | Unit of | Instruction | Operand |Current Result| | Operation Is | Address | Parameters | Location | |______________|_____________|_____________|______________| |Completed | | | | | Last unit |Next instruc-|Depends on |Changed | | of oper- | tion | the instruc-| | | ation | | tion | | | Any other |Current in- |Next unit of |Changed | | unit of | struction | operation | | | operation | | | | | | | | | |Inhibited |Current in- |Next unit of |Unchanged | | | struction | operation | | | | | | | |Nullified |Current in- |Current unit |Unchanged | | | struction | of operation| | | | | | | |Suppressed |Next instruc-|Current unit |Unchanged | | | tion | of operation| | | | | | | |Terminated |Next instruc-|Unpredictable|Unpredictable | | | tion | | | |______________|_____________|_____________|______________|Figure 5-4. Types of Ending for a Unit of Operation
If an instruction is defined to set the condition code, the execution of the instruction makes the condition code unpredictable except when the last unit of operation has been completed.
The following instructions are not interruptible instructions but instead may be completed after performing a CPU-determined subportion of the processing specified by the parameters of the instructions:
The points at which any of the above instructions may set condition code 3 are comparable to the points of interruption of an interruptible instruction, and the amount of processing between adjacent points is comparable to a unit of operation of an interruptible instruction. However, since the instruction is not interruptible, each execution is considered the execution of one unit of operation.
Completion with the setting of condition code 3 permits interruptions to occur. Depending on the model and the instruction, condition code 3 may or may not be set when there is not a need for an interruption.
The COMPARE UNTIL SUBSTRING EQUAL instruction is both an interruptible instruction and one that may set condition code 3 after performing a CPU-determined amount of processing.
Programming Notes:
All of these situations are limited to the extent that a store access does not occur and the change bit is not set when the store access is prohibited. For the CPU, a store access is prohibited whenever an access exception exists for that access, or whenever an exception exists which is of higher priority than the priority of an access exception for that access.
In certain unusual situations, the result fields of an instruction having a store-type operand are changed in spite of the occurrence of an exception which would normally result in nullification or suppression. These situations are exceptions to the general rule that the operation is treated as a no-operation when an exception requiring nullification or suppression is recognized. Each of these situations may result in the turning on of the change bit associated with the store-type operand, even though the final result in storage may appear unchanged. Depending on the particular situation, additional effects may be observable. The extent of these effects is described along with each of the situations.
When, in these situations, an interruption for an exception requiring suppression occurs, the instruction address in the old PSW designates the next sequential instruction. When an interruption for an exception requiring nullification occurs, the instruction address in the old PSW designates the instruction causing the exception even though partial results may have been stored.
Subtopics:
For DAT-associated access exceptions, on some models, channel programs may observe the effects on storage as described in the following case.
In this section, the term "DAT-associated access exceptions" is used to refer to those exceptions which may occur as part of the dynamic-address-translation process. These exceptions are page translation, segment translation, translation specification, and addressing due to a DAT-table entry being designated at a location that is not available in the configuration. The first two of these exceptions normally cause nullification, and the last two normally cause suppression. Protection exceptions, including those due to page protection, are not considered to be DAT-associated access exceptions.
When, for an instruction having a store-type operand, a DAT-associated access exception is recognized for any operand of the instruction, that portion, if any, of the store-type operand which would not cause an exception may be changed to an intermediate value but is then restored to the original value.
The accesses associated with storage change and restoration for DAT-associated access exceptions are only observable by channel programs and are not observable by other CPUs in a multiprocessing configuration. Except for instructions which are defined to have multiple-access operands, the intermediate value, if any, is always equal to what would have been the final value if the DAT-associated access exception had not occurred.
Programming Notes:
When a valid and attached DAT-table entry is changed to a value which would cause an exception, and when, before the TLB is cleared of entries which qualify for substitution for that entry, an attempt is made to refer to storage by using a virtual address requiring that entry for translation, the contents of any fields due to be changed by the instruction are unpredictable. Results, if any, associated with the virtual address whose DAT-table entry was changed may be placed in those real locations originally associated with the address. Furthermore, it is unpredictable whether or not an interruption occurs for an access exception that was not initially applicable. On some machines, this situation may be reported by means of an instruction-processing-damage machine check with the delayed-access-exception bit also indicated.
For the instructions EDIT, EDIT AND MARK, and TRANSLATE, the portions of the operands that are actually used in the operation may be established in a trial execution for operand accessibility that is performed before the execution of the instruction is started. This trial execution consists in an execution of the instruction in which results are not stored. If the first operand of TRANSLATE or either operand of EDIT or EDIT AND MARK is changed by another CPU or by a channel program, after the initial trial execution but before completion of execution, the contents of any fields due to be changed by the instruction are unpredictable. Furthermore, it is unpredictable whether or not an interruption occurs for an access exception that was not initially applicable.
A semiprivileged instruction is one which can be executed in the problem state, but which is subject to the control of one or more of the authorization mechanisms described in this section. There are 21 semiprivileged instructions and also the privileged LOAD ADDRESS SPACE PARAMETERS instruction that are controlled by the authorization mechanisms. All semiprivileged and privileged instructions are described in Chapter 10, "Control Instructions."
The authorization mechanisms which are described in this section permit the control program to establish the degree of function which is provided to a particular semiprivileged program. (A summary of the authorization mechanisms is given in Figure 5-5 in topic 5.4.8.) The authorization mechanisms are intended for use by programs considered to be semiprivileged, that is, programs which are executed in the problem state but which may be authorized to use additional capabilities. With these authorization controls, a hierarchy of programs may be established, with programs at a higher level having a greater degree of privilege or authority than programs at a lower level. The range of functions available at each level, and the ability to transfer control from a lower to a higher level, are specified in tables which are managed by the control program. When the linkage stack is used, a nonhierarchical transfer of control also can be specified.
The instructions controlled by the authorization mechanisms are listed in Figure 5-5 in topic 5.4.8. The figure also shows additional authorization mechanisms that do not control specifically semiprivileged instructions; they control implicit access-register translation (access-register translation as part of an instruction making a storage reference) and also access-register translation in the LOAD REAL ADDRESS, TEST ACCESS, and TEST PROTECTION instructions. These additional mechanisms (the extended authorization index, ALE sequence number, and ASTE sequence number) are described in "Access-Register-Specified Address Spaces" in topic 5.7.2.1.
Subtopics:
PROGRAM TRANSFER specifies a new value for the problem-state bit in the PSW. If a program in the problem state attempts to execute PROGRAM TRANSFER and set the supervisor state, a privileged-operation exception is recognized. A privileged-operation exception is also recognized on an attempt to use SET ADDRESS SPACE CONTROL to set the home-space mode in the problem state.
Most of the semiprivileged instructions can be executed only with DAT on. Basic PROGRAM CALL, and PROGRAM TRANSFER, are valid only in the primary-space mode. (Basic PROGRAM CALL is the PROGRAM CALL operation when the linkage stack is not used. When the linkage stack is used, the PROGRAM CALL operation is called stacking PROGRAM CALL). MOVE TO PRIMARY and MOVE TO SECONDARY are valid only in the primary-space and secondary-space modes. BRANCH AND STACK, stacking PROGRAM CALL, and PROGRAM RETURN are valid only in the primary-space and access-register modes. EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE are valid only in the primary-space, access-register, and home-space modes. When a semiprivileged instruction is executed in an invalid translation mode, a special-operation exception is recognized.
The extraction-authority-control bit is located in bit position 4 of control register 0. In the problem state, bit 4 must be one to allow completion of these instructions:
The PSW-key mask consists of bits 0-15 in control register 3, with the bits corresponding to the values 0-15, respectively, of the PSW key. These bits are used in the problem state to control which keys and entry points are authorized for the program. The PSW-key mask is modified by
| PROGRAM TRANSFER, is modified or loaded by BRANCH AND SET AUTHORITY and PROGRAM CALL, and is loaded by PROGRAM RETURN and LOAD ADDRESS SPACE PARAMETERS. The PSW-key mask is used in the problem state to control the following:
Bit 5 of control register 0 is the secondary-space-control bit. This bit provides a mechanism whereby the control program can indicate whether or not the secondary segment table has been established. Bit 5 must be one to allow completion of these instructions:
When the address-space-function (ASF) control, bit 15 of control register 0, is zero, bit 0 of control register 5 is the subsystem-linkage-control bit. When the ASF control is one, bit 96 of the primary ASN-second-table entry is the subsystem-linkage-control bit. The subsystem-linkage control must be one to allow completion of these instructions:
Bit 12 of control register 14 is the ASN-translation-control bit. This bit provides a mechanism whereby the control program can indicate whether ASN translation may occur while a particular program is being executed. Bit 12 must be one to allow completion of these instructions:
Associated with each address space is an authority table. The authorization index is used to select an entry in the authority table. Each entry contains two bits, which indicate whether the program with that authorization index is permitted to establish the address space as a primary address space, as a secondary address space, or both.
The authorization index is contained in bits 0-15 of control register 4. The authorization index is associated with the primary address space and is loaded along with the PASN when PROGRAM CALL with space switching, PROGRAM RETURN with space switching, PROGRAM TRANSFER with space switching, or LOAD ADDRESS SPACE PARAMETERS is executed. The authorization index is used to determine whether a program is authorized to establish a particular address space. A program may be authorized to establish the address space as a secondary-address space, as a primary-address space, or both. The authorization index is examined in both the problem and supervisor states.
The instruction SET SECONDARY ASN with space switching, and the instruction PROGRAM RETURN when the restored secondary ASN is not equal to the restored primary ASN, use the authorization index to test the secondary-authority bit in the authority-table entry to determine if the address space can be established as a secondary address space. The tested bit must be one; otherwise, a secondary-authority exception is recognized.
The instruction PROGRAM TRANSFER with space switching uses the authorization index to test the primary-authority bit in the authority-table entry to determine if the address space can be established as a primary address space. The tested bit must be one; otherwise, a primary-authority exception is recognized.
The instruction PROGRAM CALL with space switching causes a new authorization index to be loaded from the ASN-second-table entry. This permits the program which is called to be given an authorization index which authorizes it to access more or different address spaces than those authorized for the calling program. The instructions PROGRAM RETURN with space switching and PROGRAM TRANSFER with space switching restore the authorization index that is associated with the returned-to address space.
The secondary-authority bit in the authority-table entry may also be used, along with the extended authorization index, to determine if the program is authorized to use an access-list entry in access-register translation. This is described in "Access-Register-Specified Address Spaces" in topic 5.7.2.1.
Bit 15 of control register 0 is the address-space-function (ASF) control bit. Bit 15 must be one to allow completion of these instructions:
Under certain circumstances when the ASF control is or has been zero, erroneous entries may exist in the ART-lookaside buffer (ALB), and this can cause erroneous access-register translation. A description of the circumstances and of how to remove the erroneous entries from the ALB appears in "Formation of ALB Entries" in topic 5.8.5.2.
The ASF control also controls the setting of the access-register mode by SET ADDRESS SPACE CONTROL, the availability of the stacking PROGRAM CALL operation, control-register contents, the sizes of the entry-table entry and ASN-second-table entry, and other functions. A complete description of the effects of the ASF control is in "Address-Space-Function Control" in topic 5.8.1.1.
The use of access registers also involves the extended authorization index, ALE sequence number, and ASTE sequence number as authorization mechanisms. These are described in "Access-Register-Specified Address Spaces" in topic 5.7.2.1.
_______ ___________ ____________________________________________________________ _____ | | | | | | | | Authorization Mechanism | | |Func- | |_____ _____ _______ _____ _____ _____ _____ ____ ____ ______|Space| |tion | Mode | | | | |PSW- | |Ext.-| | | |Sw.- | |or |Requirement| |Sec.-|ASN- |Extr.|Key |Auth.|Auth.| | | |Event| |In- |___ _______|Subs.|Space|Trans. |Auth.|Mask |Index|Index|ALE |ASTE|ASF |Ctl. | |struc- |Pr.|Trans. |Link.|Ctl. |Ctl. |Ctl. |(3.0-|(4.0-|(8.0-|Seq.|Seq.|Ctl. |(1.0,| |tion |Op.|Mode |Ctl.7|(0.5)|(14.12)|(0.4)|3.15)|4.15)|8.15)|No.8|No.9|(0.15)|13.0)| |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____| |Implic.| | A | | | | | | | EA |ALQ |ASQ | EALB | | | AR | | | | | | | | | | | | | | | trans.| | | | | | | | | | | | | | |BAKR | |SO-PA | | | | | | | | | | SO | | | |BSA-ba | | | | | | | Q | | | | | SO | | | |BSA-ra | | | | | | | | | | | | SO | | |BSG | |SO-PSAH| | | | | | | | |ASQ | SO | | |EPAR | |SO-PSAH| | | | Q | | | | | | | | |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____| |EREG | |SO-PAH | | | | | | | | | | SO | | |ESAR | |SO-PSAH| | | | Q | | | | | | | | |ESTA | |SO-PAH | | | | | | | | | | SO | | |IAC | |SO-PSAH| | | | Q | | | | | | | | |IPK | | | | | | Q | | | | | | | | |IVSK | |SO-PSAH| | | | Q | | | | | | | | |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____| |LASP | P | | | | SO | | | CC | | | | Y | CC | |LRA | P | | | | | | | | CCA |CCA |CCA | | | |MSTA | |SO-PAH | | | | | | | | | | SO | | |MVCDK | | | | | | | Q | | | | | | | |MVCK | | | | | | | Q | | | | | | | |MVCP | |SO-PS | | SO | | | Q | | | | | | | |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____| |MVCS | |SO-PS | | SO | | | Q | | | | | | | |MVCSK | | | | | | | Q | | | | | | | |bPC-cp | |SO-P | SO | | | | Q¹ | | | | | Y | | |sPC-cp | |SO-PA | SO | | | | Q¹ | | | | | Z | | |bPC-ss | |SO-P | SO | | SO | | Q¹ | | | | | Y | X1 | |sPC-ss | |SO-PA | SO | | SO | | Q¹ | | | | | Z | X1 | |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____| |PR-cp | |SO-PA | | | SO4 | | | SA6 | | | | SO | | |PR-ss | |SO-PA | | | SO | | |PASA6| | | | SO | X1 | |PT-cp | Q²|SO-P | SO | | | | | | | | | | | |PT-ss | Q²|SO-P | SO | | SO | | | PA | | | | Y | X1 | |SAC | Q³|SO-PSAH| | SO | | | | | | | | SO5 | X2 | | |SACF | Q³|SO-PSAH| | SO¹0| | | | | | | | SO5 | X2 | |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____| |SPKA | | | | | | | Q | | | | | | | |SSAR-cp| |SO-PSAH| | | SO | | | | | | | | | |SSAR-ss| |SO-PSAH| | | SO | | | SA | | | | Y | | |TAR | | | | | | | | | CC | CC | CC | SO | | |TPROT | P | | | | | | | | CC | CC | CC | | | |_______|___|_______|_____|_____|_______|_____|_____|_____|_____|____|____|______|_____|
Explanation for Summary of Authorization Mechanisms:
PC-number translation is the process of translating the 20-bit PC number to locate an entry-table entry as part of the execution of the PROGRAM CALL instruction. To perform this translation, the 20-bit PC number is divided into two fields. Bits 12-23 are the linkage index (LX), and bits 24-31 are the entry index (EX). The effective address, from which the PC-number is taken, has the following format:
____________ ____________ ________ |////////////| LX | EX | |____________|____________|________| 0 12 24 31The translation is performed by means of two tables: a linkage table and an entry table. Both of these tables reside in real storage. The linkage-table designation may reside in control register 5, or it may reside instead in a third area in storage, called the primary ASN-second-table entry (primary ASTE), in which case the origin of the primary ASTE is in control register 5. The entry table is designated by means of a linkage-table entry.
Subtopics:
PC-number translation may be controlled by means of a linkage-table designation in control register 5, or it may be controlled by means of controls in control registers 0 and 5 and a linkage-table designation in storage.
Subtopics:
The ASF control has other effects also. A complete description of the effects of the ASF control is in "Address-Space-Function Control" in topic 5.8.1.1.
Bit 15 of control register 0 is the address-space-function (ASF) control bit. When the ASF control is zero, the linkage-table designation is in control register 5, and the entry-table entry has a length of 16 bytes. When the ASF control is one, control register 5 contains the origin of the primary ASN-second-table entry, the linkage-table designation is in the primary ASTE, and the entry-table entry has a length of 32 bytes.
When the ASF control in control register 0 is zero, control register 5 contains the linkage-table designation. The register has the following format:
_ ________________________ _______ |V| Linkage-Table Origin | LTL | |_|________________________|_______| 0 1 25 31Subsystem-Linkage Control (V): Bit 0 of control register 5 is the subsystem-linkage-control bit. Bit 0 must be one to allow completion of these instructions:
Linkage-Table Origin: Bits 1-24 of control register 5, with seven zeros
appended on the right, form a 31-bit real address that designates the beginning of the linkage table.Linkage-Table Length (LTL): Bits 25-31 of control register 5 specify the length of the linkage table in units of 128 bytes, thus making the length of the linkage table variable in multiples of 32 four-byte entries. The length of the linkage table, in units of 128 bytes, is one more than the value in bit positions 25-31. The linkage-table length is compared against the leftmost seven bits of the linkage-index portion of the PC number to determine whether the linkage index designates an entry within the linkage table.
When the ASF control is one, control register 5 specifies the location of the primary ASN-second-table entry. The register has the following format:
_ _________________________ _____ | | PASTEO | | |_|_________________________|_____| 0 1 26 31Primary-ASTE Origin (PASTEO): Bits 1-25 of control register 5, with six zeros appended on the right, form a 31-bit real address that designates the beginning of the primary ASTE.
When the ASF control is one, the linkage-table designation is in bytes 12-15 of the primary ASTE. Thus, the subsystem-linkage control (V) is bit 0 of bytes 12-15 of the primary ASTE, the linkage-table origin (LTO) is bits 1-24 of bytes 12-15, and the linkage-table length (LTL) is bits 25-31 of bytes 12-15.
The PC-number translation process consists in a two-level lookup using two tables: a linkage table and an entry table. These tables reside in real storage.
Subtopics:
The entry fetched from the linkage table has the following format:
_ _________________________ ______ |I| Entry-Table Origin | ETL | |_|_________________________|______| 0 1 26 31LX Invalid Bit (I): Bit 0 controls whether the entry table associated with the linkage-table entry is available.The fields in the linkage-table entry are allocated as follows:
When the bit is zero, PC-number translation proceeds by using the linkage-table entry. When the bit is one, an LX-translation exception is recognized.
Entry-Table Origin: Bits 1-25, with six zeros appended on the right, form a 31-bit real address that designates the beginning of the entry table.
Entry-Table Length (ETL): When the address-space-function (ASF) control, bit 15 of control register 0, is zero, bits 26-31 specify the length of the entry table in units of 64 bytes, thus making the entry table variable in multiples of four 16-byte entries. When the ASF control is one, bits 26-31 specify the entry-table length in units of 128 bytes, thus making the table variable in multiples of four 32-byte entries. The length of the entry table, in units of 64 or 128 bytes, is one more than the value in bit positions 26-31. The entry-table length is compared against the leftmost six bits of the entry index to determine whether the entry index designates an entry within the entry table.
When the ASF control in control register 0 is zero, the entry-table entry has a length of 16 bytes. When the ASF control is one, the entry has a length of 32 bytes. The format of the 16-byte entry-table entry is identical to that of the first 16 bytes of the 32-byte entry. The 32-byte entry-table entry has the following format:
________________ ________________ | Auth Key Mask | ASN | |________________|________________| 0 16 31 _ _____________________________ _ |A| Entry Instruction Address |P| |_|_____________________________|_| 32 63 _________________________________ | Entry Parameter | |_________________________________| 64 95 ________________ ________________ | Entry Key Mask | | |________________|________________| 96 112 127 _________________________________ | Linkage-Stack Fields | |_________________________________| 128 159 _ ________________________ ______ | | ASTE Address | | |_|________________________|______| 160 186 191 _________________________________ | | |_________________________________| 192 223 _________________________________ | | |_________________________________| 224 255
The fields in the entry-table entry are allocated as follows:Authorization Key Mask: Bits 0-15 are used to verify whether the program issuing the PROGRAM CALL instruction, when in the problem state, is authorized to call this entry point. The authorization key mask and the current PSW-key mask in control register 3 are ANDed, and the result is checked for all zeros. If the result is all zeros, a privileged-operation exception is recognized. The test is not performed in the supervisor state.
ASN: Bits 16-31 specify whether a PC-ss or PC-cp is to occur. When bits 16-31 are zeros, a PC-cp is specified. When bits 16-31 are not all zeros, a PC-ss is specified, and the bits contain the ASN that replaces the primary ASN.
Entry Addressing Mode (A): Bit 32 replaces the addressing-mode bit, bit 32 of the current PSW, as part of the PROGRAM CALL operation. When bit 32 is zero, bits 33-39 must also be zero; otherwise, a PC-translation-specification exception is recognized.
Entry Instruction Address: Bits 33-62, with a zero appended on the right, form the instruction address which replaces the instruction address in the PSW as part of the PROGRAM CALL operation.
Entry Problem State (P): Bit 63 replaces the problem-state bit, bit 15 of the current PSW, as part of the PROGRAM CALL operation.
Entry Parameter: Bits 64-95 are placed in general register 4.
Entry Key Mask: Bits 96-111 are ORed into the PSW-key mask in control register 3 as part of the PROGRAM CALL operation.
ASTE Address: When the address-space-function (ASF) control is one and bits 16-31 are not all zeros, bits 161-185, with six zeros appended on the right, form the real ASN-second-table-entry address that should result from applying the ASN-translation process to bits 16-31. When the ASF control is one, it is unpredictable whether PC-ss uses bits 161-185 or uses ASN translation to obtain the ASTE address.
Bits 128-159 are used in connection with the linkage stack and are described in "Extended Entry-Table Entries" in topic 5.11.
Bits 112-127, 160, and 186-255 are reserved for possible future extensions and should be zeros.
Programming Note: The entry parameter is intended to provide the called program with an address which can be depended upon and used as the basis of addressability in locating necessary information which may be environment-dependent. The parameter may be appropriately changed for each environment by setting up different entry tables. The alternative -- obtaining this information from the calling program -- may require extensive validity checking or may present an integrity exposure.
For the purposes of PC-number translation, the 20-bit PC number is divided into two parts: the leftmost 12 bits are called the linkage index (LX), and the rightmost eight bits are called the entry index (EX). The LX is used to select an entry from the linkage table, the starting address and length of which are specified by the linkage-table designation in either control register 5 or the primary ASTE. This entry designates the entry table to be used. The EX field of the PC number is then used to select an entry from the entry table.
The translation of the PC number is performed by means of a linkage table and entry table both of which reside in real storage. The translation may also require the use of the primary ASN-second-table entry, which also resides in real storage.
When, for the purposes of PC-number translation, accesses are made to main storage to fetch entries from the primary ASTE, linkage table, and entry table, key-controlled protection does not apply.
The PC-number-translation process is shown in Figure 5-6.
Linkage-Table Designation in CR5 or Primary ASTE _ ___________ ___ |V| LTO |LTL| |_|______ ____|___| PC Number |(x128) ______ ____ ____________| | LX | EX | | |___ __|___ | | |(x4) |(xN) | _____________________________________| | | | | | | | _ Linkage Table | |___ÿ|+| __________________ | | | | | | | | | | | | | | |_ÿ|_ ____________ ___| | R |I| ETO |ETL| | |_|_______ ____|___| | | |(x64) | | | | | | |_________|________| | | | __________________| | | | | ____________________________________________| | | | | _ Entry Table |___ÿ|+| _______________________________________________________________________ | | | | | | | |_ÿ|________ ________ _ ______________ _ ________________ ________ ________| R | AKM | ASN |A| IA |P| PARM | EKM | | |________|________|_|______________|_|________________|________|________| | L.-S. Fields | ASTE Address | | |_________________|__________________|__________________________________| | | | | |_______________________________________________________________________| N: 16 if ASF control, bit 15 of control register 0, is zero; 32 if ASF control is one R: Address is realFigure 5-6. PC-Number Translation
Subtopics:
When the ASF control is one, the 31-bit real address of the linkage-table designation is obtained by appending six zeros on the right to the primary-ASTE origin, bits 1-25 of control register 5, and adding 12. The addition cannot cause a carry into bit position 0. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
When the address-space-function (ASF) control, bit 15 of control register 0, is zero, the linkage-table designation is the contents of control register 5. When the ASF control is one, the linkage-table designation is obtained from bytes 12-15 of the primary ASN-second-table entry, the starting address of which is specified by the contents of control register 5.
When the ASF control is one, all four bytes of the linkage-table designation are fetched concurrently from the primary ASTE. The fetch access is not subject to protection. When the storage address which is generated for fetching the linkage-table designation designates a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed. Besides the linkage-table designation, no other field in the primary ASTE is examined.
The 31-bit real address of the linkage-table entry is obtained by appending seven zeros on the right to the contents of bit positions 1-24 of the linkage-table designation and adding the linkage index, with two rightmost and 17 leftmost zeros appended. A carry, if any, into bit position 0 is ignored. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The linkage-index (LX) portion of the PC number, in conjunction with the linkage-table origin, is used to select an entry from the linkage table.
As part of the linkage-table-lookup process, the leftmost seven bits of the linkage index are compared against the linkage-table length, bits 25-31 of the linkage-table designation, to establish whether the addressed entry is within the linkage table. If the value in the linkage-table-length field is less than the value in the seven leftmost bits of the linkage index, an LX-translation exception is recognized.
All four bytes of the linkage-table entry appear to be fetched concurrently as observed by other CPUs. The fetch access is not subject to protection. When the storage address which is generated for fetching the linkage-table entry designates a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
Bit 0 of the linkage-table entry specifies whether the entry table corresponding to the linkage index is available. This bit is inspected, and, if it is one, an LX-translation exception is recognized.
When no exceptions are recognized in the process of linkage-table lookup, the entry fetched from the linkage table designates the origin and length of the corresponding entry table.
The 31-bit real address of the entry-table entry is obtained by appending six zeros on the right to the entry-table origin and adding: (1) if the ASF control is zero, the entry index, with four rightmost and 19 leftmost zeros appended; or (2) if the ASF control is one, the entry index, with five rightmost and 18 leftmost zeros appended. A carry, if any, into bit position 0 is ignored. All 31 bits of the address are used, regardless of whether the current PSW specifies the 24-bit or 31-bit addressing mode.
The entry-index (EX) portion of the PC number, in conjunction with the entry-table origin contained in the linkage-table entry, is used to select an entry from the entry table.
As part of the entry-table-lookup process, the six leftmost bits of the entry index are compared against the entry-table length, bits 26-31 of the linkage-table entry, to establish whether the addressed entry is within the table. If the value in the entry-table length field is less than the value in the six leftmost bits of the entry index, an EX-translation exception is recognized.
The 16-byte or 32-byte entry-table entry is fetched by using the real address. The fetch of the entry appears to be word-concurrent as observed by other CPUs, with the leftmost word fetched first. The order in which the remaining three or seven words are fetched is unpredictable. The fetch access is not subject to protection. When the storage address which is generated for fetching the entry-table entry designates a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
The use that is made of the information fetched from the entry-table entry is described in the definition of the PROGRAM CALL instruction.
Programming Note: The linkage-table designation is fetched successfully from the primary ASN-second-table entry regardless of the values of bit 0, the ASX-invalid bit, and bits 30, 31, and 60-63 in the primary ASTE. A one value of any of these bits may cause an exception to be recognized in other circumstances.
The exceptions which can be encountered during the PC-number-translation process and their priority are described in the definition of the PROGRAM CALL instruction.
Each dispatchable unit normally has an address space associated with it in which the control program keeps the principal control blocks that represent the dispatchable unit. This address space is called the home address space of the dispatchable unit. Different dispatchable units may have the same or different home address spaces. When the control program initiates a dispatchable unit, it may set the primary and secondary address spaces equal to the home address space of the dispatchable unit. Thereafter, because of the dispatchable unit's possible use of the PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, or SET SECONDARY ASN instruction, the control program normally cannot depend on either the primary address space or the secondary address space being the home address space when the home address space must be accessed, for example, during the processing by the control program of an interruption. Therefore, the control program normally must take some special action to ensure that the home address space is addressed when it must be accessed. The home-address-space facilities provide an efficient means to take this action.
Facilities are provided which a privileged program, such as the control program, can use to obtain control in and access the home address space of a dispatchable unit (for example, a task).
The home-address-space facilities include:
Many of the functions related to access registers are described in this section and in "Subroutine Linkage without the Linkage Stack" in topic 5.3.3, "Access-Register Translation" in topic 5.8, and "Sequence of Storage References" in topic 5.13. Additionally, translation modes and access-list-controlled protection are described in Chapter 3, "Storage"; the PER-2 means of restricting storage-alteration events to designated address spaces and the handling of access registers during resets and during the store-status operation are described in Chapter 4, "Control"; interruptions are described in Chapter 6, "Interruptions"; instructions are described in Chapter 7, "General Instructions," and Chapter 10, "Control Instructions"; the handling of access registers during a machine-check interruption and the programmed validation of the access registers are described in Chapter 11, "Machine-Check Handling"; and the alter-and-display controls for access registers are described in Chapter 12, "Operator Facilities."
Subtopics:
These major functions are provided:
Access registers allow a sequence of instructions, or even a single instruction such as MOVE (MVC) or MOVE LONG (MVCL), to operate on storage operands in multiple address spaces, without the requirement of changing either the translation mode or other control information. Thus, a program residing in one address space can use the complete instruction set to operate on data in that address space and in up to 15 other address spaces, and it can move data between any and all pairs of these address spaces. Furthermore, the program can change the contents of the access registers in order to access still other address spaces.
The instructions for examining and changing access-register contents are unprivileged and are described in Chapter 7, "General Instructions." They are:
Access registers specify address spaces when the CPU is in the access-register mode. The SET ADDRESS SPACE CONTROL instruction allows setting of the access-register mode, and the INSERT ADDRESS SPACE CONTROL instruction provides an indication of the access-register mode. These instructions are described in Chapter 10, "Control Instructions."
Access registers are used in a special way by the BRANCH IN SUBSPACE GROUP instruction. The use of access registers by that instruction is described in detail only in the definition of the instruction in Chapter 10, "Control Instructions." However, "Subspace-Group Tables" in topic 5.9.1 describes the use of the dispatchable-unit control table and the extended ASN-second-table entry by BRANCH IN SUBSPACE GROUP.
Subtopics:
An access register may specify the primary or secondary segment-table designation in control register 1 or 7, respectively, or it may specify a
The CPU includes sixteen 32-bit access registers numbered 0-15. In the access-register mode, which results when DAT is on and PSW bits 16 and 17 are 01 binary, an instruction B or R field that is used to specify the logical address of a storage operand designates not only a general register but also an access register. The designated general register is used in the ordinary way to form the logical address of the storage operand. The designated access register is used to specify the address space to which the logical address is relative. The access register specifies the address space by specifying a segment-table designation for the address space, and this segment-table designation is used by DAT to translate the logical address. An access register specifies a segment-table designation in an indirect way, not by containing the segment-table designation.
The process of using the contents of an access register to obtain a segment-table designation for use by DAT is called access-register translation (ART). This is depicted in Figure 5-7.
Instruction ____________ ___ _________ Displacement | | B | D |______________________ |____________| _ |_________| | | | | | | General Register | In Access-Register Mode | | ________________________ | __________________________| |_ÿ| Base Address | | | |___________ ____________| | | | | | Access Register | | ________________________ ___ | |_ÿ| | | + |_______________| |___________ ____________| |_ _| | | | | Logical Address _____ _____ | | | | | ART |________ STD ________ÿ| DAT | | | | | |_____| |__ __| | Real AddressFigure 5-7. Use of Access Registers
An access register is said to specify an AR-specified address space by means of an AR-specified segment-table designation. The virtual addresses in an AR-specified address space are called AR-specified virtual addresses.In the access-register mode, whereas all storage-operand addresses are AR-specified virtual, instruction addresses are primary virtual.
Designating Access Registers: In the access-register mode, an instruction B or R field designates an access register, for use in access-register translation, under the following conditions:
MVC 0(L,1),0(2)When PSW bits 16 and 17 are 01, the B field of the LOAD REAL ADDRESS instruction designates an access register, for use in access-register translation, regardless of whether DAT is on or off.The second operand, of length L, is to be moved to the first-operand location. The logical address of the second operand is in general register 2, and that of the first-operand location in general register 1. The address space containing the second operand is specified by access register 2, and that containing the first-operand location by access register 1. These two address spaces may be different address spaces, and each may be different from the current instruction space (the primary address space).
The COMPARE AND FORM CODEWORD and UPDATE TREE instructions specify storage operands by means of implicitly designated general registers and access registers.
The MOVE TO PRIMARY and MOVE TO SECONDARY instructions specify storage operands by means of primary virtual and secondary virtual addresses, and access registers do not apply to these instructions. An exception is recognized when either of these instructions is executed in the access-register mode. The MOVE WITH KEY instruction can be used in place of MOVE TO PRIMARY and MOVE TO SECONDARY in the access-register mode. The MOVE WITH SOURCE KEY and MOVE WITH DESTINATION KEY instructions also can be used.
An instruction R field may designate an access register for other than the purpose of access-register translation.
The fields which may designate access registers, whether or not for access-register translation, are indicated in the summary figure at the beginning of each instruction chapter.
Obtaining the Segment Table Designation: This section and the following ones introduce the access-register-translation process and present the concepts related to access lists.
The segment-table designation specified by an access register is obtained by access-register translation as follows:
The treatment of an access register containing the value 00000000 hex as designating the current primary address space allows that address space to be addressed, in the access-register mode, without requiring the use of an access-list entry. This is useful when the primary address space is changed by a space-switching PROGRAM CALL (PC-ss), PROGRAM RETURN (PR-ss), or PROGRAM TRANSFER (PT-ss) instruction. Similarly, the treatment of an access register containing the value 00000001 hex as designating the secondary address space allows that space to be addressed after a space-switching operation, again without requiring the use of an access-list entry.
The contents of the access registers are not changed by the PROGRAM CALL and PROGRAM TRANSFER instructions. Therefore, an access register containing 00000000 or 00000001 hex may specify a different address space after the execution of a PROGRAM CALL or PROGRAM TRANSFER than before the execution. For example, if a space-switching PROGRAM CALL is executed, an access register containing 00000000 hex specifies the old primary address space before the execution and the new primary address space after the execution.
When access-register translation obtains a segment-table designation from an ASN-second-table entry, bit 0 of the entry, the ASX-invalid bit, must be zero; otherwise, an exception is recognized.
Access Lists: The access-list entry that is designated by the contents of an access register can be located in either one of two access lists, the dispatchable-unit access list or the primary-space access list. A bit in the access register specifies which of the two access lists contains the
Control register 2 contains the origin of a real-storage area called the dispatchable-unit control table. The dispatchable-unit control table contains the designation -- the real origin and length -- of the dispatchable-unit access list.
When the address-space-function (ASF) control, bit 15 of control register 0, is one, control register 5 contains the origin of a real-storage area called the primary ASN-second-table entry. The primary ASN-second-table entry contains the designation of the primary-space access list, and it also contains the linkage-table designation. When the ASF control is zero, the linkage-table designation is in control register 5.
The ASF control determines the contents of control register 5 for the instructions LOAD ADDRESS SPACE PARAMETERS, PROGRAM CALL, PROGRAM RETURN, and PROGRAM TRANSFER. The access-register-translation process always treats control register 5 as containing the primary-ASN-second-table-entry origin and does not examine the ASF control.
An access list, either the dispatchable-unit access list or the primary-space access list, contains one of the following, depending on the model: (1) some multiple of eight 16-byte entries, up to a maximum of 1,024 entries, or (2) some multiple of sixteen 16-byte entries, up to a maximum of 4,096 entries.
Programs and Dispatchable Units: When discussing access lists, it is necessary to distinguish between the terms "program" and "dispatchable unit." A program is a sequence of instructions and may be referred to as a program module. A program may be a sequence of calling and called programs. A dispatchable unit, which is sometimes called a process or a task, is a unit of work that is performed through the execution of a program by one CPU at a time.
The dispatchable-unit access list is intended to be associated with a dispatchable unit; that is, it is intended that a dispatchable unit have the same dispatchable-unit access list regardless of which program is currently being executed to perform the dispatchable unit. There is no mechanism, except for the LOAD CONTROL instruction, that changes the dispatchable-unit-control-table origin in control register 2.
The primary-space access list is associated with the primary address space that is specified by the primary ASN in control register 4 and the primary segment-table designation in control register 1. The primary-space access list that is available for use by a dispatchable unit changes as the primary address space of the dispatchable unit changes, that is, whenever a program in a different primary address space begins to be executed to perform the dispatchable unit. Whenever a LOAD ADDRESS SPACE PARAMETERS, PROGRAM CALL, PROGRAM RETURN, or PROGRAM TRANSFER instruction replaces the primary ASN in control register 4 and the primary segment-table designation in control register 1, it also replaces the primary-ASN-second-table-entry origin in control register 5, if the address-space-function control is one.
Thus, for a dispatchable unit, the dispatchable-unit access list is intended to be constant (although its entries may be changed, as will be described), and the primary-space access list is a function of which program is being executed, through being a function of the primary address space of the program. Also, all dispatchable units and programs in the same primary address space have the same primary-space access list.
Access-List-Entry Token: The contents of an access register are called an access-list-entry token (ALET) since, in the general case, they designate an entry in an access list. An ALET has the following format:
_______ _ ________ ________________ |0000000|P| ALESN | ALEN | |_______|_|________|________________| 0 7 8 16 31The ALET also contains an access-list-entry number (ALEN) which, when multiplied by 16, is the number of bytes from the beginning of the effective access list to the designated access-list entry. During access-register translation, an exception is recognized if the ALEN designates an entry that is outside the effective access list or if the leftmost seven bits in the ALET are not all zeros.The ALET contains a primary-list bit (P) that specifies which access list contains the designated access-list entry: the dispatchable-unit access list if the bit is zero, or the primary-space access list if the bit is one. The specified access list is called the effective access list.
The access-list-entry sequence number (ALESN) in the ALET is described in the next section.
The above format of the ALET does not apply when the ALET is 00000000 or 00000001 hex.
An ALET can exist in an access register, in a general register, or in storage, and it has no special protection from manipulation by the problem program. Any program can transfer ALETs back and forth among access registers, general registers, and storage. A called program can save the contents of the access registers in any storage area available to it, load and use the access registers for its own purposes, and then restore the original contents of the access registers before returning to its caller.
Allocating and Invalidating Access-List Entries: It is intended that access lists be provided by the control program and that they be protected from direct manipulation by any problem program. This protection may be obtained by means of key-controlled protection or by placing the access lists in real storage not accessible by any problem program by means of DAT.
As determined by a bit in the entry, an access-list entry is either valid or invalid. A valid access-list entry specifies an address space and can be used by a suitably authorized program to access that space. An invalid access-list entry is available for allocation as a valid entry. It is intended that the control program provide services that allocate valid access-list entries and that invalidate previously allocated entries.
Allocation of an access-list entry may consist in the following steps. A problem program passes some kind of identification of an address space to the control program, and it passes a specification of either the dispatchable-unit access list or the primary-space access list. The control program checks, by some means, the authority of the problem program to access the address space. If the problem program is authorized, the control program selects an invalid entry in the specified access list, changes it to a valid entry specifying the subject address space, and returns to the problem program an access-list-entry token (ALET) that designates the allocated entry. The problem program can subsequently place the ALET in an access register in order to access the address space. Later, through the use of the invalidation service of the control program, the access-list entry that was allocated may be made invalid. An exception is recognized during access-register translation if an ALET is used that designates an invalid access-list entry.
It may be that a particular access-list entry is allocated, then invalidated, and then allocated again, this time specifying a different address space than the first time. To guard against erroneous use of an ALET that designates a conceptually wrong address space, an access-list-entry sequence number (ALESN) is provided in both the ALET and the access-list entry. When the control program allocates an access-list entry, it should place the same ALESN in the entry and in the designating ALET that it returns to the problem program. When the control program reallocates an access-list entry, it should change the value of the ALESN. An exception is recognized during access-register translation if the ALESN in the ALET used is not equal to the ALESN in the designated access-list entry.
The ALESN check is a reliability mechanism, not an authority mechanism, because the ALET is not protected from the problem program, and the problem program can change the ALESN in the ALET to any value. Also, this is not a fail-proof reliability mechanism because the ALESN is one byte and its value wraps around after 256 reallocations, assuming that the value is incremented by one for each reallocation.
Authorizing the Use of Access-List Entries: Although an access list is intended to be associated with either a dispatchable unit or a primary address space, the valid entries in the list are intended to be associated with the different programs that are executed, in some order, to perform the work of the dispatchable unit. It is intended that each program be able to have a particular authority that permits the use of only those access-list entries that are associated with the program. The authority being referred to here is represented by a 16-bit extended authorization index (EAX) in control register 8. Other elements used in the related authorization mechanism are: (1) a private bit in the access-list entry, (2) an access-list-entry authorization index (ALEAX) in the access-list
A program is authorized to use an access-list entry, in access-register translation, if any of the following conditions is met:
Figure 5-8 shows an example of how the authorization mechanism can be used. In the figure, "PBZ" means that the private bit is zero, and "PBO" means that the private bit is one.
Access List _________________ / / ASTE for Space 36 |_________________| _________________ 4| PBZ |____ÿ| | |_________________| |_________________| / / ASTE for Space 25 |_________________| _________________ 7| PBO, ALEAX = 5 |____ÿ| | |_________________| |_________________| / / ASTE for Space 62 |_________________| _________________ 9| PBO, ALEAX = 10 |____ÿ| | |_________________| |_________________| / / ASTE for Space 17 Authority Table |_________________| _________________ _________________ 12| PBO, ALEAX = 5 |____ÿ| |____ÿ|S bit selected by| |_________________| |_________________| |EAX 10 is one. | / / |_________________| |_________________|Program A Program B Program C _________________ _________________ _________________ | EAX = 0 |___ÿ| EAX = 5 |___ÿ| EAX = 10 | |_________________| |_________________| |_________________|
Figure 5-8. Example of Authorizing the Use of Access-List Entries
The figure also shows a sequence of three programs, named A, B, and C, that is executed to perform the work of the dispatchable unit associated with the access list. These programs may be in the same or different address spaces. The EAX in control register 8 when each of these programs is executed is 0, 5, and 10, respectively.
The figure shows an access list--assume it is a dispatchable-unit access list--in which the entries of interest are entries 4, 7, 9, and 12. Each access-list entry contains a private bit, an ALEAX, and the real address of the ASTE for an address space. The private bit in entry 4 is zero, and, therefore, the value of the ALEAX in entry 4 is immaterial and is not shown. The private bits in entries 7, 9, and 12 are ones, and the ALEAX values in these entries are as shown. The numbers used to identify the address spaces (36, 25, 62, and 17) are arbitrary. They may be the ASNs of the address spaces; however, ASNs are in no way used in access-register translation. Only the authority table for address space 17 is shown. In it, the secondary bit selected by EAX 10 is one. Assume that no secondary bits are ones in the authority tables for the other spaces.
Each of programs A, B, and C can use access-list entry (ALE) 4 to access address space 36 since the private bit in ALE 4 is zero. Program B can use ALE 7 to access space 25 because the ALEAX in the ALE equals the EAX for the program, and no other program can use this ALE. Similarly, only program C can use ALE 9. Program B can use ALE 12 because the ALEAX and EAX are equal, and program C can use it because C's EAX selects a secondary bit that is one in the authority table for space 17.
The example would be the same if programs A, B, and C were all in the same address space and the access list were the primary-space access list for that space.
An ALE in which the private bit is zero may be called public because the ALE can be used by any program, regardless of the value of the current EAX. An ALE in which the private bit is one may be called private because the ability of a program to use the ALE depends on the current EAX.
Notes on the Authorization Mechanism: An access list is a kind of capability list, in the sense in which the word "capability" is used in computer science. It is up to the control program to formulate the policies that are used to allocate entries in an access list, and the programmed authorization checking required during allocation may be very complex and lengthy. After a valid entry has been made in an access list, the access-register-translation process enforces the control-program policies in a well-performing way by means of the authorization mechanism described above.
Using access lists has an advantage over using only ASNs and authority tables. For example, assume that an access register could contain an ASN and that access-register translation would do ASN translation of the ASN and then use the EAX to test the authority table. This would make the EAX relevant to all existing address spaces, and, therefore, it would make the management of EAXs and their assignment to programs more difficult. With the actual definitions of the ALET and access-register translation, an EAX is relevant to only the address spaces that are represented in the current dispatchable-unit and primary-space access lists. Also, since ASN translation is not done as a part of access-register translation, the number of concurrently existing address spaces, as represented by ASN-second-table entries, can be greater than the number of available ASNs (64K).
The extended entry-table entry and linkage stack can be used to assign EAXs to programs and to change the EAX in control register 8 during program linkages. These components are introduced in "Linkage-Stack Introduction" in topic 5.10.
The SET SECONDARY ASN instruction and the authorization index (AX), bits
Revoking Accessing Capability: Another mechanism, which is a combined authority and integrity mechanism, is part of access-register translation, and it is described in this section.
An access-list entry (ALE) contains an ASN-second-table-entry sequence number (ASTESN), and so does the ASTE designated by the ALE when the ASTE is extended to 64 bytes, as it is when the address-space-function control is one. During access-register translation, the ASTESN in the ALE must equal the ASTESN in the designated ASTE; otherwise, an exception is recognized.
When the control program allocates an ALE, it should copy the ASTESN from the designated ASTE into the ALE. Subsequently, the control program can, in effect, revoke the addressing capability represented by the ALE by changing the ASTESN in the ASTE. Changing the ASTESN in the ASTE makes all previously usable ALEs that designate the ASTE unusable.
Making an ALE unusable may be required in either of two cases:
Changing the ASTESN in the ASTE ends the usability of all ALEs that designate the ASTE. If this revocation of capability is to be selective, then, when an exception is recognized because of unequal ASTESNs, the control program can reapply its programmed procedures for determining authorization, and an ALE which should have remained usable can be made usable again by copying the new ASTESN into it. When the usability of an ALE is restored, the control program normally should cause reexecution of the instruction that encountered the exception.
The ASTESN mechanism is especially valuable because it avoids the need of the control program to keep track of the access lists that contain the ALEs that designate each ASTE. Furthermore, it avoids the need of searching through these access lists in order to find the ALEs and set them invalid, to prevent the use of the ALEs in access-register translation. The latter activity could be particularly time-consuming, or could present a particularly difficult management problem, because the access lists could be in auxiliary storage, such as a direct-access storage device, when the need arises to invalidate the ALEs.
The ASTESN is a four-byte field. Assuming a reasonable frequency of authorization-policy changes or address-space reassignments, the approximately four billion possible values of the ASTESN provide a fail-proof authority or integrity mechanism over the lifetime of the system.
Preventing Store References: The access-list entry contains a fetch-only bit which, when one, specifies that the access-list entry cannot be used to perform storage-operand store references. The principal description of the effect of the fetch-only bit is in "Access-List-Controlled Protection" in topic 3.4.2.
Improving Translation Performance: Access-register translation (ART) conceptually occurs each time a logical address is used to reference a storage operand in the access-register mode. To improve performance, ART normally is implemented such that some or all of the information contained in the ART tables (access-list-designation sources, access lists, ASN second tables, and authority tables) is maintained in a special buffer referred to as the ART-lookaside buffer (ALB). The CPU necessarily refers to an ART-table entry in real storage only for the initial access to that entry. The information in the entry may be placed in the ALB, and subsequent translations may be performed using the information in the ALB.
The PURGE ALB instruction can be used to clear all information from the ALB after a change has been made to an ART-table entry in real storage.
The following instructions are provided for examining and changing the contents of access registers:
The LOAD ACCESS MULTIPLE instruction loads a specified set of consecutively numbered access registers from a specified storage location whose length in words equals the number of access registers loaded. Conversely, the STORE ACCESS MULTIPLE instruction function stores the contents of a set of access registers at a storage location.
The LOAD ADDRESS EXTENDED instruction is similar to the LOAD ADDRESS instruction in that it loads a specified general register with an effective address specified by means of the B, X, and D fields of the instruction. In addition, LOAD ADDRESS EXTENDED operates on the access register having the same number as the general register loaded. When the address-space control, PSW bits 16 and 17, is 00, 10, or 11 binary, LOAD ADDRESS EXTENDED loads the access register with 00000000, 00000001, or 00000002 hex, respectively. When the address space control is 01 binary, LOAD ADDRESS EXTENDED loads the target access register with a value that depends on the B field of the instruction. If the B field is zero, LOAD ADDRESS EXTENDED loads the target access register with 00000000 hex. If the B field is nonzero, LOAD ADDRESS EXTENDED loads the target access register with the contents of the access register designated by the B field. However, in the last case when bits 0-6 of the access register designated by the B field are not all zeros, the results in the target general register and access register are unpredictable.
The address-space-control values 00, 01, 10, and 11 binary specify primary-space, access-register, secondary-space, and home-space mode, respectively, when DAT is on. LOAD ADDRESS EXTENDED functions the same regardless of whether DAT is on or off.
When used in access-register translation, the access-register values 00000000 and 00000001 hex specify the primary and secondary address spaces, respectively, and the value 00000002 hex designates entry 2 in the dispatchable-unit access list. Loading the target access register with 00000002 hex when the address-space control is 11 binary is intended to support assignment, by the control program, of entry 2 in the dispatchable-unit access list as specifying the home address space.
Access-register translation is introduced in "Access-Register-Specified Address Spaces" in topic 5.7.2.1.
Subtopics:
Additional controls are located in the access-register-translation tables.
Access-register translation is controlled by an address-space control, by the address-space-function (ASF) control in control register 0, and by controls in control registers 2, 5, and 8. The address-space control, PSW bits 16 and 17, is described in "Translation Modes" in topic 3.11.1.1. The other controls are described below.
Subtopics:
When the ASF control is one:
Bit 15 of control register 0 is the address-space-function (ASF) control.
| This bit must be one when a SET ADDRESS SPACE CONTROL or SET ADDRESS SPACE
| CONTROL FAST instruction that is to set the access-register mode is
| executed, and when a BRANCH AND SET AUTHORITY, BRANCH AND STACK, BRANCH IN SUBSPACE GROUP, EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, MODIFY STACKED STATE, PROGRAM RETURN, or TEST ACCESS instruction is executed; otherwise, a special-operation exception is recognized.
Also when the ASF control is one:
The location of the dispatchable-unit control table is specified in control register 2. The register has the following format:
_ _________________________ _____ | | DUCTO | | |_|_________________________|_____| 0 1 26 31Dispatchable-Unit-Control-Table Origin (DUCTO): Bits 1-25 of control register 2, with six zeros appended on the right, form a 31-bit real address that designates the beginning of the dispatchable-unit control table. Access-register translation may obtain the dispatchable-unit access-list designation from the dispatchable-unit control table.
The location of the primary ASN-second-table entry is specified in control register 5. The register has the following format:
_ _________________________ _____ | | PASTEO | | |_|_________________________|_____| 0 1 26 31Primary-ASTE Origin (PASTEO): Bits 1-25 of control register 5, with six zeros appended on the right, form a 31-bit real address that designates the beginning of the primary ASN-second-table entry. Access-register translation may obtain the primary-space access-list designation from the primary ASTE. The primary-ASTE origin is set by LOAD ADDRESS SPACE PARAMETERS when it performs PASN translation and by the space-switching forms of PROGRAM CALL, PROGRAM RETURN, and PROGRAM TRANSFER. When any of these instructions places the primary-ASTE origin in control register 5, it also places zeros in bit positions 0 and 26-31 of control register 5.
When the ASF control is zero, LOAD ADDRESS SPACE PARAMETERS, PROGRAM CALL, and PROGRAM TRANSFER treat control register 5 as containing the linkage-table designation. Access-register translation treats control register 5 as containing the primary-ASTE origin regardless of the value of the ASF control.
When control register 5 contains the primary-ASTE origin, bits 0 and 26-31 of the register are subject to possible future assignment, and they should not be depended upon to be zeros.
The extended authorization index is in control register 8. The register has the following format:
________________ ___ | EAX | |________________|___ 0 16Extended Authorization Index (EAX): Bits 0-15 of control register 8 are the extended authorization index. During access-register translation, the EAX may be compared against the access-list-entry authorization index (ALEAX) in an access-list entry, and it may be used as an index to locate a secondary bit in an authority table. The EAX may be set by a stacking PROGRAM CALL operation, and it is restored by PROGRAM RETURN.
There are sixteen 32-bit access registers numbered 0-15. The contents of an access register are called an access-list-entry token (ALET). An ALET has the following format:
_______ _ ________ ________________ |0000000|P| ALESN | ALEN | |_______|_|________|________________| 0 7 8 16 31Primary-List Bit (P): When the ALET is not 00000000 or 00000001 hex, bit 7 specifies the access list to be used by access-register translation. When bit 7 is zero, the dispatchable-unit access list is used; this is specified by the dispatchable-unit access-list designation in the dispatchable-unit control table designated by the contents of control register 2. When bit 7 is one, the primary-space access list is used; this is specified by the primary-space access-list designation in the primary ASTE designated by the contents of control register 5.
Access-List-Entry Sequence Number (ALESN): Bits 8-15 may be used as a check on whether the access-list entry designated by the ALET has been invalidated and reallocated since the ALET was obtained. During access-register translation when the ALET is not 00000000 or 00000001 hex, bits 8-15 of the ALET are compared against the access-list-entry sequence number (ALESN) in the designated access-list entry.
Access-List-Entry Number (ALEN): When the ALET is not 00000000 or 00000001 hex, bits 16-31 of the ALET designate an entry in either the dispatchable-unit access list or the primary-space access list, as determined by bit 7. The access-list designation that is used is called the effective access-list designation; it consists of the effective access-list origin and the effective access-list length.
During access-register translation, the ALEN, with four zeros appended on
Bits 0-6 must be zeros during access-register translation; otherwise, an ALET-specification exception is recognized.
When the ALET is 00000000 or 00000001 hex, it specifies the primary or secondary address space, respectively, and the above format does not apply.
Access register 0 usually is treated in access-register translation as containing 00000000 hex, and its actual contents are not examined; the access-register translation done as part of TEST ACCESS is the only exception. Access register 0 is also treated as containing 00000000 hex when it is designated by the B field of LOAD ADDRESS EXTENDED when PSW bits 16 and 17 are 01 binary. When access register 0 is specified for TEST ACCESS or as a source for COPY ACCESS, EXTRACT ACCESS, or STORE ACCESS MULTIPLE, the actual contents of the access register are used. Access register 0, like any other access register, can be loaded by COPY ACCESS, LOAD ACCESS MULTIPLE, LOAD ADDRESS EXTENDED, and SET ACCESS.
Another definition of ALETs 00000000 and 00000001 hex is given in "BRANCH IN SUBSPACE GROUP" in topic 10.3.
Access-register translation uses an address in the access-list entry to locate an ASN-second-table entry, and it may perform a one-level lookup to
When the ALET being translated is not 00000000 or 00000001 hex, access-register translation performs a two-level lookup to locate first the effective access-list designation and then an entry in the effective
| access list. The effective access-list designation resides in real
| storage. The effective access list resides in real or absolute storage.
Authority-table entries are described in "Authority-Table Entries" in topic 3.10.2. Access-list designations, access-list entries, and ASN-second-table entries are described in the following sections.
Subtopics:
The dispatchable-unit access-list designation (DUALD) is located in bytes 16-19 of a 64-byte area called the dispatchable-unit control table (DUCT). The DUCT resides in real storage, and its location is specified by the DUCT origin in control register 2.
When the ALET being translated is not 00000000 or 00000001 hex, access-register translation obtains the dispatchable-unit access-list designation if bit 7 of the ALET is zero, or it obtains the primary-space access-list designation if bit 7 is one. The obtained access-list designation is called the effective access-list designation.
The dispatchable-unit control table has the following format:
Hex Dec __________ ___________________ 0 0 | BASTEO | __________|_ _________________| |S| | 4 4 |A| SSASTEO | __________|_|_________________| 8 8 | | __________|___________________| C 12 | SSASTESN | __________|___________________| 10 16 | DUALD | __________|___________________| 14 20 | | 18 24 | | __________|___________________| 1C 28 |///////////////////| | __________|_ _________________| | 20 32 |A| Return Address | | __________|_|_______ ___ _ _ _| | | PSW Key |PSW|R| | | | 24 36 | Mask |Key|A| |P| | __________|_________|___|_|_|_| | 28 40 | | / / 3C 60 | | __________|___________________|The primary-space access-list designation (PSALD) is located in bytes 16-19 of a 64-byte area called the primary ASN-second-table entry. The primary ASTE resides in real storage, and its location is specified by the primary-ASTE origin in control register 5. The format of the primary ASTE is described in "Extended ASN-Second-Table Entries" in topic 5.8.3.3.Bytes 0-7 (BASTEO, SA, and SSASTEO) and 12-15 (SSASTESN) of the DUCT are described in "Subspace-Group Dispatchable-Unit Control Table" in | topic 5.9.1.1. Bytes 32-39 (A, return address, PSW key mask, PSW key, RA, | and P) are described in "BRANCH AND SET AUTHORITY" in topic 10.1. Bytes | 8-11, 20-27, and 40-63 are reserved for possible future extensions and should contain all zeros. Bytes 28-31 are available for use by programming.
The dispatchable-unit and primary-space access-list designations both have the same format.
There are two possible formats of the access-list designation, called format 0 and format 1. A model implements one or the other of these two formats but not both; that is, the access-list-designation format that is available is model-dependent, and no control is provided by which the program can specify the format. A model provides no special indication of the format that it implements.
The two possible formats of the access-list designation are as follows.
Format-0 Access-List Designation _ ________________________ _______ | | Access-List Origin | ALL | |_|________________________|_______| 0 1 25 31
The fields in the format-0 access-list designation are allocated as follows:Access-List Origin: Bits 1-24 of the format-0 access-list designation, with seven zeros appended on the right, form a 31-bit address that
Access-List Length (ALL): Bits 25-31 of the format-0 access-list designation specify the length of the access list in units of 128 bytes, thus making the length of the access list variable in multiples of eight 16-byte entries. The length of the access list, in units of 128 bytes, is one more than the value in bit positions 25-31. The access-list length, with six zeros appended on the left, is compared against bits 0-12 of an access-list-entry number (bits 16-28 of an access-list-entry token) to determine whether the access-list-entry number designates an entry in the access list.
Bit 0 is reserved for a possible future extension and should be zero.
Format-1 Access-List Designation _ _______________________ ________ | | Access-List Origin | ALL | |_|_______________________|________| 0 1 24 31
The fields in the format-1 access-list designation are allocated as follows:Access-List Origin: Bits 1-23 of the format-1 access-list designation, with eight zeros appended on the right, form a 31-bit address that
Access-List Length (ALL): Bits 24-31 of the format-1 access-list designation specify the length of the access list in units of 256 bytes, thus making the length of the access list variable in multiples of sixteen 16-byte entries. The length of the access list, in units of 256 bytes, is one more than the value in bit positions 24-31. The access-list length, with four zeros appended on the left, is compared against bits 0-11 of an access-list-entry number (bits 16-27 of an access-list-entry token) to determine whether the access-list-entry number designates an entry in the access list.
Bit 0 is reserved for a possible future extension and should be zero.
Programming Note: The maximum number of access-list entries allowed by a format-0 or format-1 access-list designation is 1,024 or 4,096, respectively. There are two access lists available for use at any time. Therefore, if a model implements the format-0 access-list designation, a maximum of 2,048 2G-byte address spaces can be addressable without control-program intervention, which is a total of 4T bytes; and if a model implements the format-1 access-list designation, a maximum of 8,192 2G-byte address spaces can be addressable without control-program intervention, which is a total of 16T bytes.
The effective access list is the dispatchable-unit access list if bit 7 of the ALET being translated is zero, or it is the primary-space access list if bit 7 is one. The entry fetched from the effective access list is 16 bytes in length and has the following format:
_ ___ _ _ ________ ________________ | | |F| | | | |I| |O|P| ALESN | ALEAX | |_|___|_|_|________|________________| 0 1 6 7 8 16 31 ___________________________________ | | |___________________________________| 32 63 _ __________________________ ______ | | ASTE Address | | |_|__________________________|______| 64 90 95 ___________________________________ | ASTESN | |___________________________________| 96 127
The fields in the access-list entry are allocated as follows:ALEN-Invalid Bit (I): Bit 0, when zero, indicates that the access-list entry specifies an address space. When bit 0 is one during access-register translation, an ALEN-translation exception is recognized.
Fetch-Only Bit (FO): Bit 6 controls which types of operand references are permitted to the address space specified by the access-list entry. When bit 6 is zero, both fetch-type and store-type references are permitted. When bit 6 is one, only fetch-type references are permitted, and an attempt to store causes a protection exception for access-list-controlled protection to be recognized and the operation to be suppressed.
Private Bit (P): Bit 7, when zero, specifies that any program is authorized to use the access-list entry in access-register translation. When bit 7 is one, authorization is determined as described for bits 16-31.
Access-List-Entry Sequence Number (ALESN): Bits 8-15 are compared against the ALESN in the ALET during access-register translation. Inequality causes an ALE-sequence exception to be recognized. It is intended that the control program change bits 8-15 each time it reallocates the access-list entry.
Access-List-Entry Authorization Index (ALEAX): Bits 16-31 may be used to determine whether the program for which access-register translation is being performed is authorized to use the access-list entry. The program is authorized if any of the following conditions is met:
ASN-Second-Table-Entry (ASTE) Address: Bits 65-89, with six zeros
appended on the right, form the 31-bit real address of the ASTE for the specified address space. Access-register translation obtains the segment-table designation for the address space from the ASTE.ASTE Sequence Number (ASTESN): Bits 96-127 may be used to revoke the addressing capability represented by the access-list entry. Bits 96-127 are compared against an ASTE sequence number (ASTESN) in the designated ASTE during access-register translation.
Bits 1-6, 32-64, and 90-95 are reserved for possible future extensions and should be zeros.
In both the dispatchable-unit access list and the primary-space access list, access-list entries 0 and 1 are intended not to be used in access-register translation. Bits 1-127 of access-list entry 0 and bits 1-63 of access-list entry 1 are reserved for possible future extensions and should be zeros. Bit 0 of access-list entries 0 and 1, and bits 64-127 of access-list entry 1, are available for use by programming. The control program should set bit 0 of access-list entries 0 and 1 to one in order to prevent the use of these entries by means of ALETs in which the ALEN is 0 or 1.
When the ASF control is one, the length of each entry in the ASN second table is extended from 16 bytes to 64 bytes when the table is used in ASN translation. Also, the ASN second table begins on a 64-byte boundary instead of a 16-byte boundary. Access-register translation, which does not involve ASN translation, always treats the ASN-second-table entry as being 64 bytes on a 64-byte boundary, and access-register translation does not examine the ASF control. The first 32 bytes of the 64-byte ASTE have the following format:
_ ___________________________ _ _ |I| ATO |0|B| |_|___________________________|_|_| 0 1 30 31 _______________ ____________ ____ | AX | ATL |0000| |_______________|____________|____| 32 48 60 63 _______________STD_______________ _ ______________ __ _ _ _ _______ |X| STO | |G|P|S| STL | |_|______________|__|_|_|_|_______| 64 84 86 89 95 _______________LTD_______________ _ ________________________ ______ |V| LTO | LTL | |_|________________________|______| 96 121 127 __________Format-0 ALD___________ _ _______________________ _______ | | ALO | ALL | |_|_______________________|_______| 128 153 159 __________Format-1 ALD___________ _ ______________________ ________ | | ALO | ALL | |_|______________________|________| 128 152 159 _________________________________ | ASTESN | |_________________________________| 160 191 _________________________________ | | |_________________________________| 192 223 _________________________________ |/////////////////////////////////| |_________________________________| 224 255
The fields in bit positions 0-127 of the ASTE are defined with respect to certain mechanisms and instructions in "ASN-Second-Table Entries" in topic 3.9.2.2. The fields in the ASTE are defined with respect to the BRANCH IN SUBSPACE GROUP instruction in "Subspace-Group ASN-Second-Table Entries" in topic 5.9.1.2. With respect to access-register translation only, and only for an instruction other than BRANCH IN SUBSPACE GROUP, the fields in the ASTE are allocated as follows:ASX-Invalid Bit (I): Bit 0 controls whether the address space associated with the ASTE is available. When bit 0 is zero, access-register translation proceeds. When the bit is one, an ASTE-validity exception is recognized.
Authority-Table Origin (ATO): Bits 1-29, with two zeros appended on the right, form a 31-bit address that designates the beginning of the
Base-Space Bit (B): Bit 31 is ignored during access-register translation if the subspace-group facility is installed and the ASF control is one. If the subspace-group facility is not installed or the ASF control is zero, bit 31 must be zero; otherwise, an ASN-translation-specification exception may be recognized. Bit 31 is further described in "Subspace-Group ASN-Second-Table Entries" in topic 5.9.1.2.
Authorization Index (AX): Bits 32-47 are not used in access-register translation.
Authority-Table Length (ATL): Bits 48-59 specify the length of the authority table in units of four bytes, thus making the authority table variable in multiples of 16 entries. The length of the authority table, in units of four bytes, is one more than the ATL value. The contents of the ATL field are used to establish whether the entry designated by a particular EAX falls within the authority table. An extended-authority exception is recognized if the entry does not fall within the table.
Segment-Table Designation (STD): Bits 65-95 are obtained as the result of access-register translation and are used by DAT to translate the logical address for the storage-operand reference being made. Bit 64, the space-switch-event control, is not used in or as a result of access-register translation.
Linkage-Table Designation (LTD): Bits 96-127 are not used in access-register translation.
Access-List Designation (ALD): When this ASTE is designated by the primary-ASTE origin in control register 5, bits 128-159 are the primary-space access-list designation (PSALD). During access-register translation when the primary-list bit, bit 7, in the ALET being translated is one, the PSALD is the effective access-list designation. The PSALD is a format-0 ALD or a format-1 ALD, depending on the model.
ASN-Second-Table-Entry Sequence Number (ASTESN): Bits 160-191 are used to control revocation of the accessing capability represented by access-list entries that designate the ASTE. During access-register translation, bits 160-191 are compared against the ASTESN in the access-list entry, and inequality causes an ASTE-sequence exception to be recognized. It is intended that the control program change the value of bits 160-191 when the authorization policies for the address space specified by the ASTE change or when the ASTE is reassigned to specify another address space.
Bits 30, 31, and 60-63 must be zeros during access-register translation if the authority table is to be accessed; otherwise, an ASN-translation-specification exception may be recognized.
Bits 84, 85, 128, and 192-223 are reserved for possible future extensions and should be zeros. Bits 224-255 are available for use by programming. The second 32 bytes of the 64-byte ASTE also are reserved for possible future extensions and should contain all zeros.
This section describes the access-register-translation process as it is performed during a storage-operand reference in the access-register mode. LOAD REAL ADDRESS when PSW bits 16 and 17 are 01 binary, TEST ACCESS in any translation mode, and TEST PROTECTION in the access-register mode, perform access-register translation the same as described here, except that the following exceptions cause a setting of the condition code instead of being treated as program-interruption conditions:
Access-register translation operates on the access register designated in a storage-operand reference in order to obtain a segment-table designation for use by DAT. When one of access-registers 1-15 is designated, the access-list-entry token (ALET) that is in the access register is used to obtain the segment-table designation. When access register 0 is designated, an ALET having the value 00000000 hex is used, except that TEST ACCESS uses the actual contents of access register 0.
When the ALET is 00000000 or 00000001 hex, the primary or secondary segment-table designation, respectively, is obtained.
When the ALET is other than 00000000 or 00000001 hex, the leftmost seven bits of the ALET are checked for zeros, the primary-list bit in the ALET and the contents of control register 2 or 5 are used to obtain the effective access-list designation, and the access-list entry number (ALEN) in the ALET is used to select an entry in the effective access list.
The access-list entry is checked for validity and for containing the correct access-list-entry sequence number (ALESN).
The ASN-second-table entry (ASTE) addressed by the access-list entry is checked for validity and for containing the correct ASN-second-table-entry sequence number (ASTESN).
Whether the program is authorized to use the access-list entry is determined through the use of one or more of: (1) the private bit and access-list-entry authorization index (ALEAX) in the access-list entry, (2) the extended authorization index (EAX) in control register 8, and (3) an entry in the authority table addressed by the ASN-second-table entry.
If a store-type reference is to be performed, the fetch-only bit in the access-list entry is checked for being zero.
When no exceptions are recognized, the segment-table designation in the ASN-second-table entry is obtained.
The principal features of access-register translation, including the effect of the ALB, are shown in Figure 5-9.
Access-List Designation ALET in Access Register Control Register 1 _ ________________ ____ _ ____ _ _____ __________ _________________ | | ALO |ALL |____|1| | |P|ALESN| ALEN | | PSTD | |_|________ _______|____| |_| |____|_|__ __|____ _____| |________ ________| | | | | __________| | | ____________| | ___________________________________________|_______| | | | | | Control Register 7 | |_____________________ | _________________ | _ Access List | | | SSTD | |_ÿ|+| __________________________________________________ | | |________ ________| | | | | | | | | | | | | ________| | |_ _ _ _____ _____ __________ __________ __________| | | | | | |F| | | | | | | | | | |__ÿ|I|O|P|ALESN|ALEAX| |ASTE Addr.| ASTESN | | | | |_| | |____ |__ __|__________|_____ ____|____ _____| | | | | | | | | | | | | | | |__|_|_____|___|___________________|_________|_____| | | | | | | | | | | ______ ____ | | | | ____ | | | |=0 if | | =0?||___|___________________|_________|______ÿ| =? |__| | | |store?| |____| | | | |____| | | |______| | | | | | CR 8 | | | | | _______ _______ | | | | | | EAX | | | | | | | |___ ___|_______| | | | | | | | | | | | | ____ | | | ____ | | ___|____ÿ| =? |______| | |____ÿ| =? |___ | | | |____| | |____| | | | | | | | | | _____________________________________| | | | | | | | | | | ASN-Second-Table Entry | | | | | _ _____________ ______ ______ ____________ __________ _____|____ __/ | | | |_ÿ |I| ATO | | ATL | STD | | ASTESN | | | | |_|_____ _______|______|______|_____ ______|__________|__________|__/ | | |_______ | | | | | |(x 4) |________________________________ | | _______|________| _________ | |(x 1/4) _ | | _____________ | |2|____ÿ| ALB |___________________ÿ| 3 | | _ Authority Table |_| | | |______ ______| |_____ÿ|+| ___ |_________| | | | | | | |_ _| _____________ |__ÿ|P|S| |Obtained STD | |_|_| |_____________| | | |___|Explanation:
_ The appropriate ALD is obtained: |1| When P in the ALET is zero (and the ALET is not zero or one), the DUALD in the DUCT is obtained. |_| When P in the ALET is one, the PSALD in the primary ASTE is obtained.
_ 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.
_ The appropriate STD is obtained: |3| When the ALET is zero, the PSTD in CR 1 is obtained. |_| When the ALET is one, the SSTD in CR 7 is obtained. When the ALET is larger than one: If a match exists, the STD from the ALB is used. | If no match exists, tables from real or absolute storage are fetched. The resulting STD from the | ASTE is obtained, and entries may be formed in the ALB.
Figure 5-9. Access-Register Translation
Subtopics:
When one of access registers 1-15 is designated, or for the access register designated by the R1 field of TEST ACCESS, access-register translation uses the access-list-entry token (ALET) that is in the access register. When access register 0 is designated, except for TEST ACCESS, an ALET having the value 00000000 hex is used, and the contents of access register 0 are not examined.
When the ALET being translated is 00000000 hex, the primary segment-table designation in control register 1 is obtained. When the ALET is 00000001 hex, the secondary segment-table designation in control register 7 is obtained. In each of these two cases, access-register translation is completed.
When the ALET being translated is other than 00000000 or 00000001 hex, bits 0-6 of the ALET are checked for being all zeros. If bits 0-6 are not all zeros, an ALET-specification exception is recognized, and the operation is suppressed.
When bit 7 is zero, the real address of the dispatchable-unit ALD is obtained by appending six zeros on the right to the DUCT origin, bits 1-25 of control register 2, and adding 16. The addition cannot cause a carry into bit position 0. The result is a 31-bit real address.
The primary-list bit, bit 7, in the ALET is used to perform a lookup to obtain the effective access-list designation. When bit 7 is zero, the effective ALD is the dispatchable-unit ALD located in bytes 16-19 of the dispatchable-unit control table (DUCT). When bit 7 is one, the effective ALD is the primary-space ALD located in bytes 16-19 of the primary ASN-second-table entry (primary ASTE).
When bit 7 is one, the real address of the primary-space ALD is obtained by appending six zeros on the right to the primary-ASTE origin, bits 1-25 of control register 5, and adding 16. The addition cannot cause a carry into bit position 0. The result is a 31-bit real address.
The obtained 31-bit real address is used to fetch the effective ALD--either the dispatchable-unit ALD or the primary-space ALD, depending on bit 7 of the ALET. The fetch of the effective ALD appears to be word-concurrent, as observed by other CPUs, and is not subject to protection. When the storage address that is generated for fetching the effective ALD refers to a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed. When the primary-space ALD is fetched, bit 0, the ASX-invalid bit, and bits 30, 31, and 60-63 in the primary ASTE are ignored.
The access-list-entry-number (ALEN) portion of the ALET is used to select an entry in the effective access list. If the format-0 ALD is
A lookup in the effective access list is performed. The effective access list is the dispatchable-unit access list if bit 7 of the ALET is zero, or
| it is the primary-space access list if bit 7 is one. The effective access
| list is treated unpredictably as being in either real or absolute storage.
As part of the access-list-lookup process if the format-0 ALD is implemented, the leftmost 13 bits of the ALEN are compared against the effective access-list length, bits 25-31 of the effective ALD, to establish whether the addressed entry is within the access list. For this comparison, the access-list length is extended with six leftmost zeros. If the value formed from the access-list length is less than the value in the 13 leftmost bits of the ALEN, an ALEN-translation exception is recognized, and the operation is nullified. If the format-1 ALD is implemented, the leftmost 12 bits of the ALEN are compared against bits 24-31 of the effective ALD. For this comparison, the access-list length is extended with four leftmost zeros. If the value formed from the access-list length is less than the value in the 12 leftmost bits of the ALEN, an ALEN-translation exception is recognized, and the operation is nullified.
Bit 0 of the access-list entry indicates whether the access-list entry specifies an address space by designating an ASN-second-table entry. This bit is inspected, and, if it is one, an ALEN-translation exception is recognized, and the operation is nullified.
When bit 0 is zero, the access-list-entry sequence number (ALESN) in bit positions 8-15 of the access-list entry is compared against the ALESN in the ALET to determine whether the ALET designates the conceptually correct access-list entry. Inequality causes an ALE-sequence exception to be recognized and the operation to be nullified.
The 64-byte ASTE is fetched by using the real address. The fetch of the entry appears to be word-concurrent as observed by other CPUs, with the leftmost word fetched first. The order in which the remaining words are fetched is unpredictable. The fetch access is not subject to protection. When the storage address that is generated for fetching the ASTE refers to a location which is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
The ASN-second-table-entry (ASTE) address in the access-list entry is used to locate the ASTE. Bits 65-89 of the access-list entry, with six zeros appended on the right, form the 31-bit real address of the ASTE.
Bit 0 of the ASTE indicates whether the ASTE specifies an address space. This bit is inspected, and, if it is one, an ASTE-validity exception is recognized, and the operation is nullified.
When bit 0 is zero, the ASTE sequence number (ASTESN) in bit positions 160-191 of the ASTE is compared against the ASTESN in bit positions 96-127 of the access-list entry to determine whether the addressing capability represented by the access-list entry has been revoked. Inequality causes an ASTE-sequence exception to be recognized and the operation to be nullified.
When the private bit is zero, the program is authorized, and the authorization step of access-register translation is completed.
The private bit, bit 7, in the access-list entry is used to determine whether the program is authorized to use the access-list entry. The access-list-entry authorization index (ALEAX) in bit positions 16-31 of the access-list entry, the extended authorization index (EAX) in bit positions 0-15 of control register 8, and the authority table designated by the ASTE may also be used.
When the private bit is one but the ALEAX is equal to the EAX, the program is authorized, and the authorization step of access-register translation is completed.
When the private bit is one and the ALEAX is not equal to the EAX, bits 30, 31, and 60-63 of the ASTE must be zeros; otherwise, an ASN-translation-specification exception may be recognized, which would cause the operation to be suppressed. A one value of bit 31 does not cause an exception to be recognized if the subspace-group facility is installed and the ASF control is one.
When the private bit is one and the ALEAX is not equal to the EAX, a process called the extended-authorization process is performed. Extended authorization uses the EAX to select an entry in the authority table designated by the ASTE, and it tests the secondary-authority bit in the selected entry for being one. The program is authorized if the tested bit is one.
Extended authorization is the same as the secondary-ASN-authorization process described in "Linkage-Table Designation (LTD)" in topic 3.9.2.2, except as follows:
If a store-type reference is to be performed and the fetch-only bit, bit 6, in the access-list entry is one, a protection exception is recognized, and the operation is suppressed.
When the ALET being translated is other than 00000000 or 00000001 hex and no exception is recognized in the steps described above, access-register translation obtains the segment-table designation from bit positions 65-95 of the ASTE. Bit 64 of the ASTE, the space-switch-event control, is ignored.
Programming Note: When updating an access-list entry or ASN-second-table entry, the program should change the entry from invalid to valid (set bit 0 of the entry to zero) as the last step of the updating. This ensures, because the leftmost word is fetched first, that words of a partially updated entry will not be fetched.
The exceptions which can be encountered during the access-register-translation process and their priority are shown in the section "Access Exceptions" in Chapter 6, "Interruptions."
To enhance performance, the access-register-translation (ART) mechanism normally is implemented such that access-list designations and information specified in access lists, ASN second tables, and authority tables are maintained in a special buffer, referred to as the ART-lookaside buffer (ALB). Access-list designations, access-list entries, ASN-second-table entries, and authority-table entries are collectively referred to as ART-table entries. The CPU necessarily refers to an ART-table entry in
Entries within the ALB are not explicitly addressable by the program.
Information is not necessarily retained in the ALB under all conditions for which such retention is possible. Furthermore, information in the ALB may be cleared under conditions additional to those for which clearing is mandatory.
Subtopics:
The description of the logical structure of the ALB covers the implementation by all systems operating as defined by ESA/390. The ALB entries are considered as being of four types: ALB access-list designations (ALB ALDs), ALB access-list entries (ALB ALEs), ALB ASN-second-table entries (ALB ASTEs), and ALB authority-table entries (ALB ATEs). An ALB entry is considered as containing within it both the
| information obtained from the ART-table entry in real or absolute storage
| and the attributes used to fetch the ART-table entry from real or absolute storage. There is not an indication in an ALB ALD of whether the ALD-source origin used to select the ALD in real storage was the dispatchable-unit-control-table origin or the primary-ASTE origin.
The attached state of an ART-table entry denotes that the CPU to which the entry is attached can attempt to use the entry for access-register translation. The ART-table entry may be attached to more than one CPU at a time.
The formation of ALB entries and the effect of any manipulation of an ART-table entry in real storage by the program depend on whether the ART-table entry is attached to a particular CPU and on whether the entry is valid.
An access-list entry or ASN-second-table entry is valid when the invalid bit associated with the entry is zero. Access-list designations and authority-table entries have no invalid bit and are always valid. The primary-space access-list designation is valid regardless of the value of the invalid bit in the primary ASTE.
An ART-table entry may be placed in the ALB whenever the entry is attached and valid.
An access-list designation is attached to a CPU when the designation is within the dispatchable-unit control table specified by the dispatchable-unit-control-table origin in control register 2 or is within the primary ASTE specified by the primary-ASTE origin in control register 5. Control register 5 is considered to contain the primary-ASTE origin regardless of the value of the address-space-function (ASF) control, bit 15 of control register 0; however, see the note below.
An access-list entry is attached to a CPU when the entry is within the access list specified by either an ALB ALD or an attached ALD.
An ASN-second-table entry is attached to a CPU when it is designated by the ASTE address in either an ALB ALE or an attached and valid ALE.
An authority-table entry is attached to a CPU when it is within the authority table designated by either an ALB ASTE or an attached and valid ASTE.
Note: During the execution of a PROGRAM CALL, PROGRAM TRANSFER, or LOAD ADDRESS SPACE PARAMETERS instruction that loads control register 5 when the ASF control is zero, an unpredictable access-list-designation (ALD) may be placed in the ALB. This unpredictable ALB ALD may then be used at any time to place other entries (ALE, ASTE, and ATE) in the ALB. If access-register translation uses any of these erroneous ALB entries, the results are unpredictable. These specific erroneous entries are removed from the ALB either by clearing the entire ALB or by the execution of (1) a PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, or LOAD ADDRESS SPACE PARAMETERS instruction that loads control register 5 when the ASF control is one, or (2) a LOAD CONTROL instruction that loads control register 5, regardless of the value of the ASF control.
When an attached and valid ART-table entry is changed, and when, before the ALB is cleared of copies of that entry, an attempt is made to perform ART requiring that entry, unpredictable results may occur, to the following extent. The use of the new value may begin between instructions or during the execution of an instruction, including the instruction that caused the change. Moreover, until the ALB is cleared of copies of the entry, the ALB may contain both the old and the new values, and it is unpredictable whether the old or new value is selected for a particular ART operation. If the old and new values are used as representations of effective space designations, failure to recognize that the effective space designations are the same may occur, with the result that operand overlap may not be recognized. Effective space designations and operand overlap are discussed in "Interlocks within a Single Instruction" in topic 5.13.4.2.
When an attached but invalid ART-table entry is made valid, or when an unattached but valid ART-table entry is made attached, and no entry formed from the ART-table entry is already in the ALB, the change takes effect no later than the end of the current instruction.
When LOAD ACCESS MULTIPLE or LOAD CONTROL changes the parameters associated with ART, the values of these parameters at the start of the operation are in effect for the duration of the operation.
All entries are cleared from the ALB by the execution of PURGE ALB and SET PREFIX and by CPU reset.
The subspace-group facility provides the BRANCH IN SUBSPACE GROUP instruction, new allocations of fields in the segment-table designation, dispatchable-unit control table, and extended ASN-second-table entry, and new operations, called subspace-replacement operations, of the PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, SET SECONDARY ASN, and LOAD ADDRESS SPACE PARAMETERS instructions. BRANCH IN SUBSPACE GROUP is introduced in "Subroutine Linkage without the Linkage Stack" in topic 5.3.3 and described in detail in "BRANCH IN SUBSPACE GROUP" in topic 10.3.
Subtopics:
This section describes the use of the dispatchable-unit control table and ASN-second-table entry by the subspace-group facility.
Subtopics:
The dispatchable-unit control table has the following format when the subspace-group facility is installed:
Hex Dec __________ ___________________ 0 0 | BASTEO | __________|_ _________________| |S| | 4 4 |A| SSASTEO | __________|_|_________________| 8 8 | | __________|___________________| C 12 | SSASTESN | __________|___________________| 10 16 | DUALD | __________|___________________| 14 20 | | 18 24 | | __________|___________________| 1C 28 |///////////////////| __________|___________________| 20 32 | | / / 3C 60 | | __________|___________________|Base-ASTE Origin (BASTEO): Bits 1-25 of bytes 0-3, with six zeros appended on the right, form a 31-bit real address that designates the beginning of the ASN-second-table entry that specifies the base space of a subspace group associated with the dispatchable unit. A comparison of bits 1-25 of bytes 0-3 to the primary-ASTE origin (PASTEO) in control register 5 is made by BRANCH IN SUBSPACE GROUP to determine whether the current primary address space is in the subspace group for the current dispatchable unit. For this comparison, either bits 1-25 may be compared to the PASTEO or the entire contents of bytes 0-3 may be compared to the entire contents of control register 5. A comparison of bits 1-25 of bytes 0-3 to the destination-ASTE origin (DASTEO) obtained from an access-list entry by access-register translation of an ALET other than ALETs 0 and 1 is made by BRANCH IN SUBSPACE GROUP to determine if the destination ASTE is the base-space ASTE. For this comparison, either bits 1-25 may be compared to the DASTEO or the entire contents of bytes 0-3 may be compared to the DASTEO with one leftmost and six rightmost zeros appended. A comparison of bits 1-25 of bytes 0-3 to an ASTE origin (ASTEO) obtained by ASN translation may be made by PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, SET SECONDARY ASN, and LOAD ADDRESS SPACE PARAMETERS. For this comparison, either bits 1-25 may be compared to the ASTEO or the entire contents of bytes 0-3 may be compared to the ASTEO with one leftmost and six rightmost zeros appended. When BRANCH IN SUBSPACE GROUP uses ALET 0, bits 1-25 of bytes 0-3, with six zeros appended on the right, designate the destination ASTE.The fields in the dispatchable-unit control table are allocated as follows:
Subspace-Active Bit (SA): Bit 0 of bytes 4-7 indicates, when one, that the last BRANCH IN SUBSPACE GROUP instruction executed for the dispatchable unit transferred control to a subspace of the subspace group associated with the dispatchable unit. Bit 0 being zero indicates any one of the following: the last BRANCH IN SUBSPACE GROUP instruction executed for the dispatchable unit transferred control to the base space of the subspace group, BRANCH IN SUBSPACE GROUP has not yet been executed for the dispatchable unit, or the dispatchable unit is not associated with a subspace group. BRANCH IN SUBSPACE GROUP sets bit 0 of bytes 4-7 to one when it transfers control to a subspace of the subspace group associated with the dispatchable unit, and it sets bit 0 to zero when it transfers control to the base space of the subspace group.
Subspace-ASTE Origin (SSASTEO): Bits 1-25 of bytes 4-7, with six zeros appended on the right, form a 31-bit real address that designates the beginning of the ASN-second-table entry that specifies the subspace last given control by a BRANCH IN SUBSPACE GROUP instruction executed for the dispatchable unit. When BRANCH IN SUBSPACE GROUP transfers control to a subspace by means of an ALET other than ALET 1, it places the ASTEO for the subspace (the destination ASTEO) in bit positions 1-25 of bytes 4-7, places zeros in bit positions 26-31 of bytes 4-7, and sets the subspace-active bit, bit 0 of bytes 4-7, to one. When BRANCH IN SUBSPACE GROUP uses ALET 1 to transfer control to a subspace, bits 1-25 of bytes 4-7, with six zeros appended on the right, designate the destination ASTE, and BRANCH IN SUBSPACE GROUP sets the subspace-active bit to one and either sets bits 26-31 of bytes 4-7 to zeros or leaves those bits unchanged. However, if bits 1-25 are all zeros, a special-operation exception is recognized. When BRANCH IN SUBSPACE GROUP transfers control to the base space of the subspace group, it sets the subspace-active bit to zero, and bits 1-31 of bytes 4-7 remain unchanged. Bits 1-25 of bytes 4-7 may be used by PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, SET SECONDARY ASN, and LOAD ADDRESS SPACE PARAMETERS to set bits 1-23 and 25-31 of the primary STD in control register 1 or the secondary STD in control register 7 from the same bits of the STD in the subspace ASTE.
Subspace-ASTE Sequence Number (SSASTESN): Bytes 12-15 may be used to revoke the linkage capability represented by the SSASTEO, bits 1-25 of bytes 4-7, in the DUCT. When BRANCH IN SUBSPACE GROUP transfers control to a subspace by means of an ALET other than ALET 1, it obtains the ASTESN in the subspace ASTE and places it in bytes 12-15. When BRANCH IN SUBSPACE GROUP uses ALET 1 to transfer control to a subspace, it compares bytes 12-15 to the ASTESN in the subspace ASTE, and it recognizes an ASTE-sequence exception if they are unequal. When the SSASTEO is used by PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, SET SECONDARY ASN, and LOAD ADDRESS SPACE PARAMETERS to set bits 1-23 and 25-31 of the primary STD in control register 1 or the secondary STD in control register 7 from the same bits of the STD in the subspace ASTE, those instructions first compare bytes 12-15 to the ASTESN in the subspace ASTE, and they recognize an ASTE-sequence exception if the two fields are unequal.
Dispatchable-Unit Access-List Designation (DUALD): Bytes 16-19 are described in "Access-List Designations" in topic 5.8.3.1.
Bytes 8-11, 20-27, and 32-63 are reserved for possible future extensions and should contain all zeros. Bytes 28-31 are available for use by programming.
When the ASF control is one, the length of each entry in the ASN second table is extended from 16 bytes to 64 bytes when the table is used in ASN translation. Also, the ASN second table begins on a 64-byte boundary instead of a 16-byte boundary. Access-register translation, which does not involve ASN translation, always treats the ASN-second-table entry as being 64 bytes on a 64-byte boundary, and access-register translation does not examine the ASF control. BRANCH IN SUBSPACE GROUP requires that the ASF control be one. The first 32 bytes of the 64-byte ASTE have the following format:
_ ___________________________ _ _ |I| ATO |0|B| |_|___________________________|_|_| 0 1 30 31 _______________ ____________ ____ | AX | ATL |0000| |_______________|____________|____| 32 48 60 63 _______________STD_______________ _ ______________ __ _ _ _ _______ |X| STO | |G|P|S| STL | |_|______________|__|_|_|_|_______| 64 84 86 89 95 _______________LTD_______________ _ ________________________ ______ |V| LTO | LTL | |_|________________________|______| 96 121 127 __________Format-0 ALD___________ _ _______________________ _______ | | ALO | ALL | |_|_______________________|_______| 128 153 159 __________Format-1 ALD___________ _ ______________________ ________ | | ALO | ALL | |_|______________________|________| 128 152 159 _________________________________ | ASTESN | |_________________________________| 160 191 _________________________________ | | |_________________________________| 192 223 _________________________________ |/////////////////////////////////| |_________________________________| 224 255
The fields in bit positions 0-127 of the ASTE are defined with respect to certain mechanisms and instructions in "ASN-Second-Table Entries" in topic 3.9.2.2. The fields in the ASTE are defined for access-register translation for other than BRANCH IN SUBSPACE GROUP in "Extended ASN-Second-Table Entries" in topic 5.8.3.3. For BRANCH IN SUBSPACE GROUP only, the fields in the ASTE are allocated as follows:ASX-Invalid Bit (I): Bit 0 controls whether the address space associated with the ASTE is available. When bit 0 is zero during access-register translation of ALET 1 or an ALET other than 0 and 1 for BRANCH IN SUBSPACE GROUP, the translation proceeds. When the bit is one, an ASTE-validity exception is recognized. The bit is ignored during access-register translation of ALET 0. When the ASTE is designated by a subspace-ASTE origin (SSASTEO) in a dispatchable-unit control table, bit 0 is also used as described in the definition of bits 160-191 (ASTESN).
Authority-Table Origin (ATO): Bits 1-29 are not used by BRANCH IN SUBSPACE GROUP.
Base-Space Bit (B): Bit 31 specifies, when one, that the address space associated with the ASTE is the base space of a subspace group. When BRANCH IN SUBSPACE GROUP uses an ALET other than ALETs 0 and 1 to locate a destination ASTE, it recognizes a special-operation exception if the destination-ASTE origin does not equal the base-ASTE origin in the dispatchable-unit control table and bit 31 is one in the destination ASTE.
Authorization Index (AX): Bits 32-47 are not used by BRANCH IN SUBSPACE GROUP.
Authority-Table Length (ATL): Bits 48-59 are not used by BRANCH IN SUBSPACE GROUP.
Segment-Table Designation (STD): Bits 64-95 are obtained as the result of access-register translation done for BRANCH IN SUBSPACE GROUP. When BRANCH IN SUBSPACE GROUP uses an ALET other than ALETs 0 and 1 to locate a destination ASTE, it recognizes a special-operation exception if the destination-ASTE origin does not equal the base-ASTE origin in the dispatchable-unit control table and the subspace-group-control bit, bit 86 (G), in the destination ASTE is zero. When BRANCH IN SUBSPACE GROUP transfers control to the base space of a subspace group associated with the current dispatchable unit, it places bits 64-95 in control register 1; otherwise, when BRANCH IN SUBSPACE GROUP transfers control to a subspace of the subspace group, it places bits 65-87 and 89-95 in the corresponding bit positions of control register 1. Bits 64-95 are used after ASN translation by PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, SET SECONDARY ASN, and LOAD ADDRESS SPACE PARAMETERS as described in "ASN-Second-Table Entries" in topic 3.9.2.2.
Linkage-Table Designation (LTD): Bits 96-127 are not used by BRANCH IN SUBSPACE GROUP.
Access-List Designation (ALD): When this ASTE is designated by the primary-ASTE origin in control register 5, bits 128-159 are the primary-space access-list designation (PSALD). During access-register translation when the primary-list bit, bit 7, in the ALET being translated is one, the PSALD is the effective access-list designation. The PSALD is a format-0 ALD or a format-1 ALD, depending on the model.
ASN-Second-Table-Entry Sequence Number (ASTESN): Bits 160-191 are used to control revocation of the accessing capability represented by access-list entries that designate the ASTE. During access-register translation, bits 160-191 are compared against the ASTESN in the access-list entry, and inequality causes an ASTE-sequence exception to be recognized.
When the ASTE is designated by a subspace-ASTE origin (SSASTEO) in a dispatchable-unit control table, bits 160-191 are also used to control revocation of the linkage capability represented by that SSASTEO. When BRANCH IN SUBSPACE GROUP uses ALET 1 to transfer control to the subspace specified by the SSASTEO, or when PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, SET SECONDARY ASN, or LOAD ADDRESS SPACE PARAMETERS uses the SSASTEO to set bits 1-23 and 25-31 of the primary STD in control register 1 or the secondary STD in control register 7 from the same bits of the STD in the subspace ASTE, those instructions first test bit 0 of the subspace ASTE for being zero and recognize an ASTE-validity exception if it is not, and they then compare bits 160-191 to the subspace-ASTE sequence number (SSASTESN) in the dispatchable-unit control table and recognize an ASTE-sequence exception if there is an inequality. However, when either of the two named exception conditions exists for LOAD ADDRESS SPACE PARAMETERS, the instruction sets condition code 1 or 2 instead of recognizing the exception.
Bits 84-85, 128, and 192-223 are reserved for possible future extensions and should be zeros. Bits 224-255 are available for use by programming. The second 32 bytes of the 64-byte ASTE also are reserved for possible future extensions and should contain all zeros.
The definitions of the subspace-replacement operations are included in the definitions of the five named instructions in Chapter 10, "Control Instructions." The operations are described in a general way as follows. Whenever an address space is established as the primary or secondary address space as a result of ASN translation, then, if that address space is in a subspace group, as indicated by the subspace-group-control bit, bit 22 (G), being one in the segment-table designation (STD) for the address space (the new PSTD in control register 1 or SSTD in control register 7), and if the dispatchable unit is subspace-active, as indicated by the subspace-active bit, bit 0 (SA) of word 1, in the dispatchable-unit control table (DUCT) being one, the ASN-second-table-entry (ASTE) origin (ASTEO) for the address space, which was obtained by ASN translation, is compared to the base-ASTE origin (BASTEO), bits 1-25 of word 0, in the DUCT. If that ASTEO and the BASTEO are equal, the following occurs. An ASTE-validity exception is recognized if bit 0 in the ASTE for the last subspace entered by the dispatchable unit, which ASTE is designated by the subspace-ASTE origin (SSASTEO) in the DUCT, is one. An ASTE-sequence exception is recognized if the ASTE-sequence number (ASTESN) in word 5 of the subspace ASTE does not equal the subspace ASTESN (SSASTESN) in word 3 of the DUCT. However, LOAD ADDRESS SPACE PARAMETERS sets a nonzero condition code instead of recognizing the ASTE-validity or ASTE-sequence exception. If no exception exists, bits 1-23 and 25-31 of the STD for the address space (the PSTD in control register 1 or SSTD in control register 7) are replaced by the same bits of the STD in word 2 of the subspace ASTE.
The subspace-group facility includes new operations, called subspace-replacement operations, of PROGRAM CALL, PROGRAM TRANSFER, PROGRAM RETURN, SET SECONDARY ASN, and LOAD ADDRESS SPACE PARAMETERS. The new operations apply when the dispatchable unit for which any of the five named instructions is executed is in a state called subspace active. A dispatchable unit is subspace active if it has used BRANCH IN SUBSPACE GROUP to transfer control to a subspace of its subspace group and has not subsequently used BRANCH IN SUBSPACE GROUP to return control to the base space of the group.
Whenever the address-space-function control, bit 15 of control register 0, is zero, the above additional general definition does not apply, and the definitions of the five instructions are the same as when the subspace-group facility is not installed.
If an addressing exception is recognized when attempting to access the DUCT or subspace ASTE, the instruction execution is suppressed. If an ASTE-validity or ASTE-sequence exception is recognized, the instruction execution is nullified. Such nullification or suppression causes all control register contents to remain unchanged from what they were at the beginning of the instruction execution.
Key-controlled protection does not apply to any accesses to the DUCT or subspace ASTE.
For comparing the ASTEO obtained by ASN translation to the BASTEO, either the ASTEO may be compared to the BASTEO or the ASTEO, with one leftmost and six rightmost zeros appended, may be compared to the entire contents of word 0 of the DUCT.
When the SSASTEO in the DUCT is used to access the subspace ASTE, no check is made for whether the SSASTEO is all zeros.
The references to the DUCT and subspace ASTE are word-concurrent single-access references. The words of the DUCT are accessed in no particular order. The words of the subspace ASTE are accessed in no particular order except that word 0 is accessed first.
The exceptions that can be recognized during a subspace-replacement operation are referred to collectively as the subspace-replacement exceptions and are listed in priority order in "Subspace-Replacement Exceptions" in topic 6.5.5.3.
Many of the functions related to the linkage stack are described in this section and in "Linkage-Stack Operations" in topic 5.12. Additionally, tracing of the stacking PROGRAM CALL instruction and of the PROGRAM RETURN instruction is described in Chapter 5, "Program Execution"; interruptions in Chapter 6, "Interruptions"; and the instructions in Chapter 10, "Control Instructions."
Subtopics:
These major functions are provided:
It is intended that a separate linkage stack be associated with and used by each dispatchable unit. The linkage stack for a dispatchable unit resides in the home address space of the dispatchable unit.
It is intended that a dispatchable unit's linkage stack be protected from the dispatchable unit by means of key-controlled protection. Key-controlled protection does not apply to the linkage-stack instructions that place information in or retrieve information from the linkage stack.
The linkage-stack functions are for use by programs considered to be semiprivileged, that is, programs which are executed in the problem state but which are authorized to use additional functions. With these authorization controls, a nonhierarchical organization of programs may be established, with each program in a sequence of calling and called programs having a degree of authority that is arbitrarily different from those of programs before or after it in the sequence. The range of functions available to each program, and the ability to transfer control from one program to another, are prescribed in tables that are managed by the control program.
The linkage-stack instructions, which are semiprivileged, are described in Chapter 10, "Control Instructions." They are:
Subtopics:
The stacking PROGRAM CALL and PROGRAM RETURN linkage operations can link programs residing in different address spaces and having different levels of authority. The execution state and the contents of the general registers and access registers are saved during the execution of stacking PROGRAM CALL and are partially restored during the execution of PROGRAM RETURN. A linkage stack provides an efficient means of saving and restoring both the execution state and the contents of registers during linkage operations. The availability of the linkage stack is controlled by the ASF control in control register 0. When the linkage stack is not available, these two linkage operations cannot be performed.
The use of the linkage stack permits programs operating at arbitrarily different levels of authority to be linked directly without the intervention of the control program. The degree of authority of each program in a sequence of calling and called programs may be arbitrarily different, thus allowing a nonhierarchical organization of programs to be established. Modular authorization control can be obtained principally by associating an extended authorization index with each program module. This allows program modules with different authorities to coexist in the same address space. On the other hand, the extended authorization index in effect during the execution of a called program module can be the one that is associated with the calling program module, thus allowing the called module to be executed with different authorities on behalf of different dispatchable units. Options concerning the PSW-key mask and the secondary ASN are other means of associating different authorities with different programs or with the same called program. The authority of each program is prescribed in tables that are managed by the control program. By setting up the tables so that the same program can be called by means of different PC numbers, the program can be assigned different authorities depending on which PC number is used to call it. The tables also allow control over which PC numbers can be used by a program to call other programs.
During the execution of a PROGRAM CALL instruction, the PC-number-translation process is performed to locate a 16-byte or 32-byte entry-table entry, as determined by the ASF control. When a 32-byte entry-table entry is located and a bit, named the PC-type bit, in the entry-table entry is one, the stacking PROGRAM CALL operation is specified; otherwise, the basic PROGRAM CALL operation (the 370-XA operation) is specified.
In addition to the entry information specified in the 16-byte entry-table entry, the 32-byte entry-table entry further contains information that specifies options concerning the address-space control and PSW key in the PSW, and the PSW-key mask, extended authorization index, and secondary ASN in the control registers.
During the stacking PROGRAM CALL operation and by means of the additional information in the entry-table entry, the address-space control in the PSW can be set to specify either the primary-space mode or the access-register mode. The PSW key can be either left unchanged or replaced from the entry-table entry. The PSW-key mask in control register 3 can be either ORed to from or replaced from the entry-table entry. The extended authorization index in control register 8 can be either left unchanged or replaced from the entry-table entry. The secondary ASN in control register 3 can be set equal to the primary ASN of either the calling program or the called program; thus, the ability of the called program to have access to the primary address space of the calling program can be controlled.
The stacking PROGRAM CALL operation always forms an entry, called a state entry, in the linkage stack to save the execution state and the contents of general registers 0-15 and access registers 0-15. The saved execution state includes the PC number used, the updated PSW before any changes are made due to the entry-table entry, and the extended authorization index, PSW-key mask, primary ASN, and secondary ASN existing before the operation. However, the value of the PER mask in the saved updated PSW is unpredictable. The linkage-stack state entry also contains an entry-type code that identifies the entry as one that was formed by PROGRAM CALL.
A space-switching operation occurs when the address-space number (ASN) specified in the entry-table entry is nonzero. When space switching occurs, the operation is called PROGRAM CALL with space switching (PC-ss). When no space switching occurs, the operation is called PROGRAM CALL to current primary (PC-cp).
PROGRAM CALL with space switching performs ASN translation of the new primary ASN to obtain a new primary-ASTE origin and a new primary segment-table designation, which it places in control registers 5 and 1, respectively. It sets the secondary segment-table designation in control register 7 equal to either the old primary segment-table designation or the new one, depending on whether it set the secondary ASN equal to the old primary ASN or the new one, respectively. PROGRAM CALL to current primary sets the secondary ASN equal to the primary ASN and the secondary segment-table designation equal to the primary segment-table designation.
The instruction PROGRAM RETURN restores most of the information saved in the linkage stack by the stacking PROGRAM CALL operation. It restores the PSW, extended authorization index, PSW-key mask, primary ASN, secondary ASN, and the contents of general registers 2-14 and access-registers 2-14. However, the PER mask in the current PSW remains unchanged, and the resulting condition code is unpredictable. The operation of PROGRAM RETURN is referred to by saying that PROGRAM RETURN unstacks a state entry.
For PROGRAM RETURN, a space-switching operation occurs when the restored primary ASN is not equal to the primary ASN existing before the operation. When space switching occurs, the operation is called PROGRAM RETURN with space switching (PR-ss). When no space switching occurs, the operation is called PROGRAM RETURN to current primary (PR-cp).
PROGRAM RETURN with space switching performs ASN translation of the restored primary ASN to obtain a new primary-ASTE origin and a new primary segment-table designation, which it places in control registers 5 and 1, respectively. For PROGRAM RETURN with space switching or to current primary, (1) if the restored secondary ASN is the same as the restored primary ASN, the secondary segment-table designation in control register 7 is set equal to the new primary segment-table designation in control register 1, or (2) if the the restored secondary ASN is not the same as the restored primary ASN, ASN translation and ASN authorization of the restored secondary ASN are performed to obtain a new secondary segment-table designation, which is placed in control register 7.
The stacking PROGRAM CALL operation and the PROGRAM RETURN operation each can be performed successfully only in the primary-space mode or access-register mode. An exception is recognized when the CPU is in the real mode, secondary-space mode, or home-space mode.
A bit, named the unstack-suppression bit, can be set to one in a linkage-stack state entry to cause an exception if an attempt is made by PROGRAM RETURN to unstack the entry. When the bit is one, the entry still can be operated on by the instructions that add information to or retrieve information from the entry. The unstack-suppression bit is intended to allow the control program to gain control when an attempt is made to unstack a state entry in which the bit is one.
BRANCH AND STACK forms a linkage-stack state entry that is almost the same as one formed by PROGRAM CALL. When it is necessary to distinguish between these two types of state entry, an entry formed by PROGRAM CALL is called a program-call state entry, and one formed by BRANCH AND STACK is called a branch state entry. A branch state entry differs from a program-call state entry in two ways: (1) it contains a different entry-type code, which identifies it as a branch state entry, and (2) it contains the new value of bits 32-63 of the current PSW, the addressing mode and the branch address, instead of a PC number. The new value of PSW bits 32-63 is in addition to the complete PSW that is saved in the state entry.
The execution state and the contents of the general registers and access registers can also be saved in the linkage stack by means of the instruction BRANCH AND STACK. BRANCH AND STACK uses a branch address as do the other branching instructions, instead of using a PC number. BRANCH AND STACK, along with PROGRAM RETURN, can link programs residing in the same address space and having the same level of authority; that is, BRANCH AND STACK does not change the execution state except for the instruction address.
For BRANCH AND STACK, the addressing mode and instruction address that are part of the complete PSW saved in the state entry can be the current addressing mode and the updated instruction address (the address of the next sequential instruction), or they can be specified in a register. This register can be one that had link information placed in it by a BRANCH AND LINK (BALR only), BRANCH AND SAVE, BRANCH AND SAVE AND SET MODE, or BRANCH AND SET MODE instruction. Thus, BRANCH AND STACK can be used either in a calling program or at (or near) the entry point of a called program, and, in either case, a PROGRAM RETURN instruction located at the end of the called program will return correctly to the calling program. The ability to use BRANCH AND STACK at an entry point allows the linkage stack to be used without changing old calling programs.
When the R2 field of BRANCH AND STACK is zero, the instruction is executed without causing branching.
When PROGRAM RETURN unstacks a branch state entry, it ignores the extended authorization index, PSW-key mask, primary ASN, and secondary ASN in the entry. The PROGRAM RETURN instruction restores the PSW and the contents of general registers 2-14 and access registers 2-14 that were saved in the entry. However, the PER mask in the current PSW remains unchanged, and the resulting condition code is unpredictable.
BRANCH AND STACK can be executed successfully only in the primary-space mode or access-register mode. An exception is recognized when the CPU is in the real mode, secondary-space mode, or home-space mode.
The unstack-suppression bit has the same effect in a branch state entry as it does in a program-call state entry.
The instructions EXTRACT STACKED REGISTERS and EXTRACT STACKED STATE can be used by a program to obtain any of the information saved in the current state entry by BRANCH AND STACK or PROGRAM CALL or placed there by MODIFY STACKED STATE. EXTRACT STACKED REGISTERS places the contents of a specified range of general registers and access registers back in the registers from which the contents were saved. EXTRACT STACKED STATE obtains any pair of words of the nonregister information saved or placed in a state entry and places them in a designated general-register pair. EXTRACT STACKED STATE sets the condition code to indicate whether the current state entry is a branch state entry or a program-call state entry.
The instruction MODIFY STACKED STATE can be used by a program to place two words of information, contained in a designated general-register pair, in the current linkage-stack state entry (a branch state entry or a program-call state entry). This is intended to allow a called program to establish a recovery routine that will be given control by the control program, if necessary.
The principal purpose of TEST ACCESS is to allow a called program to determine whether an ALET passed to it by the calling program is authorized for use by the calling program by means of the calling program's EAX. This is in support of a possible programming convention in which a called program will not operate on an AR-specified address space by means of its own EAX unless the calling program is authorized to operate on that space by means of the calling program's EAX. The called program can obtain the calling program's EAX, for use by TEST ACCESS, from the current linkage-stack state entry by means of the EXTRACT STACKED STATE instruction.
The instruction TEST ACCESS has as operands an access-list-entry token (ALET) in a designated access register and an extended authorization index (EAX) in a designated general register. TEST ACCESS applies the access-register-translation process, which uses the specified EAX instead of the current EAX in control register 8, to the ALET, and it sets the condition code to indicate the result. The condition code may indicate: (1) the ALET is 00000000 hex, (2) the ALET designates an entry in the dispatchable-unit access list and can be translated without exceptions in access-register translation, (3) the ALET designates an entry in the primary-space access list and can be translated without exceptions in access-register translation, or (4) the ALET is 00000001 hex or causes exceptions in access-register translation.
Another purpose of TEST ACCESS is to indicate the special cases in which the ALET is 00000000 hex, designating the primary address space, or 00000001 hex, designating the secondary address space. Because PROGRAM CALL may change the primary and secondary address spaces, ALETs 00000000 hex and 00000001 hex may designate different address spaces when used by the called program than when used by the calling program.
Still another purpose of TEST ACCESS is to indicate whether the ALET designates an entry in the primary-space access list since such a designation after the primary address space was changed by a space-switching program-linkage operation may be an error.
As a further analysis aid, BRANCH AND STACK when it causes branching, stacking PROGRAM CALL, and PROGRAM RETURN are also recognized as PER successful-branching events. For PROGRAM RETURN, the unstacked state entry may have been formed by BRANCH AND STACK or PROGRAM CALL.
To aid program-problem analysis, the option is provided of having a trace entry made implicitly for three additional linkage operations when the linkage stack is used. When branch tracing is on, a trace entry is made each time a BRANCH AND STACK instruction is executed and causes branching. When ASN tracing is on, a trace entry is made each time the stacking PROGRAM CALL operation is performed and each time PROGRAM RETURN unstacks a linkage-stack state entry formed by PROGRAM CALL. A detailed definition of tracing is contained in "Tracing" in topic 4.4.
The execution of a space-switching stacking PROGRAM CALL or PROGRAM RETURN instruction causes a space-switch event if the primary space-switch-event control is one before or after the operation or if a PER event is to be indicated.
This section describes the use of the 32-byte entry-table entry in both the basic and the stacking PROGRAM CALL operations. The description here of the use in the basic PROGRAM CALL operation is the same as the description in "Entry-Table Entries" in topic 5.5.2.2.
When the address-space-function (ASF) control, bit 15 of control register 0, is one, the entry-table entry is extended in length from 16 bytes to 32 bytes. Bit 128 of the 32-byte entry-table entry specifies whether the basic or the stacking PROGRAM CALL operation is to be performed, and bit positions 131-139 and 144-159 contain information that is used only if stacking is specified.
The 32-byte entry-table entry has the following format:
________________________ ________________________ | Authorization Key Mask | ASN | |________________________|________________________| 0 16 31 _ _____________________________________________ _ |A| Entry Instruction Address |P| |_|_____________________________________________|_| 32 63 _________________________________________________ | Entry Parameter | |_________________________________________________| 64 95 ________________________ ________________________ | Entry Key Mask | | |________________________|________________________| 96 112 127 _ __ _ _ _ _ _ ____ ____ ________________________ |T| |K|M|E|C|S| EK | | Entry Ext. Auth. Index | |_|__|_|_|_|_|_|____|____|________________________| 128 131 136 140 144 159 _ ________________________________________ ______ | | ASTE Address | | |_|________________________________________|______| 160 186 191 _________________________________________________ | | |_________________________________________________| 192 223 _________________________________________________ | | |_________________________________________________| 224 255
The fields in the 32-byte entry-table entry are allocated as follows:Authorization Key Mask: Bits 0-15 are used to verify whether the program issuing the PROGRAM CALL instruction, when in the problem state, is authorized to call this entry point. The authorization key mask and the current PSW-key mask in control register 3 are ANDed, and the result is checked for all zeros. If the result is all zeros, a privileged-operation exception is recognized. The test is not performed in the supervisor state.
ASN: Bits 16-31 specify whether a PC-ss or PC-cp is to occur. When bits 16-31 are all zeros, a PC-cp is specified. When bits 16-31 are not all zeros, a PC-ss is specified, and the bits are the ASN that replaces the primary ASN.
Entry Addressing Mode (A): Bit 32 replaces the addressing-mode bit, bit 32 of the current PSW, as part of the PROGRAM CALL operation. When bit 32 is zero, bits 33-39 must also be zeros; otherwise, a PC-translation-specification exception is recognized.
Entry Instruction Address: Bits 33-62, with a zero appended on the right, form the instruction address that replaces the instruction address in the PSW as part of the PROGRAM CALL operation.
Entry Problem State (P): Bit 63 replaces the problem-state bit, bit 15 of the current PSW, as part of the PROGRAM CALL operation.
Entry Parameter: Bits 64-95 are placed in general register 4 as part of the PROGRAM CALL operation.
Entry Key Mask: Bits 96-111 are ORed into the PSW-key mask in control register 3 when bit 132, the PSW-key-mask control, is zero, or replace the PSW-key mask in control register 3 when bit 132 is one, as part of the stacking PROGRAM CALL operation. Bits 96-111 are ORed into the PSW-key mask as part of the basic PROGRAM CALL operation.
PC-Type Bit (T): Bit 128, when one, specifies that the PROGRAM CALL instruction is to perform the stacking PROGRAM CALL operation. When this bit is zero, PROGRAM CALL performs the basic PROGRAM CALL operation.
PSW-Key Control (K): Bit 131, when one, specifies that bits 136-139 are to replace the PSW key in the PSW as part of the stacking PROGRAM CALL operation. When this bit is zero, the PSW key remains unchanged. Bit 131 is ignored during the basic PROGRAM CALL operation.
PSW-Key-Mask Control (M): Bit 132, when one, specifies that bits 96-111 are to replace the PSW-key mask in control register 3 as part of the stacking PROGRAM CALL operation. When this bit is zero, bits 96-111 are ORed into the PSW-key mask in control register 3 as part of the stacking PROGRAM CALL operation. Bit 132 is ignored during the basic PROGRAM CALL operation.
Extended-Authorization-Index Control (E): Bit 133, when one, specifies that bits 144-159 are to replace the current extended authorization index in control register 8 as part of the stacking PROGRAM CALL operation. When this bit is zero, the current extended authorization index remains unchanged. Bit 133 is ignored during the basic PROGRAM CALL operation.
Address-Space-Control Control (C): Bit 134, when one, specifies that bit 17 of the current PSW is to be set to one as part of the stacking PROGRAM CALL operation. When this bit is zero, bit 17 is set to zero. Because the CPU must be in either the primary-space mode or the access-register mode when a stacking PROGRAM CALL instruction is issued, the result is that the CPU is placed in the access-register mode if bit 134 is one or the primary-space mode if bit 134 is zero. Bit 134 is ignored during the basic PROGRAM CALL operation.
Secondary-ASN Control (S): Bit 135, when one, specifies that bits 16-31 are to become the new secondary ASN, and the new SSTD is to be set equal to the new PSTD, as part of the stacking PROGRAM CALL with space switching (PC-ss) operation. When this bit is zero, the new SASN and SSTD are set equal to the PASN and PSTD, respectively, of the calling program. Bit 135 is ignored during the basic PROGRAM CALL operation and the stacking PROGRAM CALL to-current-primary (PC-cp) operation.
Entry Key (EK): Bits 136-139 replace the PSW key in the PSW as part of the stacking PROGRAM CALL operation if the PSW-key control, bit 131, is one. Bits 136-139 are ignored and the current PSW key remains unchanged if bit 131 is zero. Bits 136-139 are ignored during the basic PROGRAM CALL operation.
Entry Extended Authorization Index: Bits 144-159 replace the current extended authorization index, bits 0-15 of control register 8, as part of the stacking PROGRAM CALL operation if the extended-authorization-index control, bit 133, is one. Bits 144-159 are ignored and the current extended authorization index remains unchanged if bit 133 is zero. Bits 144-159 are ignored during the basic PROGRAM CALL operation.
ASTE Address: When bits 16-31 are not all zeros, bits 161-185, with six zeros appended on the right, form the real ASN-second-table-entry (ASTE) address that should result from applying the ASN-translation process to bits 16-31. It is unpredictable whether PC-ss uses bits 161-185 or uses ASN translation to obtain the ASTE address.
Bits 33-39 must be zeros when bit 32 is zero; otherwise, a PC-translation-specification exception is recognized.
Bits 112-127, 129, 130, 140-143, 160, and 186-255 are reserved for possible future extensions and should be zeros.
A linkage stack resides in virtual storage. The linkage stack for a dispatchable unit is in the home address space for that dispatchable unit. The home address space is designated by the home segment-table designation in control register 13.
A linkage stack may be formed by the control program for each dispatchable unit. The linkage stack is used to save the execution state and the contents of the general registers and access registers during the BRANCH AND STACK and stacking PROGRAM CALL operations. The linkage stack is also used to restore a portion of the execution state and general-register and access-register contents during the PROGRAM RETURN operation.
The linkage stack is intended to be protected from problem-state programs so that these programs cannot examine or modify the information saved in the linkage stack, except by means of the EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE instructions. This protection can be obtained by means of key-controlled protection.
A linkage stack may consist of a number of linkage-stack sections chained together. A linkage-stack section is variable in length. The maximum length of each linkage-stack section is 65,560 bytes.
There are three types of entry in the linkage stack: header entry, trailer entry, and state entry. A header entry and a trailer entry are at the beginning and end, respectively, of a linkage-stack section, and they are used to chain linkage-stack sections together. Header entries and trailer entries are formed by the control program. A state entry is used to contain the execution state and register contents that are saved during the BRANCH AND STACK or stacking PROGRAM CALL operation, and it is formed during the operation. A state entry is further distinguished as being a branch state entry if it was formed by BRANCH AND STACK or as being a program-call state entry if it was formed by PROGRAM CALL.
The actions of forming a state entry and saving information in it during the BRANCH AND STACK and stacking PROGRAM CALL operations are called the stacking process. The actions of restoring information from a state entry and logically deleting the entry during the PROGRAM RETURN operation are called the unstacking process. The part of the unstacking process that locates a state entry is also performed during the EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE operations.
Each type of linkage-stack entry has a length that is a multiple of eight bytes. A header entry and trailer entry each has a length of 16 bytes. A state entry has a length of 168 bytes.
Each of the header entry, trailer entry, and state entry has a common eight-byte area at its end, called the entry descriptor. The linkage-stack-entry address in control register 15 designates the leftmost byte of the entry descriptor of the last linkage-stack entry, other than the trailer entry, in a linkage-stack section. This entry is called the current linkage-stack entry, and the section is called the current linkage-stack section.
Each entry descriptor in a linkage-stack section, except the one in the trailer entry of the section, includes a field that specifies the amount of space existing between the end of the entry descriptor and the beginning of the trailer entry. This field is named the remaining-free-space field. The remaining-free-space field in a trailer entry is unused.
When a new state entry is to be formed in the linkage stack during the stacking process, the new entry is placed immediately after the entry descriptor of the current linkage-stack entry, provided that there is enough remaining free space in the current linkage-stack section to contain the new entry. If there is not enough remaining free space in the current section, and if the trailer entry in the current section indicates that another section follows the current section, the new entry is placed immediately after the entry descriptor of the header entry of that following section, provided that there is enough remaining free space in that section. If the trailer entry indicates that there is not a following section, an exception is recognized, and a program interruption occurs. It is then the responsibility of the control program to allocate another section, chain it to the current section, and cause the BRANCH AND STACK or stacking PROGRAM CALL instruction to be reexecuted. If there is a following section but there is not enough remaining free space in it, an exception is recognized.
If the remaining-free-space value that is used to locate a trailer entry is not a multiple of 8, an exception is recognized. The remaining-free-space value in the header entry of a linkage-stack section must be set to a multiple of 8 to ensure that the remaining-free-space value that may be used to locate the trailer entry of the section will be a multiple of 8.
When the stacking process is successful in forming a new state entry, it updates the linkage-stack-entry address in control register 15 so that the address designates the leftmost byte of the entry descriptor of the new entry, which thus becomes the new current linkage-stack entry.
When, during the unstacking process in PROGRAM RETURN, the current linkage-stack entry is a state entry, the process operates on that entry and then updates the linkage-stack-entry address so that it designates the entry descriptor of the preceding entry in the same linkage-stack section. The preceding entry thus becomes the current entry. The new current entry may be another state entry, or it may be a header entry.
The header entry of a linkage-stack section indicates whether there is a preceding section. If there is a preceding section, the header entry contains the address of the last linkage-stack entry, other than the trailer entry, in the preceding section. That last entry should be a state entry (not another header entry), unless there is an error in the linkage stack.
If the unstacking process is performed when the current linkage-stack entry is a header entry, and if the header entry indicates that a preceding linkage-stack section exists, the unstacking process proceeds by treating the entry designated in the preceding section as if it were the current entry, provided that this entry is a state entry. If the header entry does not indicate a preceding section, or if the entry designated in the preceding section is not a state entry, an exception is recognized.
When the unstacking process is performed in EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, or MODIFY STACKED STATE, the process locates a state entry but does not change the linkage-stack-entry address in control register 15.
Each entry descriptor in a linkage-stack section includes a field that specifies the length of the next linkage-stack entry, other than the trailer entry, in the section. When a state entry is created during the stacking process, zeros are placed in this field in the created entry, and the length of the state entry is placed in this field in the preceding entry. When a state entry is logically deleted during the unstacking process in PROGRAM RETURN, zeros are placed in this field in the preceding entry. This field is named the next-entry-size field.
When the stacking or unstacking process operates on the linkage stack, key-controlled protection does not apply, but low-address and page protection do apply.
Subtopics:
The use of the linkage stack is controlled by the ASF control, bit 15 of control register 0, the home segment-table designation in control register 13, and the linkage-stack-entry address in control register 15. The home segment-table designation is described in "Dynamic Address Translation" in topic 3.11. The ASF control and linkage-stack-entry address are described below.
Subtopics:
Bit 15 of control register 0 is the address-space-function (ASF) control. This bit controls whether the linkage stack is available. The bit must be one for the following instructions to be executed successfully:
TEST ACCESS does not use the linkage stack. For TEST ACCESS, the ASF control controls whether the access-list-designation sources are available.
A complete description of the effects of the ASF control is in "Address-Space-Function Control" in topic 5.8.1.1.
The location of the entry descriptor of the current linkage-stack entry is specified in control register 15. The register has the following format:
_ _____________________________ ___ | | Linkage-Stack-Entry Address | | |_|_____________________________|___| 0 1 29 31Linkage-Stack-Entry Address: Bits 1-28 of control register 15, with three zeros appended on the right, form the home virtual address of the entry descriptor of the current linkage-stack entry in the current linkage-stack section. Bits 1-28 are changed during the stacking process in BRANCH AND STACK and stacking PROGRAM CALL and during the unstacking process in PROGRAM RETURN. Bits 0 and 29-31 of control register 15 are set to zeros when bits 1-28 are changed.
Each type of linkage-stack entry has an entry descriptor at its end. The leftmost byte of the entry descriptor of the current linkage-stack entry in the current linkage-stack section is designated by the linkage-stack-entry address in control register 15.
The linkage stack consists of one or more linkage-stack sections containing linkage-stack entries. There are three principal types of linkage-stack entry: header entry, trailer entry, and state entry. A state entry is further distinguished as being either a branch state entry or a program-call state entry.
The linkage stack resides in the home address space, designated by the home segment-table designation in control register 13. The linkage stack is available only when the ASF control, bit 15 of control register 0, is one.
Subtopics:
An entry descriptor is at the end of each linkage-stack entry. The entry descriptor is eight bytes in length and has the following format:
_ __ ____ ________ ________ ________ |U|ET| SI | RFS | NES | | |_|__|____|________|________|________| 0 1 8 16 32 48 63Unstack-Suppression Bit (U): When bit 0 is one in the entry descriptor of a header entry or state entry encountered during the unstacking process in PROGRAM RETURN, a stack-operation exception is recognized. Bit 0 is ignored in a trailer entry and during the unstacking process in EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE. The control program can temporarily set bit 0 to one in the current linkage-stack entry (a header entry or state entry) to prevent PROGRAM RETURN from being executed successfully while still allowing EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE to be executed successfully. Bit 0 is set to zero in the entry descriptor of a state entry when the entry is formed during the stacking process.The fields in the entry descriptor are allocated as follows:
Entry Type (ET): Bits 1-7 are a code that specifies the type of the linkage-stack entry containing the entry descriptor. The assigned codes are:
Code (in Binary) Entry Type
Codes 0000000, 0000011, and 0000110 through 0111111 binary are reserved for possible future assignments. Codes 1000000 through 1111111 binary are available for use by programming.Bits 1-7 are set to 0000100 or 0000101 binary in the entry descriptor of a state entry when the entry is formed during the stacking process.
A stack-type exception is recognized during the unstacking process in EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, MODIFY STACKED STATE, or PROGRAM RETURN if bits 1-7 in the current linkage-stack entry do not indicate that the entry is a state entry or a header entry; or, when the current entry is a header entry, if bits 1-7 in the entry designated by the backward stack-entry address in the header entry do not indicate that the designated entry is a state entry. However, a stack-specification exception is recognized, instead of a stack-type exception, if both the current entry and the designated entry are header entries.
Section Identification (SI): Bits 8-15 are an identification, provided by the control program, of the linkage-stack section containing the entry descriptor. In the state entry formed by a stacking process, the process sets bits 8-15 equal to the contents of the section-identification field in the preceding linkage-stack entry.
Remaining Free Space (RFS): Bits 16-31 specify the number of bytes between the end of this entry descriptor and the beginning of the trailer entry in the same linkage-stack section, except that this field in a trailer entry has no meaning. Thus, in the last state entry in a section, or in the header entry if there is no state entry, bits 16-31 specify the number of bytes available in the section for performances of the stacking process. In the state entry formed by a stacking process, the process sets bits 16-31 equal to the contents of the remaining-free-space field in the preceding linkage-stack entry minus the size, in bytes, of the new entry. Bits 16-31 must be a multiple of 8 (bits 29-31 must be zeros) in the entry descriptor of the header entry in a linkage-stack section; otherwise, a value that is not a multiple of 8 will be propagated to bits 16-31 in the entry descriptor of each state entry in the section, and a stack-specification exception will be recognized if the stacking process attempts to locate the trailer entry in the section in order to proceed to the next section.
Next-Entry Size (NES): Bits 32-47 specify the size in bytes of the next linkage-stack entry, other than a trailer entry, in the same linkage-stack section. This field in the current linkage-stack entry contains all zeros. This field in a trailer entry has no meaning. When the stacking process forms a state entry, it places zeros in the next-entry-size field of the new entry, and it places the size of the new entry in the next-entry-size field of the preceding entry. When the unstacking process logically deletes a state entry, it places zeros in the next-entry-size field of the preceding entry, which entry becomes the current entry.
Bits 48-63 are set to zeros in a state entry when the entry is formed during the stacking process. In a header entry, trailer entry, or state entry, bits 48-63 are reserved for possible future extensions and should always be zeros.
Programming Note: No entry-type code will be assigned in which the leftmost bit of the code is one. The control program can temporarily set the leftmost bit to one in the entry-type code of the current linkage-stack entry (a header entry or a state entry) to prevent the successful execution of EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, MODIFY STACKED STATE, or PROGRAM RETURN.
A header entry is at the beginning of each linkage-stack section. The header entry is 16 bytes in length and has the following format:
_________________ _ ___________ ___ |/////////////////|B| BSEA | | |_________________|_|___________|___| 0 32 61 63 ___________________________________ | Entry Descriptor | |___________________________________| 64 127
The fields in the first eight bytes of the header entry are allocated as follows:Backward Stack-Entry Validity Bit (B): Bit 32, when one, specifies that the preceding linkage-stack section is available and that the backward stack-entry address, bits 33-60, is valid. Bit 32 is set to one during the stacking process when the process proceeds to this section from the preceding one because there is not enough space available in the preceding section to perform the process. During the unstacking process when this header entry is the current linkage-stack entry, a stack-empty exception is recognized if bit 32 is zero.
Backward Stack-Entry Address (BSEA): When bit 32 is one, bits 33-60, with three zeros appended on the right, form the 31-bit home virtual address of the entry descriptor of the last linkage-stack entry, other than the trailer entry, in the preceding linkage-stack section. However, if the current linkage-stack entry is in the preceding or an earlier linkage-stack section, bits 33-60 may have no meaning because the entry they designate, and earlier entries, may have been logically deleted. Bits 33-60 are set during the stacking process when the process proceeds to this section from the preceding one because there is not enough space available in the preceding section to perform the process. During the unstacking process when this header entry is the current linkage-stack entry and bit 32 is one, the entry designated by bits 33-60 is treated as the current entry.
Bits 61-63 are set to zeros when bits 32-60 are set during the stacking process. Bits 0-31 are available for use by programming. Bits 61-63 are reserved for possible future extensions.
A trailer entry is at the end of each linkage-stack section. The trailer entry begins immediately after the area specified by the remaining-free-space field in the entry descriptors of the header entry and each state entry in the same linkage-stack section. The trailer entry is 16 bytes in length and has the following format:
_________________ _ ___________ ___ |/////////////////|F| FSHA | | |_________________|_|___________|___| 0 32 61 63 ___________________________________ | Entry Descriptor | |___________________________________| 64 127
The fields in the first eight bytes of the trailer entry are allocated as follows:Forward-Section Validity Bit (F): Bit 32, when one, specifies that the next linkage-stack section is available and that the forward-section-header address, bits 33-60, is valid. During the stacking process when there is not enough space available in the current linkage-stack section to perform the process, a stack-full exception is recognized if bit 32 in the trailer entry of the current section is zero.
Forward-Section-Header Address (FSHA): When bit 32 is one, bits 33-60, with three zeros appended on the right, form the 31-bit home virtual address of the entry descriptor of the header entry in the next linkage-stack section. During the stacking process when there is not enough space available in the current section to perform the process and bit 32 is one, the header entry designated by bits 33-60 becomes the current linkage-stack entry.
Bits 0-31 are available for use by programming. Bits 61-63 are reserved for possible future extensions.
Programming Note: All of the fields in the trailer entry are set only by the control program.
Zero, one, or more state entries may follow the header entry in each linkage-stack section. A state entry may be a branch state entry, formed by a BRANCH AND STACK instruction, or a program-call state entry, formed by a stacking PROGRAM CALL instruction. The state entry is 168 bytes in length and has the following format:
Hex Dec _________ ___________________ __________ 0 0 | | " 8 8 | Contents of | | / General Registers / 64 Bytes 30 48 | 0-15 | | 38 56 | | _________|___________________|__________ 40 64 | | " 48 72 | Contents of | | / Access Registers / 64 Bytes 70 112 | 0-15 | | 78 120 | | _________|___________________|__________ 80 128 | | " 88 136 | Other Status | 32 Bytes 90 144 | Information | | 98 152 | | _________|___________________|__________ A0 160 | Entry Descriptor | 8 Bytes _________|___________________|__________Bytes 128-159 of the state entry contain the other status information that is placed in the entry by BRANCH AND STACK, stacking PROGRAM CALL, and MODIFY STACKED STATE. A portion of this status information is restored to the PSW and control registers by PROGRAM RETURN, and all of the information can be examined by means of EXTRACT STACKED STATE. Bytes 160-167 contain the entry descriptor. EXTRACT STACKED STATE sets the condition code to indicate whether the entry-type code in the entry descriptor specifies a branch state entry or a program-call state entry.Bytes 0-63 of the state entry contain the contents of general registers 0-15 in the ascending order of the register numbers. Bytes 64-127 contain the contents of access registers 0-15 in the ascending order of the register numbers. The contents of these fields are moved from the registers to the state entry during the BRANCH AND STACK and stacking PROGRAM CALL operations. The contents of general registers 2-14 and access registers 2-14 are restored from the state entry to the registers during the PROGRAM RETURN operation. The contents of a specified range of general registers and access registers can be restored from the state entry to the registers by EXTRACT STACKED REGISTERS.
Bytes 128-159 of the state entry have the following detailed format:
________ ________ ________ ________ | PKM | SASN | EAX | PASN | |________|________|________|________| 128 130 132 134 135 ___________________________________ | PSW | |___________________________________| 136 143 In a Branch State Entry _________________ _ _______________ | |A|Branch Address | |_________________|_|_______________| 144 148 151 In a Program-Call State Entry _________________ _________________ |Called-Space Id. | PC Number | |_________________|_________________| 144 148 151 ___________________________________ | Modifiable Area | |___________________________________| 152 159
The fields in bytes 128-159 are allocated as follows. In the following, "of the calling program" means the value existing at the beginning of the execution of the BRANCH AND STACK or stacking PROGRAM CALL instruction that formed the state entry.PSW-Key Mask (PKM): Bytes 128-129 contain the PSW-key mask, bits 0-15 of control register 3, of the calling program. The PSW-key mask is saved in the state entry by BRANCH AND STACK or stacking PROGRAM CALL, and it is restored to the control register by a PROGRAM RETURN instruction that unstacks an entry formed by stacking PROGRAM CALL.
Secondary ASN (SASN): Bytes 130-131 contain the secondary ASN, bits 16-31 of control register 3, of the calling program. The SASN is saved in the state entry by BRANCH AND STACK or stacking PROGRAM CALL, and it is restored to the control register by a PROGRAM RETURN instruction that unstacks an entry formed by stacking PROGRAM CALL.
Extended Authorization Index (EAX): Bytes 132-133 contain the extended authorization index, bits 0-15 of control register 8, of the calling program. The EAX is saved in the state entry by BRANCH AND STACK or stacking PROGRAM CALL, and it is restored to the control register by a PROGRAM RETURN instruction that unstacks an entry formed by stacking PROGRAM CALL.
Primary ASN (PASN): Bytes 134-135 contain the primary ASN, bits 16-31 of control register 4, of the calling program. The PASN is saved in the state entry by BRANCH AND STACK or stacking PROGRAM CALL, and it is restored to the control register by a PROGRAM RETURN instruction that unstacks an entry formed by stacking PROGRAM CALL.
Program-Status Word (PSW): In a branch state entry formed by a BRANCH AND STACK instruction in which the R1 field is zero, and in a program-call state entry, bytes 136-143 contain the updated PSW of the calling program. Thus, the addressing-mode bit in this PSW specifies the addressing mode of the calling program, and the instruction address designates the next sequential instruction following the BRANCH AND STACK or stacking PROGRAM CALL instruction that formed the state entry, or following an EXECUTE instruction that had the BRANCH AND STACK or stacking PROGRAM CALL instruction as its target instruction. In a branch state entry formed by a BRANCH AND STACK instruction in which the R1 field is nonzero, bytes 136-143 contain the PSW of the calling program, except that the addressing-mode bit and instruction address in bytes 140-143 are as specified by the contents of the general register designated by the R1 field. See the definition of BRANCH AND STACK in Chapter 10, "Control Instructions" for how the addressing-mode bit and instruction address are specified. The value of the PER mask in bytes 136-143 is always unpredictable. The PSW is saved in the state entry by BRANCH AND STACK or stacking PROGRAM CALL and is restored as the current PSW by PROGRAM RETURN, except that the PER mask and the condition code, bits 1 and 18-19 of the PSW, are not restored. PROGRAM RETURN does not change the PER mask in the current PSW, and it sets the condition code to an unpredictable value.
Addressing Mode (A): In a branch state entry, bit position 0 of bytes 148-151 contains the addressing-mode bit, bit 32 of the PSW, at the end of the execution of the BRANCH AND STACK instruction that formed the state entry. The addressing-mode bit is saved in bit position 0 of bytes 148-151 by BRANCH AND STACK. BRANCH AND STACK does not change the addressing-mode bit in the PSW.
Branch Address: In a branch state entry, bit positions 1-31 of bytes 148-151 contain the instruction address, bits 33-63 of the PSW, at the end of the execution of the BRANCH AND STACK instruction that formed the state entry. The instruction address is saved in bit positions 1-31 of bytes 148-151 by BRANCH AND STACK. When the R2 field of the BRANCH AND STACK is nonzero, the instruction causes branching, and bits 1-31 of bytes 148-151 are the branch address. When the R2 field of BRANCH AND STACK is zero, the instruction is executed without branching, and bits 1-31 of bytes 148-151 designate the next sequential instruction following the BRANCH AND STACK instruction, or following an EXECUTE instruction that had the BRANCH AND STACK instruction as its target instruction.
Called-Space Identification: In a program-call state entry when the called-space-identification facility is installed, bytes 144-147 contain the called-space identification (CSI). The CSI is saved in the state entry by stacking PROGRAM CALL. If the PROGRAM CALL operation was space switching, bytes 0 and 1 of the CSI (bytes 144 and 145 of the state entry) contain the new primary ASN that was placed in control register 4 by the PROGRAM CALL instruction, and bytes 2 and 3 of the CSI (bytes 146 and 147 of the state entry) contain the rightmost two bytes of the ASTE sequence number (ASTESN) in the new primary ASTE whose address was placed in control register 5 by the PROGRAM CALL instruction. If the PROGRAM CALL operation was the to-current-primary operation, the CSI is all zeros. In a program-call state entry when the called-space-identification facility is not installed, or in a branch state entry, the contents of bytes 144-147 are unpredictable.
PC Number: In a program-call state entry, bit positions 12-31 of bytes 148-151 contain the PC number used by the stacking PROGRAM CALL instruction that formed the entry. Stacking PROGRAM CALL places the PC number in bit positions 12-31 of bytes 148-151, and it places zeros in bit positions 0-11.
Modifiable Area: Bytes 152-159 are the field that is set by MODIFY STACKED STATE. BRANCH AND STACK and stacking PROGRAM CALL place all zeros in bytes 152-159.
The contents placed in bytes 144-147 by BRANCH AND STACK and stacking PROGRAM CALL are unpredictable. Bytes 144-147 are reserved for possible future extensions.
For the stacking process to be performed successfully, the address-space-function control, bit 15 of control register 0, must be one, DAT must be on, and the CPU must be in the primary-space mode or access-register mode; otherwise, a special-operation exception is recognized, and the operation is suppressed.
The stacking process is performed as part of a BRANCH AND STACK or stacking PROGRAM CALL operation. The process locates space for a new linkage-stack state entry, forms the entry, updates the next-entry-size field in the preceding entry, and updates the linkage-stack-entry address in control register 15 so that the new entry becomes the current linkage-stack entry.
Except as just mentioned, the stacking process is performed independent of the current addressing mode and translation mode, as specified by bits 32 and 16-17 of the current PSW. All addresses used during the stacking process are always 31-bit home virtual addresses.
During the stacking process when any address is formed through the addition or subtraction of a value to or from another address, a carry out of, or a borrow into, bit 1 of the address, if any, is ignored.
When the stacking process fetches or stores by using an address that designates, after translation, a location that is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
Key-controlled protection does not apply to the accesses made during the stacking process, but page protection and low-address protection do apply. A protection exception causes the operation to be suppressed.
Subtopics:
The first word of the entry descriptor of the current linkage-stack entry is fetched by using the 31-bit home virtual address. This fetch is for the purpose of obtaining the section-identification and remaining-free-space fields in the word; the unstack-suppression bit and entry-type field in the word are not examined.
The linkage-stack-entry address in control register 15 is used to locate the current linkage-stack entry. Bits 1-28 of control register 15, with three zeros appended on the right, form the 31-bit home virtual address of the leftmost byte of the entry descriptor of the current linkage-stack entry.
The 16-bit unsigned binary value in the remaining-free-space field, bits 16-31 of the entry descriptor, is compared against the size in bytes of the linkage-stack entry to be formed. The size of a state entry is 168 bytes. If the value in the field is equal to or greater than the size of the entry to be formed, processing continues as described in "Forming the New Entry" in topic 5.12.3.2; otherwise, processing continues as described below.
When the remaining-free-space field in the current linkage-stack entry indicates that there is not enough space available in the current linkage-stack section to form the new entry, the second word of the trailer entry of the current section is fetched. The address for fetching this word is determined as follows: to the address formed from the contents of control register 15, add 8 to address the first byte after the entry descriptor of the current entry, then add the contents of the remaining-free-space field of the current entry to address the first byte of the trailer entry, and then add 4 to address the second word of the trailer entry. The remaining-free-space value used in the addition must be a multiple of 8; otherwise, a stack-specification exception is recognized, and the operation is nullified.
If the forward-section-validity bit, bit 32, of the trailer entry is zero, a stack-full exception is recognized, and the operation is nullified; otherwise, the forward-section-header address in the trailer entry is used to locate the header entry in the next linkage-stack section. Bits 33-60 of the trailer entry, with three zeros appended on the right, form the 31-bit home virtual address of the leftmost byte of the entry descriptor of the header entry in the next section.
The first word of the entry descriptor of the header entry in the next linkage-stack section is fetched. This fetch is for the purpose of obtaining the section-identification and remaining-free-space fields in the word; the unstack-suppression bit and entry-type field in the word are not examined.
The value in the remaining-free-space field of the header entry in the next linkage-stack section is compared against the size in bytes of the entry to be formed. If the value in the field is equal to or greater than the size of the entry to be formed, the following occurs:
The new entry is a state entry. The contents of general registers 0-15 are stored in bytes 0-63 of the new entry, in the ascending order of the register numbers. The contents of access registers 0-15 are stored in bytes 64-127 of the new entry, in the ascending order of the register numbers. The PSW-key mask, bits 0-15 of control register 3; secondary ASN, bits 16-31 of control register 3; extended authorization index, bits 0-15 of control register 8; and primary ASN, bits 16-31 of control register 4, are stored in bytes 128-129, 130-131, 132-133, and 134-135, respectively, of the new entry. The current PSW, in which the instruction address has been updated, is stored in bytes 136-143 of the new entry. However, the value of the PER mask, bit 1 in the PSW stored, is unpredictable. Also, if the instruction being executed is a BRANCH AND STACK instruction in which the R1 field is nonzero, the addressing-mode bit and instruction address stored in bytes 140-143 of the new entry are as specified by the contents of the general register designated by the R1 field.
When the remaining-free-space field in the current linkage-stack entry indicates that there is enough space available in the current linkage-stack section to form the new entry, the new entry is formed beginning immediately after the entry descriptor of the current entry.
When the called-space-identification facility is installed and the instruction is PROGRAM CALL, the called-space identification is stored in bytes 144-147 of the new entry. When the instruction is performing the space-switching operation, the called-space identification is the two-byte ASN, bytes 2 and 3, in the entry-table entry used by the instruction, followed by bytes 2 and 3 of the ASTE sequence number, bytes 2 and 3 being bits 176-191, in the ASN-second-table entry specified by the ASN. When the instruction is performing the to-current-primary operation, the called-space identification is all zeros.
When the instruction is BRANCH AND STACK, the addressing-mode bit and instruction address, PSW bits 32-63, existing at the end of the execution of the instruction are stored in bytes 148-151 of the new entry. When the instruction is PROGRAM CALL, the 20-bit PC number used, with 12 zeros appended on the left, is stored in bytes 148-151. Zeros are stored in bytes 152-159 of the new entry.
When the called-space-identification facility is not installed or the instruction is BRANCH AND STACK, the contents of bytes 144-147 of the new entry are unpredictable.
Bytes 160-167 of the new entry are its entry descriptor. The unstack-suppression bit, bit 0, of this entry descriptor is set to zero. The code 0000100 binary is stored in the entry-type field, bits 1-7, of this entry descriptor if the instruction being executed is BRANCH AND STACK. The code 0000101 binary is stored if the instruction is PROGRAM CALL. The value in the section-identification field of the current linkage-stack entry is stored in the section-identification field, bits 8-15, of this entry descriptor. The value in the remaining-free-space field of the current entry, minus the size in bytes of the new entry, is stored in the remaining-free-space field of this entry descriptor. Zeros are stored in the next-entry-size field, bits 32-47, and in bit positions 48-63 of this entry descriptor.
The stores into the new entry appear to be word-concurrent as observed by other CPUs. The order in which the stores occur is unpredictable.
The order of the stores into the current entry and the new entry is unpredictable.
The size in bytes of the new linkage-stack entry is stored in the next-entry-size field of the current entry. The remainder of the current entry remains unchanged.
Bits 1-28 of the 31-bit home virtual address of the entry descriptor of the new linkage-stack entry are placed in bit positions 1-28 of control register 15, the linkage-stack-entry address. Zeros are placed in bit positions 0 and 29-31 of control register 15. Thus, the new entry becomes the current linkage-stack-entry.
Programming Note: Any exception recognized during the execution of PROGRAM CALL causes either nullification or suppression. Therefore, if an exception is recognized, the stacking process does not store into any linkage-stack entry or change the contents of control register 15.
The exceptions which can be encountered during the stacking process and their priority are described in the definition of the PROGRAM CALL instruction.
For the unstacking process to be performed successfully, the address-space-function control, bit 15 of control register 0, must be one, DAT must be on, and the CPU must be in the primary-space mode or access-register mode; otherwise, a special-operation exception is recognized, and the operation is suppressed. However, when the unstacking process is performed as part of EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, or MODIFY STACKED STATE, the CPU may be in the primary-space, access-register, or home-space mode.
The unstacking process is performed as part of the PROGRAM RETURN operation. The process locates the last state entry in the linkage stack, restores a portion of the information in the entry to the CPU registers, updates the next-entry-size field in the preceding entry, and updates the linkage-stack-entry address in control register 15 so that the preceding entry becomes the current linkage-stack entry. The part of the unstacking process that locates the last state entry is also performed as part of the EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE operations.
Except as just mentioned, the unstacking process is performed independent of the current addressing mode and translation mode, as specified by bits 32 and 16-17 of the current PSW. All addresses used during the unstacking process are always 31-bit home virtual addresses.
During the unstacking process when any address is formed through the addition or subtraction of a value to or from another address, a carry out of, or a borrow into, bit 1 of the address, if any, is ignored.
When the unstacking process fetches or stores by using an address that designates, after translation, a location that is not available in the configuration, an addressing exception is recognized, and the operation is suppressed.
Key-controlled protection does not apply to the accesses made during the unstacking process, but page protection and low-address protection do apply. A protection exception causes the operation to be suppressed.
Subtopics:
The first word of the entry descriptor of the current linkage-stack entry is fetched by using the 31-bit home virtual address. If the entry-type code in bits 1-7 of the entry descriptor is not 0000001 binary, indicating that the entry is not a header entry, processing continues as described in "Checking for a State Entry" in topic 5.12.4.2; otherwise, processing continues as described below.
The linkage-stack-entry address in control register 15 is used to locate the current linkage-stack entry. Bits 1-28 of control register 15, with three zeros appended on the right, form the 31-bit home virtual address of the leftmost byte of the entry descriptor of the current linkage-stack entry.
When the entry-type code in the current linkage-stack entry is 0000001 binary, indicating a header entry, the next processing depends on which instruction is being executed. When the unstacking process is performed as part of the PROGRAM RETURN operation and the unstack-suppression bit, bit 0, in the entry descriptor of the current entry is one, a stack-operation exception is recognized, and the operation is nullified. When the unstacking process is performed as part of EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, or MODIFY STACKED STATE, the unstack-suppression bit is ignored.
When there is not an exception due to the unstack-suppression bit, the second word of the current linkage-stack entry (a header entry) is fetched. The address of this word is determined by subtracting 4 from the address of the entry descriptor of the current entry.
If the backward stack-entry validity bit, bit 32, of the current entry is zero, a stack-empty exception is recognized, and the operation is nullified; otherwise, the backward stack-entry address in the current entry is used to locate a linkage-stack entry referred to here as the designated entry. Bits 33-60 of the current entry, with three zeros appended on the right, form the 31-bit home virtual address of the leftmost byte of the entry descriptor of the designated entry.
It is assumed in this definition of the unstacking process that the designated linkage-stack entry is the last entry, other than the trailer entry, in the preceding linkage-stack section. This assumption does not imply any processing that is not explicitly described.
The first word of the entry descriptor of the designated entry is fetched. If the entry-type code in this entry descriptor is not 0000001 binary, indicating that the entry is not a header entry, the following occurs:
If the current linkage-stack entry is a state entry, the next processing depends on which instruction is being executed. When the unstacking process is performed as part of the PROGRAM RETURN operation, processing continues as described in "Restoring Information" in topic 5.12.4.3. When the process is performed as part of EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, or MODIFY STACKED STATE, the process is completed; that is, no additional processing occurs as a part of the unstacking process.
When the entry-type code in the current linkage-stack entry indicates that the entry is not a header entry, the code is checked for being 0000100 or 0000101 binary, which are the codes assigned to a state entry.
If the current linkage-stack entry is not a state entry (and necessarily not a header entry either), a stack-type exception is recognized, and the operation is nullified.
The current linkage-stack entry is a state entry. If the unstack-suppression bit in the entry is one, a stack-operation exception is recognized, and the operation is nullified.
The remaining parts of the unstacking process occur only in the PROGRAM RETURN operation.
When there is not an exception due to the unstack-suppression bit, a portion of the contents of the current linkage-stack entry are restored to the CPU registers. The contents of general registers 2-14 and access registers 2-14 are restored to those registers from where they were saved in the current entry by the stacking process. When the entry-type code in the current entry is 0000101 binary, indicating a program-call state entry, the PSW-key mask and secondary ASN in control register 3, extended authorization index in control register 8, and primary ASN in control register 4 are similarly restored. During this restoration, the authorization index in control register 4 and the monitor masks in control register 8 remain unchanged. (The authorization index may be changed by the part of the PROGRAM RETURN execution that occurs after the unstacking process.) When the entry-type code is 0000100 binary, indicating a branch state entry, the PSW-key mask, secondary ASN, extended authorization index, and primary ASN in the current entry are ignored, and all contents of the control registers remain unchanged. When the current entry is either a branch state entry or a program-call state entry, the current PSW is restored from bytes 136-143 of the entry, except that the PER mask and the condition code are not restored. The PER mask in the current PSW remains unchanged, and the condition code is set to a unpredictable value. Bytes 144-159 of the current entry are ignored.
The fetches from the current entry appear to be word-concurrent as observed by other CPUs. The order in which the fetches occur is unpredictable.
The order of the store into the preceding entry and the fetches from the current entry is unpredictable.
Zeros are stored in the next-entry-size field, bits 32-47, of the entry descriptor of the preceding linkage-stack entry. The remainder of the preceding entry remains unchanged. The address of the entry descriptor of the preceding entry is determined by subtracting the size in bytes of the current entry from the address of the entry descriptor of the current entry.
Bits 1-28 of the 31-bit home virtual address of the entry descriptor of the preceding linkage-stack entry are placed in bit positions 1-28 of control register 15, the linkage-stack-entry address. Zeros are placed in bit positions 0 and 29-31 of control register 15. Thus, the preceding entry becomes the current linkage-stack entry.
The exceptions which can be encountered during the unstacking process and their priority are described in the definition of the PROGRAM RETURN instruction. The exceptions which apply to EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, and MODIFY STACKED STATE are described in the definitions of those instructions.Programming Notes:
Some of the effects described in the following sections are independent of interaction with another CPU or a channel program. These effects, which are therefore more readily observable, relate to prefetched instructions and overlapping operands of a single instruction. These effects are described in "Conceptual Sequence" and in "Interlocks for Virtual-Storage References" in topic 5.13.4.
The following sections describe the effects which can be observed in storage due to overlapped operations and piecemeal execution of a CPU program. Most of the effects described in these sections are observable only when two or more CPUs or channel programs are in simultaneous execution and access common storage locations. Thus, most of the effects need be taken into account by a program only if the program interacts with another CPU or a channel program.
Subtopics:
The sequence of events implied by the processing just described is sometimes called the conceptual sequence.
In the real mode, primary-space mode, or secondary-space mode, the CPU conceptually processes instructions one at a time, with the execution of one instruction preceding the execution of the following instruction. The execution of the instruction designated by a successful branch follows the execution of the branch. Similarly, an interruption takes place between instructions or, for interruptible instructions, between units of operation of such instructions.
Each operation of instruction execution appears to the program itself to be performed sequentially, with the current instruction being fetched after the preceding operation is completed and before the execution of the current operation is begun. This appearance is maintained even though the storage-implementation characteristics and overlap of instruction execution with storage accessing may cause actual processing to be different. The results generated are those that would have been obtained had the operations been performed in the conceptual sequence. Thus, it is possible for an instruction to modify the next succeeding instruction in storage.
Operations in the access-register mode or home-space mode are the same as in the other translation modes, with one exception: an instruction that is a store-type operand of a preceding instruction may appear to be fetched before the store occurs. Thus, it is not assured that an instruction can modify the succeeding instructions. This exception applies if either the storing instruction or the instruction stored is executed in the access-register or home-space mode.
Regardless of the translation mode, there are two other cases in which the copies of prefetched instructions are not necessarily discarded: (1) when the fetch and the store are done by means of different effective addresses that map to the same real address, and (2) when the store is caused by the execution of a vector-facility instruction. The case involving different effective addresses is described in more detail in "Interlocks for Virtual-Storage References" in topic 5.13.4.
In simple models in which operations are not overlapped, the conceptual and actual sequences are essentially the same. However, in more complex machines, overlapped operation, buffering of operands and results, and execution times which are comparable to the propagation delays between units can cause the actual sequence to differ considerably from the conceptual sequence. In these machines, special circuitry is employed to detect dependencies between operations and ensure that the results obtained, as observed by the CPU which generates them, are those that would have been obtained if the operations had been performed in the conceptual sequence. However, other CPUs and channel programs may, unless otherwise constrained, observe a sequence that differs from the conceptual sequence.
When a program interacts with the operation on another CPU, or with a channel program, the program may have to take into consideration that a single operation may consist in a series of storage references, that a storage reference may in turn consist in a series of accesses, and that the conceptual and observed sequences of these accesses may differ.
It can normally be assumed that the execution of each instruction occurs as an indivisible event. However, in actual operation, the execution of an instruction consists in a series of discrete steps. Depending on the instruction, operands may be fetched and stored in a piecemeal fashion, and some delay may occur between fetching operands and storing results. As a consequence, intermediate or partially completed results may be observable by other CPUs and by channel programs.
Storage references associated with instruction execution are of the following types: instruction fetches, ART-table and DAT-table fetches, and storage-operand references. For the purpose of describing the sequence of storage references, accesses to storage in order to perform ASN translation, PC-number translation, tracing, and the linkage-stack stacking and unstacking processes are considered to be storage-operand references.
Programming Note: The sequence of execution of a CPU may differ from the simple conceptual definition in the following ways:
For those instructions which alter the contents of storage and have more than one operand, the instruction definition normally describes the results that are obtained when the operands overlap in storage, this definition being in terms of a sequence of stores and fetches. The interlock circuitry is used in determining whether operand overlap exists.
As described in the immediately preceding sections, CPU operation appears, with certain exceptions, to be performed sequentially as observed by the CPU itself; the stores performed by one instruction generally appear to be completed before the next instruction and its operands are fetched. This appearance is maintained in overlapped machines by means of interlock circuitry that detects accesses to a common storage location.
The purpose of this section is to define those cases in which the machine must appear to operate sequentially, and in which operands of a single instruction must or must not be treated as overlapping.
Proper operation is provided in part by comparing effective addresses. For the purpose of this definition, the term "effective address" means an address before translation, if any, regardless of whether the address is virtual, real, or absolute. If two effective addresses have the same value, the effective addresses are said to be the same even though one may be real or in a different address space.
The values of two virtual effective addresses do not necessarily indicate whether or not the addresses designate the same storage location. The address-translation tables may be set up so that different effective addresses map to the same real address, or so that the same effective address in different address spaces maps to different real addresses.
The interlocks for virtual-storage references are considered in two situations: storage references of one instruction as they affect storage references of another instruction, and multiple storage references of a single instruction.
Subtopics:
When an instruction changes the contents of a main-storage location in which a conceptually subsequent instruction is to be executed, either directly or by means of EXECUTE, and when different effective addresses are used to designate that location for storing the result and fetching the instruction, the instruction may appear to be fetched before the store occurs. When either the storing instruction or the subsequent instruction is executed in the access-register mode or home-space mode or when the store is done by the vector facility, changes to the contents of storage are not necessarily recognized even if the effective address used to store the value and the effective address used to fetch the instruction are the same. If an intervening operation causes the prefetched instructions to be discarded, then the updated value is recognized. A definition of when prefetched instructions must be discarded is included in "Instruction Fetching" in topic 5.13.5.
As observed by the CPU itself, the storage accesses for operands for each instruction appear to occur in the conceptual sequence independent of the effective address used. That is, the operand stores for one instruction appear to be completed before the operand fetches for the next instruction occur. For instruction fetches, the operand stores for one instruction necessarily appear to be completed before the next instruction is fetched only when the same effective address is used for the operand store and the instruction fetch, and then only in the real mode, primary-space mode, or secondary-space mode and when the store is not done by the vector facility.
Any change to the storage key appears to be completed before the conceptually following reference to the associated storage block is made, regardless of whether the reference to the storage location is made by means of a virtual, real, or absolute address. Analogously, any conceptually prior references to the storage block appear to be completed when the key for that block is changed or inspected.
When multiple address spaces are involved in the access-register mode, the term "effective space designation" is used to denote the value used by the machine to determine whether two spaces are the same. In the access-register mode, the 32-bit access-list-entry-token (ALET) value associated with each storage-operand address is called the effective space designation. When a B field of zero is specified, a value of all zeros is used for the effective space designation. If the effective space designations are different, the spaces are considered to be different even if both ALETs map to the same segment-table-designation value.
For those instructions which alter the contents of storage and have more than one operand, the instruction definition normally describes the results which are obtained when the operands overlap in storage. This result is normally defined in terms of the sequence of the storage accesses; that is, a portion of the results of a store-type operand must appear to be placed in storage before some portion of the other operand is fetched. This definition applies provided that the store and fetch accesses are specified by means of the same effective addresses and the same effective space designations.
When the store and the fetch accesses are specified by means of different effective space designations or by means of different effective addresses, the operand fetch may appear to precede the operand store.
Figure 5-10 summarizes the cases of overlap and the specified results, including when MOVE LONG (MVCL) sets condition code 3, for each case.
____________ ______________ ________________ ______________________ |Effective |Effective |Operands |Is Overlap Recognized?| |Space |Addresses |Overlap |_________ ____________| |Designations|Overlap |Destructively |MVCL Sets| Operand | |Equal? |Destructively?|in Real Storage?| CC 3 | Results | |____________|______________|________________|_________|____________| | 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.| |___________________________________________________________________|Figure 5-10. Virtual-Storage Interlocks within a Single Instruction
Effective space designations may be represented by ALB entries, and the test for whether two effective space designations are the same may be performed by comparing ALB entries. If the program changes an attached and valid ART-table entry without subsequently causing the execution of PURGE ALB, two effective space designations that are the same may have different representations in the ALB, and failure to recognize operand overlap may result. The use of the ALB never causes overlap to be recognized when the effective space designations are different.Programming Note: A single main-storage location can be accessed by means of more than one address in several ways:
For case 5, for those instructions which fetch by using real addresses (for example, LOAD REAL ADDRESS, which fetches a segment-table entry and a page-table entry), no effect is observable because only operand accesses between instructions are involved. All instructions that store by using a real address, except STORE USING REAL ADDRESS (or vector-facility instructions executed with DAT off), or that store across address spaces, except in the access-register mode, cause prefetched instructions to be discarded, and no effect is observable.
Cases 6 and 7 are situations which are defined to cause serialization, with the result that prefetched instructions are discarded. In these cases, no effect is observable.
The handling of cases 8 and 9 involves accesses as observed by other CPUs and by channel programs and is covered in the following sections in this chapter.
The bytes of an instruction may be fetched piecemeal and are not necessarily accessed in a left-to-right direction. The instruction may be fetched multiple times for a single execution; for example, it may be fetched for testing the addressability of operands or for inspection of PER events, and it may be refetched for actual execution.
Instruction fetching consists in fetching the one, two, or three halfwords designated by the instruction address in the current PSW. The immediate field of an instruction is accessed as part of an instruction fetch. If, however, an instruction designates a storage operand at the location occupied by the instruction itself, the location is accessed both as an instruction and as a storage operand. The fetch of the target instruction of EXECUTE is considered to be an instruction fetch.
Instructions are not necessarily fetched in the sequence in which they are conceptually executed and are not necessarily fetched each time they are executed. In particular, the fetching of an instruction may precede the storage-operand references for an instruction that is conceptually earlier. The instruction fetch occurs prior to all storage-operand references for all instructions that are conceptually later.
An instruction may be prefetched by using a virtual address only when the associated DAT table entries are attached and valid or when entries which qualify for substitution for the table entries exist in the TLB. An instruction that has been prefetched may be interpreted for execution only for the same virtual address for which the instruction was prefetched.
No limit is established on the number of instructions which may be prefetched, and multiple copies of the contents of a single storage location may be fetched. As a result, the instruction executed is not necessarily the most recently fetched copy. Storing caused by other CPUs and by channel programs does not necessarily change the copy of prefetched instructions. However, if a non-vector-facility store that is conceptually earlier is made by the same CPU using the same effective address as that by which the instruction is subsequently fetched, and the CPU is in any of the real, primary-space, and secondary-space modes when the the storing instruction is executed and is in any of those modes when the subsequent instruction is executed, the updated information is obtained. If the store is caused by a vector-facility instruction, if the effective addresses are different, or if the CPU is in the access-register mode or home-space mode during either the storing execution or the execution of the instruction that is the destination of the store, the updated information is not necessarily obtained. However, the updated information is obtained if either execution is in the real mode since prefetched instructions are discarded if DAT is turned on or off.
All copies of prefetched instructions are discarded when:
Programming Notes:
It is possible for one CPU to prefetch the contents of a storage location, after which another CPU or a channel program can change the contents of that storage location and then set a flag to indicate that the change has been made. Subsequently, the first CPU can test and find the flag set, branch to the modified location, and execute the original prefetched contents.
It is possible, if another CPU or a channel program concurrently modifies the instruction, for one CPU to recognize the changes to some but not all bit positions of an instruction.
It is possible for one CPU to prefetch an instruction and subsequently, before the instruction is executed, for another CPU to change the storage key. As a result, the first CPU may appear to execute instructions from a protected storage location. However, the copy of the instructions executed is the copy prefetched before the location was protected.
The access-register-translation (ART) table entries are access-list designations, access-list entries, ASN-second-table entries, and authority-table entries. The dynamic-address-translation (DAT) table entries are segment-table entries and page-table entries. The fetching of these entries may occur as follows:
References to the storage key are handled as follows:
The change bit may be set in cases when no storing has occurred. See "Exceptions to Nullification and Suppression" in topic 5.3.7.
During the execution of an instruction, all or some of the storage operands for that instruction may be fetched, intermediate results may be maintained for subsequent modification, and final results may be temporarily held prior to placing them in storage. Stores caused by other CPUs and by channel programs do not necessarily affect these intermediate results.
A storage-operand reference is the fetching or storing of the explicit operand or operands in the storage locations designated by the instruction.
Storage-operand references are of three types: fetches, stores, and updates.
Subtopics:
All bits within a single byte of a fetch reference are accessed concurrently. When an operand consists of more than one byte, the bytes may be fetched from storage piecemeal, one byte at a time. Unless otherwise specified, the bytes are not necessarily fetched in any particular sequence.
When the bytes of a storage operand participate in the instruction execution only as a source, the operand is called a fetch-type operand, and the reference to the location is called a storage-operand fetch reference. A fetch-type operand is identified in individual instruction definitions by indicating that the access exception is for fetch.
The storage-operand fetch references of one instruction occur after those of all preceding instructions and before those of subsequent instructions, as observed by other CPUs and by channel programs. The operands of any one instruction are fetched in the sequence specified for that instruction. The CPU may fetch the operands of instructions before the instructions are executed. There is no defined limit on the length of time between when an operand is fetched and when it is used. Still, as observed by the CPU itself, its storage-operand references are performed in the conceptual sequence.
All bits within a single byte of a store reference are accessed concurrently. When an operand consists of more than one byte, the bytes may be placed in storage piecemeal, one byte at a time. Unless otherwise specified, the bytes are not necessarily stored in any particular sequence.
When the bytes of a storage operand participate in the instruction execution only as a destination, to the extent of being replaced by the result, the operand is called a store-type operand, and the reference to the location is called a storage-operand store reference. A store-type operand is identified in individual instruction definitions by indicating that the access exception is for store.
The CPU may delay placing results in storage. There is no defined limit on the length of time that results may remain pending before they are stored. This delay does not affect the sequence in which results are placed in storage.
The results of one instruction are placed in storage after the results of all preceding instructions have been placed in storage and before any results of the succeeding instructions are stored, as observed by other CPUs and by channel programs. The results of any one instruction are stored in the sequence specified for that instruction.
The CPU does not fetch operands, ART-table entries, or DAT-table entries from a storage location until all information destined for that location by the CPU has been stored. Prefetched instructions may appear to be updated before the information appears in storage.
The stores are necessarily completed only as a result of a serializing operation and before the CPU enters the stopped state.
For most instructions which have update-type operands, the fetch and store accesses associated with an update reference do not necessarily occur one immediately after the other, and it is possible for other CPUs and channel programs to make fetch and store accesses to the same location during this time. Such an update reference is sometimes called a noninterlocked-update storage reference.
In some instructions, the storage-operand location participates both as a source and as a destination. In these cases, the reference to the location consists first in a fetch and subsequently in a store. The operand is called an update-type operand, and the combination of the two accesses is referred to as an update reference. Instructions such as MOVE ZONES, TRANSLATE, OR (OC, OI), and ADD DECIMAL cause an update to the first-operand location. An update-type operand is identified in the individual instruction definition by indicating that the access exception is for both fetch and store.
For certain special instructions, the update reference is interlocked against certain accesses by other CPUs. Such an update reference is called an interlocked-update reference. The fetch and store accesses associated with an interlocked-update reference do not necessarily occur one immediately after the other, but all store accesses and the fetch and store accesses associated with interlocked-update references by other CPUs are prevented from occurring at the same location between the fetch and the store accesses of an interlocked-update reference. Accesses by channel programs may occur to the location during the interlock period.
The storage-operand update reference for the following instructions appears to be an interlocked-update reference as observed by other CPUs. The instructions TEST AND SET, COMPARE AND SWAP, and COMPARE DOUBLE AND SWAP perform an interlocked-update reference. On models in which the STORE CHARACTERS UNDER MASK instruction with a mask of zero fetches and stores the byte designated by the second-operand address, the fetch and store accesses are an interlocked-update reference.
Within the limitations of the above requirements, the fetch and store accesses associated with an update reference follow the same rules as the fetches and stores described in the previous sections.
Programming Notes:
Depending on the model, an access to store information may be performed, for example, in the following cases:
Subtopics:
Except for the accesses associated with multiple-access references and the stores associated with storage change and restoration for DAT-associated access exceptions, all storage-operand references are single-access references.
A fetch reference is said to be a single-access reference if the value is fetched in a single access to each byte of the data field. In the case of overlapping operands, the location may be accessed once for each operand. A store-type reference is said to be a single-access reference if a single store access occurs to each byte location within the data field. An update reference is said to be single access if both the fetch and store accesses are each single access.
In some cases, multiple accesses may be made to all or some of the bytes of a storage operand. The following cases may involve multiple-access references:
Programming Notes:
For some references, the accesses to all bytes within a halfword, word, or doubleword are specified to appear to be block-concurrent as observed by other CPUs. These accesses do not necessarily appear to channel programs to include more than a byte at a time. The halfword, word, or doubleword is referred to in this section as a block. When a fetch-type reference is specified to appear to be concurrent within a block, no store access to the block by another CPU is permitted during the time that bytes contained in the block are being fetched. Accesses to the bytes within the block by channel programs may occur between the fetches. When a store-type reference is specified to appear to be concurrent within a block, no access to the block, either fetch or store, is permitted by another CPU during the time that the bytes within the block are being stored. Accesses to the bytes in the block by channel programs may occur between the stores.
For the instructions COMPARE AND SWAP and COMPARE DOUBLE AND SWAP, all accesses to the storage operand appear to be block-concurrent as observed by other CPUs.
For all instructions in the S format and RX format, with the exception of EXECUTE, CONVERT TO DECIMAL, CONVERT TO BINARY, and the I/O instructions, when the operand is addressed on a boundary which is integral to the size of the operand, the storage-operand references appear to be block-concurrent as observed by other CPUs.
The instructions LOAD MULTIPLE and STORE MULTIPLE, when the operand starts on a word boundary, and the instructions COMPARE LOGICAL (CLC), COMPARE LOGICAL CHARACTERS UNDER MASK, INSERT CHARACTERS UNDER MASK, and STORE CHARACTERS UNDER MASK access their storage operands in a left-to-right direction, and all bytes accessed within each doubleword appear to be accessed concurrently as observed by other CPUs.
The instructions LOAD ACCESS MULTIPLE, LOAD CONTROL, STORE ACCESS MULTIPLE, and STORE CONTROL access the storage operand in a left-to-right direction, and all bytes accessed within each word appear to be accessed concurrently as observed by other CPUs.
When destructive overlap does not exist, the operands of MOVE (MVC), MOVE WITH KEY, MOVE TO PRIMARY, and MOVE TO SECONDARY are accessed as follows:
The operands of MOVE WITH SOURCE KEY, MOVE WITH DESTINATION KEY, and MOVE STRING are accessed the same as those of MOVE (MVC), except that destructive overlap is assumed not to exist.
The operands for MOVE LONG and MOVE LONG EXTENDED appear to be accessed doubleword-concurrent as observed by other CPUs when all of the following are true:
The operands for COMPARE LOGICAL STRING appear to be accessed doubleword-concurrent as observed by other CPUs when both operands start on doubleword boundaries. The operand for SEARCH STRING appears to be accessed doubleword-concurrent as observed by other CPUs when it starts on a doubleword boundary.
For EXCLUSIVE OR (XC), the operands are processed in a left-to-right direction, and, when the first and second operands coincide, all bytes accessed within a doubleword appear to be accessed concurrently as observed by other CPUs.
Programming Note: In the case of EXCLUSIVE OR (XC) designating operands which coincide exactly, the bytes within the field may appear to be accessed as many as three times, by two fetches and one store: once as the fetch portion of the first operand update, once as the second-operand fetch, and then once as the store portion of the first-operand update. Each of the three accesses appears to be doubleword-concurrent as observed by other CPUs, but the three accesses do not necessarily appear to occur one immediately after the other. One or both fetch accesses may be omitted since the instruction can be completed without fetching the operands.
When an instruction has two storage operands both of which cause fetch references, it is unpredictable which operand is fetched first, or how much of one operand is fetched before the other operand is fetched. When the two operands overlap, the common locations may be fetched independently for each operand.
As observed by other CPUs and by channel programs, storage-operand fetches associated with one instruction execution appear to precede all storage-operand references for conceptually subsequent instructions. A storage-operand store specified by one instruction appears to precede all storage-operand stores specified by conceptually subsequent instructions, but it does not necessarily precede storage-operand fetches specified by conceptually subsequent instructions. However, a storage-operand store appears to precede a conceptually subsequent storage-operand fetch from the same main-storage location.
When an instruction has two storage operands the first of which causes a store and the second a fetch reference, it is unpredictable how much of the second operand is fetched before the results are stored. In the case of destructively overlapping operands, the portion of the second operand which is common to the first is not necessarily fetched from storage.
When an instruction has two storage operands the first of which causes an update reference and the second a fetch reference, it is unpredictable which operand is fetched first, or how much of one operand is fetched before the other operand is fetched. Similarly, it is unpredictable how much of the result is processed before it is returned to storage. In the case of destructively overlapping operands, the portion of the second operand which is common to the first is not necessarily fetched from storage.
The independent fetching of a single location for each of two operands may affect the program execution in the following situation. When the same storage location is designated by two operand addresses of an instruction, and another CPU or a channel program causes the contents of the location to change during execution of the instruction, the old and new values of the location may be used simultaneously. For example, comparison of a field to itself may yield a result other than equal, or EXCLUSIVE-ORing of a field with itself may yield a result other than zero.
Store accesses for interruption codes are not necessarily single-access stores. The store accesses for the external and supervisor-call-interruption codes appear to occur between the conceptually previous and conceptually subsequent operations. The store accesses for the program-interruption codes may precede the storage-operand references associated with the instruction which results in the program interruption.
The restart, program, supervisor-call, external, input/output, and machine-check PSWs appear to be accessed doubleword-concurrent as observed by other CPUs. These references appear to occur after the conceptually previous unit of operation and before the conceptually subsequent unit of operation. The relationship between the new-PSW fetch, the old-PSW store, and the interruption-code store is unpredictable.
The sequence of functions performed by a CPU is normally independent of the functions performed by other CPUs and by channel programs. Similarly, the sequence of functions performed by a channel program is normally independent of the functions performed by other channel programs and by CPUs. However, at certain points in its execution, serialization of the CPU occurs. Serialization also occurs at certain points for channel programs.
Subtopics:
Serialization is performed by CPU reset, all interruptions, and by the execution of the following instructions:
All interruptions and the execution of certain instructions cause a serialization of CPU operations. A serialization operation consists in completing all conceptually previous storage accesses by the CPU, as observed by other CPUs and by channel programs, before the conceptually subsequent storage accesses occur. Serialization affects the sequence of all CPU accesses to storage and to the storage keys, except for those associated with ART-table-entry and DAT-table-entry fetching.
Programming Notes:
CPU 1 CPU 2MVI A,X'00' G CLI A,X'00' BCR 15,0 BNE G
The BCR 15,0 instruction executed by CPU 1 is a serializing instruction that ensures that the store by CPU 1 at location A is completed. However, CPU 2 may loop indefinitely, or until the next I/O or external interruption on CPU 2, because CPU 2 may already have fetched from location A for every execution of the CLI instruction. A serializing instruction must be in the CPU-2 loop to ensure that CPU 2 will again fetch from location A.
Serialization of a channel program occurs as follows:
The interruption mechanism permits the CPU to change its state as a result of conditions external to the configuration, within the configuration, or within the CPU itself. To permit fast response to conditions of high priority and immediate recognition of the type of condition, interruption conditions are grouped into six classes: external, input/output, machine check, program, restart, and supervisor call.
Subtopics:
The old PSW stored on an interruption normally contains the address of the instruction that would have been executed next had the interruption not occurred, thus permitting resumption of the interrupted program. For program and supervisor-call interruptions, the information stored also contains a code that identifies the length of the last-executed instruction, thus permitting the program to respond to the cause of the interruption. In the case of some program conditions for which the normal response is reexecution of the instruction causing the interruption, the instruction address directly identifies the instruction last executed.
An interruption consists in storing the current PSW as an old PSW, storing information identifying the cause of the interruption, and fetching a new PSW. Processing resumes as specified by the new PSW.
Except for restart, an interruption can occur only when the CPU is in the operating state. The restart interruption can occur with the CPU in either the stopped or operating state.
The details of source identification, location determination, and instruction execution are explained in later sections and are summarized in Figure 6-1.
___________________ ________________________ _____ _________ _______ _____________ | | | |Mask Bits| | | | | | |in Ctrl | |Execution of | | | |PSW- |Registers| |Instruction | | Source | Interruption |Mask | | ILC |Identified | | Identification | Code |Bits |Reg, Bit| Set |by Old PSW | |___________________|________________________|_____|_________|_______|_____________| |MACHINE CHECK |Locations 232-239¹ | | | | | | (old PSW 48, | | | | | | | new PSW 112) | | | | | | | | | | | | | |Exigent condition | | 13 | | u |terminated or| | | | | | | nullified² | |Repressible cond | | 13 |14, 3-7 | u |unaffected² | |___________________|________________________|_____|_________|_______|_____________| |SUPERVISOR CALL |Locations 138-139 | | | | | | (old PSW 32, | | | | | | | new PSW 96) | | | | | | | | | | | | | |Instruction bits |00000000 ssssssss | | | 1,2 |completed | |___________________|________________________|_____|_________|_______|_____________| |PROGRAM |Locations 142-143 | | | | | | (old PSW 40, |__________________ _____| | | | | | new PSW 104) | Binary |Hex³ | | | | | | |__________________|_____| | | | | |Operation |00000000 p0000001 |0001 | | | 1,2,3|suppressed | |Privileged oper |00000000 p0000010 |0002 | | | 2,3|suppressed | |Execute |00000000 p0000011 |0003 | | | 2 |suppressed | |Protection |00000000 p0000100 |0004 | | | 1,2,3|suppressed or| | | | | | | | terminated | |Addressing |00000000 p0000101 |0005 | | | 1,2,3|suppressed or| | | | | | | | terminated | |Specification |00000000 p0000110 |0006 | | |0,1,2,3|suppressed or| | | | | | | | completed | |Data |00000000 p0000111 |0007 | | | 2,3|suppressed or| | | | | | | | terminated | |Fixed-pt overflow |xxxxxxxx p0001000 |0008 | 20 | | 1,2 |completed | |Fixed-point divide |00000000 p0001001 |0009 | | | 1,2 |suppressed or| | | | | | | | completed | |Decimal overflow |00000000 p0001010 |000A | 21 | | 2,3|completed | |Decimal divide |00000000 p0001011 |000B | | | 2,3|suppressed | |Exponent overflow |xxxxxxxx p0001100 |000C | | | 1,2 |completed | |Exponent underflow |xxxxxxxx p0001101 |000D | 22 | | 1,2 |completed | |Significance |xxxxxxxx p0001110 |000E | 23 | | 1,2 |completed | |Floating-pt divide |xxxxxxxx p0001111 |000F | | | 1,2 |suppressed or| | | | | | | | inhibited4 | |Segment transl |00000000 p0010000 |0010 | | | 1,2,3|nullified | |Page translation |00000000 p0010001 |0011 | | | 1,2,3|nullified | |Translation spec |00000000 p0010010 |0012 | | | 1,2,3|suppressed | |Special operation |00000000 p0010011 |0013 | | 0, 1 | 1,2,3|suppressed | |Operand |00000000 p0010101 |0015 | | | 2 |suppressed | |Trace table |00000000 p0010110 |0016 | | | 1,2 |nullified | |ASN-transl spec |00000000 p0010111 |0017 | | | 1,2,3|suppressed | |Vector operation4 |00000000 p0011001 |0019 | | | 2,3|nullified | |Space-switch event |00000000 p0011100 |001C | | 1, 0 |0,1,2 |completed | |Square root |00000000 p0011101 |001D | | | 2 |suppressed or| | | | | | | | inhibited | |Unnormalized |xxxxxxxx p0011110 |001E | | | 2 |inhibited4 | | operand4 | | | | | | | |PC-transl spec |00000000 p0011111 |001F | | | 2 |suppressed | |AFX translation |00000000 p0100000 |0020 | | | 1,2 |nullified | |ASX translation |00000000 p0100001 |0021 | | | 1,2 |nullified | |LX translation |00000000 p0100010 |0022 | | | 2 |nullified | |EX translation |00000000 p0100011 |0023 | | | 2 |nullified | |___________________|__________________|_____|_____|_________|_______|_____________| ___________________ ________________________ _____ _________ _______ _____________ | | | |Mask Bits| | | | | | |in Ctrl | |Execution of | | | |PSW- |Registers| |Instruction | | Source | Interruption |Mask | | ILC |Identified | | Identification | Code |Bits |Reg, Bit| Set |by Old PSW | |___________________|__________________ _____|_____|_________|_______|_____________| |Primary authority |00000000 p0100100 |0024 | | | 2 |nullified | |Secondary auth |00000000 p0100101 |0025 | | | 1,2 |nullified | |ALET specification |00000000 p0101000 |0028 | | | 1,2,3|suppressed | |ALEN translation |00000000 p0101001 |0029 | | | 1,2,3|nullified | |ALE sequence |00000000 p0101010 |002A | | | 1,2,3|nullified | |ASTE validity |00000000 p0101011 |002B | | | 1,2,3|nullified | |ASTE sequence |00000000 p0101100 |002C | | | 1,2,3|nullified | |Extended authority |00000000 p0101101 |002D | | | 1,2,3|nullified | |Stack full |00000000 p0110000 |0030 | | | 2 |nullified | |Stack empty |00000000 p0110001 |0031 | | | 1,2 |nullified | |Stack specification|00000000 p0110010 |0032 | | | 1,2 |nullified | |Stack type |00000000 p0110011 |0033 | | | 1,2 |nullified | |Stack operation |00000000 p0110100 |0034 | | | 1,2 |nullified | |Monitor event |00000000 p1000000 |0040 | | 8, 16-31| 2 |completed | |PER event |xxxxxxxx 1nnnnnnn5|0080 | 1 | 9, 0-4@ |0,1,2,3|completed6 | |___________________|__________________|_____|_____|_________|_______|_____________| |EXTERNAL |Locations 134-135 | | | | | | (old PSW 24, |__________________ _____| | | | | | new PSW 88) | Binary |Hex³ | | | | | | |__________________|_____| | | | | |Interrupt key |00000000 01000000 |0040 | 7 | 0, 25 | u |unaffected | |Malfunction alert |00010010 00000000 |1200 | 7 | 0, 16 | u |unaffected | |Emergency signal |00010010 00000001 |1201 | 7 | 0, 17 | u |unaffected | |External call |00010010 00000010 |1202 | 7 | 0, 18 | u |unaffected | |TOD-clock sync chk |00010000 00000011 |1003 | 7 | 0, 19 | u |unaffected | |Clock comparator |00010000 00000100 |1004 | 7 | 0, 20 | u |unaffected | |CPU timer |00010000 00000101 |1005 | 7 | 0, 21 | u |unaffected | |Service signal |00100100 00000001 |2401 | 7 | 0, 22 | u |unaffected | |___________________|__________________|_____|_____|_________|_______|_____________| |INPUT/OUTPUT |Locations 184-191 | | | | | | (old PSW 56, | | | | | | | new PSW 120) | | | | | | | | | | | | | |I/O-interruption | | 6 | 6, 0-77 | u |unaffected | | subclass | | | | | | |___________________|________________________|_____|_________|_______|_____________| |RESTART |None | | | | | | (old PSW 8, | | | | | | | new PSW 0) | | | | | | | | | | | | | |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- | | ruption conditions represented by n, p, or x in the column labeled "Binary." | | 4 Vector-operation and unnormalized-operand exceptions are associated with | | the vector facility. "Inhibited" is a type of ending which occurs only for | | instructions associated with the vector facility. These are described in | | the publication IBM Enterprise Systems Architecture/390 Vector Operations, | | SA22-7207. | | 5 When the interruption code indicates a PER event, an ILC of 0 may be stored | | only when bits 8-15 of the interruption code are 10000110 (PER, specifi- | | cation). | | 6 The unit of operation is completed, unless a program exception concurrently | | indicated causes the unit of operation to be inhibited, nullified, suppressed,| | or terminated. | | 7 Bits 0-7 of control register 6 provide detailed masking of I/O-interruption | | subclasses 0-7 respectively. | | @ Additional masks in control register 9, bit positions 16-31, provide detailed | | control over the source of PER general-register-alteration events which are | | masked by control register 9, bit 3. | | 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. | | x Exception-extension code. This field is described in the publication IBM | | Enterprise Systems Architecture/390 Vector Operations, SA22-7207. This field | | is set to zero except by vector instructions. | |__________________________________________________________________________________|Figure 6-1. Interruption Action
Subtopics:
For external interruptions, the interruption code is stored at real locations 134-135. A parameter may be stored at real locations 128-131, or a CPU address may be stored at real locations 132-133.
The six classes of interruptions (external, I/O, machine check, program, restart, and supervisor call) are distinguished by the storage locations at which the old PSW is stored and from which the new PSW is fetched. For most classes, the causes are further identified by an interruption code and, for some classes, by additional information placed in permanently assigned real storage locations during the interruption. (See also "Assigned Storage Locations" in topic 3.13.) For external, program, and supervisor-call interruptions, the interruption code consists of 16 bits.
For I/O interruptions, the I/O-interruption code is stored at real locations 184-191. The I/O-interruption code consists of a 32-bit subsystem-identification word and a 32-bit interruption parameter.
For machine-check interruptions, the interruption code consists of 64 bits and is stored at real locations 232-239. Additional information for identifying the cause of the interruption and for recovering the state of the machine may be provided by the contents of the machine-check failing-storage address and the contents of the fixed-logout and machine-check-save areas. (See Chapter 11, "Machine-Check Handling.")
For program interruptions, the interruption code is stored at real locations 142-143, and the instruction-length code is stored in bit positions 5 and 6 of real location 141. Further information may be provided in the form of the translation-exception identification, exception access identification, monitor-class number, monitor code, PER code, PER access identification, and PER address, which are stored at real locations 144-161.
For restart interruptions, no interruption code is stored.
For supervisor-call interruptions, the interruption code is stored at real locations 138-139, and the instruction-length code is stored in bit positions 5 and 6 of real location 137.
When a mask bit is zero, the CPU is disabled for the corresponding interruptions. The conditions that cause I/O interruptions remain pending. External-interruption conditions either remain pending or persist until the cause is removed. Machine-check-interruption conditions, depending on the type, are ignored, remain pending, or cause the CPU to enter the check-stop state. The disallowed program-interruption conditions are ignored, except that some causes are indicated also by the setting of the condition code. The setting of the significance and exponent-underflow program-mask bits affects the manner in which floating-point operations are completed when the corresponding condition occurs.
By means of mask bits in the current PSW and in control registers, the CPU may be enabled or disabled for all external, I/O, and machine-check interruptions and for some program interruptions. When a mask bit is one, the CPU is enabled for the corresponding class of interruptions, and these interruptions can occur.
The CPU is always enabled for program interruptions for which mask bits are not provided, as well as the supervisor-call and restart interruptions.
The mask bits may allow or disallow all interruptions within the class, or they may selectively allow or disallow interruptions for particular causes. This control may be provided by mask bits in the PSW that are assigned to particular causes, such as the bits assigned to the four maskable program-interruption conditions. Alternatively, there may be a hierarchy of masks, where a mask bit in the PSW controls all interruptions within a type, and mask bits in a control register provide more detailed control over the sources.
When the mask bit is one, the CPU is enabled for the corresponding interruptions. When the mask bit is zero, these interruptions are disallowed. Interruptions that are controlled by a hierarchy of masks are allowed only when all controlling mask bits are ones.
Programming Notes:
Service signal, I/O, and certain machine-check conditions are floating interruption conditions.
An interruption condition which can be presented to any CPU in the configuration is called a floating interruption condition. The condition is presented to the first CPU in the configuration which is enabled for the corresponding interruption and which can perform the interruption, and then the condition is cleared and not presented to any other CPU in the configuration. A CPU cannot perform the interruption when it is in the check-stop state, has an invalid prefix, is in a string of program interruptions due to a specification exception of the type which is recognized early, or is in the stopped state. However, a CPU with the rate control set to instruction step can perform the interruption when the start key is activated.
The ILC for program and supervisor-call interruptions is stored in bit positions 5 and 6 of the bytes at real locations 141 and 137, respectively. For external, I/O, machine-check, and restart interruptions, the ILC is not stored since it cannot be related to the length of the last-executed instruction.
The instruction-length code (ILC) occupies two bit positions and provides the length of the last instruction executed. It permits identifying the instruction causing the interruption when the instruction address in the old PSW designates the next sequential instruction. The ILC is provided also by the BRANCH AND LINK instructions in the 24-bit addressing mode.
For supervisor-call and program interruptions, a nonzero ILC identifies in halfwords the length of the instruction that was last executed. That instruction may be one for which a specification exception was recognized due to an odd instruction address or for which an access exception (addressing, page-translation, protection, segment-translation, or translation-specification) was recognized during the fetching of the instruction. Whenever an instruction is executed by means of EXECUTE, instruction-length code 2 is set to indicate the length of EXECUTE and not that of the target instruction.
The value of a nonzero instruction-length code is related to the leftmost two bits of the instruction. The value does not depend on whether the operation code is assigned or on whether the instruction is installed. The following table summarizes the meaning of the instruction-length code:
______________ _____ _______________ | ILC |Instr| | |_______ ______|Bits | Instruction | |Decimal|Binary| 0-1 | Length | |_______|______|_____|_______________| | 0 | 00 | |Not available | | 1 | 01 | 00 |One halfword | | 2 | 10 | 01 |Two halfwords | | 2 | 10 | 10 |Two halfwords | | 3 | 11 | 11 |Three halfwords| |_______|______|_____|_______________|
Subtopics:
An ILC of 0 occurs when a specification exception due to a PSW-format error is recognized as part of early exception recognition and the PSW has been introduced by LOAD PSW, PROGRAM RETURN, or an interruption. (See "Exceptions Associated with the PSW" in topic 6.1.5.) In the case of LOAD PSW or PROGRAM RETURN, the instruction address of LOAD PSW, PROGRAM RETURN, or EXECUTE has been replaced by the instruction address in the new PSW. When the invalid PSW is introduced by an interruption, the PSW-format error cannot be attributed to an instruction.
Instruction-length code 0, after a program interruption, indicates that the instruction address stored in the old PSW does not identify the instruction causing the interruption.
In the case of LOAD PSW, PROGRAM RETURN, and the supervisor-call interruption, a PER event may be indicated concurrently with a specification exception having an ILC of 0.
In the case of a PROGRAM RETURN instruction that causes both a space-switch event and a PSW-format error, the space-switch event is recognized, but it is unpredictable whether the ILC is 0 or 1, or 0 or 2 if EXECUTE was used.
When a program interruption occurs because of an exception that prohibits access to the instruction, the instruction is considered to have been executed, but the instruction-length code cannot be set on the basis of the first two bits of the instruction. As far as the significance of the ILC for this case is concerned, the following two situations are distinguished:
When any exceptions are encountered on fetching the target instruction of EXECUTE, the ILC is 2.
Programming Notes:
For situation c, the instruction address has been replaced as part of the operation, and the address of the last instruction executed cannot be calculated using the one appearing in the program old PSW.
For situation d, the effective address of the last instruction executed can be calculated, but, since the segment-table designation for the instruction address space is unpredictable, the corresponding real address is unknown.
For situation c, the address of the last instruction executed is available, but the corresponding real address is unknown.
Exceptions associated with erroneous information in the current PSW may be recognized when the information is introduced into the PSW or may be recognized as part of the execution of the next instruction. Errors in the PSW which are specification-exception conditions are called PSW-format errors.
Subtopics:
For the following error conditions, a program interruption for a specification exception occurs immediately after the PSW becomes active:
When an interruption or the execution of LOAD PSW or PROGRAM RETURN introduces a PSW with one of the above error conditions, the instruction-length code is set to 0, and the newly introduced PSW is stored unmodified as the old PSW. When one of the above error conditions is introduced by execution of SET SYSTEM MASK or STORE THEN OR SYSTEM MASK, the instruction-length code is set to 2, and the instruction address is incremented by 4. The PSW containing the invalid value introduced into the system-mask field is stored as the old PSW.
When a PSW with one of the above error conditions is introduced during initial program loading, the loading sequence is not completed, and the load indicator remains on.
For the following conditions, the exception is recognized as part of the execution of the next instruction:
If an I/O, external, or machine-check-interruption condition is pending and the PSW causes the CPU to be enabled for that condition, the corresponding interruption occurs, and the PSW is not inspected for exceptions which are recognized late. Similarly, a PSW specifying the wait state is not inspected for exceptions which are recognized late.
Programming Notes:
An external interruption causes the old PSW to be stored at real location 24 and a new PSW to be fetched from real location 88.
The external interruption provides a means by which the CPU responds to various signals originating from either inside or outside the configuration.
The source of the interruption is identified in the interruption code which is stored at real locations 134-135. The instruction-length code is not stored.
Additionally, for the malfunction-alert, emergency-signal, and external-call conditions, a 16-bit CPU address is associated with the source of the interruption and is stored at real locations 132-133. When the CPU address is stored, bit 6 of the interruption code is set to one. For all other conditions, no CPU address is stored, bit 6 of the interruption code is set to zero, and zeros are stored at real locations 132-133.
For the service-signal interruption, a 32-bit parameter is associated with the interruption and is stored at real locations 128-131. Bit 5 of the external-interruption code indicates that a parameter has been stored. When bit 5 is zero, the contents of real locations 128-131 remain unchanged.
External-interruption conditions are of two types: those for which an interruption-request condition is held pending, and those for which the condition directly requests the interruption. Clock comparator, CPU timer, and TOD-clock sync check are conditions which directly request external interruptions. If a condition which directly requests an external interruption is removed before the request is honored, the request does not remain pending, and no interruption occurs. Conversely, the request is not cleared by the interruption, and if the condition persists, more than one interruption may result from a single occurrence of the condition.
When several interruption requests for a single source are generated before the interruption occurs, and the interruption condition is of the type which is held pending, only one request for that source is preserved and remains pending.
An external interruption for a particular source can occur only when the CPU is enabled for interruption by that source. The external interruption occurs at the completion of a unit of operation. The external mask, PSW bit 7, and external subclass-mask bits in control register 0 control whether the CPU is enabled for a particular source. Each source for an external interruption has a subclass-mask bit assigned to it, and the source can cause an interruption only when the external-mask bit is one and the corresponding subclass-mask bit is one.
When the CPU becomes enabled for a pending external-interruption condition, the interruption occurs at the completion of the instruction execution or interruption that causes the enabling.
More than one source may present a request for an external interruption at the same time. When the CPU becomes enabled for more than one concurrently pending request, the interruption occurs for the pending condition or conditions having the highest priority.
The priorities for external-interruption requests in descending order are as follows:
Subtopics:
An interruption request for the clock comparator exists whenever either of the following conditions is met:
When the TOD clock accessed by a CPU is set or changes state, interruption conditions, if any, that are due to the clock comparator may or may not be recognized for up to 1.048576 seconds after the change.
The subclass-mask bit is in bit position 20 of control register 0. This bit is initialized to zero.
The clock-comparator condition is indicated by an external-interruption code of 1004 hex.
When the TOD clock accessed by a CPU is set or changes state, interruption conditions, if any, that are due to the CPU timer may or may not be recognized for up to 1.048576 seconds after the change.
An interruption request for the CPU timer exists whenever the CPU-timer value is negative (bit 0 of the CPU timer is one). If the value is made positive before the request is honored, the request does not remain pending, and no interruption occurs. Conversely, the request is not cleared by the interruption, and, if the condition persists, more than one interruption may occur from a single occurrence of the condition.
The subclass-mask bit is in bit position 21 of control register 0. This bit is initialized to zero.
The CPU-timer condition is indicated by an external-interruption code of 1005 hex.
Facilities are provided for holding a separate emergency-signal request pending in the receiving CPU for each CPU in the configuration, including the receiving CPU itself.
An interruption request for an emergency signal is generated when the CPU accepts the emergency-signal order specified by a SIGNAL PROCESSOR instruction addressing this CPU. The instruction may have been executed by this CPU or by another CPU in the configuration. The request is preserved and remains pending in the receiving CPU until it is cleared. The pending request is cleared when it causes an interruption and by CPU reset.
The subclass-mask bit is in bit position 17 of control register 0. This bit is initialized to zero.
The emergency-signal condition is indicated by an external-interruption code of 1201 hex. The address of the CPU that executed the SIGNAL PROCESSOR instruction is stored at real locations 132-133.
Only one external-call request, along with the processor address, may be held pending in a CPU at a time.
An interruption request for an external call is generated when the CPU accepts the external-call order specified by a SIGNAL PROCESSOR instruction addressing this CPU. The instruction may have been executed by this CPU or by another CPU in the configuration. The request is preserved and remains pending in the receiving CPU until it is cleared. The pending request is cleared when it causes an interruption and by CPU reset.
The subclass-mask bit is in bit position 18 of control register 0. This bit is initialized to zero.
The external-call condition is indicated by an external-interruption code of 1202 hex. The address of the CPU that executed the SIGNAL PROCESSOR instruction is stored at real locations 132-133.
When the interrupt key is activated while the CPU is in the load state, it depends on the model whether an interruption request is generated or the condition is lost.
An interruption request for the interrupt key is generated when the operator activates that key. The request is preserved and remains pending in the CPU until it is cleared. The pending request is cleared when it causes an interruption and by CPU reset.
The subclass-mask bit is in bit position 25 of control register 0. This bit is initialized to one.
The interrupt-key condition is indicated by an external-interruption code of 0040 hex.
Facilities are provided for holding a separate malfunction-alert request pending in the receiving CPU for each of the other CPUs in the configuration. Removal of a CPU from the configuration does not generate a malfunction-alert condition.
An interruption request for a malfunction alert is generated when another CPU in the configuration enters the check-stop state or loses power. The request is preserved and remains pending in the receiving CPU until it is cleared. The pending request is cleared when it causes an interruption and by CPU reset.
The subclass-mask bit is in bit position 16 of control register 0. This bit is initialized to zero.
The malfunction-alert condition is indicated by an external-interruption code of 1200 hex. The address of the CPU that generated the condition is stored at real locations 132-133.
Service signal is a floating interruption condition and is presented to the first CPU in the configuration which can perform the interruption. The interruption condition is cleared when it causes an interruption in any one of the CPUs and also by subsystem reset.
An interruption request for a service signal is generated upon the completion of certain configuration-control and maintenance functions, such as those initiated by means of the model-dependent DIAGNOSE instruction. A 32-bit parameter is provided with the interruption to assist the program in determining the operation for which the interruption is reported.
The subclass-mask bit is in bit position 22 of control register 0. This bit is initialized to zero.
The service-signal condition is indicated by an external-interruption code of 2401 hex. A 32-bit parameter is stored at real locations 128-131.
An interruption request for a TOD-clock sync check exists when the TOD clock accessed by this CPU is running (that is, the clock is in the set or not-set state), the clock accessed by any other CPU in the configuration is running, and bits 32-63 of the two clocks do not match. When a clock is set or changes state, or when a running clock is added to the configuration, a delay of up to 1.048576 seconds (2²0 microseconds) may occur before the mismatch condition is recognized.
The TOD-clock-sync-check condition indicates that more than one TOD clock exists in the configuration, and that the rightmost 32 bits of the clocks are not running in synchronism.
When only two TOD clocks are in the configuration and either or both of the clocks are in the error, stopped, or not-operational state, it is unpredictable whether a TOD-clock-sync-check condition is recognized; if the condition is recognized, it may continue to persist up to 1.048576 seconds after both clocks have been running with the rightmost 32 bits matching. However, in this case, the condition does not persist if one of the TOD clocks is removed from the configuration.
When more than one CPU shares a TOD clock, only the CPU with the smallest CPU address among those sharing the clock indicates a TOD-clock-sync-check condition associated with that clock.
If the condition responsible for the request is removed before the request is honored, the request does not remain pending, and no interruption occurs. Conversely, the request is not cleared by the interruption, and, if the condition persists, more than one interruption may result from a single occurrence of the condition.
The subclass-mask bit is in bit position 19 of control register 0. This bit is initialized to zero.
The TOD-clock-sync-check condition is indicated by an external-interruption code of 1003 hex.
A request for an I/O interruption may occur at any time, and more than one request may occur at the same time. The requests are preserved and remain pending until accepted by a CPU, or until cleared by some other means, such as subsystem reset.
The input/output (I/O) interruption provides a means by which the CPU responds to conditions originating in I/O devices and the channel subsystem.
The I/O interruption occurs at the completion of a unit of operation. Priority is established among requests so that in each CPU only one interruption request is processed at a time. Priority among requests for interruptions of differing I/O-interruption subclasses is according to the numerical value of the I/O-interruption subclass (with zero having the highest priority), in conjunction with the I/O-interruption subclass-mask settings in control register 6. For more details, see Chapter 16, "I/O Interruptions."
When a CPU becomes enabled for I/O interruptions and the channel subsystem has established priority for a pending I/O-interruption condition, the interruption occurs at the completion of the instruction execution or interruption that causes the enabling.
An I/O interruption causes the old PSW to be stored at real location 56 and a new PSW to be fetched from real location 120. Additional information, in the form of an eight-byte I/O-interruption code, is stored at real locations 184-191. The I/O-interruption code consists of a 32-bit subsystem-identification word and a 32-bit interruption parameter.
An I/O interruption can occur only while a CPU is enabled for the interruption subclass presenting the request. The I/O-mask bit, bit 6 of the PSW, and the I/O-interruption subclass mask in control register 6 determine whether the CPU is enabled for a particular I/O interruption.
I/O interruptions are grouped into eight I/O-interruption subclasses, numbered from 0-7. Each I/O-interruption subclass has an associated I/O-interruption subclass-mask bit in bit positions 0-7 of control register 6. Each subchannel has an I/O-interruption subclass value associated with it. The CPU is enabled for I/O interruptions of a particular I/O-interruption subclass only when PSW bit 6 is one and the associated I/O-interruption subclass-mask bit in control register 6 is also one. If the corresponding I/O-interruption subclass-mask bit is zero, then the CPU is disabled for I/O interruptions with that subclass value. I/O interruptions for all subclasses are disallowed when PSW bit 6 is zero.
A machine-check interruption causes the old PSW to be stored at real location 48 and a new PSW to be fetched from real location 112.
The machine-check interruption is a means for reporting to the program the occurrence of equipment malfunctions. Information is provided to assist the program in determining the source of the fault and extent of the damage.
The cause and severity of the malfunction are identified by a 64-bit machine-check-interruption code stored at real locations 232-239. Further information identifying the cause of the interruption and the location of the fault may be stored at real locations 216-511.
The interruption action and the storing of the associated information are under the control of PSW bit 13 and bits in control register 14. See Chapter 11, "Machine-Check Handling" for more detailed information.
A program interruption causes the old PSW to be stored at real location 40 and a new PSW to be fetched from real location 104.
Program interruptions are used to report exceptions and events which occur during execution of the program.
The cause of the interruption is identified by the interruption code. The interruption code is placed at real locations 142-143, the instruction-length code is placed in bit positions 5 and 6 of the byte at real location 141 with the rest of the bits set to zeros, and zeros are stored at real location 140. For some causes, additional information identifying the reason for the interruption is stored at real locations 144-161.
Except for PER events, the condition causing the interruption is indicated by a coded value placed in the rightmost seven bit positions of the interruption code. Only one condition at a time can be indicated. Bits 0-7 of the interruption code are set to zeros, except when they are set with an exception-extension code by a vector instruction.
PER events are indicated by setting bit 8 of the interruption code to one. When this is the only condition, bits 0-7 and 9-15 are also set to zeros. When a PER event is indicated concurrently with another program-interruption condition, bit 8 is one, and the coded value for the other condition is indicated in bit positions 0-7 and 9-15.
When there is a corresponding mask bit, a program interruption can occur only when that mask bit is one. The program mask in the PSW controls four of the exceptions, bit 1 in control register 0 controls whether SET SYSTEM MASK causes a special-operation exception, bits 16-31 in control register 8 control interruptions due to monitor events, and a hierarchy of masks control interruptions due to PER events. When any controlling mask bit is zero, the condition is ignored; the condition does not remain pending.
Programming Notes:
Subtopics:
When an arithmetic exception is recognized during execution of an interruptible vector instruction, a nonzero exception-extension code is stored in bits 0-7 of the program-interruption code. This code is set to a nonzero value only for arithmetic exceptions occurring during the execution of vector instructions. For more details, see the publication IBM Enterprise Systems Architecture/390 Vector Operations, SA22-7207.
The following is a detailed description of each program-interruption condition.
Subtopics:
The operation is suppressed when the address of the instruction is invalid. Similarly, the operation is suppressed when the address of the target instruction of EXECUTE is invalid. Also, the unit of operation is suppressed when an addressing exception is encountered in accessing a table or table entry. The tables and table entries to which the rule applies are the dispatchable-unit-control table, the primary ASN-second-table entry, and entries in the access list, segment table, page table, linkage table, entry table, ASN first table, ASN second table, authority table, linkage stack, and trace table. Addressing exceptions result in suppression when they are encountered for references to the segment table and page table, in both implicit references for dynamic address translation and references associated with the execution of LOAD REAL ADDRESS and TEST PROTECTION. Similarly, addressing exceptions for accesses to the dispatchable-unit-control table, primary ASN-second-table entry, access list, ASN second table, or authority table result in suppression when they are encountered in access-register translation done either implicitly or as part of LOAD REAL ADDRESS, TEST ACCESS, or TEST PROTECTION. Except for some specific instructions whose execution is suppressed, the operation is terminated for an operand address that can be translated but designates an unavailable location. See Figure 6-2.
An addressing exception is recognized when the CPU attempts to reference a main-storage location that is not available in the configuration. A main-storage location is not available in the configuration when the location is not installed, when the storage unit is not in the configuration, or when power is off in the storage unit. An address designating a storage location that is not available in the configuration is referred to as invalid.
For termination, changes may occur only to result fields. In this context, the term "result field" includes the condition code, registers, and any storage locations that are provided and that are designated to be changed by the instruction. Therefore, if an instruction is due to change only the contents of a field in storage, and every byte of the field is in a location that is not available in the configuration, the operation is suppressed. When part of an operand location is available in the configuration and part is not, storing may be performed in the part that is available in the configuration.
When an addressing exception occurs during the fetching of an instruction or during the fetching of a DAT table entry associated with an instruction fetch, it is unpredictable whether the ILC is 1, 2, or 3. When the exception is associated with fetching the target of EXECUTE, the ILC is 2.
In all cases of addressing exceptions not associated with instruction fetching, the ILC is 1, 2, or 3, indicating the length of the instruction that caused the reference.
An addressing exception is indicated by a program-interruption code of 0005 hex (or 0085 hex if a concurrent PER event is indicated).
___________ ________________________________________________________________ | | Action on | | |____________ ____________ ___________ __________________________| | | Table- | Table- |Instruction| | |Exception |Entry Fetch¹|Entry Store²| Fetch | Operand Reference | |___________|____________|____________|___________|__________________________| |Addressing |Suppress |Suppress |Suppress |Suppress for IPTE, LASP, | |exception | | | |LPSW, MSCH, SCKC, SPT, | | | | | |SPX, SSCH, SSM, STCRW, | | | | | |STNSM, STOSM, TPI, TPROT. | | | | | |Terminate for all others.4| |___________|____________|____________|___________|__________________________| |Protection | -- | -- |Suppress |Suppress for IPTE, LASP, | |exception | | | |LPSW, MSCH, SCKC, SPT, | |for key- | | | |SPX, SSCH, SSM, STCRW, | |controlled | | | |STNSM, STOSM, and TPI5. | |protection | | | |Terminate for all others.4| |___________|____________|____________|___________|__________________________| |Protection | -- | -- | -- |Suppress | |exception | | | | | |for access-| | | | | |list- | | | | | |controlled | | | | | |protection | | | | | |___________|____________|____________|___________|__________________________| |Protection | -- |Suppress³ | -- |Suppress for STCRW, | |exception | | | |STNSM, STOSM, and TPI5. | |for page | | | | | |protection | | | |Terminate for all others.4| |___________|____________|____________|___________|__________________________| |Protection | -- |Suppress | -- |Suppress for IPTE, STCRW, | |exception | | | |STNSM, STOSM, and TPI5. | |for low- | | | | | |address | | | | | |protection | | | |Terminate for all others.4| |___________|____________|____________|___________|__________________________| |Explanation: | | | | -- Not applicable. | | | | ¹ Table entries include segment table, page table, linkage table, entry | | table, ASN first table, ASN second table, authority table, dispatch- | | able-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. | | | | 4 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. If the suppression-on-protection facility is installed, | | the action is, for page protection, or may be, for key-controlled | | protection and low-address protection, suppression (except for the | | condition code) instead of termination; see "Suppression on Protec- | | tion" in Chapter 3, "Storage." | | | | 5 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. | |____________________________________________________________________________|Figure 6-2. Summary of Action for Addressing and Protection Exceptions
The ASN being translated is stored at real locations 146-147, and real locations 144-145 are set to zeros.
An AFX-translation exception is recognized when, during ASN translation in the space-switching form of PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, or SET SECONDARY ASN, or during ASN translation in PROGRAM RETURN when the restored SASN does not equal the restored PASN, bit 0 of the ASN-first-table entry used is not zero.
The operation is nullified.
The instruction-length code is 1 or 2.
The AFX-translation exception is indicated by a program-interruption code of 0020 hex (or 00A0 hex if a concurrent PER event is indicated).
An ALEN-translation exception is recognized during access-register translation when either:
The operation is nullified.
The instruction-length code is 1, 2, or 3.
The ALEN-translation exception is indicated by a program-interruption code of 0029 hex (or 00A9 hex if a concurrent PER event is indicated).
The number of the access register is stored in bit positions 4-7 at real location 160, and bits 0-3 are set to zeros.
An ALE-sequence exception is recognized during access-register translation when the access register used contains an access-list-entry sequence number (ALESN) which is not equal to the ALESN in the access-list entry that is designated by the access register.
The operation is nullified.
The instruction-length code is 1, 2, or 3.
The ALE-sequence exception is indicated by a program-interruption code of 002A hex (or 00AA hex if a concurrent PER event is indicated).
The operation is suppressed.
An ALET-specification exception is recognized during access-register translation when bit positions 0-6 of the access-list-entry token in the access register used do not contain all zeros. However, when access-register 0 is used, except in TEST ACCESS, it is treated as containing all zeros, and this exception is not recognized. TEST ACCESS uses the actual contents of access register 0.
The instruction-length code is 1, 2, or 3.
The ALET-specification exception is indicated by a program-interruption code of 0028 hex (or 00A8 hex if a concurrent PER event is indicated).
An ASN-translation-specification exception may be recognized during ASN translation in the space-switching form of PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, or SET SECONDARY ASN, during ASN translation in PROGRAM RETURN when the restored SASN does not equal the restored PASN, or during ASN translation in LOAD ADDRESS SPACE PARAMETERS, when either:
Whether an ASN-translation-specification exception is recognized in the above cases may depend on the model or may be unpredictable.
The operation is suppressed.
The instruction-length code is 1, 2, or 3.
The ASN-translation-specification exception is indicated by a program-interruption code of 0017 hex (or 0097 hex if a concurrent PER event is indicated).
An ASTE-sequence exception is recognized when any of the following is true:
The operation is nullified.
The instruction-length code is 1, 2, or 3.
The ASTE-sequence exception is indicated by a program-interruption code of 002C hex (or 00AC hex if a concurrent PER event is indicated).
Programming Note: The storing of zeros at real location 160 in the case of an ASTE-sequence exception recognized during a subspace-replacement operation is a unique indication since the use of access register 0 in access-register translation cannot result in the exception.
An ASTE-validity exception is recognized when any of the following is true:
The operation is nullified.
The instruction-length code is 1, 2, or 3.
The ASTE-validity exception is indicated by a program-interruption code of 002B hex (or 00AB hex if a concurrent PER event is indicated).
Programming Note: The storing of zeros at real location 160 in the case of an ASTE-validity exception recognized during a subspace-replacement operation is a unique indication since the use of access register 0 in access-register translation cannot result in the exception.
The ASN being translated is stored at real locations 146-147, and real locations 144-145 are set to zeros.
An ASX-translation exception is recognized when, during ASN translation in the space-switching form of PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, or SET SECONDARY ASN, or during ASN translation in PROGRAM RETURN when the restored SASN does not equal the restored PASN, bit 0 of the ASN-second-table entry used is not zero.
The operation is nullified.
The instruction-length code is 1 or 2.
The ASX-translation exception is indicated by a program-interruption code of 0021 hex (or 00A1 hex if a concurrent PER event is indicated).
A data exception is recognized when any of the following is true:
For all instructions other than EDIT and EDIT AND MARK, when the operation is terminated, the contents of the sign position in the rightmost byte of the result field either remain unchanged or are set to the preferred sign code; the contents of the remainder of the result field are unpredictable.
In the case of EDIT and EDIT AND MARK, an invalid sign code cannot occur; the operation is terminated on a data exception for an invalid digit code.
The instruction-length code is 2 or 3.
The data exception is indicated by a program-interruption code of 0007 hex (or 0087 hex if a concurrent PER event is indicated).
Programming Notes:
The decimal-divide exception is indicated only if the sign codes of both the divisor and dividend are valid and only if the digit or digits used in establishing the exception are valid.
A decimal-divide exception is recognized when in decimal division the divisor is zero or the quotient exceeds the specified data-field size.
The operation is suppressed.
The instruction-length code is 2 or 3.
The decimal-divide exception is indicated by a program-interruption code of 000B hex (or 008B hex if a concurrent PER event is indicated).
The interruption may be disallowed by the decimal-overflow mask (PSW bit 21).
A decimal-overflow exception is recognized when one or more nonzero digits are lost because the destination field in a decimal operation is too short to contain the result.
The operation is completed. The result is obtained by ignoring the overflow digits, and condition code 3 is set.
The instruction-length code is 2 or 3.
The decimal-overflow exception is indicated by a program-interruption code of 000A hex (or 008A hex if a concurrent PER event is indicated).
The operation is suppressed.
The execute exception is recognized when the target instruction of EXECUTE is another EXECUTE.
The instruction-length code is 2.
The execute exception is indicated by a program-interruption code of 0003 hex (or 0083 hex if a concurrent PER event is indicated).
The operation is completed. The fraction is normalized, and the sign and fraction of the result remain correct. The result characteristic is made 128 smaller than the correct characteristic.
An exponent-overflow exception is recognized when the result characteristic of a floating-point operation exceeds 127 and the result fraction is not zero.
The instruction-length code is 1 or 2.
The exponent-overflow exception is indicated by a program-interruption code of XX0C hex (or XX8C hex if a concurrent PER event is indicated), where XX is the exception-extension code.
The interruption may be disallowed by the exponent-underflow mask (PSW bit 22).
An exponent-underflow exception is recognized when the result characteristic of a floating-point operation is less than zero and the result fraction is not zero. For an extended-format floating-point result, exponent underflow is indicated only when the high-order characteristic underflows.
The operation is completed. The exponent-underflow mask also affects the result of the operation. When the mask bit is zero, the sign, characteristic, and fraction are set to zero, making the result a true zero. When the mask bit is one, the fraction is normalized, the characteristic is made 128 larger than the correct characteristic, and the sign and fraction remain correct.
The instruction-length code is 1 or 2.
The exponent-underflow exception is indicated by a program-interruption code of XX0D hex (or XX8D hex if a concurrent PER event is indicated), where XX is the exception-extension code.
The PC number is stored in bit positions 12-31 of the word at real location 144, and the leftmost 12 bits of the word are set to zeros.
An EX-translation exception is recognized during PC-number translation in PROGRAM CALL when the entry-table entry indicated by the entry-index part of the PC number is beyond the end of the entry table as designated by the linkage-table entry.
The operation is nullified.
The instruction-length code is 2.
The EX-translation exception is indicated by a program-interruption code of 0023 hex (or 00A3 hex if a concurrent PER event is indicated).
An extended-authority exception is recognized during access-register translation when all of the following are true:
The number of the access register is stored in bit positions 4-7 at real location 160, and bits 0-3 are set to zeros.
The operation is nullified.
The instruction-length code is 1, 2, or 3.
The extended-authority exception is indicated by a program-interruption code of 002D hex (or 00AD hex if a concurrent PER event is indicated).
In the case of division, the operation is suppressed. The execution of CONVERT TO BINARY is completed by ignoring the leftmost bits that cannot be placed in the register.
A fixed-point-divide exception is recognized when in signed binary division the divisor is zero or when the quotient in signed binary division or the result of CONVERT TO BINARY cannot be expressed as a 32-bit signed binary integer.
The instruction-length code is 1 or 2.
The fixed-point-divide exception is indicated by a program-interruption code of 0009 hex (or 0089 hex if a concurrent PER event is indicated).
The interruption may be disallowed by the fixed-point-overflow mask (PSW bit 20).
A fixed-point-overflow exception is recognized when an overflow occurs during signed binary arithmetic or signed left-shift operations.
The operation is completed. The result is obtained by ignoring the overflow information, and condition code 3 is set.
The instruction-length code is 1 or 2.
The fixed-point-overflow exception is indicated by a program-interruption code of XX08 hex (or XX88 hex if a concurrent PER event is indicated), where XX is the exception-extension code.
The operation is suppressed, except that the operation is inhibited when the exception is recognized by the vector facility.
A floating-point-divide exception is recognized when in floating-point division the divisor has a zero fraction.
The instruction-length code is 1 or 2.
The floating-point-divide exception is indicated by a program-interruption code of XX0F hex (or XX8F hex if a concurrent PER event is indicated), where XX is the exception-extension code.
An LX-translation exception is recognized during PC-number translation in PROGRAM CALL when either:
The operation is nullified.
The instruction-length code is 2.
The LX-translation exception is indicated by a program-interruption code of 0022 hex (or 00A2 hex if a concurrent PER event is indicated).
A monitor event is recognized when MONITOR CALL is executed and the monitor-mask bit in control register 8 corresponding to the class specified by instruction bits 12-15 is one. The information in control register 8 has the following format:
Control Register 8 __ _______________ | Monitor Masks | __|_______________| 16 31
The monitor-mask bits, bits 16-31 of control register 8, correspond to monitor classes 0-15, respectively. Any number of monitor-mask bits may be on at a time; together they specify the classes of monitor events that are monitored at that time. The mask bits are initialized to zeros.When MONITOR CALL is executed and the corresponding monitor-mask bit is one, a program interruption for monitor event occurs.
Additional information is stored at real locations 148-149 and 156-159. The format of the information stored at these locations is as follows:
Real Locations 148-149 ________ ___________ | | Monitor | |00000000| Class No. | |________|___________| 0 8 15
Real Locations 156-159 _ _________________________________ |0| Monitor Code | |_|_________________________________| 0 1 31
The contents of bit positions 8-15 of the MONITOR CALL instruction are stored at real location 149 and constitute the monitor-class number. Zeros are stored at real location 148. The effective address specified by the B1 and D1 fields of the instruction forms the monitor code, which is stored in the word at real location 156. The value of the address is under control of the addressing mode, bit 32 of the current PSW; in the 24-bit addressing mode, bits 0-7 of the address are zeros, while in the 31-bit addressing mode, bit 0 is zero.The operation is completed.
The instruction-length code is 2.
The monitor event is indicated by a program-interruption code of 0040 hex (or 00C0 hex if a concurrent PER event is indicated).
An operand exception is recognized when any of the following is true:
The instruction-length code is 2.
The operand exception is indicated by a program-interruption code of 0015 hex (or 0095 hex if a concurrent PER event is indicated).
For the purpose of checking the operation code of an instruction, the operation code is defined as follows:
An operation exception is recognized when the CPU attempts to execute an instruction with an invalid operation code. The operation code may be unassigned, or the instruction with that operation code may not be installed on the CPU.
The instruction-length code is 1, 2, or 3.
The operation exception is indicated by a program-interruption code of 0001 hex (or 0081 hex if a concurrent PER event is indicated).
Programming Notes:
Except for the operands of MOVE PAGE, a page-translation exception is recognized when either:
For the operands of MOVE PAGE, a page-translation exception is recognized when any of the following is true:
When an interruption occurs, information about the virtual address causing the exception is stored at real locations 144-147 and conditionally at real location 160. See "Assigned Storage Locations" in topic 3.13 for a detailed description of this information.
The unit of operation is nullified, except that when the exception is caused by an expanded-storage data error occurring when MOVE PAGE moves data between main storage and expanded storage, the contents of the first-operand location are unpredictable.
When the exception occurs during fetching of an instruction, it is unpredictable whether the ILC is 1, 2, or 3. When the exception occurs during a reference to the target of EXECUTE, the ILC is 2.
When the exception occurs during a reference to an operand location, the instruction-length code (ILC) is 1, 2, or 3 and indicates the length of the instruction causing the exception.
The page-translation exception is indicated by a program-interruption code of 0011 hex (or 0091 hex if a concurrent PER event is indicated).
The operation is suppressed.
A PC-translation-specification exception is recognized during PC-number translation in PROGRAM CALL when bit position 32 of the entry-table entry used is zero and bit positions 33-39 are not all zeros.
The instruction-length code is 2.
The PC-translation-specification exception is indicated by a program-interruption code of 001F hex (or 009F hex if a concurrent PER event is indicated).
The PER mask, bit 1 of the PSW, controls whether the CPU is enabled for PER. When the PER mask is zero, PER events are not recognized. When the bit is one, PER events are recognized, subject to the PER-event-mask bits in control register 9.
A PER event is recognized when the CPU is enabled for PER and one or more of these events occur.
The unit of operation is completed, unless another condition has caused the unit of operation to be inhibited, nullified, suppressed, or terminated.
Additional information identifying the event is stored at real locations 150-155 and conditionally at real location 161.
The instruction-length code is 0, 1, 2, or 3. Code 0 is set only if a specification exception is indicated concurrently.
The PER event is indicated by setting bit 8 of the program-interruption code to one.
See "Program-Event Recording" in topic 4.5 for a detailed description of the PER event and the associated interruption information.
A primary-authority exception is recognized during ASN authorization in PROGRAM TRANSFER with space switching (PT-ss) when either:
The operation is nullified.
The instruction-length code is 2.
The primary-authority exception is indicated by a program-interruption code of 0024 hex (or 00A4 hex if a concurrent PER event is indicated).
A privileged-operation exception is recognized when any of the following is true:
The instruction-length code is 2 or 3.
The privileged-operation exception is indicated by a program-interruption code of 0002 hex (or 0082 hex if a concurrent PER event is indicated).
A protection exception is recognized when any of the following is true:
For access-list-controlled protection, the operation is suppressed. For the other three types of protection, except in the case of some specific instructions whose execution is suppressed, the operation is terminated when a protection exception is encountered during a reference to an operand location. See Figure 6-2 in topic 6.5.2.1. However, if the suppression-on-protection facility is installed, the operation may be suppressed (except for the condition code) as described in "Suppression on Protection" in topic 3.4.5.
For termination, changes may occur only to result fields. In this context, the term "result field" includes condition code, registers, and storage locations, if any, which are due to be changed by the instruction. However, no change is made to a storage location when a reference to that location causes a protection exception. Therefore, if an instruction is due to change only the contents of a field in storage, and every byte of that field would cause a protection exception, the operation is suppressed. When termination occurs on fetching, the protected information is not loaded into an addressable register nor moved to another storage location.
When the exception occurs during fetching of an instruction, it is unpredictable whether the ILC is 1, 2, or 3. When the exception occurs during the fetching of the target of EXECUTE, the ILC is 2.
For a protected operand location, the instruction-length code (ILC) is 1, 2, or 3, indicating the length of the instruction that caused the reference.
The protection exception is indicated by a program-interruption code of 0004 hex (or 0084 hex if a concurrent PER event is indicated).
A secondary-authority exception is recognized during ASN authorization in SET SECONDARY ASN with space switching, or during ASN authorization in PROGRAM RETURN when the restored SASN does not equal the restored PASN, when either:
The operation is nullified.
The instruction-length code is 1 or 2.
The secondary-authority exception is indicated by a program-interruption code of 0025 hex (or 00A5 hex if a concurrent PER event is indicated).
A segment-translation exception is recognized when either:
When an interruption occurs, information about the virtual address causing the exception is stored at real locations 144-147 and conditionally at real location 160. See "Assigned Storage Locations" in topic 3.13 for a detailed description of this information.
The unit of operation is nullified.
When the exception occurs during fetching of an instruction, it is unpredictable whether the ILC is 1, 2, or 3. When the exception occurs during the fetching of the target of EXECUTE, the ILC is 2.
When the exception occurs during a reference to an operand location, the instruction-length code (ILC) is 1, 2, or 3 and indicates the length of the instruction causing the exception.
The segment-translation exception is indicated by a program-interruption code of 0010 hex (or 0090 hex if a concurrent PER event is indicated).
The interruption may be disallowed by the significance mask (PSW bit 23).
A significance exception is recognized when the result fraction in floating-point addition or subtraction is zero.
The operation is completed. The significance mask also affects the result of the operation. When the mask bit is zero, the operation is completed by replacing the result with a true zero. When the mask bit is one, the operation is completed without further change to the characteristic of the result.
The instruction-length code is 1 or 2.
The significance exception is indicated by a program-interruption code of XX0E hex (or XX8E hex if a concurrent PER event is indicated), where XX is the exception-extension code.
A space-switch event is recognized at the completion of the operation in each of the following cases:
For a SET ADDRESS SPACE CONTROL instruction that changes the translation mode away from the home-space mode, zeros are stored at real locations 146-147, and the home space-switch-event-control bit is placed in bit position 0 and zeros are placed in bit positions 1-15 at real locations 144-145.
For a PROGRAM RETURN instruction that introduces a PSW-format error, it is unpredictable whether the instruction-length code is 0 or 1, or 0 or 2 if EXECUTE was used.
The operation is completed.
The instruction-length code is 0, 1, or 2.
The space-switch event is indicated by a program-interruption code of 001C hex (or 009C hex if a concurrent PER event is indicated).
Programming Notes:
A special-operation exception is recognized when any of the following is true:
| The instruction-length code is 1, 2, or 3.
The special-operation exception is indicated by a program-interruption code of 0013 hex (or 0093 hex if a concurrent PER event is indicated).
A specification exception is recognized when any of the following is true:
Except as noted below, the instruction-length code (ILC) is 1, 2, or 3, indicating the length of the instruction causing the exception.
When the instruction address is odd (cause 4), it is unpredictable whether the ILC is 1, 2, or 3.
When the exception is recognized because of an early PSW specification exception, (causes 1-3), and the exception has been introduced by LOAD
The specification exception is indicated by a program-interruption code of 0006 hex (or 0086 hex if a concurrent PER event is indicated).
Programming Note: See "Exceptions Associated with the PSW" in topic 6.1.5 for a definition of when the exceptions associated with the PSW are recognized.
The operation is suppressed, except that the operation is inhibited when the exception is recognized by the vector facility.
A square-root exception is recognized when the second operand of SQUARE ROOT is less than zero.
The instruction-length code is 2.
The square-root exception is indicated by a program-interruption code of 001D hex (or 009D hex if a concurrent PER event is indicated).
The operation is nullified.
A stack-empty exception is recognized during the unstacking process in EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, MODIFY STACKED STATE, or PROGRAM RETURN when the current linkage-stack entry is a header entry and the backward stack-entry validity bit in the header entry is zero.
The instruction-length code is 1 or 2.
The stack-empty exception is indicated by a program-interruption code of 0031 hex (or 00B1 hex if a concurrent PER event is indicated).
The operation is nullified.
A stack-full exception is recognized during the stacking process in BRANCH AND STACK or stacking PROGRAM CALL when there is not enough remaining free space in the current linkage-stack section and the forward-section validity bit in the trailer entry of the section is zero.
The instruction-length code is 2.
The stack-full exception is indicated by a program-interruption code of 0030 hex (or 00B0 hex if a concurrent PER event is indicated).
The operation is nullified.
A stack-operation exception is recognized during the unstacking process in PROGRAM RETURN when the unstack-suppression bit is one in any linkage-stack state entry or header entry encountered during the process.
The instruction-length code is 1 or 2.
The stack-operation exception is indicated by a program-interruption code of 0034 hex (or 00B4 hex if a concurrent PER event is indicated).
A stack-specification exception is recognized in each of the following cases:
The instruction-length code is 1 or 2.
The stack-specification exception is indicated by a program-interruption code of 0032 hex (or 00B2 hex if a concurrent PER event is indicated).
A stack-type exception is recognized during the unstacking process in EXTRACT STACKED REGISTERS, EXTRACT STACKED STATE, MODIFY STACKED STATE, or PROGRAM RETURN in each of the following cases:
The instruction-length code is 1 or 2.
The stack-type exception is indicated by a program-interruption code of 0033 hex (or 00B3 hex if a concurrent PER event is indicated).
The operation is nullified.
A trace-table exception is recognized when the CPU attempts to store a trace-table entry which would reach or cross the next 4K-byte block boundary. For the purpose of recognizing this exception in the TRACE instruction, the explicit trace entry is treated as being 76 bytes long.
The instruction-length code is 1, 2, or 3, indicating the length of the instruction causing the exception.
The trace-table exception is indicated by a program-interruption code of 0016 hex (or 0096 hex if a concurrent PER event is indicated).
A translation-specification exception is recognized when translation of a virtual address is attempted and any of the following is true:
The unit of operation is suppressed.
When the exception occurs during fetching of an instruction, it is unpredictable whether the ILC is 1, 2, or 3. When the exception occurs during the fetching of the target of EXECUTE, the ILC is 2.
When the exception occurs during a reference to an operand location, the instruction-length code (ILC) is 1, 2, or 3 and indicates the length of the instruction causing the exception.
The translation-specification exception is indicated by a program-interruption code of 0012 hex (or 0092 hex if a concurrent PER event is indicated).
Programming Note: When a translation-specification exception is recognized in the process of translating an instruction address, the operation is suppressed. In this case, the instruction-length code (ILC) is needed to derive the address of the instruction, as the instruction address in the old PSW has been incremented by the amount indicated by the ILC. In the case of segment-translation and page-translation exceptions, the operation is nullified, the instruction address in the old PSW identifies the instruction, and the ILC may be arbitrarily set to 1, 2, or 3.
The unit of operation is inhibited.
An unnormalized-operand exception is recognized when, in a vector floating-point divide or multiply operation, a source-operand element has a nonzero fraction with a leftmost hexadecimal digit of zero. For more details, see the publication IBM Enterprise Systems Architecture/390 Vector Operations, SA22-7207.
The instruction-length code is 2.
The unnormalized-operand exception is indicated by a program-interruption code of XX1E hex (or XX9E hex if a concurrent PER event is indicated), where XX is the exception-extension code.
When a vector-facility instruction is executed, and the vector facility is not installed on any CPU which is or can be placed in the configuration, it depends on the model whether a vector-operation exception or an operation exception is recognized.
A vector-operation exception is recognized when a vector-facility instruction is executed while bit 14 of control register 0 is zero on a CPU which has the vector facility installed and available. The vector-operation exception is also recognized when a vector-facility instruction is executed and the vector facility is not installed or available on this CPU, but the facility can be made available to the program either on this CPU or another CPU in the configuration.
The operation is nullified when the vector-operation exception is recognized.
The instruction-length code is 2 or 3.
The vector-operation exception is indicated by a program-interruption code of 0019 hex (or 0099 hex if a concurrent PER event is indicated).
For the sake of convenience, certain program exceptions are grouped together under a single collective name. These collective names are used when it is necessary to refer to the complete set of exceptions, such as in instruction definitions. Four collective names are used:
Figure 6-3 summarizes the conditions that can cause access exceptions and the action taken when they are encountered.
__________________________________ ________________ ________________ _______________ | | |Translation for | | | | |TAR and TPROT, | | | |Translation for |and Access for |Translation and| | |Virtual Address |Logical Address |Access for Any | | |of LRA |of TPROT¹ |Other Address | | |______ _________|_______ ________|______ ________| | |Indi- | |Indi- | |Indi- | | | Condition |cation| Action |cation | Action |cation| Action | |__________________________________|______|_________|_______|________|______|________| |Access register² | | | | | | | |Bits 0-6 not all zeros | cc3 | Complete| cc3 |Complete| AS |Suppress| | | | | | | | | |Effective access-list designation²| | | | | | | |Designation protected against | - | - | - | - | - | - | | fetching | | | | | | | |Invalid address of designation | A | Suppress| A |Suppress| A |Suppress| | | | | | | | | |Access-list entry² | | | | | | | |Access-list-length violation | cc3 | Complete| cc3 |Complete| AT |Nullify | |Entry protected against fetching | - | - | - | - | - | - | |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² | | | | | | | |Entry protected against fetching | - | - | - | - | - | - | |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 | | | | | | | |Bits 30, 31, and 60-63 not all | ATS | Suppress| ATS |Suppress| ATS |Suppress| | zeros³ | | | | | | | | | | | | | | | |Authority-table entry² 4 | | | | | | | |Authority-table-length violation | cc3 | Complete| cc3 |Complete| EA |Nullify | |Entry protected against fetching | - | - | - | - | - | - | |Invalid address of entry | A | Suppress| A |Suppress| A |Suppress| |Secondary-authority bit not one | cc3 | Complete| cc3 |Complete| EA |Nullify | | | | | | | | | |Control-register-0 contents5 | | | | | | | |Invalid encoding of bits 8-12 | TS | Suppress| -6 | -6 | TS |Suppress| | | | | | | | | |Segment-table entry | | | | | | | |Segment-table-length violation | cc3 | Complete| cc3 |Complete| ST |Nullify | |Entry protected against fetching | - | - | - | - | - | - | |Invalid address of entry | A | Suppress| A |Suppress| A |Suppress| |I bit on | cc1 | Complete| cc3 |Complete| ST |Nullify | |One in a bit position which is | TS | Suppress| TS |Suppress| TS |Suppress| | checked for zero7 | | | | | | | | | | | | | | | |Page-table entry | | | | | | | |Page-table-length violation | cc3 | Complete| cc3 |Complete| PT |Nullify | |Entry protected against fetching | - | - | - | - | - | - | |Invalid address of entry | A | Suppress| A |Suppress| A |Suppress| |I bit on | cc2 | Complete| cc3 |Complete| PT |Nullify | |One in a bit position which is | TS | Suppress| TS |Suppress| TS |Suppress| | checked for zero7 | | | | | | | | | | | | | | | |Access for instruction fetch | | | | | | | |Location protected | - | - | - | - | P |Suppress| |Invalid address | - | - | - | - | A |Suppress| | | | | | | | | |Access for operands | | | | | | | |Location protected | - | - |cc set8|Complete| P | Term.* | |Invalid address | - | - | A |Suppress| A | Term.* | |__________________________________|______|_________|_______|________|______|________| ____________________________________________________________________________________ |Explanation: | | | | - The condition does not apply. | | * Action is to terminate except where otherwise specified in this publication. | | For access-list-controlled protection, the action is always to suppress. | | ¹ TAR does not have a logical address. The rows "Control-register-0 contents" | | through "Access for operands" apply only to TPROT, not to TAR. | | ² 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 they are recognized when PSW bits 16 and 17 are 01 binary, and | | for TEST ACCESS they are recognized regardless of the translation mode. | | ³ An ASN-translation-specification exception is recognized only if it is | | necessary to access the authority table. | | 4 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. | | 5 A translation-specification exception for an invalid code in control reg- | | ister 0, bit positions 8-12, is recognized as part of the execution of the | | instruction using address translation; when DAT is on, it is recognized | | during translation of the instruction address, and, when DAT is off, it is | | only recognized during execution of INVALIDATE PAGE TABLE ENTRY or for | | translation of the operand address of LOAD REAL ADDRESS. | | 6 A translation-specification exception cannot occur for the logical address | | of TEST PROTECTION because this exception would have been recognized during | | the instruction fetch for the instruction. | | 7 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. | | 8 The condition code is set as follows: | | 0 Operand location not protected. | | 1 Fetches permitted, but stores not permitted. | | 2 Neither fetches nor stores permitted. | | A Addressing exception. | | ALQ ALE-sequence exception. | | AS ALET-specification exception. | | ASQ ASTE-sequence exception. | | AT ALEN-translation exception. | | ATS ASN-translation-specification exception. | | AV ASTE-validity exception. | | cc1 Condition code 1 set. | | cc2 Condition code 2 set. | | cc3 Condition code 3 set. | | EA Extended-authority exception. | | P Protection exception. | | PT Page-translation exception. | | ST Segment-translation exception. | | TS Translation-specification exception. | |____________________________________________________________________________________|Figure 6-3. Handling of Access Exceptions
Any access exception is recognized as part of the execution of the instruction with which the exception is associated. An access exception is not recognized when the CPU attempts to prefetch from an unavailable location or detects some other access-exception condition, but a branch instruction or an interruption changes the instruction sequence such that the instruction is not executed.Every instruction can cause an access exception to be recognized because of instruction fetch. Additionally, access exceptions associated with instruction execution may occur because of an access to an operand in storage.
An access exception due to fetching an instruction is indicated when the first instruction halfword cannot be fetched without encountering the exception. When the first halfword of the instruction has no access exceptions, access exceptions may be indicated for additional halfwords according to the instruction length specified by the first two bits of the instruction; however, when the operation can be performed without accessing the second or third halfwords of the instruction, it is unpredictable whether the access exception is indicated for the unused part. Since the indication of access exceptions for instruction fetch is common to all instructions, it is not covered in the individual instruction definitions.
Except where otherwise indicated in the individual instruction description, the following rules apply for exceptions associated with an access to an operand location. For a fetch-type operand, access exceptions are necessarily indicated only for that portion of the operand which is required for completing the operation. It is unpredictable whether access exceptions are indicated for those portions of a fetch-type operand which are not required for completing the operation. For a store-type operand, access exceptions are recognized for the entire operand even if the operation could be completed without the use of the inaccessible part of the operand. In situations where the value of a store-type operand is defined to be unpredictable, it is unpredictable whether an access exception is indicated.
Whenever an access to an operand location can cause an access exception to be recognized, the word "access" is included in the list of program exceptions in the description of the instruction. This entry also indicates which operand can cause the exception to be recognized and whether the exception is recognized on a fetch or store access to that operand location. Access exceptions are recognized only for the portion of the operand as defined by each particular instruction.
With two conditions of the same priority, it is unpredictable which is indicated. In particular, the priority of access exceptions associated with the two parts of an operand that crosses a page or protection boundary is unpredictable and is not necessarily related to the sequence specified for the access of bytes within the operand.
Except for PER events, only one program-interruption condition is indicated with a program interruption. The existence of one condition, however, does not preclude the existence of other conditions. When more than one program-interruption condition exists, only the condition having the highest priority is identified in the interruption code.
The type of ending which occurs (nullification, suppression, or termination) is that which is defined for the type of exception that is indicated in the interruption code. However, if a condition is indicated which permits termination, and another condition also exists which would cause either nullification or suppression, then the unit of operation is suppressed.
Figure 6-4 lists the priorities of all program-interruption conditions other than PER events and exceptions associated with some of the more complex control instructions. All exceptions associated with references to storage for a particular instruction halfword or a particular operand byte are grouped as a single entry called "access." Figure 6-5 in topic 6.5.5.1 lists the priority of access exceptions for a single access. Thus, the second figure specifies which of several exceptions, encountered either in the access of a particular portion of an instruction or in any particular access associated with an operand, has highest priority, and the first figure specifies the priority of this condition in relation to other conditions detected in the operation. Similarly, the priorities for exceptions occurring as part of ASN translation and tracing are covered in Figure 6-6 in topic 6.5.5.2 and Figure 6-8 in topic 6.5.5.4, respectively.
For some instructions, the priority is shown in the individual instruction description.
The relative priorities of any two conditions listed in the figure can be found by comparing the priority numbers, as found in the figure, from left to right until a mismatch is found. If the first inequality is between numeric characters, either the two conditions are mutually exclusive or, if both can occur, the condition with the smaller number is indicated. If the first inequality is between alphabetic characters, then the two conditions are not exclusive, and it is unpredictable which is indicated when both occur.
To understand the use of the table, consider an example involving the instruction ADD DECIMAL, which is a six-byte instruction. Assume that the first four bytes of the instruction can be accessed but that the instruction crosses a boundary so that an addressing exception exists for the last two bytes. Additionally, assume that the first operand addressed by the instruction contains invalid decimal digits and is in a location that can be fetched from, but not stored into, because of key-controlled protection. The three exceptions which could result from attempted execution of the ADD DECIMAL are:
________ _____________________________________ |Priority| | |Number | Exception | |________|_____________________________________| | 7.B |Access exceptions for third instruc- | | |tion halfword. | | 8.B |Access exceptions (operand 1). | | 8.D |Data exception. | |________|_____________________________________|
Since the first inequality (7&ne.8) is between numeric characters, the addressing exception would be indicated. If, however, the entire ADD DECIMAL instruction can be fetched, and only the second two exceptions listed above exist, then the inequality (B&ne.D) is between alphabetic characters, and it is unpredictable whether the protection exception or the data exception would be indicated.
__________________________________________________________________________________ | 1. Specification exception due to any PSW error of the type that causes an | | immediate interruption.¹ | | | | 2. Specification exception due to an odd instruction address in the PSW. | | | | 3. Access exceptions for first halfword of EXECUTE.² | | | | 4. Access exceptions for second halfword of EXECUTE.² | | | | 5. Specification exception due to target instruction of EXECUTE not being | | specified on halfword boundary.² | | | | 6. Access exceptions for first instruction halfword. | | | | 7.A Access exceptions for second instruction halfword.³ | | | | 7.B Access exceptions for third instruction halfword.³ | | | | 7.C.1 Vector-operation exception. | | | | 7.C.2 Operation exception. | | | | 7.C.3 Privileged-operation exception for privileged instructions. | | | | 7.C.4 Execute exception. | | | | 7.C.5 Special-operation exception. | | | | 8.A Specification exception due to conditions other than those included in | | 1, 2, and 5 above. | | | | 8.B4 Access exceptions for an access to an operand in storage.5 | | | | 8.C4 Access exceptions for any other access to an operand in storage.5 | | | | 8.D Data exception.6 | | | | 8.E Decimal-divide exception.7 | | | | 8.F Trace exceptions. | | | | 9. Events other than PER events, exceptions which result in completion, | | and the following exceptions: fixed-point divide, floating-point divide,| | operand, square root, and unnormalized operand. Either these exceptions | | and events are mutually exclusive or their priority is specified in the | | corresponding definitions. | |__________________________________________________________________________________| __________________________________________________________________________________ |Explanation: | | | | Numbers indicate priority, with "1" being the highest priority; letters indicate | | no priority. | | | | ¹ PSW errors which cause an immediate interruption may be introduced by a new | | PSW loaded as a result of an interruption or by the instructions LOAD PSW, | | PROGRAM RETURN, SET SYSTEM MASK, and STORE THEN OR SYSTEM MASK. The priority | | shown in the chart is for a PSW error introduced by an interruption and may | | also be considered as the priority for a PSW error introduced by the previous | | instruction. The error is introduced only if the instruction encounters no | | other exceptions. The resulting interruption has a higher priority than any | | interruption caused by the instruction which would have been executed next; it| | has lower priority, however, than any interruption caused by the instruction | | which introduced the erroneous PSW. | | | | ² Priorities 3, 4, and 5 are for the EXECUTE instruction, and priorities start- | | ing with 6 are for the target instruction. When no EXECUTE is encountered, | | priorities 3, 4, and 5 do not apply. | | | | ³ Separate accesses may occur for each halfword of an instruction. The second | | instruction halfword is accessed only if bits 0-1 of the instruction are not | | both zeros. The third instruction halfword is accessed only if bits 0-1 of | | of the instruction are both ones. Access exceptions for one of these half- | | words are not necessarily recognized if the instruction can be completed | | without use of the contents of the halfword or if an exception of lower pri- | | ority can be determined without the use of the halfword. | | | | 4 As in instruction fetching, separate accesses may occur for each portion of | | an operand. Each of these accesses, and also accesses for different operands,| | are of equal priority, and the two entries 8.B and 8.C are listed to represent| | the relative priorities of exceptions associated with any two of these | | accesses. Access exceptions for INSERT STORAGE KEY EXTENDED, INSERT VIRTUAL | | STORAGE KEY, INVALIDATE PAGE TABLE ENTRY, LOAD REAL ADDRESS, RESET REFERENCE | | BIT EXTENDED, SET STORAGE KEY EXTENDED, and TEST PROTECTION are also included | | in 8.B. | | | | | 5 For MOVE LONG, MOVE LONG EXTENDED, COMPARE LOGICAL LONG, and COMPARE LOGICAL | | | LONG EXTENDED, an access exception for a particular operand can be indicated | | | only if the R field for that operand designates an even-numbered register. | | | | 6 The exception can be indicated only if the sign, digit, or digits responsi- | | ble for the exception were fetched without encountering an access exception. | | | | 7 The exception can be indicated only if the digits used in establishing the | | exception, and also the signs, were fetched without encountering an access | | exception, only if the signs are valid, and only if the digits used in estab- | | lishing the exception are valid. | |__________________________________________________________________________________|Figure 6-4. Priority of Program-Interruption Conditions
Subtopics:
The access exceptions consist of those exceptions which can be encountered while using an absolute, instruction, logical, real, or virtual address to access storage. Thus, in the access-register mode, the exceptions are:
With DAT off, the exceptions are:
__________________________________________________________________ |A. Protection exception (low-address protection) due to | | a store-type operand reference with an effective ad- | | dress in the range 0-511. Not recognized if DAT is | | on and another exception condition makes the segment-| | table designation to be used in the translation not | | available. | | | |B.1.A.1 ALET-specification exception due to bits 0-6 of | | access register not being all zeros. | | | |B.1.A.2 Addressing exception for access to effective access- | | list designation. | | | |B.1.A.3 ALEN-translation exception due to access-list entry | | being outside the list. | | | |B.1.A.4 Addressing exception for access to access-list entry.| | | |B.1.A.5 ALEN-translation exception due to I bit in access- | | list entry having the value one. | | | |B.1.A.6 ALE-sequence exception due to access-list-entry | | sequence number (ALESN) in access register not being | | equal to ALESN in access-list entry. | | | |B.1.A.7 Addressing exception for access to ASN-second-table | | entry. | | | |B.1.A.8 ASTE-validity exception due to I bit in ASN-second- | | table entry having the value one. | | | |B.1.A.9 ASTE-sequence exception due to ASN-second-table- | | entry sequence number (ASTESN) in access-list entry | | not being equal to ASTESN in ASN-second-table entry. | | | |B.1.A.10 ASN-translation-specification exception due to a one | | in bit positions 30, 31, or 60-63 of ASN-second-table| | entry (optional and only if authority-table access | | is required). | | | |B.1.A.11 Extended-authority exception due to authority-table | | entry being outside table. | | | |B.1.A.12 Addressing exception for access to authority-table | | entry. | | | |B.1.A.13 Extended-authority exception due to (1) private bit | | in access-list entry not being zero, (2) access-list-| | entry authorization index in access-list entry not | | being equal to extended authorization index in con- | | trol register 8, and (3) secondary-authority bit | | selected by extended authorization index not being | | one. | | | |B.1.B Translation-specification exception due to invalid | | encoding of bits 8-12 of control register 0.¹ | |__________________________________________________________________| __________________________________________________________________ |B.2.A Protection exception (access-list-controlled protec- | | tion) due to store-type operand reference to a | | virtual address which is protected against stores. | | | |B.2.B.1 Segment-translation exception due to segment-table | | entry being outside table.² | | | |B.2.B.2 Addressing exception for access to segment-table | | entry.³ | | | |B.2.B.3 Segment-translation exception due to I bit in seg- | | ment-table entry having the value one.² | | | |B.2.B.4 Translation-specification exception due to invalid | | ones in segment-table entry (bit 0, and common- | | segment bit if private-space bit in segment-table | | designation is one).³ | | | |B.2.B.5 Page-translation exception due to page-table entry | | being outside table.² | | | |B.2.B.6 Addressing exception for access to page-table entry.¹| | | |B.2.B.7 Page-translation exception due to I bit in page-table| | entry having the value one (not recognized for op- | | erand of MOVE PAGE).² | | | | Note: Exceptions B.2.B.8.A, B.3.A, B.3.B, and B.4. | | are recognized only when DAT is off or the I bit in | | the page-table entry is zero. | | | |B.2.B.8.A Translation-specification exception due to invalid | | ones in page-table entry (bits 0, 20, and 23).³ | | | |B.3.A Protection exception (page protection) due to a | | store-type operand reference to a virtual address | | which is protected against stores.4 | | | |B.3.B Addressing exception for access to instruction or | | operand. | | | |B.4. Protection exception (key-controlled protection) due | | to attempt to access a protected instruction or op- | | erand location. | | | | Note: The following access exceptions are recognized| | only by MOVE PAGE. | | | |B.2.B.8.B Page-translation exception due to I bit in page-table| | entry having the value one and the operand not being | | valid in expanded storage.4 If this is true for both| | operands, the exception is recognized for the second | | operand.5 | |__________________________________________________________________| __________________________________________________________________ | | | Note: Exceptions B.2.B.9.A.1 through B.2.B.9.C and | | B.3.C are recognized only for an operand of MOVE PAGE| | when DAT is on, the I bit in the page-table entry is | | one, and the operand is valid in expanded storage. | | | |B.2.B.9.A.1 Page-translation exception due to both operands being| | valid in expanded storage. The exception is recog- | | nized for the first operand.6 | | | |B.2.B.9.A.2 Page-translation exception due to the translation | | path to the operand being locked.6 | | | |B.2.B.9.B Page-translation exception due to the operand being | | the first operand, the second operand being valid in | | main storage, and the destination-reference- | | intention bit in general register 0 being one | | (facility 2 only).6 | | | |B.2.B.9.C Protection exception (page protection or key- | | controlled protection) due to the operand being | | protected. | | | |B.3.C Page-translation exception due to the accesses to the| | operand resulting in an expanded-storage data error.5| |__________________________________________________________________| |Explanation: | | | | ¹ Not applicable when DAT is off, except for execution of | | INVALIDATE PAGE TABLE ENTRY and for translation of operand | | address of LOAD REAL ADDRESS. | | | | ² Not applicable when DAT is off; not applicable to operand | | addresses for LOAD REAL ADDRESS and TEST PROTECTION. | | | | ³ Not applicable when DAT is off except for translation of | | operand address for LOAD REAL ADDRESS. | | | | 4 Not applicable when DAT is off. | | | | 5 With move-page facility 1, or with move-page facility 2 when | | 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. | | | | 6 With move-page facility 1, or with move-page facility 2 when | | the condition-code-option bit is one, the exception is not | | recognized. Instead, condition code 1 is set. | |__________________________________________________________________|Figure 6-5. Priority of Access 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 priority in which they are detected are shown in Figure 6-6.
______________________________________________ | 1. Addressing exception for access to ASN-| | first-table entry. | | | | 2. AFX-translation exception due to I bit | | (bit 0) in ASN-first-table entry being | | one. | | | | 3. ASN-translation-specification exception| | due to invalid ones (bits 28-31) in | | first-table entry. | | | | 4. Addressing exception for access to ASN-| | second-table entry. | | | | 5. ASX-translation exception due to I bit | | (bit 0) in ASN-second-table entry being| | one. | | | | 6. ASN-translation-specification exception| | due to invalid ones (bits 30, 31, 60- | | 63) in ASN-second-table entry (op- | | tional). | |______________________________________________|Figure 6-6. Priority of ASN-Translation Exceptions
The subspace-replacement exceptions are those exceptions which can be recognized during a subspace-replacement operation in PROGRAM CALL, PROGRAM RETURN, PROGRAM TRANSFER, or SET SECONDARY ASN. The exceptions can be recognized only if the subspace-group facility is installed and the address-space-function control, bit 15 of control register 0, is one. The exceptions and their priority are shown in Figure 6-7.
______________________________________________ | 1. Addressing exception for access to | | dispatchable-unit control table. | | | | 2. Addressing exception for access to | | subspace ASN-second-table entry. | | | | 3. ASTE-validity exception due to bit 0 | | being one in subspace ASN-second-table | | entry. | | | | 4. ASTE-sequence exception due to subspace| | ASN-second-table-entry sequence number | | in dispatchable-unit control table not | | being equal to ASN-second-table-entry | | sequence number in subspace ASN-second-| | table entry. | |______________________________________________|Figure 6-7. Priority of Subspace-Replacement Exceptions
The trace exceptions are those exceptions which can be encountered while forming a trace-table entry. The exceptions and their priority are shown in Figure 6-8.
______________________________________________ | A. Protection exception (low-address pro- | | tection) due to entry address being in | | the range 0-511. | | | | B.1 Trace-table exception due to new entry | | reaching or crossing next 4K-byte | | boundary. | | | | B.2 Addressing exception for access to | | trace-table entry. | |______________________________________________|Figure 6-8. Priority of Trace Exceptions
A restart interruption causes the old PSW to be stored at real location 8 and a new PSW, designating the start of the program to be executed, to be fetched from real location 0. The instruction-length code and interruption code are not stored.
The restart interruption provides a means for the operator or another CPU to invoke the execution of a specified program. The CPU cannot be disabled for this interruption.
If the CPU is in the operating state, the exchange of the PSWs occurs at the completion of the current unit of operation and after all other pending interruption conditions for which the CPU is enabled have been honored. If the CPU is in the stopped state, the CPU enters the operating state and exchanges the PSWs without first honoring any other pending interruptions.
The restart interruption is initiated by activating the restart key. The operation can also be initiated at the addressed CPU by executing a SIGNAL PROCESSOR instruction which specifies the restart order.
When the rate control is set to the instruction-step position, it is unpredictable whether restart causes a unit of operation or additional interruptions to be performed after the PSWs have been exchanged.
Programming Note: To perform a restart when the CPU is in the check-stop state, the CPU has to be reset. Resetting with loss of the least amount of information can be accomplished by means of the system-reset-normal key, which does not clear the contents of program-addressable registers, including the control registers, but causes the channel subsystem to be reset. The CPU-reset SIGNAL PROCESSOR order can be used to clear the CPU without affecting the channel subsystem.
The supervisor-call interruption causes the old PSW to be stored at real location 32 and a new PSW to be fetched from real location 96.
The supervisor-call interruption occurs when the instruction SUPERVISOR CALL is executed. The CPU cannot be disabled for the interruption, and the interruption occurs immediately upon the execution of the instruction.
The contents of bit positions 8-15 of the SUPERVISOR CALL instruction are placed in the rightmost byte of the interruption code. The leftmost byte of the interruption code is set to zero. The instruction-length code is 1, unless the instruction was executed by means of EXECUTE, in which case the code is 2.
The interruption code is placed at real locations 138-139; the instruction-length code is placed in bit positions 5 and 6 of the byte at real location 137, with the other bits set to zeros; and zeros are stored at real location 136.
An exigent machine-check condition has the highest priority. When it occurs, the current operation is terminated or nullified. Program and supervisor-call interruptions that would have occurred as a result of the current operation may be eliminated. Any pending repressible machine-check conditions may be indicated with the exigent machine-check interruption. Every reasonable attempt is made to limit the side effects of an exigent machine-check condition, and requests for external, I/O, and restart interruptions normally remain unaffected.
During the execution of an instruction, several interruption-causing events may occur simultaneously. The instruction may give rise to a program interruption, a request for an external interruption may be received, equipment malfunctioning may be detected, an I/O-interruption request may be made, and the restart key may be activated. Instead of the program interruption, a supervisor-call interruption might occur; or both can occur if PER is active. Simultaneous interruption requests are honored in a predetermined order.
In the absence of an exigent machine-check condition, interruption requests existing concurrently at the end of a unit of operation are honored, in descending order of priority, as follows:
Instruction execution is resumed using the last-fetched PSW. The order of executing interruption subroutines is, therefore, the reverse of the order in which the PSWs are fetched.
If the new PSW for a program interruption does not specify the wait state and has an odd instruction address, or causes an access exception to be recognized, another program interruption occurs. Since this second interruption introduces the same unacceptable PSW, a string of interruptions is established. These program exceptions are recognized as part of the execution of the following instruction, and the string may be broken by an external, I/O, machine-check, or restart interruption or by the stop function.
If the new PSW for a program interruption contains a zero in bit position 12 or contains a one in an unassigned bit position or if the leftmost seven bits of the instruction address are not zeros when bit 32 indicates 24-bit addressing, another program interruption occurs. This condition is of higher priority than restart, I/O, external, or repressible machine-check conditions, or the stop function, and CPU reset has to be used to break the string of interruptions.
A string of interruptions for other interruption classes can also exist if the new PSW allows the interruption which has just occurred. These include machine-check interruptions, external interruptions, and I/O interruptions due to PCI conditions generated because of CCWs which form a loop. Furthermore, a string of interruptions involving more than one interruption class can exist. For example, assume that the CPU timer is negative and the CPU-timer subclass mask is one. If the external new PSW has a one in an unassigned bit position, and the program new PSW is enabled for external interruptions, then a string of interruptions occurs, alternating between external and program. Even more complex strings of interruptions are possible. As long as more interruptions must be serviced, the string of interruptions cannot be broken by employing the stop function; CPU reset is required.
Similarly, CPU reset has to be invoked to terminate the condition that exists when an interruption is attempted with a prefix value designating a storage location that is not available to the CPU.
Interruptions for all requests for which the CPU is enabled occur before the CPU is placed in the stopped state. When the CPU is in the stopped state, restart has the highest priority.
Programming Note: The order in which concurrent interruption requests are honored can be changed to some extent by masking.
This chapter includes all the unprivileged instructions described in this publication other than the decimal and floating-point instructions.
Subtopics:
The general instructions manipulate data which resides in general registers or in storage or is introduced from the instruction stream. Some general instructions operate on data which resides in the PSW or the TOD clock.
The general instructions treat data as being of four types: signed binary integers, unsigned binary integers, unstructured logical data, and decimal data. Data is treated as decimal by the conversion, packing, and unpacking instructions. Decimal data is described in Chapter 8, "Decimal Instructions."
In a storage-and-storage operation the operand fields may be defined in such a way that they overlap. The effect of this overlap depends upon the operation. When the operands remain unchanged, as in COMPARE or TRANSLATE AND TEST, overlapping does not affect the execution of the operation. For instructions such as MOVE and TRANSLATE, one operand is replaced by new data, and the execution of the operation may be affected by the amount of overlap and the manner in which data is fetched or stored. For purposes of evaluating the effect of overlapped operands, data is considered to be handled one eight-bit byte at a time. Special rules apply to the operands of MOVE LONG and MOVE INVERSE. See "Interlocks within a Single Instruction" in topic 5.13.4.2 for how overlap is detected in the access-register mode.
In an unsigned binary integer, all bits are used to express the absolute value of the number. When two unsigned binary integers of different lengths are added, the shorter number is considered to be extended on the left with zeros.
Binary integers are treated as signed or unsigned.
In some operations, the result is achieved by the use of the one's complement of the number. The one's complement of a number is obtained by inverting each bit of the number, including the sign.
For signed binary integers, the leftmost bit represents the sign, which is followed by the numeric field. Positive numbers are represented in true binary notation with the sign bit set to zero. When the value is zero, all bits are zeros, including the sign bit. Negative numbers are represented in two's-complement binary notation with a one in the sign-bit position.
Specifically, a negative number is represented by the two's complement of the positive number of the same absolute value. The two's complement of a number is obtained by forming the one's complement of the number, adding a value of one in the rightmost bit position, allowing a carry into the sign position, and ignoring any carry out of the sign position.
This number representation can be considered the rightmost portion of an infinitely long representation of the number. When the number is positive, all bits to the left of the most significant bit of the number are zeros. When the number is negative, these bits are ones. Therefore, when a signed operand must be extended with bits on the left, the extension is achieved by setting these bits equal to the sign bit of the operand.
The notation for signed binary integers does not include a negative zero. It has a number range in which, for a given length, the set of negative nonzero numbers is one larger than the set of positive nonzero numbers. The maximum positive number consists of a sign bit of zero followed by all ones, whereas the maximum negative number (the negative number with the greatest absolute value) consists of a sign bit of one followed by all zeros.
A signed binary integer of either sign, except for zero and the maximum negative number, can be changed to a number of the same magnitude but opposite sign by forming its two's complement. Forming the two's complement of a number is equivalent to subtracting the number from zero. The two's complement of zero is zero.
The two's complement of the maximum negative number cannot be represented in the same number of bits. When an operation, such as LOAD COMPLEMENT, attempts to produce the two's complement of the maximum negative number, the result is the maximum negative number, and a fixed-point-overflow exception is recognized. An overflow does not result, however, when the maximum negative number is complemented as an intermediate result but the final result is within the representable range. An example of this case is a subtraction of the maximum negative number from -1. The product of two maximum negative numbers of a given length is representable as a positive number of double that length.
In discussions of signed binary integers in this publication, a signed binary integer includes the sign bit. Thus, the expression "32-bit signed binary integer" denotes an integer with 31 numeric bits and a sign bit, and the expression "64-bit signed binary integer" denotes an integer with 63 numeric bits and a sign bit.
In an arithmetic operation, a carry out of the numeric field of a signed binary integer is carried into the sign bit. However, in algebraic left-shifting, the sign bit does not change even if significant numeric bits are shifted out.
Programming Notes:
Subtopics:
Subtopics:
Subtraction is performed by adding the one's complement of the second operand and a value of one to the first operand.
Addition of signed binary integers is performed by adding all bits of each operand, including the sign bits. When one of the operands is shorter, the shorter operand is considered to be extended on the left to the length of the longer operand by propagating the sign-bit value.
The instructions SHIFT LEFT SINGLE and SHIFT LEFT DOUBLE produce an overflow when the result is outside the range of representation for signed binary integers. The actual result differs from that for addition and subtraction in that the sign of the result remains the same as the original sign.
A fixed-point-overflow condition exists for signed binary addition or subtraction when the carry out of the sign-bit position and the carry out of the leftmost numeric bit position disagree. Detection of an overflow does not affect the result produced by the addition. In mathematical terms, signed addition and subtraction produce a fixed-point overflow when the result is outside the range of representation for signed binary integers. Specifically, for ADD and SUBTRACT, which operate on 32-bit signed binary integers, there is an overflow when the proper result would be greater than or equal to +2³¹ or less than -2³¹. The actual result placed in the general register after an overflow differs from the proper result by 2³². A fixed-point overflow causes a program interruption if allowed by the program mask.
SUBTRACT LOGICAL differs from ADD LOGICAL in that the one's complement of the second operand and a value of one are added to the first operand.
Addition of unsigned binary integers is performed by adding all bits of each operand. When one of the operands is shorter, the shorter operand is considered to be extended on the left with zeros. Unsigned binary arithmetic is used in address arithmetic for adding the X, B, and D fields. (See "Address Generation" in topic 5.2.) It is also used to obtain the addresses of the function bytes in TRANSLATE and TRANSLATE AND TEST. Furthermore, unsigned binary arithmetic is used on 32-bit unsigned binary integers by ADD LOGICAL and SUBTRACT LOGICAL. Given the same two operands, ADD and ADD LOGICAL produce the same 32-bit result. The instructions differ only in the interpretation of this result. ADD interprets the result as a signed binary integer and inspects it for sign, magnitude, and overflow to set the condition code accordingly. ADD LOGICAL interprets the result as an unsigned binary integer and sets the condition code according to whether the result is zero and whether there was a carry out of bit position 0. Such a carry is not considered an overflow, and no program interruption for overflow can occur for ADD LOGICAL.
Programming Notes:
COMPARE and COMPARE HALFWORD are signed-binary-comparison operations. These instructions are equivalent to SUBTRACT and SUBTRACT HALFWORD without replacing either operand, the resulting difference being used only to set the condition code. The operations permit comparison of numbers of opposite sign which differ by 2³¹ or more. Thus, unlike SUBTRACT, COMPARE cannot cause overflow.
Comparison operations determine whether two operands are equal or not and, for most operations, which of two unequal operands is the greater (high). Signed-binary-comparison operations are provided which treat the operands as signed binary integers, and logical-comparison operations are provided which treat the operands as unsigned binary integers or as unstructured data.
Logical comparison of two operands is performed byte by byte, in a left-to-right sequence. The operands are equal when all their bytes are equal. When the operands are unequal, the comparison result is determined by a left-to-right comparison of corresponding bit positions in the first unequal pair of bytes: the zero bit in the first unequal pair of bits indicates the low operand, and the one bit the high operand. Since the remaining bit and byte positions do not change the comparison, it is not necessary to continue comparing unequal operands beyond the first unequal bit pair.
A detailed definition of instruction formats, operand designation and length, and address generation is contained in "Instructions" in topic 5.1. Exceptions to the general rules stated in that section are explicitly identified in the individual instruction descriptions.
The general instructions and their mnemonics, formats, and operation codes are listed in Figure 7-1. The figure also indicates when the condition code is set, the instruction fields that designate access registers, and the exceptional conditions in operand designations, data, or results that cause a program interruption.
Note: In the detailed descriptions of the individual instructions, the mnemonic and the symbolic operand designations for the assembler language are shown with each instruction. For LOAD AND TEST, for example, LTR is the mnemonic and R1, R2 the operand designation.
Programming Notes:
_____________________________ _____ _________________________________________ ____ | |Mne- | |Op | | Name |monic| Characteristics |Code| |_____________________________|_____|________ _______ ___________ ______ _____|____| |ADD |AR |RR C | | IF | R | |1A | |ADD |A |RX C | A | IF | R | B2|5A | |ADD HALFWORD |AH |RX C | A | IF | R | B2|4A | |ADD HALFWORD IMMEDIATE |AHI |RI C IR| | IF | R | |A7A | |ADD LOGICAL |ALR |RR C | | | R | |1E | |_____________________________|_____|________|_______|___________|______|_____|____| |ADD LOGICAL |AL |RX C | A | | R | B2|5E | |AND |NR |RR C | | | R | |14 | |AND |N |RX C | A | | R | B2|54 | |AND (character) |NC |SS C | A | | ST|B1 B2|D4 | |AND (immediate) |NI |SI C | A | | ST|B1 |94 | |_____________________________|_____|________|_______|___________|______|_____|____| |BRANCH AND LINK |BALR |RR | | T |B R | |05 | |BRANCH AND LINK |BAL |RX | | |B R | |45 | |BRANCH AND SAVE |BASR |RR | | T |B R | |0D | |BRANCH AND SAVE |BAS |RX | | |B R | |4D | |BRANCH AND SAVE AND SET MODE |BASSM|RR | | T |B R | |0C | |_____________________________|_____|________|_______|___________|______|_____|____| |BRANCH AND SET MODE |BSM |RR | | |B R | |0B | |BRANCH ON CONDITION |BCR |RR | | ¢¹ |B | |07 | |BRANCH ON CONDITION |BC |RX | | |B | |47 | |BRANCH ON COUNT |BCTR |RR | | |B R | |06 | |BRANCH ON COUNT |BCT |RX | | |B R | |46 | |_____________________________|_____|________|_______|___________|______|_____|____| |BRANCH ON INDEX HIGH |BXH |RS | | |B R | |86 | |BRANCH ON INDEX LOW OR EQUAL |BXLE |RS | | |B R | |87 | |BRANCH RELATIVE AND SAVE |BRAS |RI IR| | |B R | |A75 | |BRANCH RELATIVE ON CONDITION |BRC |RI IR| | |B | |A74 | |BRANCH RELATIVE ON COUNT |BRCT |RI IR| | |B R | |A76 | |_____________________________|_____|________|_______|___________|______|_____|____| | |BRANCH RELATIVE ON INDEX HIGH|BRXH |RSI IR| | |B R | |84 | | |BRANCH RELATIVE ON INDEX L.E.|BRXLE|RSI IR| | |B R | |85 | |CHECKSUM |CKSM |RRE C CK| A SP| | R | R2|B241| |COMPARE |CR |RR C | | | | |19 | |COMPARE |C |RX C | A | | | B2|59 | |_____________________________|_____|________|_______|___________|______|_____|____| |COMPARE AND FORM CODEWORD |CFC |S C | A SP|II GM| R |I1 |B21A| |COMPARE AND SWAP |CS |RS C | A SP| $ | R ST| B2|BA | |COMPARE DOUBLE AND SWAP |CDS |RS C | A SP| $ | R ST| B2|BB | |COMPARE HALFWORD |CH |RX C | A | | | B2|49 | |COMPARE HALFWORD IMMEDIATE |CHI |RI C IR| | | | |A7E | |_____________________________|_____|________|_______|___________|______|_____|____| |COMPARE LOGICAL |CLR |RR C | | | | |15 | |COMPARE LOGICAL |CL |RX C | A | | | B2|55 | |COMPARE LOGICAL (character) |CLC |SS C | A | | |B1 B2|D5 | |COMPARE LOGICAL (immediate) |CLI |SI C | A | | |B1 |95 | |COMPARE LOGICAL C. UNDER MASK|CLM |RS C | A | | | B2|BD | |_____________________________|_____|________|_______|___________|______|_____|____| _____________________________ _____ _________________________________________ ____ | |Mne- | |Op | | Name |monic| Characteristics |Code| |_____________________________|_____|________ _______ ___________ ______ _____|____| |COMPARE LOGICAL LONG |CLCL |RR C | A SP|II | R |R1 R2|0F | |COMPARE LOGICAL LONG EXTENDED|CLCLE|RS C CM| A SP| | R |R1 R3|A9 | |COMPARE LOGICAL STRING |CLST |RRE C SR| A SP| G0| R |R1 R2|B25D| |COMPARE UNTIL SUBSTRING EQUAL|CUSE |RRE C | A SP|II GM| |R1 R2|B257| |CONVERT TO BINARY |CVB |RX | A |D IK | R | B2|4F | |_____________________________|_____|________|_______|___________|______|_____|____| |CONVERT TO DECIMAL |CVD |RX | A | | ST| B2|4E | |COPY ACCESS |CPYA |RRE | | | |U1 U2|B24D| |DIVIDE |DR |RR | SP| IK | R | |1D | |DIVIDE |D |RX | A SP| IK | R | B2|5D | |EXCLUSIVE OR |XR |RR C | | | R | |17 | |_____________________________|_____|________|_______|___________|______|_____|____| |EXCLUSIVE OR |X |RX C | A | | R | B2|57 | |EXCLUSIVE OR (character) |XC |SS C | A | | ST|B1 B2|D7 | |EXCLUSIVE OR (immediate) |XI |SI C | A | | ST|B1 |97 | |EXECUTE |EX |RX | AI SP| EX| | |44 | |EXTRACT ACCESS |EAR |RRE | | | R | U2|B24F| |_____________________________|_____|________|_______|___________|______|_____|____| |INSERT CHARACTER |IC |RX | A | | R | B2|43 | |INSERT CHARACTERS UNDER MASK |ICM |RS C | A | | R | B2|BF | |INSERT PROGRAM MASK |IPM |RRE | | | R | |B222| |LOAD |LR |RR | | | R | |18 | |LOAD |L |RX | A | | R | B2|58 | |_____________________________|_____|________|_______|___________|______|_____|____| |LOAD ACCESS MULTIPLE |LAM |RS | A SP| | | UB|9A | |LOAD ADDRESS |LA |RX | | | R | |41 | |LOAD ADDRESS EXTENDED |LAE |RX | | | R |U1 BP|51 | |LOAD AND TEST |LTR |RR C | | | R | |12 | |LOAD COMPLEMENT |LCR |RR C | | IF | R | |13 | |_____________________________|_____|________|_______|___________|______|_____|____| |LOAD HALFWORD |LH |RX | A | | R | B2|48 | |LOAD HALFWORD IMMEDIATE |LHI |RI IR| | | R | |A78 | |LOAD MULTIPLE |LM |RS | A | | R | B2|98 | |LOAD NEGATIVE |LNR |RR C | | | R | |11 | |LOAD POSITIVE |LPR |RR C | | IF | R | |10 | |_____________________________|_____|________|_______|___________|______|_____|____| |MONITOR CALL |MC |SI | SP| MO| | |AF | |MOVE (character) |MVC |SS | A | | ST|B1 B2|D2 | |MOVE (immediate) |MVI |SI | A | | ST|B1 |92 | |MOVE INVERSE |MVCIN|SS MI| A | | ST|B1 B2|E8 | |MOVE LONG |MVCL |RR C | A SP|II | R ST|R1 R2|0E | |_____________________________|_____|________|_______|___________|______|_____|____| |MOVE LONG EXTENDED |MVCLE|RS C CM| A SP| | R ST|R1 R3|A8 | |MOVE NUMERICS |MVN |SS | A | | ST|B1 B2|D1 | |MOVE PAGE (facility 1) |MVPG |RRE C M1| A¹ SP| G0| ST|R1 R2|B254| |MOVE STRING |MVST |RRE C SR| A SP| G0| R ST|R1 R2|B255| |MOVE WITH OFFSET |MVO |SS | A | | ST|B1 B2|F1 | |_____________________________|_____|________|_______|___________|______|_____|____| _____________________________ _____ _________________________________________ ____ | |Mne- | |Op | | Name |monic| Characteristics |Code| |_____________________________|_____|________ _______ ___________ ______ _____|____| |MOVE ZONES |MVZ |SS | A | | ST|B1 B2|D3 | |MULTIPLY |MR |RR | SP| | R | |1C | |MULTIPLY |M |RX | A SP| | R | B2|5C | |MULTIPLY HALFWORD |MH |RX | A | | R | B2|4C | |MULTIPLY HALFWORD IMMEDIATE |MHI |RI IR| | | R | |A7C | |_____________________________|_____|________|_______|___________|______|_____|____| |MULTIPLY SINGLE |MSR |RRE IR| | | R | |B252| |MULTIPLY SINGLE |MS |RX IR| A | | R | B2|71 | |OR |OR |RR C | | | R | |16 | |OR |O |RX C | A | | R | B2|56 | |OR (character) |OC |SS C | A | | ST|B1 B2|D6 | |_____________________________|_____|________|_______|___________|______|_____|____| |OR (immediate) |OI |SI C | A | | ST|B1 |96 | |PACK |PACK |SS | A | | ST|B1 B2|F2 | | |PERFORM LOCKED OPERATION |PLO |SS C PL| A SP| $ GM| R ST| FC|EE | |SEARCH STRING |SRST |RRE C SR| A SP| G0| R | R2|B25E| |SET ACCESS |SAR |RRE | | | |U1 |B24E| |_____________________________|_____|________|_______|___________|______|_____|____| |SET PROGRAM MASK |SPM |RR L | | | | |04 | |SHIFT LEFT DOUBLE |SLDA |RS C | SP| IF | R | |8F | |SHIFT LEFT DOUBLE LOGICAL |SLDL |RS | SP| | R | |8D | |SHIFT LEFT SINGLE |SLA |RS C | | IF | R | |8B | |SHIFT LEFT SINGLE LOGICAL |SLL |RS | | | R | |89 | |_____________________________|_____|________|_______|___________|______|_____|____| |SHIFT RIGHT DOUBLE |SRDA |RS C | SP| | R | |8E | |SHIFT RIGHT DOUBLE LOGICAL |SRDL |RS | SP| | R | |8C | |SHIFT RIGHT SINGLE |SRA |RS C | | | R | |8A | |SHIFT RIGHT SINGLE LOGICAL |SRL |RS | | | R | |88 | |STORE |ST |RX | A | | ST| B2|50 | |_____________________________|_____|________|_______|___________|______|_____|____| |STORE ACCESS MULTIPLE |STAM |RS | A SP| | ST| UB|9B | |STORE CHARACTER |STC |RX | A | | ST| B2|42 | |STORE CHARACTERS UNDER MASK |STCM |RS | A | | ST| B2|BE | |STORE CLOCK |STCK |S C | A | $ | ST| B2|B205| |STORE HALFWORD |STH |RX | A | | ST| B2|40 | |_____________________________|_____|________|_______|___________|______|_____|____| |STORE MULTIPLE |STM |RS | A | | ST| B2|90 | |SUBTRACT |SR |RR C | | IF | R | |1B | |SUBTRACT |S |RX C | A | IF | R | B2|5B | |SUBTRACT HALFWORD |SH |RX C | A | IF | R | B2|4B | |SUBTRACT LOGICAL |SLR |RR C | | | R | |1F | |_____________________________|_____|________|_______|___________|______|_____|____| |SUBTRACT LOGICAL |SL |RX C | A | | R | B2|5F | |SUPERVISOR CALL |SVC |RR | | ¢ | | |0A | |TEST AND SET |TS |S C | A | $ | ST| B2|93 | |TEST UNDER MASK |TM |SI C | A | | |B1 |91 | |TEST UNDER MASK HIGH |TMH |RI C IR| | | | |A70 | |_____________________________|_____|________|_______|___________|______|_____|____| |TEST UNDER MASK LOW |TML |RI C IR| | | | |A71 | |TRANSLATE |TR |SS | A | | ST|B1 B2|DC | |TRANSLATE AND TEST |TRT |SS C | A | GM| R |B1 B2|DD | |UNPACK |UNPK |SS | A | | ST|B1 B2|F3 | |UPDATE TREE |UPT |E C | A SP|II GM| R ST|I4 |0102| |_____________________________|_____|________|_______|___________|______|_____|____| __________________________________________________________________________________ |Explanation: | | | | ¢ Causes serialization and checkpoint synchronization. | | ¢¹ Causes serialization and checkpoint synchronization when the M1 and R2 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. | | B1 B1 field designates an access register in the access-register mode. | | B2 B2 field designates an access register in the access-register mode. | | BP B2 field designates an access register when PSW bits 16 and 17 have the | | value 01. | | C Condition code is set. | | CK Checksum facility. | | CM Compare-and-move-extended facility. | | D Data exception. | | E E instruction format. | | EX Execute exception. | | | FC Designation of access registers depends on the function code of the | | | instruction. | | G0 Instruction execution includes the implied use of general register 0. | | GM Instruction execution includes the implied use of multiple general registers:| | General registers 1 and 2 for TRANSLATE AND TEST. | | General registers 1, 2, and 3 for COMPARE AND FORM CODEWORD. | | | General registers 0 and 1 for COMPARE UNTIL SUBSTRING EQUAL and PERFORM | | | LOCKED OPERATION. | | General registers 0-5 for UPDATE TREE. | | IF Fixed-point-overflow exception. | | II Interruptible instruction. | | IK Fixed-point-divide exception. | | IR Immediate-and-relative-instruction facility. | | I1 Access register 1 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. | | MI Move-inverse facility. | | MO Monitor event. | | M1 Move-page facility 1, which is a subset of move-page facility 2. | | | PL Perform-locked-operation facility. | | R PER general-register-alteration event. | | R1 R1 field designates an access register in the access-register mode. | | R2 R2 field designates an access register in the access-register mode. | | R3 R3 field designates an access register in the access-register mode. | | RI RI instruction format. | | RR RR instruction format. | | RRE RRE instruction format. | | RS RS instruction format. | | RSI RSI instruction format. | | RX RX instruction format. | | S S instruction format. | | SI SI instruction format. | | SP Specification exception. | | SR String-instruction facility. | | SS SS instruction format. | |__________________________________________________________________________________| __________________________________________________________________________________ |Explanation (Continued): | | | | ST PER storage-alteration event. | | T Trace exceptions (includes trace table, addressing, and low-address protec- | | tion). | | U1 R1 field designates an access register unconditionally. | | U2 R2 field designates an access register unconditionally. | | UB R1 and R3 fields designate access registers unconditionally, and B2 field | | designates an access register in the access-register mode. | |__________________________________________________________________________________|Figure 7-1. Summary of General Instructions
Subtopics:
AR R1,R2 [RR]________ ____ ____ | '1A' | R1 | R2 | |________|____|____| 0 8 12 15 A R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '5A' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is added to the first operand, and the sum is placed at the first-operand location. The operands and the sum are treated as 32-bit signed binary integers.When there is an overflow, the result is obtained by allowing any carry into the sign-bit position and ignoring any carry out of the sign-bit position, and condition code 3 is set. If the fixed-point-overflow mask is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
AH R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '4A' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
AHI R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'A' | I2 | |________|____|____|________________| 0 8 12 16 31
The second operand is added to the first operand, and the sum is placed at the first-operand location. The second operand is two bytes in length and is treated as a 16-bit signed binary integer. The first operand and the sum are treated as 32-bit signed binary integers.When there is an overflow, the result is obtained by allowing any carry into the sign-bit position and ignoring any carry out of the sign-bit position, and condition code 3 is set. If the fixed-point-overflow mask is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
ALR R1,R2 [RR]________ ____ ____ | '1E' | R1 | R2 | |________|____|____| 0 8 12 15 AL R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '5E' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is added to the first operand, and the sum is placed at the first-operand location. The operands and the sum are treated as 32-bit unsigned binary integers.Resulting Condition Code:
NR R1,R2 [RR]________ ____ ____ | '14' | R1 | R2 | |________|____|____| 0 8 12 15 N R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '54' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31 NI D1(B1),I2 [SI]
________ ________ ____ ____________ | '94' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31 NC D1(L,B1),D2(B2) [SS]
________ ________ ____ _/__ ____ _/__ | 'D4' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The AND of the first and second operands is placed at the first-operand location.The connective AND is applied to the operands bit by bit. A bit position in the result is set to one if the corresponding bit positions in both operands contain ones; otherwise, the result bit is set to zero.
For AND (NC), each operand is processed left to right. When the operands overlap, the result is obtained as if the operands were processed one byte at a time and each result byte were stored immediately after fetching the necessary operand bytes.
For AND (NI), the first operand is one byte in length, and only one byte is stored.
Resulting Condition Code:
BALR R1,R2 [RR]________ ____ ____ | '05' | R1 | R2 | |________|____|____| 0 8 12 15 BAL R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '45' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
Information from the current PSW, including the updated instruction address, is loaded as link information at the first-operand location. Subsequently, the instruction address is replaced by the branch address.In the RX format, the second-operand address is used as the branch address. In the RR format, the contents of general register R2 are used to generate the branch address; however, when the R2 field is zero, the operation is performed without branching. The branch address is computed before general register R1 is changed.
The link information in the 24-bit addressing mode consists of the instruction-length code (ILC), the condition code (CC), the program-mask bits, and the rightmost 24 bits of the updated instruction address, arranged in the following format:
___ ___ _____ ______________________ | | |Prog | | |ILC|CC |Mask | Instruction Address | |___|___|_____|______________________| 0 2 4 8 31The link information in the 31-bit addressing mode consists of the right half of the PSW, that is, the addressing-mode bit (always a one) and a 31-bit updated instruction address, arranged in the following format:The instruction-length code is 1 or 2.
_ _______________________________ |1| Instruction Address | |_|_______________________________| 0 1 31Condition Code: The code remains unchanged.
Program Exceptions:
BASR R1,R2 [RR]________ ____ ____ | '0D' | R1 | R2 | |________|____|____| 0 8 12 15 BAS R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '4D' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
Bits 32-63 of the current PSW, including the updated instruction address, are saved as link information at the first-operand location. Subsequently, the instruction address is replaced by the branch address.In the 24-bit addressing mode, the link information consists of a 24-bit instruction address with eight zeros appended on the left. In the 31-bit addressing mode, the link information consists of a 31-bit address with a one appended on the left.
In the RX format, the second-operand address is used as the branch address. In the RR format, the contents of general register R2 are used to generate the branch address; however, when the R2 field is zero, the operation is performed without branching. The branch address is computed before general register R1 is changed.
Condition Code: The code remains unchanged.
Program Exceptions:
BASSM R1,R2 [RR]________ ____ ____ | '0C' | R1 | R2 | |________|____|____| 0 8 12 15
Bits 32-63 of the current PSW, including the updated instruction address, are saved as link information at the first-operand location. Subsequently, the addressing mode and instruction address in the current PSW are replaced from the second operand. The action associated with the second operand is not performed if the R2 field is zero.In the 24-bit addressing mode, the link information consists of a 24-bit instruction address with eight zeros appended on the left. In the 31-bit addressing mode, the link information consists of a 31-bit address with a one appended on the left.
The contents of general register R2 specify the new addressing mode and designate the branch address; however, when the R2 field is zero, the operation is performed without branching and without setting the addressing mode.
When the contents of general register R2 are used, bit 0 of the register specifies the new addressing mode and replaces bit 32 of the current PSW, and the branch address is generated from the contents of the register under the control of the new addressing mode. The new value for the PSW is computed before general register R1 is changed.
Condition Code: The code remains unchanged.
Program Exceptions:
BSM R1,R2 [RR]________ ____ ____ | '0B' | R1 | R2 | |________|____|____| 0 8 12 15
Bit 32 of the current PSW, the addressing mode, is inserted into the first operand. Subsequently, the addressing mode and instruction address in the current PSW are replaced from the second operand. The action associated with an operand is not performed if the associated R field is zero.The value of bit 32 of the PSW is placed in bit position 0 of general register R1, and bits 1-31 of the register remain unchanged; however, when the R1 field is zero, the bit is not inserted, and the contents of general register 0 are not changed.
The contents of general register R2 specify the new addressing mode and designate the branch address; however, when the R2 field is zero, the operation is performed without branching and without setting the addressing mode.
When the contents of general register R2 are used, bit 0 of the register specifies the new addressing mode and replaces bit 32 of the current PSW, and the branch address is generated from the contents of the register under the control of the new addressing mode. The new value for the PSW is computed before general register R1 is changed.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Programming Notes:
BCR M1,R2 [RR]________ ____ ____ | '07' | M1 | R2 | |________|____|____| 0 8 12 15 BC M1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '47' | M1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The instruction address in the current PSW is replaced by the branch address if the condition code has one of the values specified by M1; otherwise, normal instruction sequencing proceeds with the updated instruction address.In the RX format, the second-operand address is used as the branch address. In the RR format, the contents of general register R2 are used to generate the branch address; however, when the R2 field is zero, the operation is performed without branching.
The M1 field is used as a four-bit mask. The four condition codes (0, 1, 2, and 3) correspond, left to right, with the four bits of the mask, as follows:
___________ _____________ __________ | | Instruction | Mask | | Condition | Bit No. of | Position | | Code | Mask | Value | |___________|_____________|__________| | 0 | 8 | 8 | | 1 | 9 | 4 | | 2 | 10 | 2 | | 3 | 11 | 1 | |___________|_____________|__________|When the M1 and R2 fields of BRANCH ON CONDITION (BCR) are all ones and all zeros, respectively, a serialization and checkpoint-synchronization function is performed.The current condition code is used to select the corresponding mask bit. If the mask bit selected by the condition code is one, the branch is successful. If the mask bit selected is zero, normal instruction sequencing proceeds with the next sequential instruction.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Programming Notes:
BCTR R1,R2 [RR]________ ____ ____ | '06' | R1 | R2 | |________|____|____| 0 8 12 15 BCT R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '46' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
A one is subtracted from the first operand, and the result is placed at the first-operand location. The first operand and result are treated as 32-bit binary integers, with overflow ignored. When the result is zero, normal instruction sequencing proceeds with the updated instruction address. When the result is not zero, the instruction address in the current PSW is replaced by the branch address.In the RX format, the second-operand address is used as the branch address. In the RR format, the contents of general register R2 are used to generate the branch address; however, when the R2 field is zero, the operation is performed without branching. The branch address is computed before general register R1 is changed.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Programming Notes:
BXH R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | '86' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
BXLE R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | '87' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
An increment is added to the first operand, and the sum is compared with a compare value. The result of the comparison determines whether branching occurs. Subsequently, the sum is placed at the first-operand location. The second-operand address is used as a branch address. The R3 field designates registers containing the increment and the compare value.For BRANCH ON INDEX HIGH, when the sum is high, the instruction address in the current PSW is replaced by the branch address. When the sum is low or equal, normal instruction sequencing proceeds with the updated instruction address.
For BRANCH ON INDEX LOW OR EQUAL, when the sum is low or equal, the instruction address in the current PSW is replaced by the branch address. When the sum is high, normal instruction sequencing proceeds with the updated instruction address.
When the R3 field is even, it designates a pair of registers; the contents of the even and odd registers of the pair are used as the increment and the compare value, respectively. When the R3 field is odd, it designates a single register, the contents of which are used as both the increment and the compare value.
For purposes of the addition and comparison, all operands and results are treated as 32-bit signed binary integers. Overflow caused by the addition is ignored.
The original contents of the compare-value register are used as the compare value even when that register is also specified to be the first-operand location. The branch address is computed before general register R1 is changed.
The sum is placed at the first-operand location, regardless of whether the branch is taken.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Programming Notes:
BRAS R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'5' | I2 | |________|____|____|________________| 0 8 12 16 31
Bits 32-63 of the current PSW, including the updated instruction address, are saved as link information at the first-operand location. Subsequently, the instruction address is replaced by the branch address.In the 24-bit addressing mode, the link information consists of a 24-bit instruction address with eight zeros appended on the left. In the 31-bit addressing mode, the link information consists of a 31-bit address with a one appended on the left.
The contents of the I2 field are a signed binary integer specifying the number of halfwords that is added to the address of the instruction to generate the branch address.
Condition Code: The code remains unchanged.
Program Exceptions:
BRC M1,I2 [RI]________ ____ ____ ________________ | 'A7' | M1 |'4' | I2 | |________|____|____|________________| 0 8 12 16 31
The instruction address in the current PSW is replaced by the branch address if the condition code has one of the values specified by M1; otherwise, normal instruction sequencing proceeds with the updated instruction address.The contents of the I2 field are a signed binary integer specifying the number of halfwords that is added to the address of the instruction to generate the branch address.
The M1 field is used as a four-bit mask. The four condition codes (0, 1, 2, and 3) correspond, left to right, with the four bits of the mask, as follows:
___________ _____________ __________ | | Instruction | Mask | | Condition | Bit No. of | Position | | Code | Mask | Value | |___________|_____________|__________| | 0 | 8 | 8 | | 1 | 9 | 4 | | 2 | 10 | 2 | | 3 | 11 | 1 | |___________|_____________|__________|Condition Code: The code remains unchanged.The current condition code is used to select the corresponding mask bit. If the mask bit selected by the condition code is one, the branch is successful. If the mask bit selected is zero, normal instruction sequencing proceeds with the next sequential instruction.
Program Exceptions:
BRCT R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'6' | I2 | |________|____|____|________________| 0 8 12 16 31
A one is subtracted from the first operand, and the result is placed at the first-operand location. The first operand and result are treated as 32-bit binary integers, with overflow ignored. When the result is zero, normal instruction sequencing proceeds with the updated instruction address. When the result is not zero, the instruction address in the current PSW is replaced by the branch address.The contents of the I2 field are a signed binary integer specifying the number of halfwords that is added to the address of the instruction to generate the branch address.
Condition Code: The code remains unchanged.
Program Exceptions:
BRXH R1,R3,I2 [RSI]________ ____ ____ ________________ | '84' | R1 | R3 | I2 | |________|____|____|________________| 0 8 12 16 31
BRXLE R1,R3,I2 [RSI]________ ____ ____ ________________ | '85' | R1 | R3 | I2 | |________|____|____|________________| 0 8 12 16 31
An increment is added to the first operand, and the sum is compared with a compare value. The result of the comparison determines whether branching occurs. Subsequently, the sum is placed at the first-operand location. The R3 field designates registers containing the increment and the compare value.The contents of the I2 field are a signed binary integer specifying the number of halfwords that is added to the address of the instruction to generate the branch address.
For BRANCH RELATIVE ON INDEX HIGH, when the sum is high, the instruction address in the current PSW is replaced by the branch address. When the sum is low or equal, normal instruction sequencing proceeds with the updated instruction address.
For BRANCH RELATIVE ON INDEX LOW OR EQUAL, when the sum is low or equal, the instruction address in the current PSW is replaced by the branch address. When the sum is high, normal instruction sequencing proceeds with the updated instruction address.
When the R3 field is even, it designates a pair of registers; the contents of the even and odd registers of the pair are used as the increment and the compare value, respectively. When the R3 field is odd, it designates a single register, the contents of which are used as both the increment and the compare value.
For purposes of the addition and comparison, all operands and results are treated as 32-bit signed binary integers. Overflow caused by the addition is ignored.
The original contents of the compare-value register are used as the compare value even when that register is also specified to be the first-operand location.
The sum is placed at the first-operand location, regardless of whether the branch is taken.
Condition Code: The code remains unchanged.
Program Exceptions:
CKSM R1,R2 [RRE]________________ ________ ____ ____ | 'B241' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
Successive four-byte elements of the second operand are added to the first operand in general register R1 to form a 32-bit checksum in the register. The first operand and the four-byte elements are treated as 32-bit unsigned binary integers. After each addition of an element, a carry out of bit position 0 of the first operand is added to bit position 31 of the first operand. If the second operand is not a multiple of four bytes, its last one, two, or three bytes are treated as appended on the right with the number of all-zeros bytes needed to form a four-byte element. The four-byte elements are added to the first operand until either the entire second operand or a CPU-determined amount of the second operand has been processed. The result is indicated in the condition code.
Bits 16-23 of the instruction are ignored.
The R2 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The location of the leftmost byte of the second operand is specified by the contents of the R2 general register. The number of bytes in the second-operand location is specified by the 32-bit unsigned binary integer in the R2 + 1 general register.
The handling of the address in general register R2 is dependent on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-31 of general register R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general register R2 constitute the address, and the contents of bit position 0 are ignored.
The addition of second-operand four-byte elements to the first operand proceeds left to right, four-byte element by four-byte element, and ends as soon as (1) the entire second operand has been processed or (2) a lesser CPU-determined amount of the second operand has been processed. In either case, the result in general register R1 is a 32-bit checksum for the part of the second operand that has been processed. When the second operand is not a multiple of four bytes, the final second-operand bytes in excess of a multiple of four are conceptually appended on the right with an appropriate number of all-zeros bytes to form the final four-byte element.
If the operation ends because the entire second operand has been processed, the condition code is set to 0. If the operation ends because a lesser CPU-determined amount of the second operand has been processed, the condition code is set to 3. When the operation is to end with a setting of condition code 3, any carry out of bit position 0 of the first operand is added to bit position 31 of the first operand before the operation ends.
At the completion of the operation, the operand-length field in the R2 + 1 register is decremented by the number of actual second-operand bytes added to the first operand (not including any conceptually appended all-zeros bytes), and the address in the R2 register is incremented by the same number. Thus, the R2 + 1 register contains a zero value if the condition code is set to 0, or it contains a nonzero value if the condition code is set to 3.
When condition code 3 is set, the general registers used by the instruction have been set so that the remainder of the second operand can be processed by simply branching back to reexecute the instruction.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed. The minimum amount is four bytes or the number of bytes specified in the R2 + 1 general register, whichever is smaller.
At the completion of the operation, the leftmost bits which are not part of the address in general register R2 may be set to zeros or may remain unchanged, including the case when the initial length in register R2 + 1 is zero.
When the R1 register is the same register as the R2 or R2 + 1 register, the results are unpredictable.
Access exceptions for the portion of the second operand to the right of the last byte processed may or may not be recognized. For a second operand longer than 4K bytes, access exceptions are not recognized for locations more than 4K bytes beyond the last byte processed.
Access exceptions are not recognized if the R2 field is odd. When the length of the second operand is zero, no access exceptions are recognized.
Resulting Condition Code:
Contents Contents Program of R2 of R2+1LR R2,R1 A,B 0,0 SRDL R2,16 0,A B,0 ALR R2,R2+1 B,A B,0 ALR R2,R1 A+B+C,A+B B,0 SRL R2,16 0,A+B+C B,0
_______________________________________________ |Contents of R1 __ÿ CHECKSUM | | | |Address in R2 __ÿ ADR, contents of R2+1 __ÿ LEN| |_________________ _____________________________| | ___________________ÿ| Note: All addends are unsigned binary integers | | ________ No _________________________________ | |LEN >= 4|_____________________ÿ|LEN __ÿ INC | | |____ ___| | | | | Yes |INC bytes at ADR followed by | | |4-INC all-zeros bytes __ÿ ELEMENT| | __________________________ |________________ ________________| | |4 __ÿ INC | | | | | | | |4 bytes at ADR __ÿ ELEMENT| | | |____________ _____________| | | | | | |__________________________________________| | | _______________________________ | |CHECKSUM + ELEMENT __ÿ CHECKSUM| | |______________ ________________| | | | | ___________________ Yes _________________________ | |Carry from addition|____ÿ|CHECKSUM + 1 __ÿ CHECKSUM| | |_________ _________| |____________ ____________| | | No | | |___________________________| | | _____________________________________ | |ADR + INC __ÿ ADR, LEN - INC __ÿ LEN | | |______________ ______________________| | | | | _________________________ | |LEN = 0 or CPU-determined| | |reason to end operation | | |____ _______ ____________| | | No | Yes |____________| | ________________________ |CHECKSUM __ÿ R1 | | | |ADR __ÿ R2, LEN __ÿ R2+1| |___________ ____________| | _______ No |LEN = 0|_______________________ |___ ___| | | Yes | ____________________ ____________________ |Set condition code 0| |Set condition code 3| |_________ __________| |_________ __________| | | End operation End operationFigure 7-2. Execution of CHECKSUM
CR R1,R2 [RR]________ ____ ____ | '19' | R1 | R2 | |________|____|____| 0 8 12 15 C R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '59' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first operand is compared with the second operand, and the result is indicated in the condition code. The operands are treated as 32-bit signed binary integers.Resulting Condition Code:
CFC D2(B2) [S]________________ ____ ____________ | 'B21A' | B2 | D2 | |________________|____|____________| 0 16 20 31
General register 2 contains an index, which is used along with the contents of general registers 1 and 3 to designate the starting addresses of two fields in storage, called the first and third operands. The first and third operands are logically compared, and a codeword is formed for use in sort/merge algorithms.The second-operand address is not used to address data. Bits 17-30 of the second-operand address, with one rightmost and one leftmost zero appended, are used as a 16-bit index limit. Bit 31 of the second-operand address is the operand-control bit. When bit 31 is zero, the codeword is formed from the high operand; when bit 31 is one, the codeword is formed from the low operand. The remainder of the second-operand address is ignored.
General registers 1 and 3 contain the base addresses of the first and third operands. Bits 16-31 of general register 2 are used as an index for addressing both the first and third operands. General registers 1, 2, and 3 must all initially contain even values; otherwise, a specification exception is recognized.
In the access-register mode, access register 1 specifies the address space containing the first and third operands.
The operation consists in comparing the first and third operands halfword by halfword and incrementing the index until an unequal pair of halfwords is found or the index exceeds the index limit. This proceeds in units of operation, between which interruptions may occur. The condition code is unpredictable if the instruction is interrupted.
At the start of a unit of operation, the index, bits 16-31 of general register 2, is logically compared with the index limit. If the index is larger, the instruction is completed by placing the contents of general register 3, with bit 0 set to one, in general register 2, and by setting condition code 0.
If the index is less than or equal to the index limit, the index is applied to the first-operand and third-operand base addresses to locate the current pair of halfwords to be compared. The index, with 16 leftmost zeros appended, and the contents of general register 1 are added to form a 32-bit intermediate value. A carry out of bit position 0, if any, is ignored. The address of the current first-operand halfword is generated from the intermediate value by following the normal rules for operand address generation. The address of the current third-operand halfword is formed in the same manner by adding the contents of general register 3 and the index.
The current first-operand and third-operand halfwords are logically compared. If they are equal, the contents of general register 2 are incremented by 2, and a unit of operation ends.
If the compare values are unequal, the contents of general register 2 are incremented by 2 and then shifted left logically by 16 bit positions. If the operand-control bit is zero, (1) the one's complement of the higher halfword is placed in the right half of general register 2, and (2) if operand 1 was higher, the contents of general registers 1 and 3 are interchanged. If the operand-control bit is one, (1) the lower halfword is placed in the right half of general register 2, and (2) if operand 1 was lower, the contents of general registers 1 and 3 are interchanged.
For the purpose of recognizing access exceptions, operand 1 and operand 3 are both considered to have a length equal to 2 more than the value of the index limit minus the index. When the index is initially larger than the index limit, access exceptions are not recognized for the storage operands. For operands longer than 4K bytes, access exceptions are not recognized more than 4K bytes beyond the byte being processed. Access
If the B2 field designates general register 2, it is unpredictable whether or not the index limit is recomputed; thus, in this case the operand length is unpredictable. However, in no case can the operands exceed 2¹5 bytes in length.
Resulting Condition Code:
________ _________ _________ _________ ________ ________ |Operand-| |Resulting| | | | |Control | |Condition| Result | Result | Result | | Bit |Relation | Code | in GR2 | in GR1 | in GR3 | |________|_________|_________|_________|________|________| | 0 |op1 = op3| 0 | OGR3b1 | - | - | | 0 |op1 < op3| 1 | X, nop3 | - | - | | 0 |op1 > op3| 2 | X, nop1 | OGR3 | OGR1 | | 1 |op1 = op3| 0 | OGR3b1 | - | - | | 1 |op1 < op3| 2 | X, top1 | OGR3 | OGR1 | | 1 |op1 > op3| 1 | X, top3 | - | - | |________|_________|_________|_________|________|________| |Explanation: | | | | - The contents of the register remain unchanged. | | | | OGR1 The original contents of GR1. | | | | OGR3 The original contents of GR3. | | | | OGR3b1 The original contents of GR3 with bit 0 set to | | one. | | | | | X Bits 0-15 of GR2 are 2 more than the index of | | the first unequal halfword. | | | | | nop1 Bits 16-31 of GR2 are the one's complement of | | the first unequal halfword in operand 1. | | | | | nop3 Bits 16-31 of GR2 are the one's complement of | | the first unequal halfword in operand 3. | | | | | top1 Bits 16-31 of GR2 are the first unequal halfword| | in operand 1. | | | | | top3 Bits 16-31 of GR2 are the first unequal halfword| | in operand 3. | |________________________________________________________|Figure 7-3. Operation of COMPARE AND FORM CODEWORD
_____________________________________________________ |2 x bits 17-30 of 2nd-operand address __ÿ index limit| | | |Bit 31 of 2nd-operand address __ÿ operand-control bit| |__________________________ __________________________| | ______________________________________ No |Bit 31 of GR1, GR2, and GR3 all zeros|_____________ÿ Specification |__________________ ___________________| exception | Yes _______________________ÿ| | | _______________________________ Yes | |Bits 16-31 of GR2 > index limit|___________________ | |_______________ _______________| | | | No | | ____|____ ______________________________ __________________ |Unit-of- | |GR1 + bits 16-31 of GR2 | |GR3 __ÿ GR2 | |operation| |__ÿ 1st-operand address | | | |boundary | | | |1 __ÿ bit 0 of GR2| |_________| |GR3 + bits 16-31 of GR2 | | | " |__ÿ 3rd-operand address | |0 __ÿ Cond code | | | | |________ _________| | |Fetch halfwords from current | | | |1st- and 3rd-operand locations| | | | End operation | |GR2 + 2 __ÿ GR2 | | |______________ _______________| | | | | Equal _________________________ 1st op high |___________|Compare halfwords fetched|___________________________ |____________ ____________| | | 1st op low | Zero ________________________ Zero ________________________ _________|Test operand-control bit| ______|Test operand-control bit| | |___________ ____________| | |____________ ___________| | One | One ________________ ________________ |One's complement| _______________ |One's complement| __________ |of 3rd-op HW | |1st-op HW | |of 1st-op HW | |3rd-op HW | |__ÿ TEMPHW | |__ÿ TEMPHW | |__ÿ TEMPHW | |__ÿ TEMPHW| |_______ ________| | | | | |____ _____| | |Exchange | |Exchange | | |GR1 and GR3 | |GR1 and GR3 | ________________ | | | | _______________ |1 __ÿ Cond code | |2 __ÿ Cond code| |2 __ÿ Cond code | |1 __ÿ Cond code| |_______ ________| |_______ _______| |_______ ________| |_______ _______| | | | | | | |____________________ÿ°___________________°__________________| | ____________________________ |Shift GR2 left 16 positions | | | |TEMPHW __ÿ bits 16-31 of GR2| |_____________ ______________| | End operationFigure 7-4. Execution of COMPARE AND FORM CODEWORD
CS R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'BA' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
CDS R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'BB' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first and second operands are compared. If they are equal, the third operand is stored at the second-operand location. If they are unequal, the second operand is loaded into the first-operand location. The result of the comparison is indicated in the condition code.For COMPARE AND SWAP, the first and third operands are 32 bits in length, with each operand occupying a general register. The second operand is a word in storage.
For COMPARE DOUBLE AND SWAP, the first and third operands are 64 bits in length, with each operand occupying an even-odd pair of general registers. The second operand is a doubleword in storage.
When an equal comparison occurs, the third operand is stored at the second-operand location. The fetch of the second operand for purposes of comparison and the store into the second-operand location appear to be a block-concurrent interlocked-update reference as observed by other CPUs.
When the result of the comparison is unequal, the second-operand location remains unchanged. However, on some models, the value may be fetched and subsequently stored back unchanged at the second-operand location. This update appears to be a block-concurrent interlocked-update reference as observed by other CPUs.
A serialization function is performed before the operand is fetched and again after the operation is completed.
The second operand of COMPARE AND SWAP must be designated on a word boundary. The R1 and R3 fields for COMPARE DOUBLE AND SWAP must each designate an even-numbered register, and the second operand for the CDS instruction must be designated on a doubleword boundary. Otherwise, a specification exception is recognized.
Resulting Condition Code:
CH R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '49' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
CHI R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'E' | I2 | |________|____|____|________________| 0 8 12 16 31
The first operand is compared with the second operand, and the result is indicated in the condition code. The second operand is two bytes in length and is treated as a 16-bit signed binary integer. The first operand is treated as a 32-bit signed binary integer.Resulting Condition Code:
CLR R1,R2 [RR]________ ____ ____ | '15' | R1 | R2 | |________|____|____| 0 8 12 15 CL R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '55' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31 CLI D1(B1),I2 [SI]
________ ________ ____ ____________ | '95' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31 CLC D1(L,B1),D2(B2) [SS]
________ ________ ____ _/__ ____ _/__ | 'D5' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The first operand is compared with the second operand, and the result is indicated in the condition code.The comparison proceeds left to right, byte by byte, and ends as soon as an inequality is found or the end of the fields is reached. For COMPARE LOGICAL (CL) and COMPARE LOGICAL (CLC), access exceptions may or may not be recognized for the portion of a storage operand to the right of the first unequal byte.
Resulting Condition Code:
CLM R1,M3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'BD' | R1 | M3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first operand is compared with the second operand under control of a mask, and the result is indicated in the condition code.The contents of the M3 field are used as a mask. These four bits, left to right, correspond one for one with the four bytes, left to right, of general register R1. The byte positions corresponding to ones in the mask are considered as a contiguous field and are compared with the second operand. The second operand is a contiguous field in storage, starting at the second-operand address and equal in length to the number of ones in the mask. The bytes in the general register corresponding to zeros in the mask do not participate in the operation.
The comparison proceeds left to right, byte by byte, and ends as soon as an inequality is found or the end of the fields is reached.
When the mask is not zero, exceptions associated with storage-operand access are recognized for no more than the number of bytes specified by the mask. Access exceptions may or may not be recognized for the portion of a storage operand to the right of the first unequal byte. When the mask is zero, access exceptions are recognized for one byte at the second-operand address.
Resulting Condition Code:
CLCL R1,R2 [RR]________ ____ ____ | '0F' | R1 | R2 | |________|____|____| 0 8 12 15
The first operand is compared with the second operand, and the result is indicated in the condition code. The shorter operand is considered to be extended on the right with padding bytes.The R1 and R2 fields each designate an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The location of the leftmost byte of the first operand and second operand is designated by the contents of general registers R1 and R2, respectively. The number of bytes in the first-operand and second-operand locations is specified by bits 8-31 of general registers R1 + 1 and R2 + 1, respectively. Bit positions 0-7 of general register R2 + 1 contain the padding byte. The contents of bit positions 0-7 of general register R1 + 1 are ignored.
The handling of the addresses in general registers R1 and R2 is dependent on the addressing mode.
In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general registers R1 and R2 constitute the address, and the contents of bit position 0 are ignored.
The contents of the registers just described are shown in Figure 7-5.
__________________________________________________________________________________ | | | 24-Bit Addressing Mode 31-Bit Addressing Mode | | | | ________ _______________________ _ _______________________________ | | R1 |////////| First-Operand Address | |/| First-Operand Address | | | |________|_______________________| |_|_______________________________| | | 0 8 31 0 1 31 | | | | ________ _______________________ ________ ________________________ | | R1 + 1 |////////| First-Operand Length | |////////| First-Operand Length | | | |________|_______________________| |________|________________________| | | 0 8 31 0 8 31 | | | | ________ _______________________ _ _______________________________ | | R2 |////////| Second-Operand Address| |/| Second-Operand Address | | | |________|_______________________| |_|_______________________________| | | 0 8 31 0 1 31 | | | | ________ _______________________ ________ ________________________ | | R2 + 1 | Pad | Second-Operand Length | | Pad | Second-Operand Length | | | |________|_______________________| |________|________________________| | | 0 8 31 0 8 31 | | | |__________________________________________________________________________________|Figure 7-5. Register Contents for COMPARE LOGICAL LONG
The comparison proceeds left to right, byte by byte, and ends as soon as an inequality is found or the end of the longer operand is reached. If the operands are not of the same length, the shorter operand is considered to be extended on the right with the appropriate number of padding bytes.If both operands are of zero length, the operands are considered to be equal.
The execution of the instruction is interruptible. When an interruption occurs, other than one that causes termination, the contents of general registers R1 + 1 and R2 + 1 are decremented by the number of bytes compared, and the contents of general registers R1 and R2 are incremented by the same number, so that the instruction, when reexecuted, resumes at the point of interruption. The leftmost bits which are not part of the address in general registers R1 and R2 are set to zeros; the contents of bit positions 0-7 of general registers R1 + 1 and R2 + 1 remain unchanged; and the condition code is unpredictable. If the operation is interrupted after the shorter operand has been exhausted, the length field pertaining to the shorter operand is zero, and its address is updated accordingly.
If the operation ends because of an inequality, the address fields in general registers R1 and R2 at completion identify the first unequal byte in each operand. The lengths in bit positions 8-31 of general registers R1 + 1 and R2 + 1 are decremented by the number of bytes that were equal, unless the inequality occurred with the padding byte, in which case the length field for the shorter operand is set to zero. The addresses in general registers R1 and R2 are incremented by the amounts by which the corresponding length fields were reduced.
If the two operands, including the padding byte, if necessary, are equal, both length fields are made zero at completion, and the addresses are incremented by the corresponding operand-length values.
At the completion of the operation, the leftmost bits which are not part of the address in general registers R1 and R2 are set to zeros, including the case when one or both of the initial length values are zero. The contents of bit positions 0-7 of general registers R1 + 1 and R2 + 1 remain unchanged.
Access exceptions for the portion of a storage operand to the right of the first unequal byte may or may not be recognized. For operands longer than 2K bytes, access exceptions are not recognized more than 2K bytes beyond the byte being processed. Access exceptions are not indicated for locations more than 2K bytes beyond the first unequal byte.
When the length of an operand is zero, no access exceptions are recognized for that operand. Access exceptions are not recognized for an operand if the R field associated with that operand is odd.
Resulting Condition Code:
CLCLE R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'A9' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first operand is compared with the third operand until unequal bytes are compared, the end of the longer operand is reached, or a CPU-determined number of bytes have been compared, whichever occurs first. The shorter operand is considered to be extended on the right with padding bytes. The result is indicated in the condition code.The R1 and R3 fields each designate an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The location of the leftmost byte of the first operand and third operand is designated by the contents of general registers R1 and R3, respectively. The number of bytes in the first-operand and third-operand locations is specified by bits 0-31 of general registers R1 + 1 and R3 + 1, respectively. The contents of general registers R1 + 1 and R3 + 1 are treated as 32-bit unsigned binary integers.
The handling of the addresses in general registers R1 and R3 is dependent on the addressing mode.
In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R3 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general registers R1 and R3 constitute the address, and the contents of bit position 0 are ignored.
The second-operand address is not used to address data; instead, the rightmost eight bits of the second-operand address, bits 24-31, are the padding byte. Bits 0-23 of the second-operand address are ignored.
The contents of the registers and address just described are shown in Figure 7-6.
__________________________________________________________________________________ | | | 24-Bit Addressing Mode 31-Bit Addressing Mode | | | | ________ _______________________ _ ______________________________ | | R1 |////////| First-Operand Address | |/| First-Operand Address | | | |________|_______________________| |_|______________________________| | | 0 8 31 0 1 31 | | | | ________________________________ ________________________________ | | R1 + 1 | First-Operand Length | | First-Operand Length | | | |________________________________| |________________________________| | | 0 31 0 31 | | | | ________ _______________________ _ ______________________________ | | R3 |////////| Third-Operand Address | |/| Third-Operand Address | | | |________|_______________________| |_|______________________________| | | 0 8 31 0 1 31 | | | | ________________________________ ________________________________ | | R3 + 1 | Third-Operand Length | | Third-Operand Length | | | |________________________________| |________________________________| | | 0 31 0 31 | | | | _______________________ ________ _______________________ ________ | | 2nd Op.|///////////////////////| Pad | |///////////////////////| Pad | | | Address|_______________________|________| |_______________________|________| | | 0 24 31 0 24 31 | | | |__________________________________________________________________________________|Figure 7-6. Register Contents and Second-Operand Address for COMPARE LOGICAL LONG EXTENDED
The comparison proceeds left to right, byte by byte, and ends as soon as an inequality is found, the end of the longer operand is reached, or a CPU-determined number of bytes have been compared, whichever occurs first. If the operands are not of the same length, the shorter operand is considered to be extended on the right with the appropriate number of padding bytes.If both operands are of zero length, the operands are considered to be equal.
If the operation ends because of an inequality, the address fields in general registers R1 and R3 at completion identify the first unequal byte in each operand. The lengths in general registers R1 + 1 and R3 + 1 are decremented by the number of bytes that were equal, unless the inequality occurred with the padding byte, in which case the length field for the shorter operand is set to zero. The addresses in general registers R1 and R3 are incremented by the amounts by which the corresponding length fields were decremented. Condition code 1 is set if the first operand is low, or condition code 2 is set if the first operand is high.
If the two operands, including the padding byte, if necessary, are equal, both length fields are made zero at completion, and the addresses are incremented by the corresponding operand-length values. Condition code 0 is set.
If the operation is completed because a CPU-determined number of bytes have been compared without finding an inequality or reaching the end of the longer operand, the contents of general registers R1 + 1 and R3 + 1 are decremented by the number of bytes compared, and the contents of general registers R1 and R3 are incremented by the same number, so that the instruction, when reexecuted, resumes at the next bytes to be compared. If the operation is completed after the shorter operand has been exhausted, the length field pertaining to the shorter operand is zero, and the operand address is updated accordingly. Condition code 3 is set.
The padding byte may be formed from D2(B2) multiple times during the execution of the instruction, and the registers designated by R1 and R3 may be updated multiple times. Therefore, if B2 equals R1, R1 + 1, R3, or R3 + 1 and is subject to change during the execution of the instruction, the results are unpredictable.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed. The maximum amount is approximately 4K bytes of either operand.
At the completion of the operation, the leftmost bits which are not part of the address in general registers R1 and R3 may be set to zeros or may remain unchanged, including the case when one or both of the initial length values are zero.
Access exceptions for the portion of a storage operand to the right of the first unequal byte may or may not be recognized. For operands longer than 4K bytes, access exceptions are not recognized more than 4K bytes beyond the byte being processed. Access exceptions are not indicated for locations more than 4K bytes beyond the first unequal byte.
When the length of an operand is zero, no access exceptions are recognized for that operand. Access exceptions are not recognized for an operand if the R field associated with that operand is odd.
Resulting Condition Code:
CLST R1,R2 [RRE]________________ ________ ____ ____ | 'B25D' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
The first operand is compared with the second operand until unequal bytes are compared, the end of either operand is reached, or a CPU-determined number of bytes have been compared, whichever occurs first. The CPU-determined number is at least 256. The result is indicated in the condition code.Bits 16-23 of the instruction are ignored.
The location of the leftmost byte of the first operand and second operand is designated by the contents of general registers R1 and R2, respectively.
The handling of the addresses in general registers R1 and R2 is dependent on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general registers R1 and R2 constitute the address, and the contents of bit position 0 are ignored.
The first and second operands may be of the same or different lengths. The end of an operand is indicated by an ending character in the last byte position of the operand. The ending character to be used to determine the end of an operand is specified in bit positions 24-31 of general register 0. Bit positions 0-23 of general register 0 are reserved for possible future extensions and must contain all zeros; otherwise, a specification exception is recognized.
The operation proceeds left to right, byte by byte, and ends as soon as the ending character is encountered in either or both operands, unequal bytes which do not include an ending character are compared, or a CPU-determined number of bytes have been compared, whichever occurs first. The CPU-determined number is at least 256. When the ending character is encountered simultaneously in both operands, including when it is in the first byte position of the operands, the operands are of the same length and are considered to be equal, and condition code 0 is set. When the ending character is encountered in only one operand, that operand, which is the shorter operand, is considered to be low, and condition code 1 or 2 is set. Condition code 1 is set if the first operand is low, or condition code 2 is set if the second operand is low. Similarly, when unequal bytes which do not include an ending character are compared, condition code 1 is set if the lower byte is in the first operand, or condition code 2 is set if the lower byte is in the second operand. When a CPU-determined number of bytes have been compared, condition code 3 is set.
When condition code 1 or 2 is set, the address of the last byte processed in the first and second operands is placed in general registers R1 and R2, respectively. That is, when condition code 1 is set, the address of the ending character or first unequal byte in the first operand, whichever was encountered, is placed in general register R1, and the address of the second-operand byte corresponding in position to the first-operand byte is placed in general register R2. When condition code 2 is set, the address of the ending character or first unequal byte in the second operand, whichever was encountered, is placed in general register R2, and the address of the first-operand byte corresponding in position to the second-operand byte is placed in general register R1. When condition code 3 is set, the address of the next byte to be processed in the first and second operands is placed in general registers R1 and R2, respectively. Whenever an address is placed in a general register, bits 0-7 of the register, in the 24-bit mode, or bit 0, in the 31-bit mode, are set to zeros.
When condition code 0 is set, the contents of general registers R1 and R2 remain unchanged.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed.
Access exceptions for the first and second operands are recognized only for that portion of the operand which is necessarily examined in the operation.
The storage-operand-consistency rules are the same as for the COMPARE LOGICAL LONG instruction.
Resulting Condition Code:
CUSE R1,R2 [RRE]________________ ________ ____ ____ | 'B257' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
The first operand is compared with the second operand until equal substrings (sequences of bytes) of a specified length are found, the end of the longer operand is reached, or a CPU-determined number of unequal bytes have been compared, whichever occurs first. The shorter operand is considered to be extended on the right with padding bytes. The CPU-determined number is at least 256. The result is indicated in the condition code.Bits 16-23 of the instruction are ignored.
The R1 and R2 fields each designate an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The location of the leftmost byte of the first operand and second operand is specified by the contents of the R1 and R2 general registers, respectively. The number of bytes in the first-operand and second-operand locations is specified by the 32-bit signed binary integer in general registers R1 + 1 and R2 + 1, respectively. When an operand length is negative, it is treated as zero, and it remains unchanged upon completion of the instruction.
Bits 24-31 of general register 0 specify the unsigned substring length, a value of 0-255, in bytes. Bits 24-31 of general register 1 are the padding byte. Bits 0-23 of general registers 0 and 1 are ignored.
The handling of the addresses in general registers R1 and R2 is dependent on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general registers R1 and R2 constitute the address, and the contents of bit position 0 are ignored.
The contents of the registers just described are shown in Figure 7-7.
_________________________________________________________________________________ | | | _______________________ ________ _______________________ ________ | | GR0 |///////////////////////| SS Len.| GR1 |///////////////////////| Pad | | | |_______________________|________| |_______________________|________| | | 0 24 31 0 24 31 | | | |_________________________________________________________________________________| | | | 24-Bit Addressing Mode 31-Bit Addressing Mode | | | | ________ _______________________ _ ______________________________ | | R1 |////////| First-Operand Address | |/| First-Operand Address | | | |________|_______________________| |_|______________________________| | | 0 8 31 0 1 31 | | | | ________________________________ ________________________________ | | R1 + 1 | First-Operand Length | | First-Operand Length | | | |________________________________| |________________________________| | | 0 31 0 31 | | | | ________ _______________________ _ ______________________________ | | R2 |////////| Second-Operand Address| |/| Second-Operand Address | | | |________|_______________________| |_|______________________________| | | 0 8 31 0 1 31 | | | | ________________________________ ________________________________ | | R2 + 1 | Second-Operand Length | | Second-Operand Length | | | |________________________________| |________________________________| | | 0 31 0 31 | |_________________________________________________________________________________|Figure 7-7. Register Contents for COMPARE UNTIL SUBSTRING EQUAL
The result is obtained as if the operands were processed from left to right. However, multiple accesses may be made to all or some of the bytes of each operand.The comparison proceeds left to right, byte by byte, and ends as soon as (1) equal substrings of the specified length are found, (2) the end of the longer operand is reached without finding equal substrings of the specified length, or (3) the last bytes compared are unequal, and a CPU-determined number of bytes have been compared. The CPU-determined number is at least 256. If the operands are not of the same length, the shorter operand is considered to be extended on the right with the appropriate number of padding bytes.
If the operation ends because equal substrings of the specified length were found, the condition code is set to 0. If the operation ends because the end of the longer operand was reached without finding equal substrings of the specified length, the condition code is set to 1 if equal bytes were the last bytes compared, or it is set to 2 if unequal bytes were the last bytes compared. If the operation ends because unequal bytes were compared when a CPU-determined number of bytes had been compared, the condition code is set to 3.
If the specified substring length is zero, it is considered that equal substrings of the specified length were found, and condition code 0 is set.
If both operands are of zero length but the specified substring length is not zero, it is considered that the end of the longer operand was reached when unequal bytes were the last bytes compared, and condition code 2 is set.
If equal bytes have been compared but then unequal bytes are compared, it is considered that all bytes so far compared are unequal.
At the completion of the operation, the operand-length fields in the R1 + 1 and R2 + 1 registers are decremented by the number of unequal bytes compared (including equal bytes before unequal bytes compared), and the addresses in the R1 and R2 registers are incremented by the same number. However, in the case when a byte of the longer operand is compared against the padding byte, the length field for the shorter operand is not decremented below zero, and the corresponding address is not incremented above the address of the first byte after the shorter operand. The leftmost bits which are not part of the addresses in registers R1 and R2 are set to zeros, even if the substring length is zero or both operand lengths are initially zero.
Thus, when condition code 0 or 1 is set, the resulting addresses in the R1 and R2 registers designate the first bytes of equal substrings in the two operands, and the lengths in the R1 + 1 and R2 + 1 registers have been decremented by the number of bytes preceding the equal substrings, except when the equal substring in the shorter operand begins with the padding byte, in which case the length field for the shorter operand is zero, and the corresponding address field has been incremented by the operand length. When condition code 2 is set, each address field designates the first byte after the corresponding operand, and both length fields are zero. When condition code 3 is set, each address field designates the first byte after the last compared byte of the corresponding operand, and both length fields have been decremented by the number of bytes compared, except that a length field is not decremented below zero.
When the contents of the R1 and R2 fields are the same, the first and second operands may be compared, or the condition code may be set to 0 or 1 without comparing the operands.
The substring length and padding byte may be fetched from general registers 0 and 1 multiple times during the execution of the instruction, and the registers designated by R1 and R2 may be updated multiple times. Therefore, if R1 or R2 is zero, the results are unpredictable.
When condition code 3 is set, the general registers used by the instruction have been set so that the remainder of the operands can be processed by simply branching back and reexecuting the instruction.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed.
The execution of the instruction is interruptible when the last bytes compared are unequal; it is not interruptible when the last bytes compared are equal. When an interruption occurs, other than one that causes termination, the contents of the registers designated by the R1 and R2 fields are updated the same as upon normal completion of the instruction, so that the instruction, when reexecuted, resumes at the point of interruption. The condition code is unpredictable.
Access exceptions for the portion of a storage operand to the right of the last byte processed may or may not be recognized. For operands longer than 4K bytes, access exceptions are not recognized for locations more than 4K bytes beyond the last byte processed.
When the length of an operand is zero, no access exceptions are recognized for that operand. Access exceptions are not recognized for an operand if the R field associated with that operand is odd. Although the operand address and length fields remain unchanged when a zero substring length is specified, the recognition of access exceptions is not necessarily prevented.
Resulting Condition Code:
CVB R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '4F' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is changed from decimal to binary, and the result is placed at the first-operand location.The second operand occupies eight bytes in storage and has the format of packed decimal data, as described in Chapter 8, "Decimal Instructions." It is checked for valid sign and digit codes, and a data exception is recognized when an invalid code is detected.
The result of the conversion is a 32-bit signed binary integer, which is placed in general register R1. The maximum positive number that can be converted and still be contained in a 32-bit register is 2,147,483,647; the maximum negative number (the negative number with the greatest absolute value) that can be converted is -2,147,483,648. For any decimal number outside this range, the operation is completed by placing the 32 rightmost bits of the binary result in the register, and a fixed-point-divide exception is recognized.
Condition Code: The code remains unchanged.
Program Exceptions:
CVD R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '4E' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first operand is changed from binary to decimal, and the result is stored at the second-operand location. The first operand is treated as a 32-bit signed binary integer.The result occupies eight bytes in storage and is in the format for packed decimal data, as described in Chapter 8, "Decimal Instructions." The rightmost four bits of the result represent the sign. A positive sign is encoded as 1100; a negative sign is encoded as 1101.
Condition Code: The code remains unchanged.
Program Exceptions:
CPYA R1,R2 [RRE]________________ ________ ____ ____ | 'B24D' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
The contents of access register R2 are placed in access register R1.Bits 16-23 of the instruction are ignored.
Condition Code: The code remains unchanged.
Program Exceptions: None.
DR R1,R2 [RR]________ ____ ____ | '1D' | R1 | R2 | |________|____|____| 0 8 12 15 D R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '5D' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The doubleword first operand (the dividend) is divided by the second operand (the divisor), and the remainder and the quotient are placed at the first-operand location.The R1 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The dividend is treated as a 64-bit signed binary integer. The divisor, the remainder, and the quotient are treated as 32-bit signed binary integers. The remainder is placed in general register R1, and the quotient is placed in general register R1 + 1.
When the divisor is zero, or when the magnitudes of the dividend and divisor are such that the quotient cannot be expressed by a 32-bit signed binary integer, a fixed-point-divide exception is recognized. This includes the case of division of zero by zero.
Condition Code: The code remains unchanged.
Program Exceptions:
XR R1,R2 [RR]________ ____ ____ | '17' | R1 | R2 | |________|____|____| 0 8 12 15 X R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '57' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31 XI D1(B1),I2 [SI]
________ ________ ____ ____________ | '97' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31 XC D1(L,B1),D2(B2) [SS]
________ ________ ____ _/__ ____ _/__ | 'D7' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The EXCLUSIVE OR of the first and second operands is placed at the first-operand location.The connective EXCLUSIVE OR is applied to the operands bit by bit. A bit position in the result is set to one if the corresponding bit positions in the two operands are unlike; otherwise, the result bit is set to zero.
For EXCLUSIVE OR (XC), each operand is processed left to right. When the operands overlap, the result is obtained as if the operands were processed one byte at a time and each result byte were stored immediately after fetching the necessary operand bytes.
For EXCLUSIVE OR (XI), the first operand is one byte in length, and only one byte is stored.
Resulting Condition Code:
EX R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '44' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The single instruction at the second-operand address is modified by the contents of general register R1, and the resulting instruction, called the target instruction, is executed.When the R1 field is not zero, bits 8-15 of the instruction designated by the second-operand address are ORed with bits 24-31 of general register R1. The ORing does not change either the contents of general register R1 or the instruction in storage, and it is effective only for the interpretation of the instruction to be executed. When the R1 field is zero, no ORing takes place.
The target instruction may be two, four, or six bytes in length. The execution and exception handling of the target instruction are exactly as if the target instruction were obtained in normal sequential operation, except for the instruction address and the instruction-length code.
The instruction address of the current PSW is increased by the length of EXECUTE. This updated address and the instruction-length code of EXECUTE are used, for example, as part of the link information when the target instruction is BRANCH AND LINK. When the target instruction is a successful branching instruction, the instruction address of the current PSW is replaced by the branch address specified by the target instruction.
When the target instruction is in turn EXECUTE, an execute exception is recognized.
The effective address of EXECUTE must be even; otherwise, a specification exception is recognized. When the target instruction is two or three halfwords in length but can be executed without fetching its second or third halfword, it is unpredictable whether access exceptions are recognized for the unused halfwords. Access exceptions are not recognized for the second-operand address when the address is odd.
The second-operand address of EXECUTE is an instruction address rather than a logical address; thus, the target instruction is fetched from the primary address space when in the primary-space, secondary-space, or access-register mode.
Condition Code: The code may be set by the target instruction.
Program Exceptions:
EAR R1,R2 [RRE]________________ ________ ____ ____ | 'B24F' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
The contents of access register R2 are placed in general register R1.Bits 16-23 of the instruction are ignored.
Condition Code: The code remains unchanged.
Program Exceptions: None.
IC R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '43' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The byte at the second-operand location is inserted into bit positions 24-31 of general register R1. The remaining bits in the register remain unchanged.Condition Code: The code remains unchanged.
Program Exceptions:
ICM R1,M3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'BF' | R1 | M3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
Bytes from contiguous locations beginning at the second-operand address are inserted into general register R1 under control of a mask.The contents of the M3 field are used as a mask. These four bits, left to right, correspond one for one with the four bytes, left to right, of general register R1. The byte positions corresponding to ones in the mask are filled, left to right, with bytes from successive storage locations beginning at the second-operand address. When the mask is not zero, the length of the second operand is equal to the number of ones in the mask. The bytes in the general register corresponding to zeros in the mask remain unchanged.
The resulting condition code is based on the mask and on the value of the bits inserted. When the mask is zero or when all inserted bits are zeros, the condition code is set to 0. When the inserted bits are not all zeros, the code is set according to the leftmost bit of the storage operand: if this bit is one, the code is set to 1; if this bit is zero, the code is set to 2.
When the mask is not zero, exceptions associated with storage-operand access are recognized only for the number of bytes specified by the mask. When the mask is zero, access exceptions are recognized for one byte at the second-operand address.
Resulting Condition Code:
IPM R1 [RRE]________________ ________ ____ ____ | 'B222' |////////| R1 |////| |________________|________|____|____| 0 16 24 28 31
The condition code and program mask from the current PSW are inserted into bit positions 2-3 and 4-7, respectively, of general register R1. Bits 0 and 1 of the register are set to zeros; bits 8-31 are left unchanged.Bits 16-23 and 28-31 of the instruction are ignored.
Condition Code: The code remains unchanged.
Program Exceptions: None.
LR R1,R2 [RR]________ ____ ____ | '18' | R1 | R2 | |________|____|____| 0 8 12 15 L R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '58' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is placed unchanged at the first-operand location.Condition Code: The code remains unchanged.
Program Exceptions:
LAM R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | '9A' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The set of access registers starting with access register R1 and ending with access register R3 is loaded from the locations designated by the second-operand address.The storage area from which the contents of the access registers are obtained starts at the location designated by the second-operand address and continues through as many storage words as the number of access registers specified. The access registers are loaded in ascending order of their register numbers, starting with access register R1 and continuing up to and including access register R3, with access register 0 following access register 15.
The second operand must be designated on a word boundary; otherwise, a specification exception is recognized.
Condition Code: The code remains unchanged.
Program Exceptions:
LA R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '41' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The address specified by the X2, B2, and D2 fields is placed in general register R1. The address computation follows the rules for address arithmetic.In the 24-bit addressing mode, the address is placed in bit positions 8-31, and bits 0-7 are set to zeros. In the 31-bit addressing mode, the address is placed in bit positions 1-31, and bit 0 is set to zero.
No storage references for operands take place, and the address is not inspected for access exceptions.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Programming Notes:
LAE R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '51' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The address specified by the X2, B2, and D2 fields is placed in general register R1. Access register R1 is loaded with a value that depends on the current value of the address-space-control bits, bits 16 and 17 of the PSW. If the address-space-control bits are 01 binary, the value placed in the access register also depends on whether the B2 field is zero or nonzero.The address computation follows the rules for address arithmetic. In the 24-bit addressing mode, the address is placed in bit positions 8-31 of general register R1, and bits 0-7 are set to zeros. In the 31-bit addressing mode, the address is placed in bit positions 1-31 of general register R1, and bit 0 is set to zero.
The value placed in access register R1 is as shown in the following table:
PSW Bits 16 and 17 |
Value Placed in Access Register R1 |
---|---|
00 | 00000000 hex (zeros in bit positions 0-31) |
10 |
00000001 hex (zeros in bit positions 0-30 and one in bit position 31) |
01 | If B2 field is zero: 00000000 hex (zeros in bit positions 0-31) |
If B2 field is nonzero: Contents of access register B2 | |
11 |
00000002 hex (zeros in bit positions 0-29 and 31, and one in bit position 30) |
However, when PSW bits 16 and 17 are 01 binary and the B2 field is nonzero, bit positions 0-6 of access register B2 must contain all zeros; otherwise, the results in general register R1 and access register R1 are unpredictable.No storage references for operands take place, and the address is not inspected for access exceptions.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Programming Notes:
PSW Bits 16 and 17 |
Translation Mode |
---|---|
00 | Primary-space mode |
10 | Secondary-space mode |
01 | Access-register mode |
11 | Home-space mode |
LTR R1,R2 [RR]________ ____ ____ | '12' | R1 | R2 | |________|____|____| 0 8 12 15
The second operand is placed unchanged at the first-operand location, and the sign and magnitude of the second operand, treated as a 32-bit signed binary integer, are indicated in the condition code.Resulting Condition Code:
Programming Note: When the R1 and R2 fields designate the same register, the operation is equivalent to a test without data movement.
LCR R1,R2 [RR]________ ____ ____ | '13' | R1 | R2 | |________|____|____| 0 8 12 15
The two's complement of the second operand is placed at the first-operand location. The second operand and result are treated as 32-bit signed binary integers.When there is an overflow, the result is obtained by allowing any carry into the sign-bit position and ignoring any carry out of the sign-bit position, and condition code 3 is set. If the fixed-point-overflow mask is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
LH R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '48' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
LHI R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'8' | I2 | |________|____|____|________________| 0 8 12 16 31
The second operand is considered to be extended to a 32-bit signed binary integer and is placed at the first-operand location. The second operand is two bytes in length and is considered to be a 16-bit signed binary integer. The second operand is extended to 32 bits by setting each of the 16 leftmost bit positions equal to the sign bit of the two-byte operand.Condition Code: The code remains unchanged.
Program Exceptions:
LM R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | '98' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The set of general registers starting with general register R1 and ending with general register R3 is loaded from storage beginning at the location designated by the second-operand address and continuing through as many locations as needed.The general registers are loaded in the ascending order of their register numbers, starting with general register R1 and continuing up to and including general register R3, with general register 0 following general register 15.
Condition Code: The code remains unchanged.
Program Exceptions:
LNR R1,R2 [RR]________ ____ ____ | '11' | R1 | R2 | |________|____|____| 0 8 12 15
The two's complement of the absolute value of the second operand is placed at the first-operand location. The second operand and result are treated as 32-bit signed binary integers.Resulting Condition Code:
Programming Note: The operation complements positive numbers; negative numbers remain unchanged. The number zero remains unchanged.
LPR R1,R2 [RR]________ ____ ____ | '10' | R1 | R2 | |________|____|____| 0 8 12 15
The absolute value of the second operand is placed at the first-operand location. The second operand and the result are treated as 32-bit signed binary integers.When there is an overflow, the result is obtained by allowing any carry into the sign-bit position and ignoring any carry out of the sign-bit position, and condition code 3 is set. If the fixed-point-overflow mask is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
MC D1(B1),I2 [SI]________ ________ ____ ____________ | 'AF' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31
A program interruption is caused if the appropriate monitor-mask bit in control register 8 is one.The monitor-mask bits are in bit positions 16-31 of control register 8, which correspond to monitor classes 0-15, respectively.
Bit positions 12-15 in the I2 field contain a binary number specifying one of 16 monitoring classes. When the monitor-mask bit corresponding to the class specified by the I2 field is one, a monitor-event program interruption occurs. The contents of the I2 field are stored at location 149, with zeros stored at location 148. Bit 9 of the program-interruption code is set to one.
The first-operand address is not used to address data; instead, the address specified by the B1 and D1 fields forms the monitor code, which is placed in the word at location 156. Address computation follows the rules of address arithmetic; in the 24-bit addressing mode, bits 0-7 are set to zeros; in the 31-bit addressing mode, bit 0 is set to zero.
When the monitor-mask bit corresponding to the class specified by bits 12-15 of the instruction is zero, no interruption occurs, and the instruction is executed as a no-operation.
Bit positions 8-11 of the instruction must contain zeros; otherwise, a specification exception is recognized.
Condition Code: The code remains unchanged.
Program Exceptions:
MVI D1(B1),I2 [SI]________ ________ ____ ____________ | '92' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31 MVC D1(L,B1),D2(B2) [SS]
________ ________ ____ _/__ ____ _/__ | 'D2' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The second operand is placed at the first-operand location.For MOVE (MVC), each operand is processed left to right. When the operands overlap, the result is obtained as if the operands were processed one byte at a time and each result byte were stored immediately after fetching the necessary operand byte.
For MOVE (MVI), the first operand is one byte in length, and only one byte is stored.
Condition Code: The code remains unchanged.
Program Exceptions:
MVCIN D1(L,B1),D2(B2) [SS]________ ________ ____ _/__ ____ _/__ | 'E8' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The second operand is placed at the first-operand location with the left-to-right sequence of the bytes inverted.The first-operand address designates the leftmost byte of the first operand. The second-operand address designates the rightmost byte of the second operand. Both operands have the same length.
The result is obtained as if the second operand were processed from right to left and the first operand from left to right. The second operand may wrap around from location 0 to location 2²4 - 1 in the 24-bit addressing mode, or, in the 31-bit addressing mode, to location 2³¹ - 1. The first operand may, in the 24-bit addressing mode, wrap around from location 2²4 - 1 to location 0, or, in the 31-bit addressing mode, from location 2³¹ - 1 to location 0.
When the operands overlap by more than one byte, the contents of the overlapped portion of the result field are unpredictable.
Condition Code: The code remains unchanged.
Program Exceptions:
MVCL R1,R2 [RR]________ ____ ____ | '0E' | R1 | R2 | |________|____|____| 0 8 12 15
The second operand is placed at the first-operand location, provided overlapping of operand locations would not affect the final contents of the first-operand location. The remaining rightmost byte positions, if any, of the first-operand location are filled with padding bytes.The R1 and R2 fields each designate an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The location of the leftmost byte of the first operand and second operand is designated by the contents of general registers R1 and R2, respectively. The number of bytes in the first-operand and second-operand locations is specified by bits 8-31 of general registers R1 + 1 and R2 + 1, respectively. Bit positions 0-7 of register R2 + 1 contain the padding byte. The contents of bit positions 0-7 of register R1 + 1 are ignored.
The handling of the addresses in general registers R1 and R2 is dependent on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-31 of registers R1 and R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of registers R1 and R2 constitute the address, and the contents of bit position 0 are ignored.
The contents of the registers just described are shown in Figure 7-8.
__________________________________________________________________________________ | | | 24-Bit Addressing Mode 31-Bit Addressing Mode | | | | ________ _______________________ _ _______________________________ | | R1 |////////| First-Operand Address | |/| First-Operand Address | | | |________|_______________________| |_|_______________________________| | | 0 8 31 0 1 31 | | | | ________ _______________________ ________ ________________________ | | R1 + 1 |////////| First-Operand Length | |////////| First-Operand Length | | | |________|_______________________| |________|________________________| | | 0 8 31 0 8 31 | | | | ________ _______________________ _ _______________________________ | | R2 |////////| Second-Operand Address| |/| Second-Operand Address | | | |________|_______________________| |_|_______________________________| | | 0 8 31 0 1 31 | | | | ________ _______________________ ________ ________________________ | | R2 + 1 | Pad | Second-Operand Length | | Pad | Second-Operand Length | | | |________|_______________________| |________|________________________| | | 0 8 31 0 8 31 | | | |__________________________________________________________________________________|Figure 7-8. Register Contents for MOVE LONG
The movement starts at the left end of both fields and proceeds to the right. The operation is ended when the number of bytes specified by bit positions 8-31 of general register R1 + 1 have been moved into the first-operand location. If the second operand is shorter than the first operand, the remaining rightmost bytes of the first-operand location are filled with the padding byte.As part of the execution of the instruction, the values of the two length fields are compared for the setting of the condition code, and a check is made for destructive overlap of the operands. Operands are said to overlap destructively when the first-operand location is used as a source after data has been moved into it, assuming the inspection for overlap is performed by the use of logical operand addresses. When the operands overlap destructively, no movement takes place, and condition code 3 is set.
Operands do not overlap destructively, and movement is performed, if the leftmost byte of the first operand does not coincide with any of the second-operand bytes participating in the operation other than the leftmost byte of the second operand. When an operand wraps around from location 2²4 - 1 (or 2³¹ - 1) to location 0, operand bytes in locations up to and including 2²4 - 1 (or 2³¹ - 1) are considered to be to the left of bytes in locations from 0 up.
In the 24-bit addressing mode, wraparound is from location 2²4 - 1 to location 0; in the 31-bit addressing mode, wraparound is from location 2³¹ - 1 to location 0.
In the access-register mode, the contents of access register R1 and access register R2 are compared. If the R1 or R2 field is zero, 32 zeros are used rather than the contents of access register 0. If all 32 bits of the compared values are equal, then the destructive overlap test is made. If all 32 bits of the compared values are not equal, destructive overlap is declared not to exist. If, for this case, the operands actually overlap in real storage, it is unpredictable whether the result reflects the overlap condition.
When the length specified by bit positions 8-31 of general register R1 + 1 is zero, no movement takes place, and condition code 0 or 1 is set to indicate the relative values of the lengths.
The execution of the instruction is interruptible. When an interruption occurs other than one that causes termination, the contents of general registers R1 + 1 and R2 + 1 are decremented by the number of bytes moved, and the contents of general registers R1 and R2 are incremented by the same number, so that the instruction, when reexecuted, resumes at the point of interruption. The leftmost bits which are not part of the address in general registers R1 and R2 are set to zeros; the contents of bit positions 0-7 of general registers R1 + 1 and R2 + 1 remain unchanged; and the condition code is unpredictable. If the operation is interrupted during padding, the length field in general register R2 + 1 is 0, the address in general register R2 is incremented by the original contents of general register R2 + 1, and general registers R1 and R1 + 1 reflect the extent of the padding operation.
When the first-operand location includes the location of the instruction or of EXECUTE, the instruction may be refetched from storage and reinterpreted even in the absence of an interruption during execution. The exact point in the execution at which such a refetch occurs is unpredictable.
As observed by other CPUs and by channel programs, that portion of the first operand which is filled with the padding byte is not necessarily stored into in a left-to-right direction and may appear to be stored into more than once.
At the completion of the operation, the length in general register R1 + 1 is decremented by the number of bytes stored at the first-operand location, and the address in general register R1 is incremented by the same amount. The length in general register R2 + 1 is decremented by the number of bytes moved out of the second-operand location, and the address in general register R2 is incremented by the same amount. The leftmost bits which are not part of the address in general registers R1 and R2 are set to zeros, including the case when one or both of the original length values are zeros or when condition code 3 is set. The contents of bit positions 0-7 of general registers R1 + 1 and R2 + 1 remain unchanged.
When condition code 3 is set, no exceptions associated with operand access are recognized. When the length of an operand is zero, no access exceptions for that operand are recognized. Similarly, when the second operand is longer than the first operand, access exceptions are not recognized for the part of the second-operand field that is in excess of the first-operand field. For operands longer than 2K bytes, access exceptions are not recognized for locations more than 2K bytes beyond the current location being processed. Access exceptions are not recognized for an operand if the R field associated with that operand is odd. Also, when the R1 field is odd, PER storage-alteration events are not recognized, and no change bits are set.
Resulting Condition Code:
In the access-register mode, the contents of the access registers used are called the effective space designations. When the effective space designations are not equal, destructive overlap is declared not to exist and movement occurs. When the effective space designations are the same or when not in the access-register mode, then the following cases apply.
Depending on whether the second operand wraps around from location 2²4 - 1 to location 0, or, in the 31-bit addressing mode, from location 2³¹ - 1 to location 0, movement takes place in the following cases:
When the second-operand length is one or zero, destructive overlap cannot exist.
MVCLE R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'A8' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
__________________________________________________________________________________ | | | 24-Bit Addressing Mode 31-Bit Addressing Mode | | | | ________ _______________________ _ ______________________________ | | R1 |////////| First-Operand Address | |/| First-Operand Address | | | |________|_______________________| |_|______________________________| | | 0 8 31 0 1 31 | | | | ________________________________ ________________________________ | | R1 + 1 | First-Operand Length | | First-Operand Length | | | |________________________________| |________________________________| | | 0 31 0 31 | | | | ________ _______________________ _ ______________________________ | | R3 |////////| Third-Operand Address | |/| Third-Operand Address | | | |________|_______________________| |_|______________________________| | | 0 8 31 0 1 31 | | | | ________________________________ ________________________________ | | R3 + 1 | Third-Operand Length | | Third-Operand Length | | | |________________________________| |________________________________| | | 0 31 0 31 | | | | _______________________ ________ _______________________ ________ | | 2nd Op.|///////////////////////| Pad | |///////////////////////| Pad | | | Address|_______________________|________| |_______________________|________| | | 0 24 31 0 24 31 | | | |__________________________________________________________________________________|Figure 7-9. Register Contents and Second-Operand Address for MOVE LONG EXTENDED
All or part of the third operand is placed at the first-operand location. The remaining rightmost byte positions, if any, of the first-operand location are filled with padding bytes. The operation proceeds until the end of the first-operand location is reached or a CPU-determined number of bytes have been placed at the first-operand location, whichever occurs first. The result is indicated in the condition code.The R1 and R3 fields each designate an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The location of the leftmost byte of the first operand and third operand is designated by the contents of general registers R1 and R3, respectively. The number of bytes in the first-operand and third-operand locations is specified by bits 0-31 of general registers R1 + 1 and R3 + 1, respectively. The contents of general registers R1 + 1 and R3 + 1 are treated as 32-bit unsigned binary integers.
The handling of the addresses in general registers R1 and R3 is dependent on the addressing mode.
In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R3 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general registers R1 and R3 constitute the address, and the contents of bit position 0 are ignored.
The second-operand address is not used to address data; instead, the rightmost eight bits of the second-operand address, bits 24-31, are the padding byte. Bits 0-23 of the second-operand address are ignored.
The contents of the registers and address just described are shown in Figure 7-9. The movement starts at the left end of both fields and proceeds to the right. The operation is ended when the number of bytes specified in general register R1 + 1 have been placed at the first-operand location or when a CPU-determined number of bytes have been placed, whichever occurs first. If the third operand is shorter than the first operand, the remaining rightmost bytes of the first-operand location are filled with the padding byte.
When the operation is completed because the end of the first operand has been reached, the condition code is set to 0 if the two operand lengths are equal, it is set to 1 if the first-operand length is less than the third-operand length, or it is set to 2 if the first-operand length is greater than the third-operand length. When the operation is completed because a CPU-determined number of bytes have been moved without reaching the end of the first operand, condition code 3 is set.
No test is made for destructive overlap, and the results in the first-operand location are unpredictable when destructive overlap exists. Operands are said to overlap destructively when the first-operand location is used as a source after data has been moved into it.
Operands do not overlap destructively if the leftmost byte of the first operand does not coincide with any of the third-operand bytes participating in the operation other than the leftmost byte of the third operand. When an operand wraps around from location 2²4 - 1 (or 2³¹ - 1) to location 0, operand bytes in locations up to and including 2²4 - 1 (or 2³¹ - 1) are considered to be to the left of bytes in locations from 0 up.
In the 24-bit addressing mode, wraparound is from location 2²4 - 1 to location 0; in the 31-bit addressing mode, wraparound is from location 2³¹ - 1 to location 0.
When the length specified in general register R1 + 1 is zero, no movement takes place, and condition code 0 or 1 is set to indicate the relative values of the lengths.
As observed by other CPUs and by channel programs, that portion of the first operand which is filled with the padding byte is not necessarily stored into in a left-to-right direction and may appear to be stored into more than once.
At the completion of the operation, the length in general register R1 + 1 is decremented by the number of bytes stored at the first-operand location, and the address in general register R1 is incremented by the same amount. The length in general register R3 + 1 is decremented by the number of bytes moved out of the third-operand location, and the address in general register R3 is incremented by the same amount.
If the operation is completed because a CPU-determined number of bytes have been moved without reaching the end of the first operand, the contents of general registers R1 + 1 and R3 + 1 are decremented by the number of bytes moved, and the contents of general registers R1 and R3 are incremented by the same number, so that the instruction, when reexecuted, resumes at the next byte to be moved. If the operation is completed during padding, the length field in general register R3 + 1 is 0, the address in general register R3 is incremented by the original contents of general register R3 + 1, and general registers R1 and R1 + 1 reflect the extent of the padding operation.
The padding byte may be formed from D2(B2) multiple times during the execution of the instruction, and the registers designated by R1 and R3 may be updated multiple times. Therefore, if B2 equals R1, R1 + 1, R3, or R3 + 1 and is subject to change during the execution of the instruction, the results are unpredictable.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed. The maximum amount is approximately 4K bytes of either operand.
At the completion of the operation, the leftmost bits which are not part of the address in general registers R1 and R3 may be set to zeros or may remain unchanged, including the case when one or both of the original length values are zeros.
When the length of an operand is zero, no access exceptions for that operand are recognized. Similarly, when the third operand is longer than the first operand, access exceptions are not recognized for the part of the third-operand field that is in excess of the first-operand field. For operands longer than 4K bytes, access exceptions are not recognized for locations more than 4K bytes beyond the current location being processed. Access exceptions are not recognized for an operand if the R field associated with that operand is odd. Also, when the R1 field is odd, PER storage-alteration events are not recognized, and no change bits are set.
Resulting Condition Code:
MVN D1(L,B1),D2(B2) [SS]________ ________ ____ _/__ ____ _/__ | 'D1' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The rightmost four bits of each byte in the second operand are placed in the rightmost bit positions of the corresponding bytes in the first operand. The leftmost four bits of each byte in the first operand remain unchanged.Each operand is processed left to right. When the operands overlap, the result is obtained as if the operands were processed one byte at a time and each result byte were stored immediately after fetching the necessary operand bytes.
Condition Code: The code remains unchanged.
Program Exceptions:
________________________________________________________________________________________ | | | ________________ ________ ________ | | GR0 |////////////////|00000001|////////| | | |________________|________|________| | | 0 16 24 31 | | | | 24-Bit Addressing Mode | | | | ________ ____________ ____________ ________ ____________ ____________ | | R1 |////////|Op1 Address |////////////| R2 |////////|Op2 Address |////////////| | | |________|____________|____________| |________|____________|____________| | | 0 8 20 31 0 8 20 31 | | | | 31-Bit Addressing Mode | | | | _ ___________________ ____________ _ ___________________ ____________ | | R1 |/| Op1 Address |////////////| R2 |/| Op2 Address |////////////| | | |_|___________________|____________| |_|___________________|____________| | | 0 1 20 31 0 1 20 31 | | | |________________________________________________________________________________________|Figure 7-10. Register Contents for MOVE PAGE of Move-Page Facility 1
MVPG R1,R2 [RRE]________________ ________ ____ ____ | 'B254' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
This definition applies if move-page facility 1 is installed. The MOVE PAGE instruction of move-page facility 2 is defined in Chapter 10, "Control Instructions."The first operand is replaced by the second operand. The first and second operands both are 4K bytes on 4K-byte boundaries. The results are indicated in the condition code.
Bits 16-23 of the instruction are ignored.
The location of the leftmost byte of the first operand and second operand is designated by the contents of general registers R1 and R2, respectively.
The handling of the addresses in general registers R1 and R2 depends on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-19 of a general register, with 12 rightmost zeros appended, are the address, and bits 0-7 and 20-31 in the register are ignored. In the 31-bit addressing mode, the contents of bit positions 1-19 of a general register, with 12 rightmost zeros appended, are the address, and bits 0 and 20-31 in the register are ignored.
Bits 16-23 of general register 0 must be 00000001 binary; otherwise, a specification exception is recognized. Bits 0-15 and 24-31 of general register 0 are ignored.
The contents of the registers just described are shown in Figure 7-10 in topic 7.5.58.
When DAT is on and the page-invalid bit is one in the page-table entry for an operand, additional address translation is performed to determine whether the operand is valid in expanded storage. As a result, the replacement of the first operand by the second operand may be performed by moving data from main storage to main storage, from main storage to expanded storage, or from expanded storage to main storage, depending on whether and where the operands are valid. When 4K bytes have been moved, condition code 0 is set.
Certain conditions prevent data movement from occurring and cause a nonzero condition code to be set. Data movement is prevented, and condition code 1 is set, if (1) the second operand is valid in either main storage or expanded storage, but the first operand is invalid in both main storage and expanded storage; (2) both operands are valid in expanded storage; or (3) data movement between main storage and expanded storage is due to occur but the translation path for the expanded-storage operand is locked or the expanded-storage block containing that operand either is not available or causes an expanded-storage data error. When condition code 1 is set because of an expanded-storage data error, the contents of the first-operand location are unpredictable. Data movement is prevented, and condition code 2 is set, if the second operand is invalid in both main storage and expanded storage.
When one operand is invalid in both main storage and expanded storage and an access exception can be recognized for the other operand, it is unpredictable whether a nonzero condition code is set or the access exception is recognized.
The case when the page-table entry for an operand is outside the page table is treated as a page-translation-exception condition.
When data is moved to or from expanded storage, access-list-controlled, page, and key-controlled protection apply, and it is unpredictable whether low-address protection applies. The protection mechanisms apply to main storage in the normal way.
When the first operand is valid in main storage and the second operand is valid in expanded storage, but the expanded-storage block containing the second operand is unavailable, a storage-alteration PER event may be recognized, and the change bit may be set, for the first operand even though the first-operand location remains unchanged.
Operation in a Multiple-CPU Configuration
The references to main storage and to expanded storage are not necessarily single-access references and are not necessarily performed in a left-to-right direction, as observed by other CPUs and by channel programs.
If two or more CPUs move data to or from expanded storage at approximately the same instant in time, depending on the model, the operations may be performed one at a time, or the operations may be performed concurrently. Concurrent operation may occur even if the instructions address the same expanded-storage block.
When two or more CPUs move data to the same expanded-storage block concurrently, the resulting values in the expanded-storage block for each group of bytes transferred may be from any of the instructions being executed simultaneously. The number of bytes transferred as a group is unpredictable.
Similarly, for concurrent movement to and from the same expanded-storage block, the resulting values for each group of bytes moved from expanded storage may be either the old or the new values from the expanded-storage block.
When data movement is due to occur between main storage and expanded storage, the translation path being used for the expanded-storage operand is set to the locked state. When this data movement is completed successfully, or when condition code 1 is due to be set because the movement cannot be completed successfully, the translation path is set to the unlocked state.
Resulting Condition Code:
MVST R1,R2 [RRE]________________ ________ ____ ____ | 'B255' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
All or part of the second operand is placed in the first-operand location. The operation proceeds until the end of the second operand is reached or a CPU-determined number of bytes have been moved, whichever occurs first. The CPU-determined number is at least one. The result is indicated in the condition code.Bits 16-23 of the instruction are ignored.
The location of the leftmost byte of the first operand and second operand is designated by the contents of general registers R1 and R2, respectively.
The handling of the addresses in general registers R1 and R2 is dependent on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general registers R1 and R2 constitute the address, and the contents of bit position 0 are ignored.
The end of the second operand is indicated by an ending character in the last byte position of the operand. The ending character to be used to determine the end of the second operand is specified in bit positions 24-31 of general register 0. Bit positions 0-23 of general register 0 are reserved for possible future extensions and must contain all zeros; otherwise, a specification exception is recognized.
The operation proceeds left to right and ends as soon as the second-operand ending character has been moved or a CPU-determined number of second-operand bytes have been moved, whichever occurs first. The CPU-determined number is at least one. When the ending character is in the first byte position of the second operand, only the ending character is moved. When the ending character has been moved, condition code 1 is set. When a CPU-determined number of second-operand bytes not including an ending character have been moved, condition code 3 is set. Destructive overlap is not recognized. If the second operand is used as a source after it has been used as a destination, the results are unpredictable to the extent that an ending character in the second operand may not be recognized.
When condition code 1 is set, the address of the ending character in the first operand is placed in general register R1, and the contents of general register R2 remain unchanged. When condition code 3 is set, the address of the next byte to be processed in the first and second operands is placed in general registers R1 and R2, respectively. Whenever an address is placed in a general register, bits 0-7 of the register, in the 24-bit mode, or bit 0, in the 31-bit mode, are set to zeros.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed.
Access exceptions for the first and second operands are recognized only for that portion of the operand that is necessarily used in the operation.
The storage-operand-consistency rules are the same as for the MOVE (MVC) instruction, except that destructive overlap is not recognized.
Resulting Condition Code:
MVO D1(L1,B1),D2(L2,B2) [SS]________ ____ ____ ____ _/__ ____ _/__ | 'F1' | L1 | L2 | B1 | D1 | B2 | D2 | |________|____|____|____|_/__|____|_/__| 0 8 12 16 20 32 36 47
The second operand is placed to the left of and adjacent to the rightmost four bits of the first operand.The rightmost four bits of the first operand are attached as the rightmost bits to the second operand, the second-operand bits are offset by four bit positions, and the result is placed at the first-operand location.
The result is obtained as if the operands were processed right to left. When necessary, the second operand is considered to be extended on the left with zeros. If the first operand is too short to contain all of the second operand, the remaining leftmost portion of the second operand is ignored. Access exceptions for the unused portion of the second operand may or may not be indicated.
When the operands overlap, the result is obtained as if the operands were processed one byte at a time, as if each result byte were stored immediately after fetching the necessary operand bytes, and as if the left digit of each second-operand byte were to remain available for the next result byte and need not be refetched.
Condition Code: The code remains unchanged.
Program Exceptions:
MVZ D1(L,B1),D2(B2) [SS]________ ________ ____ _/__ ____ _/__ | 'D3' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The leftmost four bits of each byte in the second operand are placed in the leftmost four bit positions of the corresponding bytes in the first operand. The rightmost four bits of each byte in the first operand remain unchanged.Each operand is processed left to right. When the operands overlap, the result is obtained as if the operands were processed one byte at a time and each result byte were stored immediately after the necessary operand byte is fetched.
Condition Code: The code remains unchanged.
Program Exceptions:
MR R1,R2 [RR]________ ____ ____ | '1C' | R1 | R2 | |________|____|____| 0 8 12 15 M R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '5C' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second word of the first operand (multiplicand) is multiplied by the second operand (multiplier), and the doubleword product is placed at the first-operand location.The R1 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
Both the multiplicand and multiplier are treated as 32-bit signed binary integers. The multiplicand is taken from general register R1 + 1. The contents of general register R1 are ignored. The product is a 64-bit signed binary integer, which replaces the contents of the even-odd pair of general registers designated by R1. An overflow cannot occur.
The sign of the product is determined by the rules of algebra from the multiplier and multiplicand sign, except that a zero result is always positive.
Condition Code: The code remains unchanged.
Program Exceptions:
MH R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '4C' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
MHI R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'C' | I2 | |________|____|____|________________| 0 8 12 16 31
The first operand (multiplicand) is multiplied by the second operand (multiplier), and the rightmost 32 bits of the product are placed at the first-operand location. The second operand is two bytes in length and is considered to be a 16-bit signed binary integer.The multiplicand is treated as a 32-bit signed binary integer and is replaced by the rightmost 32 bits of the signed-binary-integer product. The bits to the left of the 32 rightmost bits of the product are not tested for significance; no overflow indication is given.
The sign of the product is determined by the rules of algebra from the multiplier and multiplicand sign, except that a zero result is always positive.
Condition Code: The code remains unchanged.
Program Exceptions:
MSR R1,R2 [RRE]________________ ________ ____ ____ | 'B252' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31 MS R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '71' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first operand (multiplicand) is multiplied by the second operand (multiplier), and the rightmost 32 bits of the product are placed at the first-operand location.For MSR, bits 16-23 of the instruction are ignored.
Both the multiplicand and multiplier are treated as 32-bit signed binary integers. The multiplicand is taken from general register R1 and is replaced by the rightmost 32 bits of the signed-binary-integer product. The bits to the left of the 32 rightmost bits of the product are not tested for significance; no overflow indication is given.
The sign of the product is determined by the rules of algebra from the multiplier and multiplicand sign, except that a zero result is always positive.
Condition Code: The code remains unchanged.
Program Exceptions:
OR R1,R2 [RR]________ ____ ____ | '16' | R1 | R2 | |________|____|____| 0 8 12 15 O R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '56' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31 OI D1(B1),I2 [SI]
________ ________ ____ ____________ | '96' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31 OC D1(L,B1),D2(B2) [SS]
________ ________ ____ _/__ ____ _/__ | 'D6' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The OR of the first and second operands is placed at the first-operand location.The connective OR is applied to the operands bit by bit. A bit position in the result is set to one if the corresponding bit position in one or both operands contains a one; otherwise, the result bit is set to zero.
For OR (OC), each operand is processed left to right. When the operands overlap, the result is obtained as if the operands were processed one byte at a time and each result byte were stored immediately after fetching the necessary operand bytes.
For OR (OI), the first operand is only one byte in length, and only one byte is stored.
Resulting Condition Code:
PACK D1(L1,B1),D2(L2,B2) [SS]________ ____ ____ ____ _/__ ____ _/__ | 'F2' | L1 | L2 | B1 | D1 | B2 | D2 | |________|____|____|____|_/__|____|_/__| 0 8 12 16 20 32 36 47
The format of the second operand is changed from zoned to packed, and the result is placed at the first-operand location. The zoned and packed formats are described in Chapter 8, "Decimal Instructions."The second operand is treated as though it had the zoned format. The numeric bits of each byte are treated as a digit. The zone bits are ignored, except the zone bits in the rightmost byte, which are treated as a sign.
The sign and digits are moved unchanged to the first operand and are not checked for valid codes. The sign is placed in the rightmost four bit positions of the rightmost byte of the result field, and the digits are placed adjacent to the sign and to each other in the remainder of the result field.
The result is obtained as if the operands were processed right to left. When necessary, the second operand is considered to be extended on the left with zeros. If the first operand is too short to contain all digits of the second operand, the remaining leftmost portion of the second operand is ignored. Access exceptions for the unused portion of the second operand may or may not be indicated.
When the operands overlap, the result is obtained as if each result byte were stored immediately after fetching the necessary operand bytes. Two second-operand bytes are needed for each result byte, except for the rightmost byte of the result field, which requires only the rightmost second-operand byte.
Condition Code: The code remains unchanged.
Program Exceptions:
| PLO R1,D2(B2),R3,D4(B4) [SS]| ________ ____ ____ ____ _/__ ____ _/__ | | 'EE' | R1 | R3 | B2 | D2 | B4 | D4 | | |________|____|____|____|_/__|____|_/__| | 0 8 12 16 20 32 36 47
___ _______________________________________________________ ______ _____ | |Fun|- |Operan|Func-| | |tio| |Length|tion | | |Cod|Operation |(Bits)|Symbo| |___|_______________________________________________________| _____|_____| | | 0 |Compare and load | 32 |CL | |___|________________________________________________________|_____|_____| | | 1 |Compare and load | 64 |CLG | |___|________________________________________________________|_____|_____| | | 4 |Compare and swap | 32 |CS | |___|________________________________________________________|_____|_____| | | 5 |Compare and swap | 64 |CSG | |___|________________________________________________________|_____|_____| | | 8 |Double compare and swap | 32 |DCS | |___|________________________________________________________|_____|_____| | | 9 |Double compare and swap | 64 |DCSG | |___|________________________________________________________|_____|_____| | | 12|Compare and swap and store | 32 |CSST | |___|________________________________________________________|_____|_____| | | 13|Compare and swap and store | 64 |CSSTG| |___|________________________________________________________|_____|_____| | | 16|Compare and swap and double store | 32 |CSDST| |___|________________________________________________________|_____|_____| | | 17|Compare and swap and double store | 64 |CSDST| |___|________________________________________________________|_____|_____| | | 20|Compare and swap and triple store | 32 |CSTST| |___|________________________________________________________|_____|_____| | | 21|Compare and swap and triple store | 64 |CSTST| |___|________________________________________________________|_____|_____|
| Figure 7-11. PERFORM LOCKED OPERATION Function Codes and Operations
| GR 0 | _______________________ _ ________ | |00000000000000000000000|T| FC | | |_______________________|_|________| | 0 24 31 | GR 1 in 24-Bit Addressing Mode | ________ _________________________ | |////////| PLT Address | | |________|_________________________| | 0 8 31 | GR 1 in 31-Bit Addressing Mode | _ ________________________________ | |/| PLT Address | | |_|________________________________| | 0 1 31
| ______________________________________________ | |Func- | | |tion | | |Code Operation R1 R3 D4(B4)| | | | | | 0 Compare and load EO EO Op4a | | | 1 Compare and load - NZ PLa | | | 4 Compare and swap E - - | | | 5 Compare and swap - - PLa | | | 8 Double compare and swap E E Op4a | | | 9 Double compare and swap - NZ PLa | | | 12 Compare and swap and E EO Op4a | | | store | | | 13 Compare and swap and - NZ PLa | | | store | | | 16 Compare and swap and E NZ PLa | | | double store | | | 17 Compare and swap and - NZ PLa | | | double store | | | 20 Compare and swap and E NZ PLa | | | triple store | | | 21 Compare and swap and - NZ PLa | | | triple store | | |______________________________________________| | |Explanation: | | | | | |- Ignored. | | |E Must be even. | | |EO Can be even or odd. | | |NZ Must be nonzero in the access-register | | | mode. Ignored otherwise. | | |Op4a D4(B4) is operand-4 address. | | |PLa D4(B4) is parameter-list address. | | |______________________________________________|| Figure 7-12. Register Rules and D4(B4) Usage for PERFORM LOCKED OPERATION
| ________________________________ ____________________ ____________ ________ ____________________ | |Func- | | Op3 | | Op5 Op7 | | |tion | | or | | and and | | |Code Operation | Op1c Op1r Op2a | Op3c Op3r | Op4a | Op6a Op8a PLa | | |________________________________|____________________|____________|________|____________________| | | 0 Compare and load | R1 - D2(B2) | R3 | D4(B4) | - - - | | | | | | | | | | 1 Compare and load | PL - D2(B2) | PL | PL | - - D4(B4) | | | | | | | | | | 4 Compare and swap | R1 R1+1 D2(B2) | - | - | - - - | | | | | | | | | | 5 Compare and swap | PL PL D2(B2) | - | - | - - D4(B4) | | | | | | | | | | 8 Double compare and swap | R1 R1+1 D2(B2) | R3 R3+1 | D4(B4) | - - - | | | | | | | | | | 9 Double compare and swap | PL PL D2(B2) | PL PL | PL | - - D4(B4) | | | | | | | | | | 12 Compare and swap and store| R1 R1+1 D2(B2) | R3 | D4(B4) | - - - | | | | | | | | | | 13 Compare and swap and store| PL PL D2(B2) | PL | PL | - - D4(B4) | | | | | | | | | | 16 Compare and swap and | R1 R1+1 D2(B2) | PL | PL | PL - D4(B4) | | | double store | | | | | | | | | | | | | | 17 Compare and swap and | PL PL D2(B2) | PL | PL | PL - D4(B4) | | | double store | | | | | | | | | | | | | | 20 Compare and swap and | R1 R1+1 D2(B2) | PL | PL | PL PL D4(B4) | | | triple store | | | | | | | | | | | | | | 21 Compare and swap and | PL PL D2(B2) | PL | PL | PL PL D4(B4) | | | triple store | | | | | | |________________________________|____________________|____________|________|____________________| | |Explanation: | | | | | |- 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-13. Operand and Address Locations for PERFORM LOCKED OPERATION
| Parameter List for Function Code 1 | _________________________________ | 0 | | | |_________________________________| | 2 | Operand-1 Comparison Value | | |_________________________________| | 4 | | | |_________________________________| | 6 | | | |_________________________________| | 8 | | | |_________________________________| | 10 | Operand 3 | | |_________________________________| | 12 | | | |_________________________________| | 14 | | | |________________ ________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________|
| Parameter List for Function Code 5 | _________________________________ | 0 | | | |_________________________________| | 2 | Operand-1 Comparison Value | | |_________________________________| | 4 | | | |_________________________________| | 6 | Operand-1 Replacement Value | | |_________________________________|
| Parameter List for Function Code 9 | _________________________________ | 0 | | | |_________________________________| | 2 | Operand-1 Comparison Value | | |_________________________________| | 4 | | | |_________________________________| | 6 | Operand-1 Replacement Value | | |_________________________________| | 8 | | | |_________________________________| | 10 | Operand-3 Comparison Value | | |_________________________________| | 12 | | | |_________________________________| | 14 | Operand-3 Replacement Value | | |________________ ________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________|
| Parameter List for Function Code 13 | _________________________________ | 0 | | | |_________________________________| | 2 | Operand-1 Comparison Value | | |_________________________________| | 4 | | | |_________________________________| | 6 | Operand-1 Replacement Value | | |_________________________________| | 8 | | | |_________________________________| | 10 | | | |_________________________________| | 12 | | | |_________________________________| | 14 | Operand 3 | | |________________ ________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________|
| Parameter List for Function Code 16 | _________________________________ | 0 | | | |_________________________________| | 2 | | | |_________________________________| | 4 | | | |_________________________________| | 6 | | | |_________________________________| | 8 | | | |_________________________________| | 10 | | | |_________________________________| | 12 | | | |________________ ________________| | 14 | | Operand 3 | | |________________|________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________| | 20 | | | |________________ ________________| | 22 | | Operand 5 | | |________________|________________| | 24 | | Operand-6 ALET | | |________________|________________| | 26 | | Operand-6 Adr. | | |________________|________________|
| The parameter list used for function code 17 has the following format:
| Parameter List for Function Code 17 | _________________________________ | 0 | | | |_________________________________| | 2 | Operand-1 Comparison Value | | |_________________________________| | 4 | | | |_________________________________| | 6 | Operand-1 Replacement Value | | |_________________________________| | 8 | | | |_________________________________| | 10 | | | |_________________________________| | 12 | | | |_________________________________| | 14 | Operand 3 | | |________________ ________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________| | 20 | | | |_________________________________| | 22 | Operand 5 | | |________________ ________________| | 24 | | Operand-6 ALET | | |________________|________________| | 26 | | Operand-6 Adr. | | |________________|________________|
| Parameter List for Function Code 20 | _________________________________ | 0 | | | |_________________________________| | 2 | | | |_________________________________| | 4 | | | |_________________________________| | 6 | | | |_________________________________| | 8 | | | |_________________________________| | 10 | | | |_________________________________| | 12 | | | |________________ ________________| | 14 | | Operand 3 | | |________________|________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________| | 20 | | | |________________ ________________| | 22 | | Operand 5 | | |________________|________________| | 24 | | Operand-6 ALET | | |________________|________________| | 26 | | Operand-6 Adr. | | |________________|________________| | 28 | | | |________________ ________________| | 30 | | Operand 7 | | |________________|________________| | 32 | | Operand-8 ALET | | |________________|________________| | 34 | | Operand-8 Adr. | | |________________|________________|
| The parameter list used for function code 21 has the following format:
| Parameter List for Function Code 21 | _________________________________ | 0 | | | |_________________________________| | 2 | Operand-1 Comparison Value | | |_________________________________| | 4 | | | |_________________________________| | 6 | Operand-1 Replacement Value | | |_________________________________| | 8 | | | |_________________________________| | 10 | | | |_________________________________| | 12 | | | |_________________________________| | 14 | Operand 3 | | |________________ ________________| | 16 | | Operand-4 ALET | | |________________|________________| | 18 | | Operand-4 Adr. | | |________________|________________| | 20 | | | |_________________________________| | 22 | Operand 5 | | |________________ ________________| | 24 | | Operand-6 ALET | | |________________|________________| | 26 | | Operand-6 Adr. | | |________________|________________| | 28 | | | |_________________________________| | 30 | Operand 7 | | |________________ ________________| | 32 | | Operand-8 ALET | | |________________|________________| | 34 | | Operand-8 Adr. | | |________________|________________|
| ________ ________ ____ _______________________________________________ | | | |Cond| | | |Op1c=Op2|Op3c=Op4|Code| Action | | |________|________|____|_______________________________________________| | | Function Codes 0 and 1 (Compare and Load) | | | | | | No | - | 1 | Op2 __ÿ Op1c | | | Yes | - | 0 | Op4 __ÿ Op3 | | |________|________|____|_______________________________________________| | | Function Codes 4 and 5 (Compare and Swap) | | | | | | No | - | 1 | Op2 __ÿ Op1c | | | Yes | - | 0 | Op1r __ÿ Op2 | | |________|________|____|_______________________________________________| | | Function Codes 8 and 9 (Double Compare and Swap) | | | | | | No | - | 1 | Op2 __ÿ Op1c | | | Yes | No | 2 | Op4 __ÿ Op3c | | | Yes | Yes | 0 | Op1r __ÿ Op2 Op3r __ÿ Op4 | | |________|________|____|_______________________________________________| | | Function Codes 12 and 13 (Compare and Swap and Store) | | | | | | No | - | 1 | Op2 __ÿ Op1c | | | Yes | - | 0 | Op1r __ÿ Op2 Op3 __ÿ Op4 | | |________|________|____|_______________________________________________| | | Function Codes 16 and 17 (Compare and Swap and Double Store) | | | | | | No | - | 1 | Op2 __ÿ Op1c | | | Yes | - | 0 | Op1r __ÿ Op2 Op3 __ÿ Op4 | | | | | | Op5 __ÿ Op6 | | |________|________|____|_______________________________________________| | | Function Codes 20 and 21 (Compare and Swap and Triple Store) | | | | | | No | - | 1 | Op2 __ÿ Op1c | | | Yes | - | 0 | Op1r __ÿ Op2 Op3 __ÿ Op4 | | | | | | Op5 __ÿ Op6 | | | | | | Op7 __ÿ Op8 | | |________|________|____|_______________________________________________| | | Explanation: | | | | | | - Not applicable. | | | OpNc Operand-N comparison value. | | | OpNr Operand-N replacement value. | | |______________________________________________________________________|| Figure 7-14. Summary of PERFORM LOCKED OPERATION Results
SRST R1,R2 [RRE]________________ ________ ____ ____ | 'B25E' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
The second operand is searched until a specified character is found, the end of the second operand is reached, or a CPU-determined number of bytes have been searched, whichever occurs first. The CPU-determined number is at least 256. The result is indicated in the condition code.Bits 16-23 of the instruction are ignored.
The location of the leftmost byte of the second operand is designated by the contents of general register R2. The location of the first byte after the second operand is designated by the contents of general register R1.
The handling of the addresses in general registers R1 and R2 is dependent on the addressing mode. In the 24-bit addressing mode, the contents of bit positions 8-31 of general registers R1 and R2 constitute the address, and the contents of bit positions 0-7 are ignored. In the 31-bit addressing mode, the contents of bit positions 1-31 of general register R1 and R2 constitute the address, and the contents of bit position 0 are ignored.
In the access-register mode, the address space containing the second operand is specified only by means of access register R2. The contents of access register R1 are ignored.
The character for which the search occurs is specified in bit positions 24-31 of general register 0. Bit positions 0-23 of general register 0 are reserved for possible future extensions and must contain all zeros; otherwise, a specification exception is recognized.
The operation proceeds left to right and ends as soon as the specified character has been found in the second operand, the address of the next second-operand byte to be examined equals the address in general register R1, or a CPU-determined number of second-operand bytes have been examined, whichever occurs first. The CPU-determined number is at least 256. When the specified character is found, condition code 1 is set. When the address of the next second-operand byte to be examined equals the address in general register R1, condition code 2 is set. When a CPU-determined number of second-operand bytes have been examined, condition code 3 is set. When the CPU-determined number of second-operand bytes have been examined and the address of the next second-operand byte is in general register R1, it is unpredictable whether condition code 2 or 3 is set.
When condition code 1 is set, the address of the specified character found in the second operand is placed in general register R1, and the contents of general register R2 remain unchanged. When condition code 3 is set, the address of the next byte to be processed in the second operand is placed in general register R2, and the contents of general register R1 remain unchanged. When condition code 2 is set, the contents of general registers R1 and R2 remain unchanged. Whenever an address is placed in a general register, bits 0-7 of the register, in the 24-bit mode, or bit 0, in the 31-bit mode, are set to zeros.
The amount of processing that results in the setting of condition code 3 is determined by the CPU on the basis of improving system performance, and it may be a different amount each time the instruction is executed.
Access exceptions for the second operand are recognized only for that portion of the operand that is necessarily examined.
The storage-operand-consistency rules are the same as for the COMPARE LOGICAL LONG instruction.
Resulting Condition Code:
SAR R1,R2 [RRE]________________ ________ ____ ____ | 'B24E' |////////| R1 | R2 | |________________|________|____|____| 0 16 24 28 31
The contents of general register R2 are placed in access register R1.Bits 16-23 of the instruction are ignored.
Condition Code: The code remains unchanged.
Program Exceptions: None.
SPM R1 [RR]________ ____ ____ | '04' | R1 |////| |________|____|____| 0 8 12 15
The first operand is used to set the condition code and the program mask of the current PSW.Bits 12-15 of the instruction are ignored.
Bits 2 and 3 of general register R1 replace the condition code, and bits 4-7 replace the program mask. Bits 0, 1, and 8-31 of general register R1 are ignored.
Condition Code: The code is set as specified by bits 2 and 3 of general register R1.
Program Exceptions: None.
Programming Notes:
SLDA R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '8F' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 63-bit numeric part of the signed first operand is shifted left the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The R1 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
The first operand is treated as a 64-bit signed binary integer. The sign position of the even-numbered register remains unchanged. The leftmost bit position of the odd-numbered register contains a numeric bit, which participates in the shift in the same manner as the other numeric bits. Zeros are supplied to the vacated bit positions on the right.
If one or more bits unlike the sign bit are shifted out of bit position 1 of the even-numbered register, an overflow occurs, and condition code 3 is set. If the fixed-point-overflow mask bit is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
SLDL R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '8D' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 64-bit first operand is shifted left the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The R1 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
All 64 bits of the first operand participate in the shift. Bits shifted out of bit position 0 of the even-numbered register are not inspected and are lost. Zeros are supplied to the vacated bit positions on the right.
Condition Code: The code remains unchanged.
Program Exceptions:
SLA R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '8B' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 31-bit numeric part of the signed first operand is shifted left the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
The first operand is treated as a 32-bit signed binary integer. The sign of the first operand remains unchanged. All 31 numeric bits of the operand participate in the left shift. Zeros are supplied to the vacated bit positions on the right.
If one or more bits unlike the sign bit are shifted out of bit position 1, an overflow occurs, and condition code 3 is set. If the fixed-point-overflow mask bit is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
SLL R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '89' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 32-bit first operand is shifted left the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
All 32 bits of the first operand participate in the shift. Bits shifted out of bit position 0 are not inspected and are lost. Zeros are supplied to the vacated bit positions on the right.
Condition Code: The code remains unchanged.
Program Exceptions: None.
SRDA R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '8E' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 63-bit numeric part of the signed first operand is shifted right the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The R1 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
The first operand is treated as a 64-bit signed binary integer. The sign position of the even-numbered register remains unchanged. The leftmost bit position of the odd-numbered register contains a numeric bit, which participates in the shift in the same manner as the other numeric bits. Bits shifted out of bit position 31 of the odd-numbered register are not inspected and are lost. Bits equal to the sign are supplied to the vacated bit positions on the left.
Resulting Condition Code:
SRDL R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '8C' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 64-bit first operand is shifted right the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The R1 field designates an even-odd pair of general registers and must designate an even-numbered register; otherwise, a specification exception is recognized.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
All 64 bits of the first operand participate in the shift. Bits shifted out of bit position 31 of the odd-numbered register are not inspected and are lost. Zeros are supplied to the vacated bit positions on the left.
Condition Code: The code remains unchanged.
Program Exceptions:
SRA R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '8A' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 31-bit numeric part of the signed first operand is shifted right the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
The first operand is treated as a 32-bit signed binary integer. The sign of the first operand remains unchanged. All 31 numeric bits of the operand participate in the right shift. Bits shifted out of bit position 31 are not inspected and are lost. Bits equal to the sign are supplied to the vacated bit positions on the left.
Resulting Condition Code:
Programming Notes:
SRL R1,D2(B2) [RS]________ ____ ____ ____ ____________ | '88' | R1 |////| B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The 32-bit first operand is shifted right the number of bits specified by the second-operand address, and the result is placed at the first-operand location.Bits 12-15 of the instruction are ignored.
The second-operand address is not used to address data; its rightmost six bits indicate the number of bit positions to be shifted. The remainder of the address is ignored.
All 32 bits of the first operand participate in the shift. Bits shifted out of bit position 31 are not inspected and are lost. Zeros are supplied to the vacated bit positions on the left.
Condition Code: The code remains unchanged.
Program Exceptions: None.
ST R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '50' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The first operand is placed unchanged at the second-operand location.Condition Code: The code remains unchanged.
Program Exceptions:
STAM R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | '9B' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The contents of the set of access registers starting with access register R1 and ending with access register R3 are stored at the locations designated by the second-operand address.The storage area where the contents of the access registers are placed starts at the location designated by the second-operand address and continues through as many storage words as the number of access registers specified. The contents of the access registers are stored in ascending order of their register numbers, starting with access register R1 and continuing up to and including access register R3, with access register 0 following access register 15. The contents of the access registers remain unchanged.
The second operand must be designated on a word boundary; otherwise, a specification exception is recognized.
Condition Code: The code remains unchanged.
Program Exceptions:
STC R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '42' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
Bits 24-31 of general register R1 are placed unchanged at the second-operand location. The second operand is one byte in length.Condition Code: The code remains unchanged.
Program Exceptions:
STCM R1,M3,D2(B2) [RS]________ ____ ____ ____ ____________ | 'BE' | R1 | M3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
Bytes selected from general register R1 under control of a mask are placed at contiguous byte locations beginning at the second-operand address.The contents of the M3 field are used as a mask. These four bits, left to right, correspond one for one with the four bytes, left to right, of general register R1. The bytes corresponding to ones in the mask are placed in the same order at successive and contiguous storage locations beginning at the second-operand address. When the mask is not zero, the length of the second operand is equal to the number of ones in the mask. The contents of the general register remain unchanged.
When the mask is not zero, exceptions associated with storage-operand accesses are recognized only for the number of bytes specified by the mask.
When the mask is zero, the single byte designated by the second-operand address remains unchanged; however, on some models, the value may be fetched and subsequently stored back unchanged at the same storage location. This update appears to be an interlocked-update reference as observed by other CPUs.
Condition Code: The code remains unchanged.
Program Exceptions:
STCK D2(B2) [S]________________ ____ ____________ | 'B205' | B2 | D2 | |________________|____|____________| 0 16 20 31
The current value of the TOD clock is stored in the eight-byte field designated by the second-operand address, provided the clock is in the set, stopped, or not-set state.Zeros are stored for the rightmost bit positions that are not provided by the clock.
Zeros are stored at the operand location when the clock is in the error state or in the not-operational state.
The quality of the clock value stored by the instruction is indicated by the resultant condition-code setting.
A serialization function is performed before the value of the clock is fetched and again after the value is placed in storage.
Resulting Condition Code:
STH R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '40' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
Bits 16-31 of general register R1 are placed unchanged at the second-operand location. The second operand is two bytes in length.Condition Code: The code remains unchanged.
Program Exceptions:
STM R1,R3,D2(B2) [RS]________ ____ ____ ____ ____________ | '90' | R1 | R3 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The contents of the set of general registers starting with general register R1 and ending with general register R3 are placed in the storage area beginning at the location designated by the second-operand address and continuing through as many locations as needed.The general registers are stored in the ascending order of register numbers, starting with general register R1 and continuing up to and including general register R3, with general register 0 following general register 15.
Condition Code: The code remains unchanged.
Program Exceptions:
SR R1,R2 [RR]________ ____ ____ | '1B' | R1 | R2 | |________|____|____| 0 8 12 15 S R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '5B' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is subtracted from the first operand, and the difference is placed at the first-operand location. The operands and the difference are treated as 32-bit signed binary integers.When there is an overflow, the result is obtained by allowing any carry into the sign-bit position and ignoring any carry out of the sign-bit position, and condition code 3 is set. If the fixed-point-overflow mask is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
SH R1,D2(X2,B2) [RX]________ ____ ____ ____ ____________ | '4B' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is subtracted from the first operand, and the difference is placed at the first-operand location. The second operand is two bytes in length and is treated as a 16-bit signed binary integer. The first operand and the difference are treated as 32-bit signed binary integers.When there is an overflow, the result is obtained by allowing any carry into the sign-bit position and ignoring any carry out of the sign-bit position, and condition code 3 is set. If the fixed-point-overflow mask is one, a program interruption for fixed-point overflow occurs.
Resulting Condition Code:
SLR R1,R2 [RR]________ ____ ____ | '1F' | R1 | R2 | |________|____|____| 0 8 12 15 SL R1,D2(X2,B2) [RX]
________ ____ ____ ____ ____________ | '5F' | R1 | X2 | B2 | D2 | |________|____|____|____|____________| 0 8 12 16 20 31
The second operand is subtracted from the first operand, and the difference is placed at the first-operand location. The operands and the difference are treated as 32-bit unsigned binary integers.Resulting Condition Code:
SVC I [RR]________ ________ | '0A' | I | |________|________| 0 8 15
The instruction causes a supervisor-call interruption, with the I field of the instruction providing the rightmost byte of the interruption code.Bits 8-15 of the instruction, with eight zeros appended on the left, are placed in the supervisor-call interruption code that is stored in the course of the interruption. See "Supervisor-Call Interruption" in topic 6.7.
A serialization and checkpoint-synchronization function is performed.
Condition Code: The code remains unchanged and is saved as part of the old PSW. A new condition code is loaded as part of the supervisor-call interruption.
Program Exceptions: None.
TS D2(B2) [S]________ ________ ____ ____________ | '93' |////////| B2 | D2 | |________|________|____|____________| 0 8 16 20 31
The leftmost bit (bit position 0) of the byte located at the second-operand address is used to set the condition code, and then the byte is set to all ones.Bits 8-15 of the instruction are ignored.
The byte in storage is set to all ones as it is fetched for the testing of bit position 0. This update appears to be an interlocked-update reference as observed by other CPUs.
A serialization function is performed before the byte is fetched and again after the storing of all ones.
Resulting Condition Code:
TM D1(B1),I2 [SI]________ ________ ____ ____________ | '91' | I2 | B1 | D1 | |________|________|____|____________| 0 8 16 20 31
A mask is used to select bits of the first operand, and the result is indicated in the condition code.The byte of immediate data, I2, is used as an eight-bit mask. The bits of the mask are made to correspond one for one with the bits of the byte in storage designated by the first-operand address.
A mask bit of one indicates that the storage bit is to be tested. When the mask bit is zero, the storage bit is ignored. When all storage 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 all ones, condition code 3 is set; otherwise, condition code 1 is set.
Access exceptions associated with the storage operand are recognized for one byte even when the mask is all zeros.
Resulting Condition Code:
TMH R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'0' | I2 | |________|____|____|________________| 0 8 12 16 31
TML R1,I2 [RI]________ ____ ____ ________________ | 'A7' | R1 |'1' | I2 | |________|____|____|________________| 0 8 12 16 31
A mask is used to select bits of the first operand, and the result is indicated in the condition code.The contents of the I2 field are used as a 16-bit mask. The bits of the mask are made to correspond one for one with 16 bits of the first operand. For TEST UNDER MASK HIGH, the mask is made to correspond with bits 0-15 of the first operand. For TEST UNDER MASK LOW, the mask is made to correspond with bits 16-31 of the first operand.
A mask bit of one indicates that the first-operand 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 zeros and ones, condition code 1 is set if the leftmost selected bit is zero, or condition code 2 is set if the leftmost selected bit is one. When the selected bits are all ones, condition code 3 is set.
Resulting Condition Code:
TR D1(L,B1),D2(B2) [SS]________ ________ ____ _/__ ____ _/__ | 'DC' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The bytes of the first operand are used as eight-bit arguments to reference a list designated by the second-operand address. Each function byte selected from the list replaces the corresponding argument in the first operand.The L field specifies the length of only the first operand.
The bytes of the first operand are selected one by one for translation, proceeding left to right. Each argument byte is added to the initial second-operand address. The addition is performed following the rules for address arithmetic, with the argument byte treated as an eight-bit unsigned binary integer and extended with zeros on the left. The sum is used as the address of the function byte, which then replaces the original argument byte.
The operation proceeds until the first-operand field is exhausted. The list is not altered unless an overlap occurs.
When the operands overlap, the result is obtained as if each result byte were stored immediately after fetching the corresponding function byte.
Access exceptions are recognized only for those bytes in the second operand which are actually required.
Condition Code: The code remains unchanged.
Program Exceptions:
TRT D1(L,B1),D2(B2) [SS]________ ________ ____ _/__ ____ _/__ | 'DD' | L | B1 | D1 | B2 | D2 | |________|________|____|_/__|____|_/__| 0 8 16 20 32 36 47
The bytes of the first operand are used as eight-bit arguments to select function bytes from a list designated by the second-operand address. The first nonzero function byte is inserted in general register 2, and the related argument address in general register 1.The L field specifies the length of only the first operand.
The bytes of the first operand are selected one by one for translation, proceeding from left to right. The first operand remains unchanged in storage. Calculation of the address of the function byte is performed as in the TRANSLATE instruction. The function byte retrieved from the list is inspected for a value of zero.
When the function byte is zero, the operation proceeds with the next byte of the first operand. When the first-operand field is exhausted before a nonzero function byte is encountered, the operation is completed by setting condition code 0. The contents of general registers 1 and 2 remain unchanged.
When the function byte is nonzero, the operation is completed by inserting the function byte in general register 2 and the related argument address in general register 1. This address points to the argument byte last translated. The function byte replaces bits 24-31 of general register 2. In the 24-bit addressing mode, the address replaces bits 8-31, and bits 0-7 of general register 1 remain unchanged. In the 31-bit addressing mode, the address replaces bits 1-31, and bit 0 of general register 1 is set to zero. In both modes, bits 0-23 of general register 2 remain unchanged.
When the function byte is nonzero, either condition code 1 or 2 is set, depending on whether the argument byte is the rightmost byte of the first operand. Condition code 1 is set if one or more argument bytes remain to be translated. Condition code 2 is set if no more argument bytes remain.
The contents of access register 1 always remain unchanged.
Access exceptions are recognized only for those bytes in the second operand which are actually required. Access exceptions are not recognized for those bytes in the first operand which are to the right of the first byte for which a nonzero function byte is obtained.
Resulting Condition Code:
UNPK D1(L1,B1),D2(L2,B2) [SS]________ ____ ____ ____ _/__ ____ _/__ | 'F3' | L1 | L2 | B1 | D1 | B2 | D2 | |________|____|____|____|_/__|____|_/__| 0 8 12 16 20 32 36 47
The format of the second operand is changed from packed to zoned, and the result is placed at the first-operand location. The packed and zoned formats are described in Chapter 8, "Decimal Instructions."The second operand is treated as though it had the packed format. Its digits and sign are placed unchanged in the first-operand location, using the zoned format. Zone bits with coding of 1111 are supplied for all bytes except the rightmost byte, the zone of which receives the sign of the second operand. The sign and digits are not checked for valid codes.
The result is obtained as if the operands were processed right to left. When necessary, the second operand is considered to be extended on the left with zeros. If the first-operand field is too short to contain all digits of the second operand, the remaining leftmost portion of the second operand is ignored. Access exceptions for the unused portion of the second operand may or may not be indicated.
When the operands overlap, the result is obtained as if the operands were processed one byte at a time and as if the first result byte were stored immediately after fetching the first operand byte. The entire rightmost second-operand byte is used in forming the first result byte. For the remainder of the field, information for two result bytes is obtained from a single second-operand byte, and execution proceeds as if the leftmost four bits of the byte were to remain available for the next result byte and need not be refetched. Thus, the result is as if two result bytes were to be stored immediately after fetching a single operand byte.
Condition Code: The code remains unchanged.
Program Exceptions:
UPT [E]________________ | '0102' | |________________| 0 15
The doubleword nodes of a tree in storage are examined successively on a path toward the base of the tree, and the contents of general-register pair 0-1 are conditionally interchanged with the contents of the nodes so as to give a unique maximum logical value in general register 0.General register 4 contains the base address of the tree, and general register 5 contains the index of a node whose parent node will be examined first. The base address is eight less than the address of the root node of the tree. The initial contents of general registers 4 and 5 must be a multiple of 8; otherwise, a specification exception is recognized.
In the access-register mode, access register 4 specifies the address space containing the tree.
This instruction may be interrupted between units of operation. The condition code is unpredictable if the instruction is interrupted.
A unit of operation begins by shifting the contents of general register 5 right logically one position and then setting bit 29 to zero. However, general register 5 remains unchanged if the execution of a unit of operation is nullified or suppressed. If after shifting and setting bit 29 to zero, the contents of general register 5 are zero, the instruction is completed, and condition code 1 is set; otherwise, the unit of operation continues.
Bit 0 of general register 0 is tested. If bit 0 of register 0 is one, the instruction is completed, and condition code 3 is set.
If bit 0 of general register 0 is zero, the sum of the contents of general registers 4 and 5 is used as the intermediate value for normal operand address generation. The generated address is the address of a node in storage.
The contents of general register 0 are logically compared with the contents of the first word of the currently addressed node. If the register operand is low, the contents of general-register pair 0-1 are interchanged with those of the node, and a unit of operation is completed. If the register operand is high, no additional action is taken, and the unit of operation is completed. If the compare values are equal, general-register pair 2-3 is loaded from the currently addressed node, the instruction is completed, and condition code 0 is set.
In those cases when the value in the first word of the node is less than or equal to the value in the register, the contents of the node remain unchanged. However, in some models, these contents may be fetched and subsequently stored back.
Access exceptions are recognized only for one doubleword node at a time. Access exceptions, change-bit action, and PER storage alteration do not occur for subsequent nodes until the previous node has been successfully compared and updated.
Access exceptions, change-bit action, and PER storage alteration do not occur if a specification exception exists.
Resulting Condition Code: