Digital PDFs
Documents
Guest
Register
Log In
EK-VAXAR-RM-001
May 1982
494 pages
Original
15MB
view
download
OCR Version
15MB
view
download
Document:
VAX-11 Architecture Reference Manual
Order Number:
EK-VAXAR-RM
Revision:
001
Pages:
494
Original Filename:
OCR Text
IDNUDIA ©2U818J8Y aINJosSlIydiy | L-XVA EK-VAXAR-RM-001 VAX-11 Architecture Reference Manudadl 20 May 1982 Revision 6.1 Revision Revision Revision Revision Revision Revision 1, 1975 Sept, June, 1976 3, May, 1977 4, Feb, 1979 5, May, 1980 &, June,1981 6.1, to change The information in this document 1is subject a commit ment as ued constr without notice and should not be ent Equipm l Digita ation. Corpor by Digital Equipment that errors any for ty sibili respon no s assume Corporation may appear in this document. rty of Digital The specifications, herein, are the prope duced or copied repro Equipment Corporation and shall not be cture or sale manufa the for in whole or in part as the basis of items without written permission. Copyright (c) 1976, Equipment Corporation The following 1977, are 1979, trademarks 198¢, 1981 of Digital by Digital Equipment Corporation: DIBOL ASSIST-11 COMPUTER LABS DIGITAL COMSYST COMTEX DNC EDGRIN DECCOMM DECUS DECsystem-10 GLC-8 IDAC IDACS DDT DEC DECnet DECsystem-2@0 DECtape EDUSYSTEM FLIP CHIP FOCAL INDAC KAL0 K110 KL1@ RSTS RSX MASSBUS OMNIBUS 0S/8 SABR SBI TRAX LAB-8 LAB-K PDP PHA PS/8 QUICKPOINT RAD-8 RT-11 RTS-8 TYPESET-8 TYPESET-10 TYPESET-11 UNIBUS VAX PREFACE The VAX-11 natural We is a believe that traditional of of of these years upward-compatible and is strongly systems methods culmination in family outgrowth of of represent of particular. For readers the VAX interested Technical programming and instructional detail how in just operation and the of central do, how it means, and what machine and to language, symbolic addressing member defined on any other sophisticated features only text of the system and Chapter 2 and the -- no all 5 defines covers Chapter instructions discusses the the process the Chapter instructions. 1is notational defines instructions. of manual almost conventions formats 3 4 the various the addressing interrupt structure the available management and definition to of of exception handling context switching. and and users aspects is in status must given in relies the more manual is assembler to the is functional goals the forms detailed of the manual. of modes the in its mnemonics the throughout of gives and of entirely discusses used what treatment the discusses generally memory 1 of Dboth procedures any to language defines control Moreover, devoted refer for manual The on knowledge compilers instruction nor prior Chapter the and machine and assembler. assembler. from programming basic of programming. the the software the 1its a represents family, the is family. departure exactly what The It PDP-11 please the VAX-11 techniques Digital self-contained description the data, by family, functions, required. The the effectively. uses the software, Basically programming it of explains of purposes. it that neither completely any of manual handles utilize in needs processor instructions employed the summary This reference information be a Summary. systems. with a significant design. VAX-11 computer analysis computer compatible data and used in description system., Chapter the system. Chapter the 5 system. Chapter 7 Chapter 8 defines those interactions between processor, memory, and I/0 devices which are true of any member of the family. Chapter 9 defines the specifics of interacting with processor registers. Chapter 18 documents the PDP-11 Compatibility Mode instructions, their used to construct an of operation. operands, and "instruction the Appendix encoding. card". A is It is a summary suitable of the to be TA OF BL CONTEE NTS 1 « o Reserved . . . . . . ., . . . . . . . . .. Conventions . . . . o o oL L L. . . . . . . Longword . . . ... . . . Quadword . . . . . . . . . . . . . . Octaword . . . . . . . . . . . . . . floating . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Blt e Numeric Strlng Separate « Numeric String Packed Decimal PROCESSOR STATE PROCESSOR . STATUS WORD e String . . . . . . . . . . . . . . . . . . v 0. CBit . . o o v VBit . . . o 0000 v . Bit . . . . IVBIt . ... . . . . . . oL . . . . . e o o o e . . .00 . e . FU Bit . . . * . Bit . . PERMANENT Divide EXCEPTION By Zero . Floating Overflow INSTRUCTION FORMAT SEPARATION I/0 OF OPCODE . 4 . o . . . ... ..., . . . .. e o o o« o e . . . . . . . . . . . . AND DATA . . . e s . . . . . . o« AND . ., ., SPECIFIERS . . MODE ADDRESSING . . . ADDRESSING . . . . NOTATION GENERAL e . . . o ... . . FORMATS . e L. ENABLFS . STRUCTURE FORMATS OPERAND o PROCEDURE STRUCTURE INTERRUPT o ... ... . v Bit DV T e . Leading . T N e Trailing . Z . b= e String NBit . e Fleld Character L Length .. . — Variable . . FORMATS ww | - H floating w G_floating ds N D floating w X ~J AU W . . o . . . . W N . e e ¢ . L . . . HHEFHFRFROOJOOWU S WN — e e @& o ® ] * o e e [) [] * [] . Byte Word [ . . T . . T . . T . . T . . O . . T . . T . . R . . NN N NN DN D NN N . . TYPES WHOWOWAU U &S WWN N - . o - ARCHITECTURE . F SR . 0L, . 0 . . . @mflmmmm@fib&&b@&&wwwl\)l\)(\)[\) DN . Drawing e N S . ot Extents . el And NDNDN NN NDNDO NN DD NDNDND RN NDODNNODNDNONNDNODNDNNDNDND . . UNDEFINED Ranges Figure o . ADDRESSING w ww And MBZ . c .« DATA N . . . . UNPREDICTABLE BASIC W ww . CONVENTIONS Numbering INSTRUCTION . CHAPTER . WWWwhNNON - L] * N CHAPTER L AND DU D W N . TERMINOLOGY [] . [ NN INTRODUCTION MDD el i e e [ [ L] . INTRODUCTION U CHAPTER « . . . . . . e . . . « « = .« o . | . . . .+ I Displacement Deferred Mode Literal Mode Index Mode . SUMMARY OF GENERAL MODE ADDQES%INF General Register Addressing Program Counter Addressing (reg=15) BRANCH MODE ADDRESSING FORMATS OPERAND SPECIFIER CONVENTIONS > W N (2 [ — L] [] S [] N S . W N > N U N . Operation Description Notation INTEGER ARITHMETIC AND LOGICAL INQTRUCTIONS ADDRESS INSTRUCTIONS . . . . CONTROL INSTRUCTIONS . . . . QUEUE INSTRUCTIONS . . . .. Absolute Queues Self-relative Queues . .« . . .+ . . = PROCEDURE CALL INSTRUCTIONS MISCELLANEOUS INSTRUCTIONS . o w N ¢« . o W N « ITntroduction . . « « « « o o o o o o o o Overview Of The Instruction Set ACCUracCy =« Instruction Descriptions . CHARACTER STRING INSTRUCTIONS DECIMAL STRING Decimal Zero * 2 b b b b b b b . Instruction Descriptions . FLOATING POINT INSTRUCTIONS INSTRUCTIONS Overflow . . . . . . . . « . . . o Numbers . Reserved Operand Exception UNPREDICTABLE Results Packed Decimal Operations Zero Length Decimal Strings Instruction Descriptions . EDIT INSTRUCTION OTHER VAX-11 INTRODUCTION N - CYCLIC REDUNDANCY CHECK INSTRUCTION e B WD NN = > O WO 0 O WO 0 0 000 ] Y . O o S e S S s e o e L] S « I ¢ N L] N S N N N O Y S un N - Instruction Descriptions . Operand Specifier Notation VARIABLE LENGTH BIT FIELD INSTRUCTIONS " N o e e e o e e SET INSTRUCTION . . . « « « = . « « « = . . . INSTRUCTIONS . VIRTUAL ADDRESS « SPACE W ww W | + . . . O . . . w Autodecrement Mode Displacement Mode . Autoincrement Deferred Mode I L i[ [N . . | @ . e . o L] o . « . o o . . L] . Mode Autoincrement . . . WW W wwwww OO~ d W S S DD DD D W W wwww wwwwwww AN U U W . MEMORY MANAGEMENT . CHAPTER . . Mode Register Deferred Mode INSTRUCTIONS e CHAPTER . Register NN W XRQOLWOISHYWU! ii Page . . . . . . . . . . . . . Modes Protection Code Length Violation Access Control Access Across System Space Region Pl Region AND = N w | . . . . . . . v o . . . . . . . . . . . . . . . .. . . . . . . . . . . . . .. . . . . . . . . . . . . Fault . . . . . . Boundary . . . . . . Translation . . . . . . . . . Translation . . . . . . . . . . . . . . BUFFER . .. . .. . . . . . . . . . . . . . . . . . AND . . . . . . .. . . . EXCEPTIONS AND INTERRUPTS . . . instructions . . Interrupt v o v v o Priority . . . . . o . . . . .. . . . . . . . . . . Levels . (IPL) Interrupts . . . . . . Exceptions . . . . . . . . .. . . .« . . . . . . . . . .. Between STATUS . . . + v . . . . . -- N . Device Interrupts W . Exceptions . -- Software Generated .« . Levels . . Interrupts o o . . . ] 18-1F . . .« . . . (Hex) . Levels 14-17 (Hex) Interrupts -- Levels 01 . N S And v Software Interrupt Software Summary Interrupt Register . Request . Register . . Interrupt Priority Level Interrupt Register Example . . . . . . v . . Arithmetic . . . Traps/Faults Integer Overflow Integer Divide Floating Divide By String . Floating Decimal Trap By Zero Overflow Trap Zero . . . Trap . . Underflow String L . . . . . . . . . . . v v o v v .. . . . . .« e . . . . . oL Overflow . v . . . . . . . . . . . . .« . . Floating Trap . . Trap O .. VALIDATION . . . PROBE . . (PROBE The . . Arguments On . . ARGUMENT Modes Address . RO . . (S RIRCANS | . Entries Address U RO IO IS, IO . v Interrupts W N . v Page Access Contrast O Ut . v Urgent T . v SERVICES [] . I/0 W PARAMETERS . . e v Address Space PG . . . Violation A . . S Processor . . . or . . Decima L. L. . . . . . . Trap . . . . Wi . . . [ Table . . . W Page . . 0U To CONTROL INTERRUPTS L . . For PROCESSOR [ . (PTE) Processor U W w . (PTE) PRIVILEGED o e . VYNV OO S o . Entry FAULTS s . Disabled OO CONTROL G NSy . . LU WSS DS . Entry Process W N - . Layout . | N w OOJNWULTd WM — s o o o e « . . — = L] L L] [ . . o o e e s e o . .. Table Changes e ¢ e WO IS WO WS IS . NS G O N W o« « o .. . Table Notes ¢« . . Page Validating . . . Page Changing * * . . . TRANSLATION INTRODUCTION L] . . Management instructions) . . . ] SSW N N . L] L] N DN . [] W N e s Lo v D AR R CXJOOOO\)O\U'IU'IU'IU'ILNU‘ILflLflU'IU'IkS.b&b'w w co * . - . . MANAGEMENT Memory (o)) OY O o e . . SIYO OV OYOY Y WWwWwWwN - AN AN * NN S S DWW W . . Format TRANSLATION DA . . . Space ACCESS B * . . Address ADDRESS D L] . Address EXCEPTIONS . . Virtual MEMORY [Ia NN L] Space Space Virtual (Hex) [] CHAPTER Process System N w W AU Reference 5-18 o o o o o« « « . Customers Opcode Reserved To Compatibility Mode Exception Fault Breakpoint « « « . . . . o« o o o o o . . « « o Trace Using o Fault 6-20 6-20 6-21 6-21 6-22 6-24 = . . Serious System Failures Kernel Stack Not Valid Abort Interrupt Stack Not Valid Halt . Machine Check Exception Af-18 6-20 CSS) . Instruction Summary Trace (and 6-17 6-17 5-18 SERIALIZATION OF NOTIFICATION OF MULTIPLE EVENTS SYSTEM CONTROL BLOCK (SCB) . . System Control Block Base (SCBB) 6-25 6-26 6-26 6-26 6-25 6-27 6-29 6-29 5-29 o o o o o o o o o o o s o o o 6-34 . Stack Residency . Stack Alignment Stack Status Bits . . . . . . . . . « . . . . . 6-35 o ¢ ¢ v « « VecCtorsS 6-34 -35 . Accessing Stack Registers INITIATE EXCEPTION OR INTERRUPT RELATED INSTRUCTIONS PROCESS STRUCTURE PROCESS PROCESS DEFINITION . CONTEXT . . . . . . « . « . « . « . o . = Process Control Block Base (PCBB) Process Control Block (PCB) Process Privileged Registers ASYNCHRONOUS SYSTEM TRAPS (AST) PROCESS STRUCTURE INTERRUPTS . PROCESS STRUCTURE INSTRUCTIONS USAGE . EXAMPLE . <« « « « =« 6-35 65-37 6-39 6-43 [JERN JRNG RS IS BES D BE BE N D N D o o o e o . L] NN NN W [] OS Vs AU = . AN N . . . . . . . OO U O 00 ~d ~] ~J ~J1O N+ DD DD D o ¢ o o o o L] Ld . L] * L] L] L] . CACHE L] L] L N « | . O © N+ w INTRODUCTION DATA SHARING AND SYNCHRONIZATION 0 L] o o e . . o o o o o o o 65-17 Exceptions Occurring As The Consequence Of PROCESSOR STATE TRANSITION TABLE e 5-16 Reserved Addressing Mode Fault Reserved Operand Exception Tracing w N . OY N . D D ANANAADNTAAANANAANDATNDAANAN TN YA N N . N L] B . e . 5-16 o | WoooJoaaNNDNDH L] [ N N . Divide By Zero Floating Fault Floating Underflow Fault . Memory Management Exceptions . Access Control Violation Fault Translation Not Valid Fault Exceptions Detected During Operand STACKS oo NG I B 6-15 . SYSTEM ARCHITECTURAL IMPLICATIONS L] O o CHAPTER 5-15 . . Opcode Reserved To DIGITAL fault 7 iv ~J 00 O Floating Overflow Fault Instruction CHAPTER . Trap Range Subscript = [ . » = T S WWwNND N - S N * . R [] [ S . NN S . A AN NN Page RESTARTABILITY 8.6 INTERRUPTS . ERRORS 8.7 . 1/0 . . . e e e e e St . « e . e . e e 4 e e o e e e e+ e e e e e e 4 e s e s e . e . e . e . e . e . . . . Registers . . .. . . . . . . . . . . S L] . . . e e . . REGISTERS . « . . . . s e e . . (SID) . . Registers console Byte Time-of-Year . . register Definition c « e 1mp1ementatlon . . . . . . . . . . . . . . . . Clock . .. . . . . . . . . . . . . . W 9-17 . Clock . SPECIFIC . . L Accelerator VAX-11/780 Micro . e s e e 4 e e o e o e 4o o . e e e e e o Store c o o o o o © e e e 9-18 e o o o e 9-19 . & o SILO COMPARATOR REGISTER (SBISC) MAINTENANCE REGISTER (SBIMT) . . ERROR REGISTER (SBIER) . . . . . TIMEOUT ADDRESS (SBITA) s s+ e QUAD CLEAR (SBIQC) . . . . . . . SBI & SILO SBI e FAULT/STATUS SBI SBI & SBI * Control SBI ® SBI VAX-11/750 1 CMI .2 3 SPECIFIC Error Console . . L] U J0 0 Initialize W e Accelerator Translation 10 PDP-11 . . .« Error Summary (CAER) Control/Status UNIBUS MODE General . . . . e o e e e e e o W e e e e o . e . . Register e e e . . 9-26 o o . 9-26 (MCESR) 9-26 . . . . . . 4 e e (TBDATA) e e e e And e Addressing e Modes Mode 2 Register Deferred . . o« o . 9-27 . 9-28 9-27 10-1 19-2 10-2 10-2 .3 Autoincrement Mode 4 Autoincrement 5 Deferred Autodecrement Mode Mode . . « . e 9-26 . 10-2 Mode . 9-24 9-25 e e Registers 9-24 e ENVIRONMENT Register 9-22 9-23 Register U%ER 1 9-21 . o« e . e e 9-19 9-290 s+ . e+ e e . . . . . . e e Register . MODE . . . e Register IORESET) COMPATIBILITY ., . e Register Data INTRODUCTION . . . 9-15 e . (CADR) Buffer COMPATIBILITY . . Reglster Check Error e Device Reglsters Buffer Group Disable Dlsable Cache . Storage . (SBIFS) (SBIS) REGISTERS Register Translation Machine REGISTER REGISTER . . e REGISTERS VAX-11/788 DATA o I . Register o =0 W0J0Y WK - . . @ WO -JOU b WK . . Registers Interval SWITCHING . Terminal VAX-11/78@8 . o= 3 .2 . O WVWWYWWYWWYwWYWW [] * 1 . Tdentification Status Clock . . CONTEXT INSTRUCTIONS VAX-11/780 .2.1.1 3 . el el Console . AND IMAGES SERIES 2 2.1 SPACE REGISTERS MFPR System . e WY O O [ | I VAX-11 . I/0 REGISTER POINTER AND 1 L[] . « . . W — MTPR L] L] . . U . N o STACK e PROCESSOR PER-PROCESS Cache e . . REGISTERS * OO0 *WO OWOWYWWYWWIWWOWIWWWOIWIWYWOWWWOWY OO WO WY * o L] PRIVILEGED (TBDR) ” O WO WO W WL CHAPTER . . O | 9 3 . . Introduction . Constraints On 8.7.2 CHAPTER . QTRUCTURE . . — 8.7.1 . . O 8.4 8.5 e e e o o s . . s 10-3 190-3 19-4 Page 10,2.1.6 10.2.1.7 10.2.1.8 Autodecrement Deferred Mode vi e e e e e e e . Tndex Mode v v v o o o o e e e e s e s s e Index Deferred Mode e e e e e e e e e e e 19-4 19-5 19-5 The Stack o « o o o o o o o o o o o o o so oo =- 10-5 10.2.2 10-5 Processor Status Word . . « « o « o o o 1¢.2.3 19-7 e e e s e e o o o o o o ¢ v v v EionNsS INSErUC 10.2.4 Single Operand Instructions . . . .« . « « - 10-9 10.2.4.1 Double Operand Instructions . . . . . « . = 10-24 10.2.4.72 .« « .« . . 10-36 Branch Instructions . . . . . 16.2.4.3 e e e e . .o 102-42 ctlons In%tru tine Subrou And Jump 10.2.4.4 . . . .« « = 10-45 Traps And Return From Interrupts 10.2.4.5 e e e e . 10-48 e e e e . . s Miscellaneou 10.2.4.6 . . . . 10-53 MODE ITY TIBIL COMPA NG LEAVI AND ING ENTER 1.3 e« . . 10-53 e e . . . . General Register Usage 10.3.1 e« . . 10-54 e v MENT MANAJF MEMORY MODE Y COMPATIBILIT 19.4 . . 10-57 UPTS INTERR AND IONS EXCEPT MODE Y IBILIT COMPAT 19.5 « = 19-57 « « « « « . . . Fault Reserved Instruction 19.5.1 « = 10-57 o o o « « ¢ « ¢ « . . Fault BPT Instruction 10.5.2 =« o 10-57 « o « o o ¢ o « « . . Fault n uctio 10T Instr 19.5.3 ¢ = 19-57 « « o o ¢ « « « EMT Instruction Fault . . 19.5.4 « =« 13-57 o o o ¢ ¢ « « « . . Fault TRAP Instruction 10.5.5 « = 13-57 « « « « « . . . Fault n uctio Illegal Instr 13.5.9 . l0-58 e« e e e e 0dd Address Error Abort . . 16.5.7 . 10-58 . . . . MODE Y T BIT OPERATION IN COMPATIBILIT 1.6 = 19-60 « = « « ¢ o « « « . . TRAPS 1 UNIMPLEMENTED PDP-1 19.7 . 1lo-061 e e e e e NCES REFERE I/0 MODE Y IBILIT COMPAT 10.8 e 10-51 e e s e e e e e e e e e e PROCESSOR REGISTERS 19.9 19-61 o o o o o o o o o « & ION ONIZAT PROGRAM SYNCHR 19.19 APPENDIX A A.l A.2 A.3 A.4 INSTRUCTION SET AND OPCODE ASSIGNMENTS INSTRUCTION OPERAND FORMATS . « « « « o o ¢ o o= o o o o OPERAND SPECTIFIER NOTATION . o « o « oS . . . . . OPCODE ASSIGNMENTS INSTRUCTIONS USABLE TO REFERENCE I/O SPACE . . . A-1 A-9 e A-18 CHAPTER 1 INTRODUCTION 1-Feb-89 1.1 represents architecture. instruction not need the compared address to mode to 6 protection number 1. 2. of PDP-11, of in bit goals new mode can the run PDP-11, conversion PDP-11 offers a instructions greatly of it is in existing which the extended data the Likewise programs unchanged and I1/0 Although programmer. manual user guided to VAX-11 programs the elegant data instruction set language with of VAX-11 do PDP-11 virtual types, and This the PDP-11 the virtual is be achieved modes. should not to virtual consistent with address space, and and grow address a wide range should easily, with modes. data in size; smaller orthogonality This a a naively get space. set of programs significantly VAX-11 addressing exploited processors. by PDP-11 exploit instruction types, to desiqgn: enhancement. redesigned extended systematic, the addressing operators, level with PDP-11 VAX-11 VAX-11 efficiency. translated A formats. family similar new Also provided is a sophisticated memory management mechanism, and hardware assisted proces s scheduling and and despite a PDP-11 VAX-11. compatibility significant extension significant functional while 3. Existing Maximal types by the addressing, compatible easily features of byte data straightforward VAX-11. specific High PDP-11 identical additional médes. extension the strictly provided the synchronization. A not mastered extended space, addressing and be with and enables programs compatibility As is can similarity PDP-11 significant shares structures, set and a It interrupt related, the Rev INTRODUCTION VAX-11l and -- of enables the by high particularly Page 1-2 1-Feb-82 -- Rev % Introduction INTRODUCTION Extensibility. 4. The instruction set is designed so that new data types and operators can be included efficiently in a manner consistent with the currently defined operators and data types. Range. The architecture should be suitable over the entire range of PDP-11 computer system implementations currently sold 5. by Digital Equipment Corporation. The VAX-11 Architecture Reference Manual describes the architecture VAX-11 and applies to all implementations of VAX-11 systems. of TERMINOLOGY AND CONVENTIONS 1.2 1.2.1 Numbering 1.2.2 UNPREDICTABLE And UNDEFINED Where there 1is All numbers unless otherwise indicated are decimal. with the base in ted indica are l decima ambiguity, numbers other than . (hex)) FF (e.g., heses parent in number the English following to moment, Results specified as UNPREDICTABLE may vary from to moment within ction instru ction implementation to implementation, and instru as ied specif s result on depend implementations. Software can never moment from vary may NED UNDEFI as ied specif ions Operat UNPREDICTABLE. to instruction to moment, implementation to implementation, and effect in vary may ion operat The instruction within implementations. UNDEFINED operations must from nothing to stopping system operation. ed state from which not cause the processor to hang i.e. reach an unhalt machine eXxXecutes the which there is no transition to a normal state in and operation. result n betwee ction distin Note the instructions. Non-privileged software can not invoke UNDEFINED operations. 1.2.3 Ranges And Extents of Ranges are specified in English and are inclusive (e.g.,and a 4.)range s Extent 3, integers @ through 4 includes the integers @, 1, by2, a colon and are ted separa are specified by a pair of numbers (i.e. bits 7:3 specifies an extent of bits including bits 7, inclusiv 6, 5, 4, and 3). Introduction TERMINOLOGY 1-Feb-80 AND CONVENTIONS 1.2.4 MB7Z Fields specified software value with in occurs a only field (see accessible to a to in fields UNDEFINED by Be value. specified as 4, privileged MBZ (Must MBZ, or all accessible should processor a reserved and never operand fields mode) to if that may privileged Page 1-3 filled by a fault non-zero or that are not implementations. operation. be encounters Interrupts) MBZ (kernel VAX-11 only 5 the software. software some Rev Zero) If Exceptlons non-privileged value be abort field checked Non-zero software is accessible for wvalues may produce many cases, Reserved Unassigned some MBZ Chapter non-zero 1.2.5 as non-zero -- values values values should of are fields be used indicated as extend the standard 1.2.6 Figure Drawing which depict Flgures increasing are indicated reserved addresses for to DEC reserved as for reserved non-standard and architecture all in the MBRZ future to use. 1In CSS /customers. applications. fields are to be future. Only The used these wvalues only to Conventions registers or run to right memory left and follow top to the convention bottom. that CHAPTER 2 BASIC ARCHITECTURE 29-Feb-80 2.1 The basic addressable are 32 (approximately 4.3 program are management 2.2 VAX-11 is 6 in long: billion) translated hence bytes. 1into the Virtual physical described in the 8-bit virtual addresses memory Chapter byte. address Virtual space as is seen addresses by 2%*%3) by the the memory 5. DATA TYPES Byte A is byte bits 8 contiguous are numbered A byte is specified a byte is a going @ the support of unsigned twos through for 6 and and -128 its starting the bit increasing is right address 7 the through the range an sign addressable through When byte 7: The For arithmetically, increasing significance value of the integer is of the instructions ©purposes of also provide of a byte as an going unsigned @ through 7. The @ through boundary. interpreted bits bit. 127, interpretation in @ with VAX-11 significance on A. integer comparison, the integer by bits from complement range subtraction, bits wunit bits mechanism 2.2.1 in Rev ADDRESSING addresses The -- 255, addition, direct integer wvalue of with the 29-Feb-80 -- Rev 5 Basic Architecture page 2-2 DATA TYPES 2.2.2 Word an arbitrary byte A word is 2 contiguous bytes starting 8 onthrou gh 15: The bits are numbered from the right boundary. containing ss A, the address of the byte A word is specified by itsd addre complement twos a metically, a word is bit @. When interprete arith and bit 14 gh throu 0 asing significance going integer with bits of incre -32,768 range the in is er integ the of 15 the sign bit. Thethe value and n actio subtr purposes of addition, through 32,767. For the for rt suppo t direc provide instructions also integ comparison, VAX-1la word g easin 1incr of bits with er ned as an unsig interpretation of is er integ significance going # through 15. The value of the unsigned in the range @ through 65,535. 2.2.3 Longword starting on an arbitrary byte A longword is 4 contiguous bytes the right 0 through 31: The bits are numbered from boundary. of the Dbyte address A, the address word A longword is specified by its a twos long 2 ly, interpreted arithmeticalificance going 9 is thro containing bit #. When bits ugh sign ng easi of incr complement integerthewith range the in is er sign bit. The value of the integses of addition, 39 and bit 31 2,147,483,647. For the purpoalso provide direct gh throu -2,147,483,648 ions arison, VAX-11 instruct subtraction, and comp an unsigned integer with as ord longw a of tion support for the interpreta gh 31. The value of the bits of 1increasing significance going ¢ throu unsigned integer is in the range @ through 4,294,967,295. t rent from the 1longword forma Note that the longword format is. diffe asing incre of bits t, forma In that 1 FP-11 defined by the PDP-1 the sign gh 31 and @ through 14. BitAN 15andis COBOL significance go from 16 throu use Most DEC software and in particular PDP-11 FORTR bit. the VAX-11 longword format. Basic DATA Architecture 2.2.4 A -- Rev 5 Page 2-3 Quadword quadword The 29-Feb-80 TYPES bits is are 8 contiguous numbered bytes from the starting right @ on an through arbitrary byte boundary. 63: 3 1 | o + l | P :A + | Fo e | e 3 3 A 2 quadword is specified containing bit complement integer 62 and bit 4. 63 VAX-11 instructions. 2.2.5 Octaword is 16 bits A, the address of the byte arithmetically, a quadword is a twos increasing significance going # through bits sign The The address with the 2**63-1. octaword its interpreted to boundary. by When =2**63 A :A+4 + 5 of bit. The quadword contiguous are value data bytes numbered from of type the is integer not starting the right on # is fully an in the range supported arbitrary through by byte 127: 3 1 2 P + | | Bt | | Bt tt | :A+4 + | o :A+8 + | | e :A+12 + 1 9 2 6 7 A :A + octaword is specified containing bit complement integer 126 and —2**127 VAX-11 bit to @. 127 by its address A, the address of the byte arithmetically, a octaword is a twos increasing significance going # through When interpreted with bits the sign 2**127-1. The instructions. of bit. The octaword value data of type the is integer not fully is in the range supported by DATA Page 2-4 29-Feb-80 -- Rev A Basic Architecture TYPES 2.2.6 F floating byte ry A F floating datum is 4 contiguous bytes starting on an h arbitra 31. throug @ right the from ed boundary. The bits are labell 1 1 %) 7 5 5 4 bb+ exp |S | fraction | | A | A+2 —— + oo fraction | —— = + oe the address of the A F floating datum is specified by its address ngA, datum is sign magnitude floati F a of form The #. byte containing bit nt, and binary 128 with bit 15 the sign bit, bits 14:7 an excess on with the expone ant most redund fracti 24-bit bits 6:0 and 31:16 a normalized bits of on, fracti the Within ented. repres not significant fraction bit 6. The h throug 0 and 31 h increasing significance go from 15 throug nt expone An 255. h throug @ values 8-bit exponent field encodes the the that te indica to taken is 0, of bit sign a value of 0 together with of 1 through 255 F floating datum has a value of @#. Exponent values An exponent value +127. h throug indicate true binary exponents of -127 Floating ed. reserv as taken is 1, of bit of @, together with a sign operand ed reserv a take d point instructions processing a reserved operan in the is datum ing _float F a of value fault (See Chapter 4 and 6). The of a ion precis The **38. 1.7*18 h throug **-38 approximate range .29*%1@ 7 lly typica i.,e., 2%%x23 F floating datum is approximately one part in decimal 2.2.7 digits. D floating ry A D floating datum is 8 contiguous bytes starting on an h arbitra 63: throug @ right the from ed boundary. The bits are labell 1 1 7 6 5 4 eo S| exp | ) ———— + fraction byte | A ot - e + | fraction | :A+2 l fraction | :A+4 | fraction | :A+6 A D floating datum is specified by its addres s A, the PR + — + o P+ address of the ing datum is identical to a byte containing bit @#. The form of a D float 1low significance fraction 32 floating datum except for an additional sing significance go 48 1increa of bits on, Within the fracti bits. h 6. The exponent throug # and 31, h throug 16 47, h through 63, 32 throug Basic DATA Architecture conventions, as and F floating. part in 2.2.8 A 29-Feb-80 TYPES approximate The 2**55, range precision i.e., of typically a 16 of -- Rev 6 values D floating Page is the datum decimal digits. bytes starting same is for D 2-5 floating approximately one arbitrary byte G floating G_floating boundary. datum The is bits 8 are contiguous labelled from the right on # an through 63: 11 5 4 4 3 ? e __ LT IS | exp | Fot p—— + fract | :a Fommm— + | fraction | o :A+2 + | fraction | :A+4 | :A+6 Foe __ + | fraction oe __ + A G_floating datum is byte containing bit with bit sign bits 15 3:0 the and significant increasing and # 2047, specified #. 63:16 The bit, a by form bits of 14:4 normalized fraction bit significance not go its address a G_floating an excess 53-bit through 53, through the address datum 1024 fraction represented. 48 A, is binary sign of the magnitude exponent, and redundant most with the Within the through fraction, 32 47, 16 bits of through 31, 3. The 1ll-bit exponent field encodes the values @ through An exponent value of @ together with a sign bit of @, is taken to indicate that the G_floating datum has a value of 4. Exponent values of 1 through 2047 An 1indicate exponent value of reserved. #, Floating true binary together point with exponents a sign instructions .9*10**308. 2.2.9 A in The 2**52, precision ji,e., of typically a G _floating 15 decimal -1023 of processing take a reserved operand fault (See Chapter 4 G_floating datum is in the approximate part of bit and 6). range datum through 1, a 1is reserved The as operand wvalue .56*10**-308 is +1023. taken of a through approximately one digits. H floating H floating boundary. datum The bits is 15 are contiguous labelled bytes from the starting right @ on an through arbitrary 127: byte DATA Page 2-6 29-Feb-804 -- Rev 6 Basic Architecture TYPES 1 1 5 4 ) s+ TS I exponent S| e+ | fraction | A :A+2 -+ :A+4 | fraction I g+ | fraction | + o | fraction | o e + | | fraction | fraction | I fraction | S et + ettt + S :A+5 :A+8 :A+10 :A+12 :A+14 o e~ + the address of the A H floating datum is specified by its address A, The form of a H floating datum is sign magnitude byte containing bit @#. with bit 15 the sign bit, bits 14:0 an excess 16384 binary exponent, and bits 127:16 113-bit normalized a fraction with the redundant most significant fraction bit not represented. Within the fraction, bits of increasing significance go 112 through 127, 96 through 111, 8@ through The 95, 64 through 79,48 through 53, 32 through 47, and 15 through 31. 15-bit field encodes the values ? through 32767. exponent An exponent value of @ together with a sign bit of #, is taken to indicate that the Exponent values of 1 through 32767 H floating datum has a value of 0. indicate true binary exponents of -15383 through value of @, together with a sign bit +16383. An exponent of 1, is taken as reserved. reserved operand take a instructions processing a Floating point reserved operand fault (See Chapter 4 and 6). The value of a H floating datum is in the approximate range .84%10**-4932 through L59%19g**%4032, The precision of a H floating datum is approximately one part in 2**112, i.e., 2.2.10 typically Variable 33 decimal Length Bit digits. Field A variable bit field is @ to 32 contiguous bits located arbitrarily with A variable bit field byte Dboundaries. the address A of a byte, a bit position location of the field with respect to bit § starting The specification of and a size S of the field. respect to attributes: is specified by 3 P which 1is the of the byte at A, a bit indicated by the following where the field is the shaded area. field 1is Basic DATA Architecture 29-Feb-80 TYPES P+S P+S-1 P T T pu—— Fo l Rev 4 Page P-1 Fm + For bit strings 2**31~-1 3-bit The and sign 3-bit of field support integer. bits the sign variable the bit is added the byte in for encodes that the byte. the The interpretation interpreted as a of a significance as go S-1. bit field point to fields position in 8 to may be view the contained (Chapter field registers, operand the specifies field in the registers register. if the sum of is A in 5) to actually position the and is bit size as it through field 5 and the The is twos bit integer, of size bytes. the complement S-2; § has From minimum S-1 1is bits of a a number value memory of bytes referenced. starting variable position 1 only A begins. (# through 7) instructions provide a signed or unsigned unsigned A 4. of contain from an field position integer, @ address the field field signed interpreted to the starting going equal to which VAX-11 significance management necessary offset increasing bit. When identically For field of increasing byte specifies within When with field: 29-bit address bit-within-byte direct The in memory, the position is in the range -2%%3) through conveniently viewed as a signed 29-bit byte offset and a is extended the :a + Y bit-within-byte resulting | b S-1 2-7 Y Fom /777777777777 /777777777] Lt A -- in the range position field exceeds may be (@ # through 31, through 31) of contained in 2 32. 3 1 P pP-1 Y Fmm e o e \//7/7/7/7/771 + | Rn o + | \////7////7//1 P D P+S For further details see Chapter 4. on the specification of variable T Rn+1] T p— + P+S-1 length bit fields 29-Feb-80 -- Rev A Basic Architecture DATA Page 2-8 TYPES Character 2.2.11 String A ce of bytes in memory. A character string is a contiguous by sequen the of A ss addre the : butes attri 2 character string 1is specified Thus first byte of the string, and the length L of the string in bytes. the format of a character string is: g 7 U S+ A | | R+ e+ | | mm o 7 :A+L-1 + ) The address of a string specifies the first character of a string. "XYZ" Thus represented: is e+ ‘ llel | it + ‘ IlYll | A :A+l + fmmm —— + fommm e The length L of a string is in the range @ through 65,535. 2.2.12 Trailing Numeric String string in sequence of bytes in memory. A trailing numeric string 1is a contiguous : the address A of the first utes attrib 2 by ied The string is specif of the byte (most significant digit) of the string, and the length L bytes. the least significant All bytes of a trailing numeric string, except al digit character (6-9). The digit byte, must contain an ASCII decimis: representation for the high order digits Basic DATA Architecture 29-Feb-80 digit The -- TYPES highest encoding of decimal Rev 5 hex ASCII @ 48 30 49 31 2 1 50 3 32 51 2 4 33 52 3 5 34 4 53 5 35 54 5 35 6 7 55 37 7 56 9 38 57 8 39 9 the byte least string. of a trailing significant numeric digit represents an 4 8 addressed 2-9 character 1 both Page string and the in overpunch are accepted sign of the numeric The VAX numeric string instructions support any encoding; there are 3 preferred encodings used by DEC software. These are (1) unsigned numeric in which there is no sign and the least significant digit contains an ASCII decimal digit charac ter, (2) zoned numeric, and (3) overpunched numeric. Because the overpunch format has been used by compilers of many manufacturers over many years, and because variou s however card encodings evolved. normal form is representations is: are used, Typically, generated of several these the as variations alternate the digit output and sign forms format on for all operations. in each of the later input; The two have the wvalid formats DATA Page 2-10 29-Feb-8¢ -- Rev 5 Basic Architecture TYPES Representation of Least Significant Digit and Sign Overpunch Format Zoned Numeric Format digit 0] 1 2 3 4 5 6 7 8 9 -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 hex ASCII char 48 30 4 113 114 115 116 117 118 119 120 121 71 72 73 74 75 76 77 78 79 q r S t u \Y w X y | decimal I | l | l l | | | | | I | | | | | l | | l | 49 5@ 51 52 53 54 55 56 57 112 31 32 33 34 35 36 37 38 39 70 1 2 3 4 5 6 7 8 9 p | decimal l l | | l | I | | | l | | I I I | | I l | I hex 123 7B 74 75 76 77 78 79 80 81 82 4n 4B AC 4D AR AR 50 51 52 65 656 57 68 69 70 71 72 73 125 41 42 43 44 45 46 477 48 49 7D ASCII char alt. norm { A B C D E F G H I } J K L M N 0 P Q R g 1 2 1 2 3 4 5 6 7 8 9 ]! range 0 to The length L of a trailing numeric string must be in the ally 0. identic is (0 to 31 digits). The value of a @ length string 31 containing The address A of the string specifies the byte of theingstring significance are the most significant digit. assigned to increasing addresses. Digits of decreas Thus "123" is represented: Basic DATA Architecture 29-Feb-80 TYPES Zoned Format 7 or 4 Unsigned 3 3 I 4 7 1 I 3 I 2 3 | | 3 I A+1 "-123" is Format 7 4 | A+2 3 3 I 3 A Y 1 | 7 2 | Leading leading the I of the numeric The The 2 | in A+l 4 I 3 | A+2 3 |+ | A+l | Separate 4 Format 3 ? 3 | 1 | A o to————— + | 3 | 2 |« A+l e t—————— + A+2 | 4 l C s A+2 t—————— - + Numeric numeric leading separate string String is numeric a contiguous string is sequence specified by of 2 attributes: A of the first byte (containing the sign character), and a which is the length of the string in digits and NOT the length string in bytes. The number of bytes in a leading separate string of a Valid is L+1. separate sign bytes leading numeric decimal an string hex + 43 2B + 32 20 - 45 2D representation ASCIT digit is stored are: Sign preferred contain bytes A L, sign byte. | --+ A address length I 7 separate A 1 Overpunch t—————— - + memory. I 3 I t—————— - + 2.2.13 4 te—m————— Fm————— + Fe—————— t-————— + | 3 3 | t-—————— tm————— + | Format represented Zoned | 2-11 t————— e + o tme———— + and 4 Page Fo—————— t—————— + te—————— to—————— + | 6 t-—————— - + A e te————— + | Rev Overpunch tm————— S + I -- for character: "+" is ASCII ASCII in a separate character + <{blank> - "+". All subsequent bytes DATA Page 2-12 29-Feb-8¢ -- Rev 6 Basic Architecture TYPES digit decimal hex 0 1 2 48 49 50 30 31 32 33 34 35 36 37 38 39 51 52 53 54 55 55 57 3 4 5 5 7 8 9 character ASCITI 0 1 2 3 4 5 6 7 8 9 The length L of a leading separate numeric string must be in (@ to 31 digits). The value of a @ length string is to 31 the randge 0 identically a. The address A of the string specifies the byte of the string the Digits sign. increasing addresses. Thus "+123" ) 3 4 7 of decreasing significance are assigned SIS bommm + | B l 2 I | === pm—————— l A+l : | 1 | 3 | A | = te-————— | | 2 l 3 | | ——=———- f——————- | |+ 3 | 3 | A+2 A+3 SR IS + and is: "-123" J 3 4 7 bo+ | 2 l D | -————=-- o | | 3 I 3 A | | === to—————- | | 1 | 3 \ | te—————| -———--| 2 l 3 | | -+ fomm———— fom——— : A+l : A+2 : A+3 1is: containing to bytes of Basic Architecture DATA 2.2.14 A Packed packed digits byte in of a 3:0) The of of the which the a is contiquous specified string string packed (nibbles) is string the and decimal must and a NOT the Page sequence by 2 are of or sign L 2 3 is the string in 1into except 5 the number of part only) that an first L/2 + byte 11 sign and is 1 of address most must When "g© digit the to string. are 7 nibble 4 o 3 1 9 or the has B, for in | number 12 digits high length in the byte high increasing length 2 A+ byte. Thus 1 is represented: or F D 13 for decimal through 31. sign fit in is even, nibble bytes of The (not When the (integer is required it the string Digits -, string L/2 (bits of the nibble. byte + and the the A | and of in or packed @ and P+ | "+" the range digits a A,C,E, 13 12 the 15 + 2 .. "-12" 7 0] | .N 3 to (bits sign. 8 or appear within N | the a 5 is in the fields 3 digits Again assigned low represented: | be odd, of The nibble contain ot 5 A of the string specifies significant digit in its significance nibble of bytes. 1. the number sign) extra The representation the number bytes. 4-bit low a A 4 9 digits + 2 10,12,14 - counting 2 7 9 is 1 8 + L 4] 1 5 7 preferred 4) 5 8 memory. hex 4 6 2 the must 3 4 length 2-13 address the divided digits in the which of decimal 1 bytes attributes: length decimal 4] and 5 (highest addressed) byte which representation for the digit s and sign is: digit The Rev length string contain last -- String string decimal first bytes Decimal decimal packed the 29-Feb-8¢ TYPES of 7:4) of the string is containing decreasing addresses and "+123" length has from 3 high and is Basic DATA 20-Feb-34 -- Rev 5 Architecture TYPES 4 3 4 7 - tm————— + \ Y | 1 | A l 2 \ 13 | A+ 1 -e+ t—m———— + Page 2-14 Basic Architecture PROCESSOR 2.3 The processor the than memory. state is state process to in status word register. The containing address an Page bits Certain offset of of a (in 2-15 2. 3. is the next the are assigned program the stack the processor R13 is the current convention a data the the contains that of preclude their 3, PC wuses datum of a the used base also (e.g., used for A use register on data address of are for other be byte, numbering SP Run contains (FP). Time stack base of (AP). base all meaning to called this The an this data as base of used these an longword, register registers or stack of as of the ©procedure Manual) frame. FP structure. VAX-11 termed accumulator, the address VAX-11 a is VAX-11 address Reference data However, in the The purposes. word, 3) 31: the the Library used as by contains register containing Chapter through meaning storage, program. structure the an the stack. the the ¢ is A see 16-bit denote temporary size, right PC the pointer pointer a cannot type bit of the a n to that purpose and registers. operand (PC). of VAX/VMS registers register. register, are (SP). frame (see structure special Chapter is special defined address the these assignment byte pointer argument convention Note counter instruction is is ambiguity 15 rather processor general through register. from of R12 base 32-bit @ R{n] and numbered top contains 4. is of R1l4 builds there multiples are registers R15 call range which, of additional register. architecture: 1. a 15 the registers termed consists 7. includes in notation purpose is register the is here Certain and registers, address index 5, Where the index an n (PSW). general 5, state where expression) accumulators, termed Rn described software. Chapters processor denoted arithmetic state non-privileged non-privileged processor When 6 of that portion of a process's state executing, is stored in processor registers ©processor described registers The Rev consists is The accessible an -- PROCESSOR STATE while The 29-Feb-80 STATE procedure argument call list. AP Structure. registers. does not will be temporary, The generally seen or 1in index F floating is stored in a corresponds to the numbering Basic Architecture PROCESSOR 29-Feb-84 -- Rev 5/ Page 2-16 STATE word in in memory. Hence a byte is stored in reqgister bits 7:8, er a bits 31:0. regist in ting, F_floa or rd longwo register bits 15:0, and 15:0 and 7:0 only bits writes A byte or word written to a registerunaff ected. A byte or word read from are bits other the ly; ctive respe the other bits respectively; 15:9 and a register reads only bits 7:0 are ignored. stored in a register When a quadword, D floating or G floating datum is ters R[n] and R{n+l]. d in 2 adjacent regis R{n], it is actually store 3) specification of PC (see Chapter are the on ns ictio restr of RBecause datum the of 31:0 Bits BLE. wraparound from PC to RO is UNPREDICTA and bits 63:32 of the datum are stored in bits 31:0 of register R[n] Rin+l]. stored in bits 31:0 of register it is datum is stored in register R[nl, When an octaword or a H floating ]. Rin+3 and ], R[n+2 ters R{n], R{n+l], actually stored in adjacent regis 3) er Chapt (see PC of fication Because of restrictions on the speci are datum the of 31:0 Bits BLE. DICTA UNPRE wraparound from PC to RO is ter bits 63:32 in Dbits 31:8 of stored in bits 31:0 of regis in R{n], bits 31:0 of register R[n+2], and bits register R[n+l], Dbits 95:64 ]. 127:96 in bits 31:0 of register R[n+3 in length bit field may be specified With one restriction, a variable bit ¥ range the in be must P ion posit the starting the reglisters: of pair a ing, float G and ing, float D ord, quadw through 31. As for t register with bits 31:0 registers R[n] and R{n+1] is treated as a 54-bi R[n+l]. in register R[n] and bit 53:32 in register Dby d 1in registers can be processed ral None of the string data types store tectu archi no 1is there s. Thus the VAX-11 string 1instruction tion of strings in registers. specification of the representa Basic Architecture PROCESSOR 2.4 STATUS 29-Feb-80 -- WORD Rev 5 Page 2-17 PROCESSOR STATUS WORD The processor information status on word the (PSW) results exception enables which exception conditions (see contains produced control Chapter the by the 6). condition previous processor The format codes which give instructions and action Certain of the on PSW the is: 1 5 8 tm— | | -t-t t —t+-+— t + condition codes UNPREDICTABLE Chapter and 4) the C When set, T enable IV and at procedure the C which (carry) DV condition affected C into a clear, borrow there was no carry 2.4.2 V When they are call enables, affected by instructions clear the FU (See enable, entry. set, or had a the code bit indicates carry out most significant borrow. of the most the significant bit. When last bit C is Bit the instruction to be there or 2.4.3 7 Bit When set, the 2.4.4 N When set, was 7 which result condition affected code V Produced a represented 1in the conversion instruction the (overflow) properly or clear, V which overflow a conversion (zero) 7 When «code produced a non-zero. whose operand error. condition indicates result error. affected was bit V which is which the too the there no that was last was received clear, 1indicates result that magnitude was the last 0. When e the last ative. When 7 is BRit the N (negative) instruction which N the is set when procedure the or result VAX-11 unchanged result large UNPREDICTABLE The Bit instruction the are results. conditionally leave 2.4,1 of 1G¢ —t—+-4-4 IDIFIT] | | | | ! IVIUIVITIN|Z|V]|C] MB?Z tom The 765432 -ttt clear, affected result was condition N code produced positive bhit a result (or zero). indica which w Basic Architecture STATUS WORD PROCESSOR 2.4.5 T 29-Feb-80 -- Rev A Page 2-18 Bit T (trace) bit causes When set at the beginning of an instruction, the be set (see Chapter 5). to rd Longwo the TP bit in the Processor Status trace fault 1is taken a ction, instru an of end the When TP is set at See Chapter 5 for before the execution of the next instruction. additional information on the trace fault. 2.4.6 IV Bit an integer overflow trap When set, the IV (integer overflow) bit forces ed an integer result that produc which ction after execution of an instru IV is <clear, no integer When overflowed or had a conversion error. the condition code V bit is still set.) overflow trap occurs. 2.4.7 FU (However, Bit a floating underflow When set, the FU (floating underflow) bit forces ction is too small in instru point ng fault if the result of a floati When FU is clear, no nd. opera t resul the in magnitude to be represented underflow fault 2.4.8 occurs. DV Bit l overflow trap When set, the DV (decimal overflow) bit forces a decima lowed decimal overf an ced produ after execution of an instruction which rsion error. conve a had or t resul al) (numeric string, or packed decim When DV is clear, no trap occurs. still set.) (However, the condition code V bit is Basic Architecture PERMANENT 2.5 29-Feb-80 EXCEPTION Rev 6 Page 2-19 PERMANENT EXCEPTION ENABLES The processor by bits in action the on PSW. 2.5.1 Divide By certain Traps conditions. A -- ENABLES or exception faults conditions always result is not from controlled these exception Zero divide by zero trap is forced after the execution of integer, or division 1instruction which has a zero diviso r. A fault occurs floating division instruction which has a zero divisor. decimal on a 2.5.2 A Floating floating point the overflow instruction result 2.6 Overflow fault which is forced produced a operand. after the execution result too large to of be a floating represented in INSTRUCTION FORMAT VAX-11 has specifies a termed an bytes long. access the An format an a n and Depending operand operand by 1length operation opcode. followed of wvariable an and to on may be 1 instruction format. § An operands. the specifier specifier operand 0 or instruction indicates the 2 An extension, instruction bytes. an address, An operation the opcode 1is addressing operand or instruction specifier 1 mode specifier immediate is or 2 used to may data. is: be The opcode operand specifier specifier operand specifier 2 operand specifier n specifier See for all Chapter a 1 extension, 3 for definition operands, extension, a full of the address, or immediate data 1 (i1f needed) address, or immediate data n (if needed) description of instructions. instructions, and their addressing See binary modes. Appendix A for assignments. See a Chapter summary 4 of Page 2-20 29-Feb-80 -- Rev 5 Basic Architecture SEPARATION OF PROCEDURE AND DATA 2.7 DATA ON URE AND PROCEDTI OF RA SEPA The VAX-11 architecture encourages (and provides the mechanisms to facilitate) separation of procedure (instructions) and writablde data. an Procedures may not write data which is to be subsequently execute as(Sece d execute being tion instruc instruction without an intervening REI Chapter 6) or an intervening context switch occurring (See Chapter 7). 1f no REI or context switch occurs between a procedure writing data as instructions to be executed, and those instructions being executed, the instructions executed are UNPREDICTABLE. 2.8 1/0 STRUCTURE PDP-11l. Generally, the VAX-11 1/0 structure closely follows that of the rs. The registe of set a by defined 1is ler An I/0 device <control space. address l physica the in es address d assigne registers are Commands are 1issued to I/0 controllers by the processor writing these the registers; controllers return status by writing these registers and memory have rs registe the Since them. reading ently processor subsequ I/0 addresses, ordinary instructions can read or write them; no special sm mechani ent managem memory normal The are needed. instructions controls access to device controller registers. 2.9 INTERRUPT STRUCTURE A VAX-11 processor provides system. a 32 level vectored This is described in detail in Chapter 5. priority interrupt CHAPTER 3 INSTRUCTION FORMATS AND ADDRESSING MODES 5-May-80 3.1 An -- Rev 7 OPCODE FORMATS instruction is specified 7 by the byte address A of its opcode: 5] o -+ | opcode | :A Fom - + The opcode of the (hex) may byte through extend at FF over address (hex) A. is 2 bytes; 1If, the the and only opcode 2 length if, bytes the depends value long: on of the the contents byte is FC OPERAND 3.2 Page 3-2 5-May-88 -- Rev 7 Instruction Formats and Addressing Modes SPECIFIERS OPERAND SPECIFIERS Fach instruction takes a specific sequence of operand specifier types. An operand specifier type conceptually has two components: the access the type and The access data types type. include: 1. Read - the specified operand is read only. 2. Write - the specified operand is written only. 3. Modify - the specified operand is read, 4. Address - the address of the specified operand in the form of a longword is the actual instruction operand. The specified operand is not accessed directly although the instruction may and written. potentially modified, This is not done under a memory interlock. subsequently use the address to access that operand. 5. Variable bit field base address - same as address except for register mode. register In access type mode, the field is contained in register n designated Dby the operand specifier (or register n+l concatenated with register n). This access type is a special variant of the address access type. 6. Branch - no operand is accessed. is a branch displacement. The operand specifier itself ed in Types 1 - 5 are termed dgeneral mode addressing and ingareand discuss ed discuss is address mode branch Type 6 is termed Section 3.4. 3.6. in Section The data types 1. Byte 2. Word 3. Longword and F floating which are 4. OQuadword, and D floating and G floating 5. Octaword and H floating which are also similarly equivalent. mode include: equivalent for addressing which are similarly considerations. equivalent. For the address and branch access types which do not directly operands, 1. the data type indicates: reference address Address - the operand size to be used in the modes. index and rement, autodec rement, autoinc in tion calcula Instruction OPERAND 2. Formats SPECIFIERS Branch - and the Addressing size of the Modes 5-May-80 branch displacement. -- Rev 7 Page 3-3 5-May-80 -- Rev 7 Instruction Formats and Addressing Modes Page 3-4 NOTATION 33 NOTATION To describe the addressing modes the following is used: + - addition Rn or R[n] - the contents of register n - * <~ = PC or SP - subtraction multiplication is replaced by is defined as concatenation - the contents of register 15 or 14 respectively NOTE formal In the addressing modes the of descriptions Rn or PC, for example, always means the contents of register n or register 15. When there is no ambiguity, Rn or PC, for example, is often wused in text as the name of register n or register 15. (%) - the contents of a location in memory { 1 - arithmetic parentheses used SEXT (x) - x is sign extended to size ZEXT (%) - x is zero extended to size 0A - operand address ! - comment delimiter whose address 1is x. to indicate precedence of operand needed of operand needed es the definition of the Each general mode addressing description includ For operand specifiers of d. operan operand address, and the specified the actual instruction is s addres d operan address access type, the ied operand 1is the specif the types access other for operand; description includes sing instruction operand. The branch mode addres the definition of the branch address. Instruction GENERAL 34 Formats MODE and Addressing ADDRESSING Modes 5-May-80 FORMATS -- Rev 7 Page 3-5 GENERAL MODE ADDRESSING FORMATS 3.4.1 Register The operand No specifier In register (or and Mode specifier extension mode register certain format the concatenated field operand follows. addressing n+l is: operand with operands): = is the register n Rn contents for of register n D floating, quadword, !1f one register !if two registers 'if four or R{n+1] "Rn or R{n+3]'R[n+2]'R[n+1]'Rn Because not registers defined, address bit access field mode and type fault results If the an operand have (See is Likewise, SP takes register mode for used adjacent is takes if SP takes The 4 is 4 contents register mode registers, R13 write for a Rf used in adjacent assembler for PC may not read is be the the used be type operand are type register mode If R12, which is 1is addressing it is, the PC is used in 2 R13, which 1If mode PC if takes operand 1If specified If UNPREDICTABLE. contents a of write contents register register Again, which operand variable addressing adjacent SP, takes PC requires is 4 or PC four used in adjacent and R2 are UNPREDICTABLE. Likewise, a write access type operand which for for in operand fashion. an for illegal used next UNPREDICTABLE. for is of UNPREDICTABLE. in same address specifiers address an registers. the R1l, the mode registers, notation is, not results access registers, register base it or operand operand the value are the contents of RO, used in register mode adjacent of adjacent in for If addressing the write may the used 4). 6). access of mode registers, register if the in case be executed two UNPREDICTABLE a the the instruction which not Chapter read, addresses, may Chapter are registers, in see results are memory mode (except PC next UNPREDICTABLE. for not instructions, addressing. written, do register registers mode RO are access of R¢ is Rn. and UNPREDICTABLE; type Rl are operand and, which UNPREDICTABLE. 5-May-80 -- Rev 7 Instruction Formats and Addressing Modes GENERAL MODE ADDRESSING FORMATS 3.4.2 Page 3-5 Register Deferred Mode The operand specifier format is: No specifier extension follows. In register deferred mode addressing, the address of the operand contents of is the register n: = Rn 0A (0A) = operand addressing. If it is, the PC may not be used in register deferred mode of operan address of the operand (and whether the E. d is written if it is modify or write access type) is UNPREDICTABL The assembler notation for register deferred mode is (Rn). 3.4.3 Autoincrement Mode The operand specifier format is: 2 3 4 7 fmm——— - + I 8 | o t-—m Rn | -+ No specifier extension follows. 1f Rn denotes follows, and the mode is termed immediate mode. PC, immediate data address of the operand is, the In autoincrement mode addressing, the address 1s determined the opera contents of register n. After thebyte; nd word; 4 for 1longword for 2 for (1 size of the operand in bytes 16 for G floating and D floating; and and F floating; 8 for quadword, the and n ter regis of ents cont To the octaword, and H floating )is added ced by the result: contents of register n is repla Rn OA = Rn <- Rn + operand = size (OA) modify or write access Immediate mode may not be used for operands of nd opera of modify access type, 1f immediate mode is used for an type. DICTABLE. 1f immediate mode is used the value of the data read is UNPRE Instruction Formats GENERAL MODE for operand an operand The is assembler which follows. No extension and the In autoincrement the contents After the longword contents of of which for access it is format mode where is OA = (Rn) Rn <- Rn mode follows. + = n If Rn 7 address Page at 3-7 which the UNPREDICTABLE. (Rn) +. constant denotes absolute mode addressing, is Rev is For the immediate immediate data is: termed longword the is -- Mode follows. is type, written) autoincrement I"kconstant deferred register assembler absolute 5-May-8¢ whose address PC, replaced by the a mode. the is address the operand address is determin ed, 4 (the address) is added to the contents operand The mode a write Deferred specifier specifier follows, or whether is Autoincrement Modes FORMATS (and notation operand Addressing modify notation the The of written mode 3.4.4 and ADDRESSING result: longword of contents size of address the operand is of register n. in bytes of a register n and the 4 (0A) notation the for autoincrement notation is deferred mode is @(Rn) +. @faddress where address is the long For word Instruction Formats and Addressing Modes GENERAL MODE ADDRESSING FORMATS 3.4.5 5-May-89 -- Rev 7 Page 3-8 Autodecrement Mode The operand specifier format is: No specifier extension follows. (1 of the operand 1in bytes addressing, the size In autodecrement mode word, gquad for 8 ; longword and F_floating for byte; 2 for word; 4 for H floating )is 16 for octaword, and ents and ; ting floa G _floating and D of register cont the and n contents of register subtracted from the n is the ster regi of ents cont ted upda The t. n are replaced by the resul address of the operand: <- Rn Rn OA = - size Rn operand = (OA) the ent mode. If it is, the addrefyss orof writ PC may not be used in autodecrem modi of operand is written if it is n executed or thee operand (and whether the BLE the next instructio access type) is UNPREDICTA UNPREand DICTABLE. next operand specified 1is The assembler notation for autodecrement mode 1is -(Rn) . Instruction GENERAL 3.4.6 There The are extension extension extension register to n OA and = Rn 5-May-83 -- Rev 7 Page 3-9 signed termed a termed a is if result word longword is is displacement, word) operand which which displacement displacement or is follows the follows the mode. displacement, the which mode. displacement longword byte the displacement, displacement word termed it byte byte signed is is formats: addressing, bits the is This mode 32 a is This specifier. displacement is This specifier. extended Modes FORMATS specifier specifier. specifier Addressing Mode operand specifier operand In 3 specifier operand The and ADDRESSING Displacement operand The Formats MODE follows (after added to the mode. being the sign contents of address: + SEXT(displ) !1f byte Rn + displ !'i1f longword operand = (0A) of PC or word displacement or If Rn denotes contents of PC, the updated PC is the contents address of byte, word, the first extension. The assembler B"D(Rn), notation W'D (Rn), and for L"D(Rn) and displacement is used. byte beyond long respectively where The the displacement D = displ. updated specifier mode is Instruction Formats and Addressing Modes GENERAL MODE ADDRESSING FORMATS 3.4.7 Displacement There are 3 operand Deferred 5-May-8¢ -- Rev 7 Page 3-19 Mode specifier formats: The specifier extension is a signed byte displacement, which follows the operand specifier. This is termed byte displacement deferred mode. the The specifier extension is a signed word -displacement, whichd follows mode. deferre ement displac word termed is This er. operand specifi the The specifier extension is a longword displacement, which follows mode. d deferre ement displac operand specifier. This 1is termed longword In displacement deferred mode addressing, the displacement (after being the contents sign extended to 32 bits if it is byte or word) is added towhose contents d longwor a of address the of register n and the result is is the operand address: 1if byte or word displacement OA = (Rn + SEXT (displ)) or 1if longword (Rn + displ) operand = displacement (OA) The updated If Rn denotes PC, the updated contents of the PC is used. specifier the beyond byte first the contents of PC is the address of extension. The assembler notation for byte, word, and longword displacement deferred mode is @B"D(Rn), @W'D(Rn), and @L"D(Rn) respectively where D = displ. Instruction GENERAL 3.4.8 The Formats MODE Literal operand specifier For operands is of data zero operand = for these data range @ through 53. operands where used exp to of the is form -- Rev byte, word, of the longword, 6-bit quadword, literal 3-11 types, data literal type literal and F_floating fra or mode may F_floating, field is is be used for G floating, composed fraction. D floating 4 i 7 L 101 of The 2 exp operand as 6 4 3 wvalues the D 128 + exp | fra | T | and | | | :A+2 + 0 | A :A+4 + | Y | o __ + are not present in a F_floating floating, and fra T pup— + Y] Fo the follows: + 0 in 3-bit a T T tmm R Fob o e 63:32 octaword field: 11 bits Page follows. type 6-bit 5 where 7 is: extension exponent a 5-May-88 ZEXT(literal) Thus For Modes FORMATS format extension the H_floating, Addressing Mode specifier No operand and ADDRESSING :A+56 operand. fields: fields are 5-May-8¢ -- Rev 7 Instruction Formats and Addressing Modes GENERAL MODE ADDRESSING FORMATS Page 3-12 The exp and fra fields are used to form a G _floating operand as follows: 11 1 0 4 3 5 4 fopm e NRSE— +—+ fra | 1024 + exp 19| 0] U S b +—+ l 4] l Y | 0 | :A+2 | :A+4 o+ e + :A+6 | — -+ o The exp and fra fields are used to form a H floating operand as follows: 1 1 9] 5 4 + — oo 16384 + exp |2 bodom o | fra | mmmmm o) | e ——mm—— = + | :A+2 Se+ | Y | :A+4 l @ | :A+45 | 0 | :A+8 l 0] | :A+10 | 4] | :A+12 | 4 | :A+14 S+ S+ + m——— e mm—— + o + — oe — -+ o The range of values available is given in the following table: E F -=> I \Y g 1 2 3 4 5 6 7 Y 1 2 3 4 5 6 7 1/2 1 2 4 8 9/16 1 1/8 2 1/4 4 1/2 9 5/8 1 1/4 2 1/2 5 10 11/16 1 3/8 2 3/4 5 1/2 11 3/4 1 1/2 3 6 12 13/16 1 5/8 3 1/4 6 1/2 13 7/8 1 3/4 3 1/2 7 14 15/16 1 7/8 3 3/4 7 1/2 15 16 32 64 18 36 72 22 44 88 20 40 80 Table 1. 24 48 96 26 52 104 Floating Literals 28 56 112 30 50 120 Instruction Formats GENERAL MODE Because there used for addressing modify either is no not If modify, (see mode Table Literal the mode The notation Index operand Bits 15:8 5-May-80 for access is -- type, a very 43 PC efficient and the the type. literal is specifier format contain a for any index. The specification results in an second of of specifiers operand illegal way addressing of specifying point constants range may be apply specifier addressing of modes register, addressing if it were (termed except literal, mode used alone. (i.e., causes specifier 1is under some circumstances, base operand operand illegal specifier to be then in that index specified address size (BOA). of longword and 16 by or fault the base register, index (see for OA If the base BOA + = or and {size Chapter a the use of 6). specifier is similarly index mode same 8 particular behavior) illegal as a circumstances. addressing 1is termed the used normally to the base operand operand specified 1is for quadword, H floating), * the restrictions some UNPREDICTABLE the 1If immediately or under or mode adding D floating BOA, and and taking the for G floating; the result: (Rx)} (0OA) operand increment operand. in by operand literal of the primary the contents of the index register x by operand in bytes (1 for byte; 2 for word; 4 F_floating; octaword, = integer given addressing operand specifier 1is This address is termed address primary operand the The 1If multiplying the and mode obtained fault mode by primary operand. The base determine an operand address. determined or of S"#literal. operand specifier requires a specifier extension, it follows. The base operand specifier is subject to the same The write is: operand the 1illegal base would be mode Mode specifier) as not Literal mode) . mode may 3-13 for floating (immediate Page specifiers an indicated 7 addressing access used Rev 6). outside for mode operand write to using literal address mode is 9 values autoincrement assembler used or range of literal Chapter addressing in The be type. constants 3.4.9 address, may address, 1. operand also Modes FORMATS specifiers results Literal Addressing operand access fault and ADDRESSING specifier decrement is for size autoincrement 1is the size in or autodecrement bytes of the mode primary Instruction Formats and Addressing Modes GENERAL MODE ADDRESSING FORMATS 5-May-80 -- Rev 7 Page 3-14 Index mode addressing permits very general and efficient accessing of The base address of the array is determined by the operand arrays. s of the address caculation of the base operand specifier. The contentThe logical array. the into index logical a index register is taken as contents the ing multiply by offset (byte) real a into d converte index is of the index register by the size of the primary operand in bytes. Certain restrictions are placed on the index register x. PC cannot be fault used as an index register. 1If it is, a reserved addressing 1ismode an -for er specifi 1f the base operand occurs (see Chapter 5). register modification (i.e. in results which mode addressing autoincrement deferred mode), or mode, t cremen autoincrement mode, autode er. If it is, the primary regist index the be cannot er regist the same operand address is UNPREDICTABLE. addressing The names of the addressing modes resulting from index mode of the mode ing address the to d" are formed by adding the suffix "indexe er assembl and names the gives ng followi base operand specifier. The from it uish disting to Rx ted designa is r registe 1index The notation. the register Rn in the base operand specifier. 1. register deferred indexed - 2. autoincrement indexed - (Rn) [Rx] (Rn)+([Rx] by or immediate indexed - I #constant[Rx] which is recognized the that Note useful. lly genera the assembler but 1is not t. operand address is independent of the value of constan 3. autoincrement deferred indexed - @(Rn)+[Rx] or absolute indexed - @kaddress([Rx] 4. autodecrement indexed - -(Rn) [Rx] 5. byte, word, byte, word, 5. or longword BTMD (Rn) [Rx],W D (Rn) [Rx], or displacement or L"D(Rn) [Rx] longword displacement [Rx], or @L D (Rn) [Rx] (Rn)W"D @B"D (Rn) [Rx],@ deferred indexed - indexed - Instruction SUMMARY 3.5 Formats GENERAL and Addressing MODE ADDRESSING Modes 5-May-80 -— Rev 7 Page 3-15 SUMMARY OF GENERAL MODE ADDRESSING 3.5.1 Hex OF General Dec Register Addressing Name Assembler PC SP AP& Index- autoincrement deferred + @(Rn) A 10 byte displacement B”D (Rn) B 11 byte displacement deferred C 12 word displacement D 13 word displacement @W"D (Rn) deferred E 14 F 15 longword displacement longword displacement deferred @B"D (Rn) WTMD (Rn) M 9 el o 9 + (Rn) s autoincrement KX 8 (Rn) - (Rn) L L autodecrement 8 deferred MK register LS 6 7 e 6 7 i[Rx] M Rn M register KKK KX 5 MK KX 5 < literal indexed S"#literal 4 MK KK @-3 4 < g-3 N able £ Y u u u u Y Y u Y Y Y Y Y p p Y Y p Y Y p Y Y p Y Y LAD(Rn) p Y Y p Y Y @L "D (Rn) P Y Y Instruction Formats and Addressing Modes Page 3-15 5-May-80 -- Rev 7 SUMMARY OF GENERAL MODE ADDRESSING Program Counter Addressing 3.5.2 4 7 3 21 (reg=15) 9 t—t—t—t—+ T 11 mode | 1 1 1} fom $—t—+-+-+ Hex Dec 8 8 Assembler rmwea v PC SP immmediate I"#constant y uuyy - - y W~ address @W " address VY VY YY VYV VYY - - y Y L"address vV YYVYY - - y 9 A B 9 10 11 absolute byte relative byte relative C D 12 13 word relative word relative E 14 C#address BT address @B~ address deferred deferred long word relative long word relative 15 @L "address Y YVYYY vV YV Y Y Y VY Y Y Y vV VYYVYY - - - - deferred o o rh - 1 O Key - to 3.5.1 and 3.5.2 displacement any indexable addressing mode logically impossible reserved addressing mode fault Program Counter addressing UNPREDICTABLE Cc q - UNPREDICTABLE for quad, octa, D floating, G_floating, and H floating (and field if position + size greater than 32) uo - UNPREDICTABLE for octa, and H format o x - UNPREDICTABLE for index register same yes, always valid addressing mode - read access - access | <o £ 3 F Indexable? Name modify - Wwrite - address access field access - access as base register Y Y y Y Instruction Formats BRANCH ADDRESSING MODE and Addressing Modes 3.6 BRANCH MODE ADDRESSING FORMATS There are The In 2 operand branch extended operand is displacement to 32 bits updated contents operand specifier. A specifier specifier = PC + of PC The a -- REV 7 PAGE word addressing, and is added the 3-17 formats: signed is displacement. the byte to the address result the of or word updated the branch displacement contents first address byte is sign PC. The beyond the of A: SEXT (displ) The assembler is notation for A A branch not the where 5-MAY-8( FORMATS is the displacement is byte used. and word address. branch Note displacement that the branch addressing address and Page 3-18 5-May-8¢ -- Rev 7 Instruction Formats and Addressing Modes OPERAND SPECIFIER CONVENTIONS 3.7 OPERAND SPECIFIER CONVENTIONS The following 3 steps are performed by each instruction: 1. operand FEach is occurrence specifier treated as of order 1in follows: stream instruction a. If read access type: evaluate the operand address, b. 1If write access type: evaluate the operand address c. If modify access type: d. 1If address access type: e. If branch access type: the operand, read save and and save it. 1it. evaluate the operand address and save it; read the operand and save it. save evaluate the address and 1it. save the operand specifier. 2. Perform the operation indicated by the instruction. 3. Store the result(s) using the saved addresses 1in the order indicated by the occurrence of operand specifiers in the instruction stream. NOTE packed and zoned decimal, (character, The string and 3. instructions are an exception to 2. decimal) the before stored in that partial results are instruction operation 1is completed. The variable bit field instructions treat the position, size, and base address operand specifiers as the specification of an If implied field operand specifier (see Appendix A). order the 2., and 1. during occur ons excepti multiple in which they are taken for occur, example, in whose destination operand type 1. UNPREDICTABLE. This can a floating point instruction specifier of write access uses a reserved addressing mode and the operation results ications of is in an overflow fault. these conventions are: Autoincrement and autodecrement operations occur as the operand specifiers are processed, and subsequent operand specifiers use the updated contents of registers modified by those operations. Instruction OPERAND 2. Formats SPECIFIER Other and Addressing than as indicated by of operands all addresses the instruction An operand written type of as If an by the output are stored. modify access an operands synchronization access Modes CONVENTIONS indivisible cannot at second. type be references the same all input used See two address, -- Rev operands 7 Page 3-19 are computed read, before any results is read, modified, therefore, modify operation; instructions, instruction type 1, 5-May-80 for not synchronization, Chapter 8.) operands of the first write will be or and of and access (For modify overwritten CHAPTER 4 INSTRUCTIONS 12-Feb-82 4.1 -- Rev 7 INSTRUCTION SET This chapter across describes all instructions which architecture process the instructions implementations are specific (e.g., dispatching, memory and of to the generally VAX-11 specialized management, processor registers) software portions 1in the the architecture. A concise appears in Appendix A. list of assignments 4.1.1 instruction all software Certain portions and are of set is 1. 1Integer 2. Address 3. Variable 4, Control 5. Procedure 6. Miscellaneous 7. Queue 8. Floating Character divided arithmetic length call point string bit and into 12 logical field major of and VAX-11 exceptions, used describing instructions sections: the generally chapters Descriptions \Ne) The 1Instruction described by interrupts privileged are used architecture. and by those opcode Instructions INSTRUCTION SET Redundancy 19. Cyclic 11. Decimal 12. Edit Check string Within each major section, instructions which are into groups and described together. combined description is composed of the following: 1. 2. Page 4-2 12-Feb-82 -- Rev 7 The group closely related are The instruction group name. This gives the The format of each instruction in the group. name and type of each instruction operand specifier and the order in which it appears in memory. Operand specifiers from left to right appear in increasing memory addresses. the instruction. 3. The operation of 4, The effect on condition codes. 5. Exceptions Exceptions specific to the instruction. (e.g., ns instructio all for generally possible reserved addressing mode, T-bit, memory management etc.) are not which are 1illegal or violations, 1listed. instruction in 6. The opcodes, mnemonics, and names of each 7. A description in English of the instruction. 8. Optional notes on the instruction and programming examples. group. The opcodes are given in hex. the Instructions INSTRUCTION 4.1.2 12-Feb-82 Operand Operand -- SET Specifier specifiers are 7 Page 4-3 Notation described <name>.<access Rev in type><data the following way: type> where: 1. Name is a suggestive instruction. 2. Access type name a letter is type: a - name The for is the often denoting Calculate the operand. Address operand the effective is which in operand address returned of is the actual instruction address calculation is given i.e. size to be used and No operand Operand Note reference. by is that <data read, this operation. Also is the operand. If address operand. the Rn Context <data in type>; autoincrement, an if the be written letter b - byte d - D floating written. are always operand accessability address effective returned in address written only. denoting the of address a is R[n+l]'Rn. is and not operands a memory that effective the is modified indivisible may write is displacement is not back. checked (See only. effective or Operand a by branch data the is specified in longword is the actual instruction address calculation is given in is it type and read Calculate If type note modify which Data NOT However, of access specified specifier of potentially is modified, Operand Size Rn, operand. by <data the type the longword type>. actually for both read Chapter 5). 3. Operand displacement. given the the a of indexing. branch is context specifier in of autodecrement, the abbreviated. of memory, Context type>. operand the is operand: Instructions INSTRUCTION 12-Feb-82 -- Rev 7 Page 4-4 SET f - F floating g - G _floating h - H floating 1 - longword o - octaword g - quadword w - word x - first data type specified by instruction y - second data type specified by instruction 4.1.3 Operation Description Notation given as a sequence of control and The operation of each instruction is -like to syntax. No attempt is made r. ALGOL assignment statements in an reade the to iar famil be to ed assum is it define the syntax formally, that introduced in Chapter 3. The notation used is an extension of - + addition - - subtraction, unary minus * — multiplication / - division (quotient only) **x - exponentiation - concatenation ' <- = - is replaced by is defined Rn or R[n] as - contents of register Rn pCc, SP, FP, or AP - the contents of register R15, R14, or R12 respectively PSW - the contents of the processor status word PSL - the contents of the processor status long word (x) - contents of memory location whose address is X R13, Instructions 12-Feb-82 INSTRUCTION (x)+ - contents X -(x) - X - decremented X; a modifier <x1,%x2,...,xn> - } - arithmetic AND - logical - logical parentheses used EQL NEQ - GTR GTRU than not - - greater greater - greater SEXT(X) - x REM(x,y) - x - bit enumerates to bits x1,x2,...,xn indicate precedence unsigned or equal or signed equal unsigned is unsigned than or than than equal or equal is signed unsigned signed than unsigned sign extended to sigze of operand extended to size of operand y, such zero remainder REM(x,y) of have x divided the same by x inclusive complement needed ZEXT (x) from is signed equal greater - address unsigned equal not referenced signed equal - GEQU than equal be whose extent y X; signed than less - NEQU GEQ less - EQLU than less to is 4-5 referenced OR (ones) less an position address operand AND logical - whose location delimits bit Page operand which - LEQU of memory modifier NOT - size of a XOR LEQ by 7 of to logical - size which - LSSU the x XOR LSS location by contents position OR memory Rev x at <X:y> of incremented at { -- SET sign needed that x/y and Instructions INSTRUCTION 12-Feb-82 -- Rev 7 Page 4-6 SET MINU (x,y) - minimum unsigned of x and Yy MAXU (x,y) - maximum unsigned of X and vy The following conventions are used: 1. ement of Other than that caused by ( )+, or —( ), and the advanc the left on ing appear ds PC, only operands or portions of operan side of assignment statements are affected. ement No operator precedence is assumed, other than that replac ted indica 1is ence Preced ence. (<-) has the lowest preced explicitly by { }. are defined All arithmetic, logical, and relational operators applied to "+" e exampl For ds. operan their of t contex in the d to applie "+" floating operands means a floating add while is a "LSS" rily, Simila add. byte byte operands 1is an integer while ds operan ng floati to d applie when floating comparison "[LSS" is an integer byte comparison when applied to byte operands. d Instruction operands are evaluated according to the inoperan which order The specifier conventions (See Chapter 3). operands appear in the instruction description has no effect on the order of evaluation. Condition codes are in general affected on the value of actual be generated stored results, not on "true" results (which might 2 example, for Thus, ion). precis r greate to internally , stored sum the and er togeth positive integers can be added because of overflow, as a negative value. The condition codes will indicate a negative value even though the "true" result 1is clearly positive. Instructions INTEGER 4.2 The 12-Feb-82 ARITHMETIC AND LOGICAL -- Rev 7 Page INSTRUCTIONS 4-7 INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS following instructions are described in this section. Instructions —— Add Aligned Word ADAWI add.rw, Add Operand 2 ADD{B,W,L}2 Add 3 add.rx, With ADWC addl.rx, Arithmetic Shift Clear 2 Clear 3 BIC{B,W,L}3 Bit Set 2 Operand mask.rx, Bit dst.wx dst.wx Test mask.rx, src.rx Clear dst.wx Compare srcl.rx, src2.rx Convert All pairs except src.rx, dst.wy BB,WW,LL. Decrement DEC{B,W,L} 15, src.rx, src.rx, Cvr{B,w,L}{B,W,L} 14, dst.mx Bit Set 3 Operand BIS{B,W,L}3 mask.rx, CMP{B,W,L} 13, Operand mask.rx, dst.mx CLR{B,W,L,Q} 12, dst.wx mask.rx, BIT{B,W,L} 11, src.rx, Operand BIS{B,W,L}2 19, sum.wx sum.ml cnt.rb, BIC{B,W,L}2 Bit add2.rx, Carry add.rl, ASH{L,Q} Bit sum.mx Operand ADD{B,W,L}3 Add sum.mw Divide 2 dif.mx Operand DIV{B,W,L}2 divr.rx, quo.mx - —— — — —— 12-Feb-832 -- Rev 7 Instructions AL INSTRUCTIONS LOGIC AND INTEGER ARITHMETIC Operand 3 16. Divide 17. Extended Divide 18. EMUL mulr.rl, muld.rl, add.rl, prod.wq 19. Increment 20. 21. quo.wX Extended Multiply sum.mx INC{B,W,L} Move Complemented MCOM{B,W,L} Move Negated MNEG {B,W,L} Move 23. Move 25, divd.rx, EDIV divr.rl, divd.rg, quo.wl, rem.wl 22. 24. divr.rx, DIV{B,wW,L}3 src.rx, dst.wXx src.rx, dst.wx MOV {B,W,L,Q} src.rx, dst.wx Zero-Extended MOVZ {BW,BL,WL} src.rx, dst.wy Multiply 2 Operand MUL{B,W,L}2 mulr.rx, prod.mx Multiply 3 Operand MUL{B,W,L}3 mulr.rx, muld.rx, prod.wX Long 25. Push 27. Rotate 28, Add Aligned Word 29. Subtract With Carry PUSHL src.rl, Long ROTL cnt.rb, SBWC sub.rl, {-(SP).wl} src.rl, dst.wl dif.ml 30. Subtract 2 Operand 31. Subtract 3 Operand sUB{B,wW,L}2 sub.rx, dif.mx SUB{B,W,L}3 sub.rx, min.rx, dif.wx Test TST{B,W,L} src.rx Exclusive OR 2 Operand XOR{B,W,L}2 mask.rx, dst.mx Page 4-8 Instructions INTEGER 34. 12-Feb-82 ARITHMETIC AND Exclusive OR XOR{B,W,L}3 LOGICAL 3 -- Rev 7 INSTRUCTIONS Operand mask.rx, src.rx, dst.wx Page 4-9 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS ADAWI Add Aligned Word Interlocked opcode add.rw, Page 4-19 Format: sum.mw Operation: tmp <- add; sum <- sum {set interlock}; {release + tmp; interlock}; NN =2 Condition Codes: {- sum LSS 0@; <- sum EQL @; <- {integer overflow}; <- {carry from most significant bit}; Exceptions: reserved operand integer fault overflow Opcodes: ADAWI 58 Add Aligned Word Interlocked Description: the sum operand 1is The addend operand is added to the sum operand and ocked against similar interl is ion operat replaced by the result. The The or system. operations on other processors in a multiprocess the of @ bit i.e. ry a word bounda destination must be aligned on zero. ed reserv a not, 1is it If be address of the sum operand must operand fault is taken. Notes: 1. have Integer overflow occurs if the input operands to the add On sign. te opposi the has result the same sign and the of bits order low the by ed replac is d operan sum overflow, the the 2. true result. 1f the addend and the sum operands overlap, the result and condition codes are UNPREDICTABLE. the Instructions INTEGER 12-Feb-82 ARITHMETIC ADD AND LOGICAL -- Rev 7 Page INSTRUCTIONS 4-11 Add Format: opcode add.rx, opcode addl.rx, sum.mx add2.rx, sum.wx 2 operand 3 operand Operation: sum <- sum sum <- addl No<<N 2 Condition + add; + add2; !2 operand !3 operand Codes: <- sum LSS @; <{- sum EQL @; <<- {integer overflow}; {carry from most significant bit}; Exceptions: integer overflow Opcodes: 80 ADDB2 Add Byte 2 Operand 81 ADDB3 Add Byte 3 Operand AQ Al ADDW2 ADDW3 Add Add Word Word 2 Operand 3 Operand Co ADDL2 Add Long 2 Operand Cl ADDL3 Add Long 3 Operand Description: In 2 the operand sum addend 1 replaced format, operand operand by the the 1is is addend operand replaced added to by the the is added result. addend 2 to 1In operand result. the 3 and sum operand operand the sum and format, the operand is Notes: Integer sign is overflow occurs if the input and the result has the opposite replaced by the low order bits of operands sign. the On true to the add overflow, result, have the the sum same operand Page 4-12 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Add With ADWC Carry Format: sum.ml add.rl, opcode Operation: sum aO< N 2Z Condition sum + <- add + C; Codes: <- sum LSS @; {- sum EQL @; <- overflow}; {integer <- {carry from most significant bit}; Exceptions: integer overflow Opcodes: ADWC D8 Add With Carry Description: operand are the result. by added to the sum operand and the sum operand 1s replaced The contents of the condition code C bit and the addend Notes: 1. On overflow, the sum operand is replaced by the low order of 5. the true bits result. The 2 additions in the operation are performed simultaneously. Instructions INTEGER 12-Feb-82 ARITHMETIC ASH AND LOGICAL Arithmetic -- Rev 7 Page 4-13 INSTRUCTIONS Shift Format: opcode cnt.rb, src.rx, dst.wx Operation: dst Condition <- src shifted cnt bits; Codes: N <- dst LSS g; Z <- dst EQL 32; V <- {integer C <- @; overflow}; Exceptions: integer overflow Opcodes: 78 ASHL Arithmetic Shift 79 ASHQ Long Arithmetic Shift Quad Description: The source specified by the operand is by count the result. The arithmetically operand source operand to A operand shifts to (sign) bit into most signficant operand replaces the the left bringing by the destination into right the A in the bits replaced count significant significant with of is positive least bringing most operand the number operand unaffected. #s the destination operand. the is operand shifts negative count shifted and copies bit. of A unshifted @ bit, the count source Notes: 1. Integer the overflow sign occurs bit position 32 (ASHL) on a left differs operand. 2. If cnt GTR operand 3. If cnt is LEQ destination operand. replaced -31 or by (ASHL) operand cnt shift from GTR 64 if the any sign bit bit (ASHQ) the 0. or are cnt LEQ -63 copies of (ASHQ) the all sign shifted of into source destination the bit the of bits the of the source 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Bit BIC Page 4-14 Clear Format: opcode mask.rx, dst.mx opcode mask.rx, src.rx, 2 operand dst.wx 3 operand Operation: dst <- dst AND {NOT mask}; !12 operand dst <- src AND {NOT mask}; 13 operand Condition Codes: <- dst LSS 0; dst 0; EQL @; V <<- C K- C; N Z Exceptions: none Opcodes: 8A 8B AA AB CA CB Byte Byte Bit Clear Word BICB2 BICB3 BICW2 Bit Clear Bit Clear BICL2 BICL3 Bit Clear Bit Clear BICW3 Bit Clear Word Long Long Description: is ANDed with the ones on operand is replaced destinati the and operand mask the of t complemen by the result. In 3 operand format, the source operand 1is ANDed with the ones complement of the mask operand and the destination operand is In 2 operand format, the destination operand replaced by the result. Instructions INTEGER 12-Feb-82 ARITHMETIC BIS AND Bit LOGICAL -- Rev 7 Page INSTRUCTIONS 4-15 Set Format: opcode mask.rx, dst.mx opcode mask.rx, src.rx, dst.wx 2 operand 3 operand Operation: <- dst OR mask; !2 operand dst <- src OR mask; !3 operand Codes: a<gN 2 Conditon dst <- dst LSS @; <{- dst EQL 0; <- 0; <= C; Exceptions: none 88 BISB?2 Bit Set Byte 89 BISB3 Bit Set Byte A8 BISW2 Word BISW3 Bit Bit Set A9 Set Word Cc8 BISL2 Bit Set Long C9 BISL3 Bit Set Long W N W WwWN Opcodes: Operand Operand Operand Operand Operand Operand Description: In 2 operand operand operand and format, the format, destination the operand the mask operand destination mask is operand replaced 1is operand is by is ORed the ORed destination replaced with result. the by the source result. operand and 1In 3 the 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Bit BIT Page 4-16 Test Format: mask.rx, opcode src.rx Operation: tmp src <- AND mask; Codes: Conditon LSS tmp EQL tmp N <- Z <- vV <- 8; C K- C; 9; @; Exceptions: none Opcodes: 93 B3 D3 BITB Bit Test Byte BITL Bit Test Long BITW Bit Test Word Description: Both operands The mask operand is ANDed with the source operand. codes. on conditi affect to is action only The unaffected. are Instructions INTEGER 12-Feb-82 ARITHMETIC CLR AND LOGICAL -- Rev 7 Page INSTRUCTIONS Clear Format: opcode dst.wx Operation: dst Condition <- @; Codes: N <- Z <- 1; V <- 0; C <= C; 0; Exceptions: none Opcodes: 94 CLRB Clear Byte B4 CLRW Clear Word D4 CLRL Clear Long 7C CLRQ Clear 7CFD Quad CLRO Clear Octa Description: The destination operand is replaced by 4. Notes: CLRX dst is equivalent to MOVx S"#0, dst, but is 1 byte shorter. 4-17 12-Feb-82 Instructions -- 7 Rev Page 4-18 The only LOGICAL INSTRUCTIONS INTEGER ARITHMETIC AND Compare CMP Format: opcode srcl.rx, src2.rx Operation: srcl A< 2 Condition src2; - Codes: {- srcl LSS src?2; { - srcl EQL src?2; < - A {- srcl LSSU src2; Exceptions: none Opcodes: CMPB CMPW Compare Byte B1 Compare Word D1 CMPL Compare Long 91 Description: The source 1 action is to operand is compared with the affect the condition codes. source 2 operand. Instructions INTEGER 12-Feb-82 ARITHMETIC CVT AND LOGICAL -- Rev 7 Page INSTRUCTIONS 4-19 Convert Format: opcode src.rx, dst.wy Operation: dst AN 2 Condition <- conversion of src; Codes: {- dst LSS @; <- dst EQL 0; <- {integer <~ 0@; overflow}; Exceptions: integer overflow Opcodes: 99 CVTBW Convert Byte 98 to CVTBL Convert Byte to 33 Long CVTWB Convert Word to Byte Word 32 CVTWL Convert F6 Word CVTLB to Long Convert Long to F7 Byte CVTLW Convert Long to Word Description: The source operand operand and Conversion the of a conversion of numbered (most is converted to destination shorter data the data operand type to 1longer to a shorter significant) bits. is a longer is done type of the replaced is by done by by destination the sign truncation of result. extension; the higher Notes: Integer not overflow equal to the occurs sign if bit any of truncated the bits destination of the operand. source operand are 12-Feb-82 -- Rev 7 Instructions L INSTRUCTIONS LOGICA AND ETIC INTEGER ARITHM Page 4-20 Decrement DEC Format: opcode dif.mx Operation: dif <- dif - 1; A< N2 Condition Codes: <- dif LSS 9; <- dif EQL @; <- {integer overflow}; <- {borrow into most significant bit}; Exceptions: integer overflow Opcodes: DECB 97 DECW DECL B7 D7 Decrement Byte Decrement Word Decrement Long Description: One is subtracted from the difference operand and the differenc e is replaced by the operand result. Notes: 1. Integer overflow occurs if the largest negative in teger 1is On overflow, the difference operand is replaced decremented. by the largest positive integer. 5. DECx dif is equivalent shorter. to SUBx S7#1, dif, but |is 1 byte Instructions INTEGER 12-Feb-82 ARITHMETIC DIV AND LOGICAL -- Rev 7 Page INSTRUCTIONS 4-21 Divide Format: opcode divr.rx, quo.mx opcode divr.rx, divd.rx, quo.wx 2 operand 3 operand Operation: quo <- quo quo <- divd Condition / divr; / 12 operand !3 operand OR {divr divr; Codes: N <- quo LSS g; Z <- quo EQL @; V <- {integer C <- 0; overflow} EQL @}; Exceptions: integer overflow divide by 86 DIVB2 Divide Byte 2 87 DIVB3 Divide A6 Byte DIVW2 3 Operand Divide Word 2 Operand zero Opcodes: Operand A7 DIVW3 Divide Cé6 Word DIVL2 3 Operand Divide C7 Long DIVL3 2 Divide Operand Long 3 Operand Description: In 2 operand operand format, and the operand format, and quotient the the quotient quotient the dividend operand operand operand is is is divided replaced operand is divided replaced by the by by the by the the divisor result. divisor 1In 3 operand result. Notes: l. 2. Division is performed zero and which i.e., the result is is Integer overflow integer as in 3 1is divided below. such that lost) truncated occurs by if -1. the has the towards and oOn only remainder same sign (unless as the it is dividend, 0. if overflow, the largest operands are negative affected Instructions 12-Feb-82 -- Rev 7 INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS 3. Page 4-22 If the divisor operand is @, then in 2 operand format the in 3 operand format the quotient operand 1is not affected; d operand. dividen the by d replace is quotient operand Instructions INTEGER ARITHMETIC EDIV 12-Feb-82 AND LOGICAL Extended -- Rev 7 Page INSTRUCTIONS 4-23 Divide Format: opcode divr.rl, divd.rq, quo.wl, rem.wl Operation: quo <- divd rem <- REM(divd, << 2 Condition / divr; divr); Codes: <- quo LSS g; <- quo EQL 4; <- {integer <- 0; overflow} OR {divr by the EQL 0}; Exceptions: integer divide overflow by zero Opcodes: 7B EDIV Extended Divide Description: The dividend operand by the operand is replaced remainder. is by divided the quotient divisor and the operand; remainder the operand quotient is replace Notes: 1. The division (unless On it is overflow, is @) the performed has the operands If the divisor operand is replaced by bits 31:8 remainder operand is such same are @, of replaced that sign as affected then the by the the as the in 3. operand operand. Dbelow. quotient dividend 0. remainder dividend operand operand, and 1is the 12-Feb-82 —-- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Page 4-24 Extended Multiply EMUL Format: opcode mulr.rl, muld.rl, add.rl, prod.wq Operation: prod <- {muld * mulr} + SEXT (add); Condition Codes: N <- prod LSS @; 7 <- prod EQL 0; vV C <~ <~ 0; 0; Exceptions: none Opcodes: 7A EMUL Description: Extended Multiply g plied by the multiplier operadndto givin The multiplicand operand is multi le doub ende -ext sign 1is and oper nd t. The adde a double length toresul the result. The product operand is replaced by the length and added final result. Instructions INTEGER ARITHMETIC INC 12-Feb-82 AND LOGICAL -- Rev 7 INSTRUCTIONS Page 4-25 by the Increment Format: opcode sum.mx Operation: sum O N2 Condition <- sum + 1; Codes: <{- sum LSS @; <{- sum EQL 4; <<- {integer overflow}; {carry from most significant bit}; Exceptions: integer overflow Opcodes: 96 INCB Increment B6 Byte INCW D6 Increment INCL Word 1Increment Long Description: One is added to the result. sum operand and the sum operand is replaced Notes: ].o Arithmetic overflow occurs if the largest positive integer incremented. On overflow, the sum operand is replac ed by largest INCx sum shorter. negative is integer. equivalent to ADDx S"#1, sum, but is 1 is the byte 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGTICAL INSTRUCTIONS MCOM Move Complemented opcode src.rx, Page 4-26 Format: dst.wX Operation: dst <- NOT src; Condition Codes: 7 dst <- dst VvV C <<- N <- LSS EQL @; 0; 0; C; Exceptions: none Opcodes: 92 B2 D2 MCOMB MCOMW MCOML Description: Move Complemented Byte Move Complemented Word Move Complemented Long The destination operand is replaced by the ones complement of the operand. source Instructions INTEGER 12-Feb-82 ARITHMETIC MNEG AND Move LOGICAL -~ Rev 7 Page INSTRUCTIONS 4-27 Negated Format: opcode src.rx, dst.wx Operation: dst A< N2 Condition <- -src; Codes: <- dst LSS @; <- dst EQL @; <- {integer <- dst NEQ overflow}; @; Exceptions: integer overflow Opcodes: 8E MNEGB Move Negated Byte AE MNEGW Move Negated Word CE MNEGL Move Negated Long Description: The destination operand is operand. replaced by the negative of the source Notes: Integer overflow integer (which destination occurs if has no operand is the source positive replaced by the operand is the counterpart). source operand. 1largest On negative overflow, the 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Move MOV Format: src.rx, opcode dst.wx Operation: dst Condition src; <- Codes: N <- dst LSS @; 7 <- dst EQL @; V <- 0; C <= C; Exceptions: none Opcodes: Move Byte 90 MOVB B0O MOVW Move Word DO MOVL Move Long 7D MOVQ Move Quad 7DFD MOVO Move Octa Description: The destination operand is replaced by the source operand. Page 4-28 Instructions INTEGER 12-Feb-82 ARITHMETIC MOV?Z AND Move LOGICAL -- Rev 7 Page 4-29 INSTRUCTIONS Zero-Extended Format: opcode src.rx, dst.wy Operation: dst Condition <- ZEXT(src); Codes: N <- @; Z <- dst V <- @; C <- C; EQL @; Exceptions: none Opcodes: 9B MOVZBW Move Zero-Extended 9A MOVZBL Byte to Move 3C Zero-Extended MOVZWL Byte to Move Long Zero-Extended Word to Long Word Description: For MOVZBW, source of the 31:8 7:0 destination are operand 2. bits operand; are replaced of bits the 15:8 destination are operand replaced by operand are replaced by by 0. For MOVZWL, replaced by the source operand; are zero. the bits bits replaced by the MOVZBL, bits 7:0 For source 15:8 of 31:16 operand; bits the destination are replaced by Page 4-30 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Multiply MUL Format: 2 operand prod.mx opcode mulr.rx, opcode mulr.rx, muld.rx, prod.wx 3 operand Operation: prod prod <- prod <- muld Condition mulr; 12 operand * mulr; 13 operand * Codes: N <- prod LSS @; 7 <- prod EQL 0; C <- 0; V <- {integer overflow}; Exceptions: integer overflow Opcodes: 84 MULB2 Multiply Byte 85 A4 AS C4 C5 MULB3 MULW2 MULW3 MULL2 MULL3 Multiply Multiply Multiply Multiply Multiply Byte Word Word Long Long 2 Operand 3 Operand 2 Operand 3 Operand 2 Operand 3 Operand Description: In 2 operand format, the product operand is multiplied by the multiplier operand and the product operand is replaced by the low half of the double length result. In 3 operand format, the multiplicand operand is multiplied by the multiplier operand and the product operand is replaced by the low half of the double length result. Notes: Integer overflow occurs if the high half of the double length result not equal to the sign extension of the low half. is Instructions INTEGER 12-Feb-82 ARITHMETIC AND PUSHL Push opcode src.rl LOGICAL -- Rev 7 Page INSTRUCTIONS Long Format: Operation: -(SP) Condition <~ src; Codes: N <- src LSS #; Z <- src EQL 4; V <~ @; C K- C; Exceptions: none Opcodes: DD PUSHL Push Long Description: The longword source operand is to src, pushed on the stack. Notes: PUSHL is equivalent MOVL -(SP), but is 1 byte shorter. 4-31 12-Feb-82 -- Rev 7 Instructions Page 4-32 INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Rotate ROTL Long Format: src.rl, opcode cnt.rb, dst.wl Operation: dst <- src rotated cnt bits; Condition Codes: N 7 <- dst <- dst V <~ 0; C <= C; LSS 0; EQL @; Exceptions: none Opcodes: 9C ROTL Rotate Long Description: ied The source operand is rotated logically by the number of bits specif the by ed replac is d operan ation by the count operand and the destin operand count ve positi A cted. unaffe is d result. The source operan A rotates to the left. A negative count operand rotates to theth eright. source with d @ count operand replaces the destination operan operand. Instructions INTEGER 12-Feb-82 ARITHMETIC SBWC AND LOGICAL Subtract With -- Rev 7 Page 4-33 INSTRUCTIONS Carry Format: opcode sub.rl, dif.ml Operation: dif a<<N=Z Condition <- dif - sub - C; Codes: <- dif LSS g; <- dif EQL g; <<- {integer overflow}; {borrow into most significant bit}; Exceptions: integer overflow Opcodes: D9 SBWC Subtract With Carry Description: The subtrahend operand and subtracted from the replaced by the result. On overflow, the contents difference of the condition operand and the code difference C bit are operand is the 1low Notes: l. order 2. The bits of the the difference true 2 subtractions simultaneously. operand result. in the is replaced operation are by performed 12-Feb-82 -- Rev 7 Instructions INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Page 4-34 Subtract SUB Format: opcode sub.rx, dif.mx 2 operand opcode sub.rx, min.rx, dif.wx 3 operand Operation: dif <- dif - sub; 12 operand dif <- min - sub; 13 operand Q<N 2 Condition Codes: <<- <- dif dif LSS 0; EQL 0; {integer overflow}; <- {borrow into most significant bit}; Exceptions: integer overflow Opcodes: 82 83 A2 A3 C2 C3 SUBB2 SUBB3 SUBW2 SUBW3 SUBL2 SUBL3 Subtract Subtract Subtract Subtract Byte Byte Word Word 2 3 2 3 Operand Operand Operand Operand Subtract Long 2 Operand Subtract Long 3 Operand Description: the In 2 operand format, the subtrahend operand is subtracted from result. the d by difference operand and the difference operand is replace ted from the In 3 operand format, the subtrahend operand is subtrac the result. by ed replac is d operan ence minuend operand and the differ Notes: subtract are of Integer overflow occurs if the input operands to the the sign of the is result the different signs and the sign of ed by the low replac is d operan ence differ the subtrahend. On overflow, order bits of the true result. Instructions INTEGER ARITHMETIC TST 12-Feb-82 AND -- Rev 7 LOGICAL INSTRUCTIONS affected according Page 4-35 Test Format: opcode src.rx Operation: src Condition - @; Codes: N <- src LSS @; Z <- src EQL 4; V <- 0; C <- 0; Exceptions: none Opcodes: 95 TSTB Test Byte B5 TSTW Test Word D5 TSTL Test Long codes are Description: The condition operand. to the value of the Notes: TSTx src is equivalent to CMPx src, S"#8, but is 1 byte shorter. source 12-Feb-82 Instructions -—- Rev INTEGER ARITHMETIC AND LOGICAL INSTRUCTIONS Exclusive XOR Page 7 4-36 OR Format: mask.rx, opcod e opcode mask.rx, dst. mx src LIX, dst.wx 2 operand 3 operand Operation: dst <- dst XOR mask; 12 operand dst <- src XOR mask; '3 operand a<<N 2 Condition Cod es: {- <- & dst dst LSS 0; EQL @; 2; C; Exceptions: none 8C XORB2 8D XORB3 AC AD XORW?2 XORW3 CcC XORL2 CD XORL3 Exclusive OR Exclusive OR Exclusive OR Exclusive OR Exclusive Exclusive Byte Byte Word Word OR Long OR Long WM W W Opcodes: Operand Operand Operand Operand Operand Operand Description: In 2 operand format, the mask operand 1is XORed destination In 3 operand is replaced by the result. destination the and operand and operand the with XORed is operand mask the operand format, the destination operand is replaced by the result. Instructions ADDRESS 4.3 The 12-Feb-82 INSTRUCTIONS -- Rev 7 Page 4-37 ADDRESS INSTRUCTIONS following instructions are described in this section. Instructions 1. 2. Move Address MOVA{B,W,L=F,Q=D=G,0=H} Push src.ax, dst.wl Address PUSHA{B,W,L=F,Q=D=G,0=H} src.ax, {-(SP).wl} 5 5 12-Feb-82 -- Rev 7 Instructions ADDRESS Page 4-38 INSTRUCTIONS Move MOVA Address Format: opcode src.ax, dst.wl Operation: dst Condition <- src; Codes: N <- dst LSS @; 7 <- dst EQL 9; V <- 0; C <= C; Exceptions: none Opcodes: 9E 3E DE 7E 7EFD MOVAB MOVAW MOVAL, Move Address Byte Move Address Word Move Address Long MOVAF MOVAQ, MOVAD, MOVAG Move Move Move Move Address Address Address Address F_floating Quad D_floating G floating MOVAO Move Address Octa MOVAH Move Address H_floating, Description: The destination operand is replaced by the source operand. The context in which the source operand is evaluated is given by the data type of the instruction. The operand whose address replaces the destination operand is not referenced. Notes: The source operand is of address access type which causes the address of the specified operand to be moved. Instructions ADDRESS 12-Feb~-82 INSTRUCTIONS PUSHA Push opcode src.ax -- Rev 7 Page 4-39 Address Format: Operation: - (SP) Condition <~ src; Codes: N <- src LSS 0; Z <- src EQL @; V <- 0; C <~ C; Exceptions: none Opcodes: 9F PUSHAB Push 3F PUSHAW Address Push DF Address PUSHAL, Push Address Long PUSHAF Push Address F_floating 7F 7FFD Byte Word PUSHAQ, Push Address PUSHAD, Quad Push Address D floating PUSHAG Push PUSHAH Address Push Address PUSHAO H_floating, Push Address Octa G floating Description: The source source operand operand instruction. is 1is The pushed on the stack. evaluated is given operand whose address is The by context the pushed is in data not which type of the the referenced. Notes: 1. PUSHAX src is shorter, 2. The source address of equivalent operand the is to MOVAx src, of address access specified operand to be -(SP), type but which pushed. is 1 causes byte the 12-Feb-82 -- Rev 7 Instructions VARIABLE LENGTH BIT FIELD INSTRUCTIONS 4.4 Page 4-490 VARIABLE LENGTH BIT FIELD INSTRUCTIONS A variable length bit field is specified by 3 operands: 1. A longword position operand. 2. A byte field size operand which must be in the range @ 3. on is used to A base address (relative to which the positi d locate the bit field). The address is obtained from an operan of es instanc other unlike , of address access type. However mode may be operand specifiers of address access type, register the field is case designated in the operand specifier. 1In this er specifi operand the by ted contained in the register n designa r Chapte (See n). er regist with enated (or register n+l concat 2) If the field 1is contained in a register and size is not zero, the position operand must have a value in the range @ 32 or a reserved operand fault occurs. through through 31 or a reserved operand fault occurs. In order to instructions, simplify the description of the variable bitwithfield the a macro FIELD(pos, size, address) is introduced following expansion (if size NEQ B): FIELD (pos, size, address) (address + SEXT (pos<31:3>))<{size - 1} + pos<2:0>:pos<2:0>> 1if address not specified by register mode {(R[n+1]'Rn}<{size - 1} + pos:pos> 1if address specified by register mode and pos + size IGTRU 32 Rn<{size - 1} + pos:pos> 1if address specified by register mode and pos + size 'LEQU 32 The number of bytes referenced by the contents ( ) operator above 1is: 1 + {{{size - 1} + pos<2:0>} / 8} Zero bytes are referenced if the field size is @. Instructions VARIABLE The 12-Feb-82 LENGTH following BIT FIELD instructions -- Rev 7 Page INSTRUCTIONS are described in this 4-41 section. Instructions 1. Compare CMPV 2. Compare CMPZV 3. Extract Find The following section 1. on size.rb, base.vb, base.vb, 1 {field.rv}, src.rl {field.rv}, 1 dst.wl Field size.rb, startpos.rl, base.vb, : {field.rv}, variable Control Branch Branch on Branch pos.rl, size.rb, base.vb, {field.rv}, size.rb, base.vb, {field.wv} bit 2 findpos.wl on BB{SS,CC}I 1 instructions are described Bit pos.rl, on field Instructions. Bit Bit base.vb, (and modify pos.rl, (and pos.rl, displ.bb, without base.vb, modify) base.vb, {field.rv} interlock) displ.bb, {field.mv} Interlocked displ.bb, 1 dst.wl Field BB{S,C}{S,C} 3. Field size.rb, Zero-Extended src.rl, BB{S,C} 2. src.rl First Insert INSV {field.rv}, Field pos.rl, FF{S,C} 6. 1 base.vb, Zero-Extended pos.rl, EXTZV 5. size.rb, pos.rl, Extract EXTV 4, Field pos.rl, {field.mv} 1in 2 4 2 the 12-Feb-82 -- Rev 7 Instructions VARIABLE LENGTH BIT FIELD INSTRUCTIONS Page 4-42 Compare Field CMP Format: opcode pos.rl, size.rb, base.vb, src.rl Operation: tmp <- if size NEQU 0 then SEXT(FIELD (pos, size, base)) else @; 1CMPV Src; - tmp tmp <- if size NEQU ¢ then ZEXT(FIELD (pos, size, base)) 1CMPZV src; - tmp else @; NN 2 Condition Codes: <- tmp LSS src; <- tmp EQL src; <- 0; <- tmp LSSU src; Exceptions: reserved operand Opcodes: CMPV EC CMPZV ED Compare Field Compare Zero-Extended Field Description: and base operands is compared The field specified by the position, size sourc e operand is compared with the with the source operand. For CMPV, the operand is compared with source CMPZV, the sign extended field. For t the condition the extended zero codes. field. The only action is to affec Notes: 1. A reserved operand fault occurs 1if: 32. 1. size GTRU 2. pos GTRU 31, size NEQ @, and the field is contained in registers. the Instructions VARIABLE 2. 12-Feb-82 LENGTH BIT On reserved a FIELD UNPREDICTABLE. -- Rev 7 Page INSTRUCTIONS operand fault, the condition codes 4-43 are Page 4-44 12-Feb-82 -- Rev 7 Instructions VARIABLE LENGTH BIT FIELD INSTRUCTIONS Extract EXT Field Format: opcode pos.rl, size.rb, base.vb, dst.wl Operation: dst <- if size NEQU @ then SEXT(FIELD(pos, size, base)) else B; 'EXTV dst <- if size NEQU @ then ZEXT(FIELD(pos, size, base)) else 0; 1EXTZV Condition Codes: N 7 <- dst <- dst V <~ @; C K- C; LSS 4; EQL 0; Exceptions: reserved operand Opcodes: Extract Field EXTV EE Extract Zero-Extended Field EXTZV EF Description: ed field For EXTV, the destination operand is replaced by the sign extend the EXTZV, For ds. operan base and size, specified by the position, by ied specif ed field destination operand is replaced by the zero Ifextend the @, is d operan size the the position, size and base operands. only action is to replace the destination operand with @ and affect the condition codes. Notes: A reserved operand fault occurs if: ) t o) 3 o (® Q. P_‘ ct o) pos GTRU 31, size NEQ @, and the field o] 3 2. O size GTRU 0 32. 1. (=] 1. reg*lB S catersg =2 DAL ol B 2. On a resemved operand fault, the destination operand unaffected and the condition codes are UNPREDICTABLE. is Instructions VARIABLE 12-Feb-82 LENGTH BIT FF FIELD Find -- Rev 7 Page INSTRUCTIONS 4-45 First Format: opcode startpos.rl, size.rb, base.vb, findpos.wl Operation: state if = if size {FFS} NEQU @ then 1 else 0; then begin tmpl <- tmp2 <- while FIELD(startpos, g; {tmpl<tmp2> {tnp2 tmp2 findpos base); NEQ LEQU <- size, state} AND {sigze - 1}} do tmp2 <- startpos <- startpos; + + end 1; tmp2; else findpos Condition Codes: N <- Z <- {bit V <- 0@; C <- 0; @; not found}; Exceptions: reserved operand Opcodes: EB FFC Find First EA Clear FFS Find First Set the start Description: A field specified extracted. The instruction field. If operand bit is position bit code one bit replaced set., is by field starting a bit replaced cleared. operand is position is by set. the to If is at 1in by position, tested for a size, bit in and the base state bit @ and extending to the highest the indicated state is found,. the the position of the bit and the operands indicated Z bit find is by the in the position condition code If no bit in the indicated state is found, the find replaced by the position (rela tive to the base) of a the left of the specified field, and the Z condition the start size operand position is operand @, and the the find Z position operand condition code bit is is Page 4-46 12-Feb-82 -- Rev 7 Instructions VARIABLE LENGTH BIT FIELD INSTRUCTIONS Notes: 1. 5. A reserved operand fault occurs if: 32. 1. size GTRU 2. startpos GTRU 31, size NEQ 0, and the field is contained in the registers. On a reserved operand fault, the find position operand unaffected and the condition codes are UNPREDICTABLE. 1is Instructions VARIABLE 12-Feb-82 LENGTH BIT INSV FIELD Insert —-- Rev 7 Page INSTRUCTIONS 4-47 Field Format: opcode src.rl, pos.rl, size.rb, base.vb Operation: if size NEQU @ then src<{size Condition - FIELD (pos, size, 1}:0>; base) <- Codes: N <- Z <- 7; V <~ V; C <- C; N; Exceptions: reserved operand Opcodes: Fo@ INSV Insert Field Description: The field specified by bits size-1:8 only action is to by of the the affect position, source the size, and operand. condition If base the operands size codes. is operand replaced is @, the Notes: 1. A reserved 1. size 2. pos operand GTRU GTRU fault On a reserved condition if: 32. 31, size registers. 2. occurs operand codes are NEQ @, and the fault, the field UNPREDICTABLF. field is is contained unaffected in the and the Instructions CONTROL INSTRUCTIONS 4.5 Page 4-48 12-Feb-82 —-- Rev 7 CONTROL INSTRUCTIONS tion VAX-11 architecture, improved n execu In most implementations of the targe an on is uctio t of a control instr speed will vresult if the aligned longword boundary. The following instructions are described in this section. 1. Instructions Add Compare and Branch ACB{B.W,L,F,D,G,H} limit.rx, add.rx, index.mx, displ.bw 7 Compare is LE on positive add, GE on negative add. 2. Equal Add One and Branch Less Than or .bb 1 3. Add One and Branch Less Than 1 4. Conditional Branch 12 AOBLEQ 1limit.rl, index.ml, displ AOBLSS limit.rl, index.ml, displ.bb B{condition} displ.bb Condition Name LSS Less Than NEQ, NEQU Not Equal, Not Equal Unsigned GTR Greater Than LEQ EQL, EQLU GEQ Lssu, CS LEQU GEQU, CC GTRU VS VC Less Than or Equal Equal, Equal Unsigned Greater Than or Equal Less Than Unsigned, Carry Set Less Than or Equal Unsigned Greater Than or Equal Unsigned, Carry Clear Greater Than Unsigned Overflow Set Overflow Clear 5. Branch on Bit 2 6. Branch on Bit (and modify without interlock) BB{S,C}{S,C} pos.rl, base.vb, displ.bb, {field.mv} Branch on Bit (and modify) Interlocke, d {field.mv} BB{SS,CC}I pos.rl, base.vb, displ.bb 4 7. 8. BR{S,C} pos.rl, base.vb, displ.bb, {field.rv} Branch on Low Bit BLB{S,C} src.rl, displ.bb 2 2 Instructions CONTROL 9. 12-Feb-82 Branch With BR{B,W} 16. Branch to 14, Page Displacement With {Byte, Word} {-(SP).wl} 2 Displacement selector.rx, base.rx, limit.rx, from 1 Subroutine 1 {(SP)+.r1} Subtract and index.ml, Subtract SOBGTR One One 3 1 Jump to Subroutine JSB dst.ab, {-(SP).wl} Return 2 displ.bw-list dst.ab SOBGEQ 16, 7 Jump RSB 15. Rev Case JMP 13. Word} Subroutine displ.bx, CASE{B,W,L} 12, {Byte, displ.bx BSB{B,W} 11. -- INSTRUCTIONS and index.ml, Branch Greater Than displ.bb Branch Greater displ.bb Than or Equal 1 1 4-49 12-Feb-82 -- Rev 7 Instructions CONTROL Page 4-50 INSTRUCTIONS Add Compare and Branch ACB Format: opcode limit.rx, add.rx, index.mx, displ.bw Operation: index <- index + add; if {{add GEQ 0} AND {index LEQ limit}} OR {{add LSS 0} AND {index GEQ limit}} then PC <N 2 Condition <- PC + SEXT(displ); Codes: <- index LSS 9; <- index EQL @; <- C; <- {integer or floating overflow}; Exceptions: integer overflow floating overflow floating underflow reserved operand Opcodes: 9D ACBB Add Compare and Branch Byte 4F oF 4FFD 6FFD ACBF ACBD ACBG ACBH Add Add Add Add 3D F1l ACBW ACBL Add Compare and Branch Word Add Compare and Branch Long Compare Compare Compare Compare and and and and Branch Branch Branch Branch F_floating D_floating G_floating H_floating Description: index operand The addend operand is added to the index operand and thed with the limit compare is operand index The result. the by d is replace son 1is compari the and @) operand. If the addend operand is positive (or son is compari the and e negativ is less than or equal or if the addend to added is ement displac branch tended sign-ex the equal, or greater than PC and PC is replaced by the result. Instructions CONTROL 12-Feb-82 -- INSTRUCTIONS Rev 7 Page 4-51 Notes: lo ACB efficiently level and limit On integer order since the dependent on is overflow, bits of determination On implements languages floating proceed by normally. A @ and fault floating fault On and a and reserved the Except index for 5. the if fault, codes above, are the of operand is FU on is FOR or addend. is replaced the branch set by the and 1low branch operand. index operand is determination proceed and the index takes a floating unaffected. is high index index the index operand UNPREDICTABLE. C-bit in between Comparison clear, is loops the updated and DO comparison the instruction operand operand condition FU the result. normally if of sign comparison overflow, the general index occurs unaffected. the true underflow, replaced On the the the sense unaffected. is operand is overflow unaffected 12-Feb-82 -- Rev 7 Instructions Page 4-52 INSTRUCTIONS CONTROL AOBLEQ Add One and Branch Less Than or Equal opcode limit.rl, Format: index.ml, displ.bb Operation: index <- index + 1; if index LEQ limit then PC PC <- + SEXT (displ); N < NZ Condition Codes: <- index LSS 9; <- index EQL 4; <- C; <- {integer overflow}; Exceptions: integer overflow AOBLEQ Add One and Branch Less Than or Equal Opcodes: F3 Description: One is added to the index operand and the index operand is replaced by The index operand is compared with the limit operand. If the result. it is less than or equal, the sign-extended branch displacement is added to PC and PC is replaced by the result. Notes: 1. Integer overflow occurs if the index operand before addition is On overflow, the index operand the largest positive integer. is e integer, and the branch negativ largest the is replaced by taken. 2. The C-bit is unaffected. Instructions CONTROL 12-Feb-82 -- Rev 7 Page 4-53 replaced operand. by 1If INSTRUCTIONS AOBLSS Add One and Branch Less Than Format: opcode limit.rl, index.ml, displ.bb Operation: index if <~ index index LSS PC Condition + 1; limit + then PC <- SEXT (displ); Codes: N <- index LSS g; Z <- index EQL 0; V <- {integer C K- C; overflow}; Exceptions: integer overflow AOBLSS Add Opcodes: F2 One and Branch Less Than Description: One is the added result. it is less PC and PC to the The than, is index index the replaced operand operand and is sign-extended by the the index operand is with the limit compared branch result. displacement is added to the Notes: 1. Integer the 2. overflow largest is replaced the 1limit is taken. The C-bit occurs ©positive by the operand is if largest is the integer. the unaffected. index operand before On overflow, the negative largest integer, negative and addition is operand index thus integer) the (unless branch CONTROL Page 4-54 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS Branch B on (condition) Format: opcode displ.bb Operation: condition then PC if Condition <- PC + SEXT(displ); Codes: N <- 7 <= N; 7; V <= V; C K- C; Exceptions: none Opcodes: Condition 14 {N OR Z} EQL o BGTR Branch on Greater Than 15 {N OR Z} EQL 1 BLEQ Branch on Less Than or Equal 12 Z EQL 0 BNEQ, Branch on Not Equal (signed) 13 Z EQL 1 18 N EQL 9 1A 19 N EQL 1 {C OR Z} EQL @ BLSS BGTRU 1B {C OR Z} EQL 1 BLEQU 1C V EQL @ BVC 1D 1E 1F V EQL 1 C EQL @ (signed) (signed) BNEQU Branch on Not Equal Unsigned BEQLU Branch on Equal Unsigned BEQL, BGEQ Branch on Greater Than or Equal (signed) Branch on Less Than (signed) Branch on Greater Than Unsigned Branch Less Than or Equal Unsigned Branch on Overflow Clear BVS BGEQU, Branch on Overflow Set Branch on Greater Than or BCC Branch on Carry Clear BCS Branch on Carry Set BLSSU, C EQL 1 Branch on Equal (signed) Equal Unsigned Branch on Less Than Unsigned Description: The condition codes are tested and if the <condition indicated by the instruction 1is met, the sign-extended branch displacement is added to the PC and PC is replaced by the result. Instructions CONTROL 12-Feb-82 -- branch instructions INSTRUCTIONS Rev 7 Page 4-55 Notes: The VAX-11 flexibility instruction. overlapping 1. conditional in branching The but conditional Overflow and Carry V EQL 1 BvVC V EQL # BCS C EQL 1 BCC C EQL @ instructions overflow arithmetic, and Unsigned These are traps for BLSSU C EQL 1 BLEQU {C OR Z} BEQLU Z EQL 1 BNEQU Z EQL ¢ BGEQU C EQL @ BGTRU {C OR 2} 1instructions where are used not are to the considerable correct best check enabled), special EQL 1 EQL ¢ typically the address instructions. These instructions typically other integers, Signed permit choosing seen branch as for purposes. for overflow follow operands instructions, are and integer treated and field as unsigned character string Group BLSS N EQL 1 BLEQ {N OR Z} BEQL Z EQL 1 BNEOQ Z EQL 0 BGEQ N EQL @ BGTR {N OR Z} 1instructions instructions where integers, floating instructions. 3 multiprecision Group instructions 3. in Group BVS (when care branch groups: These 2. require EQL 1 EQL @ typically follow integer and the operands are being treated point instructions, and decim as al field signed string CONTROL Page 4-56 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS Branch on Bit BB Format: opcode pos.rl, base.vb, displ.bb Operation: teststate = if {BBS} then 1 else 0; if FIELD (pos, 1, base) EQL teststate then PC <- PC + SEXT(displ); Condition Codes: N;j; N <- 72 <- Z; V <~ V; C - C; Exceptions: reserved operand Opcodes: Branch on Bit Set BBS EQ Branch on Bit Clear BBC El Description: is the position and base operands The single bit field specified by state the n, uctio instr the by ated indic test the If it is in tested. by sign-extended branch displacement is added to PC and PC is replaced the result. Notes: 1. See Section 4.5 for definition of FIELD. 2. A reserved operand fault occurs if pos GTRU 31 and the 3. oOn contained in a register. a reserved UNPREDICTABLE. operand fault, the condition bit codes 1is are Instructions CONTROL 12-Feb-82 -- INSTRUCTIONS BB Branch on Bit (and Rev modify 7 Page without 4-57 interlock) Format: opcode pos.rl, base.vb, displ.bb Operation: teststate = if {BBSS or BBSC} then 1 else g; newstate = if {BBSS or BBCS} then 1 else 2; tmp <- FIELD(pos, 1, FIELD (pos, 1, if teststate tmp EQL PC Condition base) <- PC + base); <- newstate; then SEXT(displ); Codes: N <- Z <- 7; V K- V; C K- C; N; Exceptions: reserved operand Opcodes: E2 BBSS Branch on Bit Set E3 BBCS Branch E4 on BBSC Bit Clear Branch on Bit ES Set BBCC Branch on Bit Clear and Set and and Set Clear and Clear Description: The single tested. bit If sign-extended the result. tested bit is field it specified 1is in the by test the position and state indicated by base the operands is instruction, the branch displacement is added to PC and PC is replaced Regardless of whether the branch is taken or not, put in the new state Section 4.5 for definition as indicated by the by the instruction. Notes: 1. See 2. A reserved contained 3. On a operand in reserved condition a fault of occurs FIELD. if pos GTRU register. operand codes are fault, the field UNPREDICTABLE. is 31 and the unaffected bit and is the Instructions Page 4-58 12-Feb-82 -- Rev 7 CONTROL INSTRUCTIONS 4. The modification of the bit is not an interlocked See BBSSI and BBCCI for interlocking instructions. operation. Instructions CONTROL 12-Feb-82 -- INSTRUCTIONS BB Branch on Bit Rev 7 Page 4-59 Interlocked Format: opcode pos.rl, base.vb, displ.bb Operation: teststate newstate {set = <- FIELD(pos, FIELD (pos, {release tmp 1, 1, base) interlock}; EQL then 1 else g; base); <- teststate PC Condition {BBSSI} teststate; interlock}; tmp if if = <~ PC + newstate; then SEXT (displ); Codes: N <- Z <= 7; V <- V; C <~ C; N; Exceptions: reserved operand Opcodes: E6 BBSSI Branch on E7 Bit Set BBCCI Branch on Bit Clear and Set and Interlocked Clear Interlocked Description: The single tested. bit If sign-extended by the tested the the result. bit bit is is field it 1is branch specified in the displacement Regardless put in contained by test the in of new position and indicated by is whether state memory, setting other during the state as the added the operands is instruction, the to the PC and PC is branch is effected or indicated reading of it to the new state is processor or 1I/0 device can do the interlocked operation. base the of by the the replaced not, instruction. state of the the If bit and an interlocked operation. interlocked access on the bit of FIELD an No Notes: 1. See 2. A Section reserved contained 4.5 for operand in definition fault registers. occurs if pos GTRU 31 and the bit 1is CONTROL 3. Page 4-60 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS and the Except for memory interlocking BBSSI is equivalent to BBSS and This instruction is designed to modify interlocks with For example, to implement or devices. processors other "busy On a reserved operand fault, the field is condition codes are UNPREDICTABLE. BBCCI unaffected is equivalent to BBCC. waiting": 1$: BBSSI bit,base,1$ Instructions CONTROL 12-Feb-82 -- Rev 7 Page INSTRUCTIONS BLB Branch on Low 4-61 Bit Format: opcode src.rl, displ.bb Operation: teststate = if EQL src<@> PC Condition if <- {BLBS} then teststate PC + 1 else 2 ; then SEXT (displ); Codes: N <- Z <-7; N; V <-V; C <= C; Exceptions: none Opcodes: ES8 BLBS Branch on E9 Low Bit BLBC Set Branch on Low Clear Bit Description: The to low the bit (bit test state indicated is to displacement @) of added the PC source by the and PC operand is tested instruction, is replaced the by and if it is equal sign-extended branch the result. 12-Feb-82 -- Rev 7 Instructions Page 4-62 INSTRUCTIONS CONTROL Branch BR Format: displ.bx opcode Operation: PC Condition <- PC + SEXT (displ); Codes: N; N <- 2 <= Z7; V <= V; C K- C; Exceptions: none Opcodes: 11 31 BRB BRW Branch With Byte Displacement Branch With Word Displacement Description: The sign-extended branch displacement is added to PC and PC is by the result. replaced Instructions CONTROL 12-Feb-82 INSTRUCTIONS BSB Branch To -- Rev 7 Page 4-63 Subroutine Format: opcode displ.bx Operation: -(SP) <- PC; PC PC + Condition <~ SEXT(displ); Codes: N <- Z <-7Z; N; V <~ V; C K- C; Exceptions: none Opcodes: 10 BSBB Branch to Subroutine 30 With BSBW Byte Branch to Displacement Subroutine With Word Displacement Description: PC is pushed on the displacement is added stack to as PC and a longword. PC is replaced The by sign-extended the result. branch 12-Feb-82 -- Rev 7 Instructions CONTROL Page 4-64 INSTRUCTIONS Case CASE Format: opcode selector.rx, base.rx, limit.rx, displ(®#].bw,..., displ(limit].bw Operation: selector tmp <- - base; PC <- PC + if tmp LEQU limit then SEXT (displ[tmp]l) else {2 + 2 * ZEXT (limit) }; A< =2 Condition Codes: <- tmp LSS limit; <- tmp EQL limit; <- @; <- tmp LSSU limit; Exceptions: none Opcodes: CASEB 8F Case Byte Case Word Case Long CASEW CASEL AF CF Description: The base operand is subtracted from the selector operand and a temporary The temporary is compared with the limit displacement operand and if it is less than or equal unsigned, a PCbranch d by the replace is and PC to added is value ry tempora the selected by added is 1 and result. Otherwise, 2 times the sum of the limit operand is replaced by the result. moved past to PC and PC is replaced by the result. This causes PC to be taken, the branch the of ess Regardl ements. displac the array of branch operand ry condition codes are affected by the comparison of the tempora with the limit operand. Notes: 1. the After operand evaluation, PC 1is pointing at displ{@], not the to ve relati are s cement displa branch The ction. next instru address of displ({g]. 2. The selector and base operands can both be considered either as signed or unsigned integers. Instructions CONTROL 12-Feb-82 INSTRUCTIONS JMP -- Rev Jump Format: opcode dst.ab Operation: PC Condition <~ dst; Codes: N <- Z <- 7; V <~ V; C K- C; N; Exceptions: none Opcodes: 17 JMP Jump Description: PC is replaced by the destination operand. 7 Page 4-55 Instructions CONTROL INSTRUCTIONS Page 4-66 12-Feb-82 -- Rev 7 Jump to Subroutine JSB Format: dst.ab opcode Operation: -(SP) PC <- { - { {- { - N <N 2 Codes: ~e A<<N Z Condition <- PC; dst; Exceptions: none Opcodes: 16 JSB Jump to Subroutine Description: PC is pushed on the destination operand. stack as a longword. PC is replaced by the Notes: Since the operand specifier conventions cause evaluation of the calls with the stack used for linkage. The form of such a call 1is JSB destination @(Sp)+. operand before saving PC, the JSB can be used for coroutine Instructions CONTROL 12-Feb-82 INSTRUCTIONS RSB Return —-- from Subroutine From Subroutine Rev 7 Page 4-67 Format: opcode Operation: PC Condition <- (SP)+; Codes: N <- Z <- 7; V <= V; C <= C; N; Exceptions: none Opcodes: g5 RSB Return Description: PC is replaced by a longword popped from the stack. Notes: 1. 2. RSB is and JSB RSB is used to return from instructions. equivalent to JMP subroutines @(SP)+, but is c¢ alled 1 byte by the BSBB, shorter. BSBW 12-Feb-82 -- Rev 7 Instructions CONTROL INSTRUCTIONS SOBGE(Q Subtract One and Branch Greater Than or Equal opcode index.ml, displ.bb Page 4-68 Format: Operation: index <- index - 1; if index GEQ @ then PC PC <2 Condition <- + SEXT (displ); Codes: <<- index index <- C; LSS EQL @; @; <- {integer overflow}; Exceptions: integer overflow SOBGEQ Subtract One and Branch Greater Than or Equal Opcodes: F4 Description: index operand is One is subtracted from the index operand and thegreate r than or equal is d operan replaced by the result. 1f the index is added to PC and PC 1is to @, the sign-extended branch displacement replaced by the result. Notes: 1. before subtraction 1Integer overflow occurs if the index operandoverf the index on er. 1integ is the largest negative largest positive integlow, thus and er, the by ced operand is repla the branch 2. is taken. The C-bit is unaffected. Instructions CONTROL 12-Feb-82 INSTRUCTIONS SOBGTR Subtract opcode index.ml, One and -- Rev 7 Page Branch Greater Than Branch Greater Than 4-69 Format: displ.bb Operation: index if <- index index - GTR then PC + 1; PC <- SEXT (displ); N2 Codes: <- <- {integer N Condition @ <- C; index LSS @; <- index EQL 4; overflow}; Exceptions: integer overflow SOBGTR Subtract Opcodes: F5 One and Description: One is subtracted replaced by sign-extended the from the the index operand and the 1index If index operand is greater result. branch the displacement result. is added to PC and PC is operand than is 8, the replaced by Notes: 1. Integer is operand 2. overflow the 1largest is the branch The C-bit occurs replaced is is if negative by the taken. unaffected. the index integer. largest operand On positive before subtraction overflow, the index integer, and thus Page 4-70 12-Feb-82 —-- Rev 7 Instructions PROCEDURE CALL INSTRUCTIONS 4.6 E CTIONS UR INSTRU ED CALL PROC a standard procedure <calling Three instructions are used to implement the CALL to the procedure; the ent Two instructions implem interface. to the VAX/VMS Run Time Refer . RETURN ng third implements the matchi rd. The CALLG Library Reference Manual for the procedure calling standaactual s in an list nt argume instruction calls a procedure with the ction with the ure proced a calls instru CALLS The arbitrary 1location. list this CALLS a after return Upon stack. the on s argument list actual specif ctions instru call is automatically removed from the stack. Both being called. The entryy the address of the entry point of the procedurethe entry mask followed by point is assumed to consist of a word termed a the procedure's instructions. The procedure terminates by executing RET instruction. The entry mask specifies the subprocedure's register use and overflow enables: 11111 Y] 5 4 3 21 t+ ——— 44— IDITIMBZ| AARA l REGISTERS | l -4t + boundary and the trap enables On CALL the stack is aligned to a longword consistent behavior of the ensure to in the PSW are set to a known state decimal overflow enable and e enabl low overf called procedure. Integer entry mask respectively. are affected according to bits 14 and 15 of the ters R11 through R#A regis The Floating underflow enable 1is cleared. saved on the stack and specified by bits 11 through ¢ respectively are SP, FP, and AP are restored by the RET instruction. In addition,andPC,restor ed by the RET are always preserved by the CALL instructions instruction. All external procedure CALLs generated by standard DIGITAL language software and all inter-module CALLs to major VAX-11 processors, (see rd standa re softwa g callin ure proced subsystems comply with the ure proced The VAX/VMS Run Time Library Reference Manual, Appendix C). in the range R2 through R11 calling standard requires that all registiners the mask. RO and R1 are not appear used in the procedure must with the procedure es compli that ure proced preserved by any called calling standard. In order to preserve the state, the CALL instructions form a structure frame. This contains the on the stack termed a call frame or stack save mask, and several er saved registers, the saved PSW, the regist longword which the CALL a es includ The frame also control Dbits. the condition handling ent implem to used is instructions clear; this of execution of the CALL end Refer to Appendix D. At the facility. The RET frame. stack the of s instruction, FP contains the addres restore and frame stack the find to FP of ts instruction uses the conten to points always FP that state. The condition handling facility assumes wing format: the stack frame. The stack frame has the follo Instructions 12-Feb-82 PROCEDURE CALL P e e e | condition Fom bbb |SPAlS |9 Rev 7 handler mask<11:0> | | saved | saved 0) | T saved —— S PSW<15:5> TP Fm o e Page saved | ) e P+ AP | | FP I + PC saved o | e (6 Note e e e e to 3 bytes S = set that the are cleared. The contents become specified if saved of the procedure. RET The (...) | e saved T + + | P RO T | + P T (FP) e+ e | 4-71 + (initially e eR i e e et P -- INSTRUCTIONS the CALLS; frame Similarly, + (...) by SPA, clear if CALLG. codes and condition condition R11l Stack I + Pointer the PSW<3:0> codes the at the resulting content of the Alignment) saved trace time RET from the frame PSW<4> is executed will become the PSW<KT> bit. following instructions are described in this enable (PSWKTD) is executed execution of at the time will the the section. Instructions 1. Call CALLG 2. Call CALLS 3. Procedure with arglist.ab, Procedure with numarg.rl, General dst.ab, Stack dst.ab, Return from Procedure RET {(SP)+.r*} Argument List 1 {-(SP).w*} Argument List 1 {-(SP).w*} 1 Page 4-72 12-Feb-82 -- Rev 7 Instructions PROCEDURE CALL INSTRUCTIONS CALLG call Procedure With General Argument List opcode arglist.ab, Format: dst.ab Operation: {align stack}; {create stack frame}; {set arithmetic exception enables}; {set new values of AP,FP,PC}; Condition Codes: N <- @; Z <- 0; V <- @; C <- 8; Exceptions: reserved operand Opcodes: FA CALLG Call Procedure with General Argument List Description: SP is saved in a temporary and then bits 1:8 are replaced by 8 the stack is longword aligned. so that The procedure entry mask is scanned from bit 11 to @ and the contents of registers whose number corresponds to set bits in the mask are pushed on the stack as longwords. PC, FP, and The condition <codes are AP are pushed on the stack as longwords. A longword containing the saved two low bits of SP in bits cleared. entry 31:30, a ¢ in bit 29 and bit 28, the low 12 bits of the procedure on pushed is cleared T with 15:0 bits in PSW mask in bits 27:16, and the SP. by d replace is FP stack. the on pushed is 6 d longwor A the stack. the PSW are AP 1is replaced by the arglist operand. The trap enables inoverflo w are decimal and w, overflo Integer set to a known state. ; tively respec mask entry the of 15 and 14 bits to ing affected accord by d replace is PC ted. floating underflow is cleared. T-bit is unaffec the sum of destination operand plus 2 which transfers control to the called procedure at the byte beyond the entry mask. Instructions PROCEDURE 12-Feb-82 CALL (0 1. If bits fault 2. On 3. The a 13:12 procedure Rl which the Rev 7 3 bytes specified by SPA) of the entry mask occurs. facility and to reserved never -- Page INSTRUCTIONS operand calling require are the always saved 1in are modified mask. Refer Appendix C. fault, are condition standard following the mask. to entry called VAX/VMS the Run are Library handling conventions. registers must operand UNPREDICTABLE. condition return procedure Time reserved saving function All a codes and for the @, register available in not 4-73 values R2 be and R# are through R11 preserved in Reference Manual, 12-Feb-82 Instructions CALL PROCEDURE Page 4-74 -- Rev 7 INSTRUCTIONS call Procedure with Stack Argument List CALLS Format: opcode numarg.rl, dst.ab Operation: {push arg count}; {align stack}; {create stack frame}; {set arithmetic exception enables}; new values of AP,FP,PC}; {set Condition Codes: N <- 0; Z V <<- @; 0; C <- 0; Exceptions: operand reserved Opcodes: FB CALLS Call Procedure With Stack Argument List Description: (byte @ contains The numarg operand is pushed on the stack as a longword used by DIGITAL are bits 24 order high arguments, of number the then bits 1:0 of SP are SP is saved in a temporary and e). softwar that so @ by replaced entry mask is scanned from corresponds number whose PC, FP, and AP are stack. condition codes the stack is longword aligned. The procedure bit 11 to bit @ and the contents of registers to set bits 1in the mask are pushed on the The pushed on the stack as longwords. low two saved the ning contai rd longwo A cleared. are bits of SP in bits 31:34, al in bit 29, a @ in bit 28, the low 12 Dbits bits 15:8 with of the procedure entry mask in bits 27:16, and the PSW in on the stack. T cleared is pushed on the stack. FP is replaced by SP. AP is set A longword @ is pushed to the value of the stack pointer after enables in the PSW the numarg operand was pushed on the stack. Theandtrap al overflow, are decim Integer overflow, to a known state. set are respectively, mask, entry the of affected according to bits 14 and 15 T a3 ing float underflow is cleared. T-bit is unaffected.PC is replaced by the sum of destination operand plus 2 which transfers at the byte beyond the entry mask. procedure called the stack after CALLS is executed is: control to The appearance the of Instructions PROCEDURE 12-Feb-82 CALL -- Rev 7 INSTRUCTIONS Page P RL+ | o 4-75 | e N | o+ . N longwords of argument list :(aP) . e + Notes: 1. Tf bits fault 2. On 13:12 of a reserved Normal use order prior from 4. The the Rl which to push arglist the the CALLS. On calling the 1in modified entry mask. Appendix standard following for mask. in the Refer C. called to a reserved operand condition codes onto the in and the @, the Run is are reverse removed condition return handling conventions. R{ registers procedure VAX/VMS arglist saving function All stack the the register available entry not return, automatically. are Manual, are to always saved mask fault, require are never the stack procedure facility and is entry operand UNPREDICTABLE. 3. the occurs. must Time values R2 and through are R11 be preserved in Library Reference 12-Feb-82 -- Rev 7 Instructions Page 4-76 PROCEDURE CALL INSTRUCTIONS Return RET from Procedure Format: opcode Operation: {restore SP from FP}; {restore registers}; {drop stack alignment}; {if CALLS then remove arglist}; {restore PSW}; A< 2 Condition Codes: <- tmpl<3>; <- tmpl<2>; <<- tmpl<l>; tmpl<B>; Exceptions: reserved operand Opcodes: @4 RET Description: Return from Procedure alignment bits SP is replaced by FP plus 4. A longword containingthestack 12 bits of the low 29, bit in in bits 31:39, a CALLS/CALLG flag 15:8 1is bits in PSW saved a and 27:16, bits procedure entry mask in AP are and FP, PC, in a temporary. popped from the stack and saved is mask e restor er regist A stack. the replaced by longwords popped from 11 bit to 8 bit from ing Scann rary. tempo the formed from bits 27:16 of registers whose number is indicated of the restore mask, the contents of by longwords popped from the stack. by set bits in the mask are replaced PSW is replaced by Dbits ary. tempor SP is incremented by 31:38 of the is 1 (indicating that rary tempo the in 29 bit If 15:8 of the temporary. rd containing the number of the procedure was called by CALLS), a longwo times the unsigned value of Four arguments 1is popped from the stack. SP is replaced by the and SP to added is the low byte of this longword result. Instructions PROCEDURE 12-Feb-82 CALL -- Rev INSTRUCTIONS 7 Page 4-77 Notes: l. 2. A reserved On a operand reserved fault occurs operand if fault, the UNPREDICTABLE. The value The procedure assume status Time of tmpl<28> calling that code Library is so in standard RO Reference NEQ 4. condition codes are ignored. procedures do tmpl<15:8> or and condition which return R# R1. Manual, and Appendix a handling function Refer C. to facility value VAX/VMS or a Run Instructions MISCELLANEOQOUS 4.7 INSTRUCTIONS 12-Feb-82 -- Rev 7 Page 4-78 MISCELLANEOUS INSTRUCTIONS The following instructions are described in this section, Instructions Bit Clear PSW 1 Bit Set PSW 1 Breakpoint Fault 1 4, Halt 1 5. 1 Index INDEX subscript.rl, low.rl, high.rl, size.rl, indexin.rl, 1. 2. 3. BICPSW mask.rw BISPSW mask.rw BPT HALT {-(KSP).w*} {- (KSP).w*} indexout.wl 0. Move from PSL 1 7. No Operation 1 MOVPSL dst.wl NOP 1 8. Pop Regilisters 9. Push Registers 10. Extended Function Call POPR mask.rw, PUSHR mask.rw, XFC {(SP)+.r*} {-(SP).w*} {unspecified operands} 1 1 Instructions MISCELLANEOUS 12-Feb-82 -- Rev INSTRUCTIONS BICPSW Bit Clear 7 Page 4-79 PSW 1is PSW Format: opcode mask.rw Operation: PSW <N 2 Condition <- PSW AND {NOT mask<3>}; mask}; Codes: <{- N AND {NOT <- Z AND <= {NOT mask<2>}; V AND <- C AND {NOT mask<1>}; {NOT mask<@>}; Exceptions: reserved operand Opcodes: B9 BICPSW Bit Clear PSW Description: PSW is ANDed replaced by with the the ones complement result. of the mask Notes: A reserved reserved operand operand fault fault, occurs the PSW if is mask not <15:8> affected. Zero. On a Instructions MISCELLANEOUS INSTRUCTIONS Bit BISPSW Set Page 4-84 12-Feb-82 -- Rev 7 PSW Format: opcode mask.rw Operation: PSW <- PSW OR mask; N<N 2 Condition Codes: <- N OR mask<3>; <~ 7Z OR mask<2>; {- V OR mask<1l>; {- C OR mask<9>; Exceptions: reserved operand Opcodes: B8 BISPSW Bit Set PSW Description: PSW is ORed with the mask operand and PSW 1is replaced by the result. Notes: A reserved operand fault occurs 1if mask<1l5:8> reserved operand fault, the PSW is not affected. 1is not zero. On a Instructions 12-Feb-82 MISCELLANEOUS -- Rev 7 Page INSTRUCTIONS BPT Breakpoint 4-81 Fault Format: opcode Operation: PSLLTP> K- {breakpoint Condition @; fault}; !push current PSL on stack Codes: N <- #; Z <- 0; V <~ @; C <- 0; l!lcondition codes Breakpoint Fault cleared after BPT fault Exceptions: none Opcodes: 23 BPT Description: In order to necessary to the to T-bit, understand read the Chapter implement operation 6. debugging This of this instruction facilities. instruction, is used, it together is with Instructions INSTRUCTIONS MISCELLANEOUS 12-Feb-82 -- Rev 7 Page 4-82 Halt HALT Format: opcode Operation: PSL<current_mode> NEQU kernel then {privileged instruction fault} If else {halt the processor}; Condition N Codes: <- @; 7 <- @; V <- @; C <- @; N <- N; Z <- 7; VvV - V; C <~ C; !If privileged instruction fault lcondition codes are cleared after !'the fault. PSL saved on stack !contains condition codes prior to HALT. !If processor halt Exceptions: privileged instruction Opcodes: 09 HALT Halt Description: In order to understand the operation of this instruction it 1s necessary If the process 1is running in kernel mode, the to read Chapter 6. , a privileged instruction fault occurs. Otherwise halted. processor is Notes: This opcode is @ to trap many branches to data. Instructions 12-Feb-82 MISCELLANEOUS -- Rev 7 INSTRUCTIONS INDEX Compute opcode subscript.rl, Page 4-83 the sum Index Format: size.rl, low.rl, indexin.rl, high.rl, indexout.wl Operation: indexout <- {indexin + subscript} *size; if {subscript LSS low} or {subscript GTR high} then {subscript range trap}; Condition Codes: N <- indexout LSS 4g; Z <- indexout EQL @; V <~ @; C <- 8; Exceptions: subscript range Opcodes: aAa INDEX index Description: The indexin multiplied operand by result. TIf greater than the the is added size subscript the high to the operand. The operand operand, a subscript indexout 1is less subscript operand operand than range is the trap and replaced 1low is by the operand or taken. Notes: l. No arithmetic from this occurs on in the result. operand product use 2. either the add step If overflow is of of exception sum this and The instruction index of and index the trap and cascading INDEX subscript indication multiply is the on the order multiply the the subscript 1low range is steps. low by order If 32 step, 32 cannot if fixed is decimal wuseful length for for index types arrays strings. instructions 1in data The of of the of the the fields, indexin without a for floating) character operand multidimensional true normal calculations and true 1indexout In occur occurs the bits (integer bit result overflow overflow bits operand. overflow can given occurring. calculations strings, than no 1instruction, range arrays or sum occurs replaced the Thus add the subscript for other instruction. permits arrays. For Instructions MISCELLANEOUS INSTRUCTIONS 12-Feb-82 -- Rev 7 Page 4-84 one-dimensional bit field arrays it also permits introd1isuction not of the constant portion of an index calculation which notes ing follow The etic. arithm s addres by readily absorbed will show some of the uses of INDEX. 3. statements: The COBOL g1 A-ARRAY. g1 TO A(I) #1, INDEX I, 410, MOVC3 PL/]1 compile INSV The RO #3, RO B. (5); to: #-3, #10, #5, statements: INTEGER*4 A(Ll:Ul, could #0, #1, RO, #5, A; assumes A byte aligned FORTRAN A(1,J) #10, A-10([RO], BIT INDEX I, 5. #15, statements: DCL A(-3:18) could B. to: compile could The 15 TIMES. B PIC X(19). MOVE 4. OCCURS X(13) A PIC g2 L2:U2), I, J =1 compile to: INDEX J, #L2, #U2, #M1, #0, RO; M1=Ul-Ll1+l INDEX I, MOVL #1, A-alR@); a = {{L2*M1} + L1} *4 #L1, #Ul, #1, R@, RO; Instructions 12-Feb-82 MISCELLANEOUS -- Rev 7 Page INSTRUCTIONS MOVPSL Move opcode dst.wl from PSL from PSL Format: Operation: dst PSL; <<- {— * = s Codes: N <N 2 A< N Z Condition <- Exceptions: none Opcodes: DC MOVPSL Move Description: The destination operand is replaced by PSL (See Chapter 6) . 4-85 12-Feb-82 Instructions MISCELLANEQUS INSTRUCTIONS NOP No Operation No Operation Format: opcode Operation: none Condition Codes: N <- Z <= N; Z; V <~ V; C <= C; Exceptions: none Opcodes: 21 NOP Description: No operation is performed. -- Rev Page 4-86 Instructions 12-Feb-82 MISCELLANEOQOUS -- Rev 7 INSTRUCTIONS POPR Pop Page 4-87 in the Registers Format: opcode mask.rw Operation: for if step EQL 1 1 until 14 do then R{tmp] <- (SP)+; <- C <- W <- V %e <- Z We N O<<N 2 Codes: e Condition tmp <~ @ mask<tmp> Exceptions: none Opcodes: BA POPR Pop Registers Description: The contents mask replaced Bit of operand 15 is if registers are mask<n> ignored. whose replaced is set. by number corresponds longwords The mask is popped scanned to from from set the bit bits stack. & to R([n] bit is 14. Instructions INSTRUCTIONS MISCELLANEOUS Page 4-88 12-Feb-82 -- Rev 7 Registers PUSHR Push opcode mask.rw Format: Operation: for tmp <- 14 step -1 until @ do if mask<tmp> EQL 1 then -(SP) <- Ritmp]; Condition Codes: N <- Z <= N; 7; V <= V; C <~ C; Exceptions: none Opcodes: BB PUSHR Push Registers Description: to set bits in the The contents of registers whose number correspondsrds. R[n] is pushed if longwo mask operand are pushed on the stack as Bit 15 1is 4. bit to 14 bit from d mask<n> is set. The mask is scanne ignored. Notes: The order of pushing 1is specified so that the contents of higher addresses. This results numbered registers are stored at higher memoryadjace nt registers Dbeing in in, say, a double floating datum stored stored by PUSHR in memory in the correct order. Instructions 12-Feb-82 MISCELLANEOUS -- Rev INSTRUCTIONS XFC Extended Function Call Function Call 7 Page 4-89 it is Format: opcode Operation: {XFC <~ C <- - <- V W <- Z wme N Qoo Codes: we Condition fault}; Exceptions: none Opcodes: FC XFC Extended Description: In order to necessary defined to wunderstand read extensions the Chapter to the operation 6. This instruction of this instruction set. instruction, provides for customer QUEUE INSTRUCTIONS 4.8 QUEUE INSTRUCTIONS A queue Page 4-99 12-Feb-82 -- Rev 7 Instructions is a circular, doubly linked list. A queue entry 1is specified Each queue entry is linked to the next via a pair of its address. by the specifies it The first longword is the forward link : longwords. backward the is longword second The location of the succeeding entry. The VAX-11 it specifies the location of the preceeding entry. link : An absolute, and self-relative. supports two distinct types of links : points it that entry the absolute link contains the absolute address of A self-relative link contains a displacement from the present queue to. A queue is classified by the type of link it uses, entry. Queues Absolute 4.8.1 Absolute queues use absolute addresses linked by a The first of pair of as Queue links. are entries longwords. (lowest addressed) longword is the forward link: the succeeding queue entry. The second the address of is the backward link: the address the longword (highest addressed) preceding queue A entry. 1is specified by a queue header which is identical to a pair of queue The forward link of the header is the address queue linkage longwords. The backward link of the of the entry termed the head of the queue. The of the queue. tail the termed entry header is the address of the forward link of the tail points to the header. Two general operations can be performed on queues: and of removal entries. only at the head or tail of a queue. can be inserted or removed elsewhere; its header they restrictions (Under certain this is discussed later.) The following contains examples of queue operations. specified by insertion of entries Generally entries can be inserted or removed at address H: 3 is An empty Jueue ) 1 + s et :H | H | I H | :H+4 - — oo - + oo o —— o — - + —e m o Y 3 1 If an entry at address B is inserted into an empty queue (at either head or tail), the queue is as shown below: the Instructions QUEUE 12-Feb-82 INSTRUCTIONS -- Rev 7 Page 4-91 3 1 ) P | + B Fo e e e e | B | | F o :H + :H+4 + 3 ) 1 3 1 A e l + H o | e | H o | e 3 :B + + ) :B+4 12-Feb-82 -- Rev 7 Instructions QUEUE Page 4-92 INSTRUCTIONS If an entry at address A 1is inserted at the head of the gqueue, the queue as is shown below: 3 Y 1 it + SRR | A | B :H | et + S S PS | :H+4 iy + E S SR PSS Y 3 1 @ 3 1 it + S SSI PR | B | H | e+ S S P LRSS PP :A | :A+4 it + S E S SRSR PSS Y 3 1 ) 3 1 E S+ EE S R PS | H | A | P RS S St + PR | :B+4 it + S S S RI 3 :B Y Instructions QUEUE 12-Feb-82 -- Rev INSTRUCTIONS Finally, if appears as an entry at address C is follows: 7 inserted Page at the tail, the 4-93 queue 3 1 4] P | + A Fo | e | C P e e :H + | e :H+4 + 3 @ 1 3 1 ? P e e e e I P e e e + B [ e | H P A + | e :A+4 + 3 @ 1 3 1 4] P | + C P | e | :B + A | P :B+4 + 3 ) 1 3 1 ) P I + H | Fo I B | Fom :C+4 + 3 ) 1 Following at :C + the the tail above and steps removal at in reverse the head. order gives the effect of removal 12-Feb-82 —-- Rev 7 Instructions QUEUE Page 4-94 INSTRUCTIONS If more than 1 process can perform operations on a queue simultaneously, insertions and removals should only be done at the head or tail of the queue. If only 1 process (or 1 process at a time) can perform other than operations on a queue, insertions and removals can be made at the queue with above -example the In queue. the of tail the head or removed be can B address at containing entries A,B, and C, the entry giving: 3 @ 1 e+ S S S SI :H | A | | C | :H+4 R+ SR SR + S S S R Y 3 1 3 @ 1 + S S S SRS R | C | H | :A + S S SRS | :A+4 + S S b R PSS PS 2 3 1 3 @ 1 e+ S S S SRSS :C l H | | A | :C+4 -+ — e —— boe e+ S S Y 3 1 The reason for the above restriction is that operations at the head or tail are always valid because the queue header is always present; operations elsewhere in the queue present and may become invalid performing operations on the queue. depend on specific entries being if another process is simultaneously absolute queues by an entry specified INSQUE 1inserts an entry INSQUE, and REMQUE. or predecess the by specified entry the following operand into the queue operand. entry the by d specifie entry the removes REMQUE operand. Both INSQUE and Queue entries can be on arbitrary byte boundaries. ions. instruct e rruptibl REMQUE are implemented as non-inte Two instructions are provided for manipulating Instructions QUEUE 4,8.2 Self-relative Self-relative Queue entries (lowest entry addressed) queue is entry header, following specified the by self-relative the the links 7 Page of examples must zero be entries longwords. link : displacement entry. the The A queue longword queue address as The second displacement entry. of at queue of two header from pair link: present consists its a present backward contains by forward the also Rev displacements linked is from which use are from -- 4-95 Queues queues addressed) queue The 12-Feb-82 INSTRUCTIONS is as links. first of the longword succeeding longword of the specified (highest preceding by a queue links. operations. H. Since shown below: the An empty queue is queue is empty, the 3 1 4} o l + ) o | | 4] o | :H+4 + 3 Y 1 If :H + an head entry or at tail), address the B is inserted queue is as shown into an below: empty queue (at either the 3 1 e ) e | B o e e - e e | B P e e e - H :H :H+4 + 0 1 1 ) P e e _+ I H e I o | + | e 3 o + H - B e H - B e | :B + | + :B+4 QUEUE If is an as -- Rev 12-Feb-82 Instructions 7 Page 4-96 the queue INSTRUCTIONS entry shown at address below: is inserted at the head of 3 the queue, @ 1 it + it R | A H B H R N | S S | :H it + | :H+4 + S S S S VRI @ 3 1 3 @ 1 + b e e e e o= | B A | H A | :A -+ e 3 et | :A+4 ) + 1 3 /) 1 b o=+ | H B | :B | A B | :B+4 R R R R RS + RR PS S+ S S NSR A Instructions QUEUE 12-Feb-82 -- Rev 7 Page INSTRUCTIONS Finally, appears if as an entry at address C follows: is inserted at the tail, the 4-97 queue 3 1 1) e e it + | A P e e | C P e e - H | e :H + - H | e e :H+4 + 3 ) 1 3 1 Y] - + | B - A e | :A + I H Fo - A | e :A+4 + 3 o) 1 3 1 For 0] e | C + - B e | A - B | :B + | Fom :B+4 + 3 1 4] 3 1 4 Fo ! + H-C | Fo | B Fo - C | e :C+4 + 3 0 1 Following at :C + the Four head, the tail above and operations insert Furthermore, processes in steps removal at can be at tail, in reverse the order gives the effect of removal head. performed on remove these operations a multiprocessor self-relative from are head, 1interlocked system to queues and access remove to allow a shared insert at from tail. cooperating list without Page 4-98 12-Feb-82 -- Rev 7 Instructions QUEUE INSTRUCTIONS additional synchronization. Hardware supported the queue header. must Queue entries be quadword aligned. interlocked memory access mechanism is used to read 1is Bit @ of the queue header a as wused secondary If an 1is being accessed. is set when the queue interlock and interlocked queue instruction encounters the secondary interlock set, it terminates after setting the condition codes to indicate failure to gain access to the queue. the If the secondary interlock bit is queue interlocked 1instruction clears it at instruction completion. queue sets This it prevents instructions from operating on the same dqueue. 4.8.3 1Instruction other 3. 4, 6. Instructions 1 1Insert Entry into Queue at Tail, Interlocked 1 Insert Entry in Queue 1 INSQTI INSQUE entry.ab, entry.ab, entry.ab, header.aq header.aq pred.ab Remove Entry from Queue at Head, REMQHI 5. interlocked Interlocked Insert Entry into Queue at Head, INSQHI 2. then set, Descriptions The following instructions are described in this section. 1. not during its operation and header.aq, Remove Entry from Queue at Tail, REMQTI header.aq, 1 Interlocked 1 addr.wl Remove Entry from Queue REMQUE entry.ab, Interlocked addr.wl addr.wl 1 Instructions QUEUE 12-Feb-82 INSTRUCTIONS INSQHI Insert opcode entry.ab, Entry into -- Rev Queue at 7 Page Head, 4-99 Interlocked Format: header.aq Operation: tmpl <- (header){interlocked}; lacquire header hardware !must have 'header must !header _RAINBW:: tmpl<@> EQLU 1 access to be quadword aligned cannot be equal to entry 1tmpl<2:1> if interlock write must be zero then TTAl:,NUNES 15:29:57.79 begin interlock (header) {interlocked} <- {set terminate condition end; codes and tmpl; !release hardware instruction}; else begin interlock (header){interlocked} <- tmpl v 1; lIset secondary !release interlock If {all memory accesses !check if !without ! ! !Also, begin can following causing entry header check + for a be completed} addresses tmpl quadword alignment end; else begin {release secondary interlock}; {backup instruction}; {initiate fault}; end; then can be memory management {insert entry into queue}; {release secondary interlock}; end; hardware written exception: QUEUE Page 4-100 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS Condition Codes: if {insertion succeeded} then begin <- @; N 1first entry in queue 7 <- (entry) EQL (entry+4); vV C <<- @; @; end; else begin @; N <- Z <- @; VvV <- 3; Cc <- 1; tsecondary interlock failed end; Exceptions: reserved operand INSQHI 1Insert Entry into Queue at Head, Interlocked Opcodes: 5C Description: The entry specified by the entry operand is inserted into the queue If the entry inserted was the first one in the following the header. The ise it is cleared. queue, the condition code Z-bit is set; otherw 1is ion 1insert The ion. operat tible non-interrup a is insertion ions or removals at interlocked to prevent concurrent interlocked inserter process even in a anoth by the head or tail of the same Qqueue the of part any ing perform Before multiprocessor environment. ion can be processor validates that the entire operation occurs except ment completed. This ensures that if a memory inmanage If the state. tent consis a left (See Chapters 5 and 6), the queue is ction instru the ock, interl ary second the instruction fails to acquire operation, the sets condition codes and terminates. Instructions QUEUE 12-Feb-82 -- Rev 7 Page INSTRUCTIONS 4-101 Notes: l. Because the insertion is non-interruptible, in kernel mode can share queues (See Chapters 5, 6, and 7). The INSQHI, implemented INSQTI, such may synchronization. To set a following REMQHI, access software can be INSERT: a shared interlock processes interrupt service instructions software processes 1list without realized ... with iWas 1$ running routines REMQTI a used: INSQHI BEQL and cooperating that multiprocessor with queue are in a additional queue, the empty? iY€eS BCS INSERT itry CALL inserting WAIT(...) ;no, wait again 1$: During access results 1in insertion A reserved address a is not is altered. if is any access management which exception cannot even started. operand that (header)<2:1> occurs validation, memory fault not not header occurs quadword zero. equals if aligned A entry. entry (i.e. reserved 1In this be completed though the or header <2:9> NEQU operand case the queue 1is @) fault queue an or if also is not QUEUE Page 4-102 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS INSQTI Insert Entry into Queue at Tail, opcode entry.ab, Interlocked Format: header.aq Operation: tmpl <- (header){interlocked}; header ‘l!acquire hardware interlock Imust have write access to theader must be quadword aligned to 'header cannot be equal 1tmpl<2:1> must be zero if tmpl<@> EQLU 1 then begin (header) {interlocked} interlock entry <- lrelease tmpl; hardware {set condition codes and terminate instruction}; end; else begin (header) {interlocked} <- interlock v tmpl interlock 1; !set lrelease secondary hardware If {all memory accesses can be completed} then icheck if the following addresses can be written Iwithout causing a memory management exception: ! ! 1Also, begin entry header + (header + 4) check for quadword alignment {insert entry into queue}; {release secondary interlock}; end; else begin {release secondary interlock}; {backup instruction}; {initiate fault}; end; end; Instructions QUEUE 12-Feb-82 INSTRUCTIONS Condition -- Rev 7 Page 4-103 Codes: if {insertion succeeded} then begin N <- Z <- (entry) V <- 3; C <- @; @; EQL (entry+4); !first entry in queue end; else begin N <- Z <- @; V <- 0; C <~ 1; @; !secondary end; interlock failed Exceptions: reserved operand Opcodes: 5D INSQTI Insert Entry into Queue at Tail, Interlocked Description: The entry specified preceding the queue, condition the insertion interlocked is to the head or multiprocessor by the header. a code operand the Z-bit entry is concurrent tail of the environment. operation, the processor This ensures is inserted inserted set; was otherwise non-interruptible prevent completed. (See entry If the it operation. interlocked validates if a that memory the entire queue in cleared. The insertions management the one is same queue by another Before performing any that into first or the The insertion 1is removals at process part even in a of the operation can be exception occurs Chapters 5 and 6), the queue is left in a consistent state. If the instruction fails to acquire the secondary interlock, the instruction sets condition codes and terminates. Page 4-104 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS QUEUE Notes: 1. Because the insertion is non-interruptible, processes running in kernel mode can share queues with interrupt service routines (See Chapters 5, 6, and 7). are 1in a additional instructions The INSQHI, INSQTI, REMQHI, and REMQTI implemented such that cooperating software processes multiprocessor may access synchronization. To set following INSERT: a software can be used: INSQHI a shared interlock ... BEQL 1$ CALL WAIT(...) BCS INSERT list realized ;yes without with a Qqueue, the ;jwas queue empty? ;try inserting again ;no, wait 1$: During access validation, any access which cannot be completed results in a memory management exception even though the queue insertion is not started. A reserved operand fault occurs if entry, header, or (header+4) 2) is an address that is not quadword aligned (i.e. <2:0> NEQUalso fault operand d reserve A zero. not is or if (header)<2:1> occurs if header equals entry. In this case the queue is not altered. Instructions QUEUE 12-Feb-82 INSTRUCTIONS INSQUE 1Insert opcode entry.ab, Entry in -- Rev 7 Page 4-105 Queue Format: pred.ab Operation: If {all memory accesses begin can be completed} (entry) <- (pred); (entry + 4) <- pred; ((pred) + 4) <- entry; (pred) <- then !forward link of entry lbackward link of entry !backward entry; !forward end; link of link of successor predecessor else begin {backup instruction}; {initiate fault}; end; Condition Codes: N <- (entry) LSS (entry+4); Z <- (entry) EQL V <- (entry+4); @; C <- (entry) LSSU !first entry in queue (entry+4); Exceptions: none Opcodes: OE INSQUE Insert Entry in Queue Description: The entry following inserted set; specified the was operation. if a queue the memory is it Before that the entry operand is inserted specified by the predecessor opera first otherwise validates by entry the in a in the queue, cleared. performing entire management left one is any The part operation exception consistent can occurs state. the condition insertion of be the is a code Chapters queue entry Z-bit is non-interruptible operation, completed. (See into the nd. If the the This 5 processor ensures and 6), that the Page 4-136 12-Feb-82 ~-- Rev 7 Instructions QUEUE INSTRUCTIONS Notes: lo Three types of insertion can be performed by appropriate cholice of predecessor operand: 1. at head Insert 2. Insert at tail entry,@h+4 INSQUE (Note "@" 3. :h is queue head entry,h INSQUE :h is queue head in this case only) 1Insert after arbitrary predecessor INSQUE ;p 1s predecessor entry,p le, processes running Because the insertion is non-interruptib rupt service routines inter in kernel mode can share queues with (See Chapters 5, 6, and 7). mented such that The INSQUE and REMQUE instructions are imple ssor may access proce e singl a in cooperating software processes the ation 1if roniz synch ional addit ut witho a shared list the of tail or head the insertions and removals are only at queue, To set a software following can be used: INSQUE BEQL CALL interlock realized with ... swas queue empty? WAIT(...) ;no, wailt 1$ a queue, the ;yes 1$: which cannot be completed During access validation, any access tion even though the queue results in a memory management excep insertion is not started. Instructions QUEUE 12-Feb-82 INSTRUCTIONS REMQHI Remove opcode header.aq, Entry from -- Rev Queue 7 at Page Head, 4-107 Interlocked Format: addr.wl Operation: tmpl <- (header) {interlocked}; lacquire have !header '!header must header addr hardware Imust access to be quadword aligned cannot equal address of 'tmpl<2:1> if interlock write must be zero tmpl<@> interlock EQLU 1 then begin (header){interlocked} {set end; condition codes <- and tmpl; lrelease terminate hardware instruction}; else begin interlock (header) {interlocked} <- tmpl v 1; !set secondary !release intevlock If {all memory !check accesses if !causing !write ‘read !write the a can memory addr completed} can be management operand contents of header into header check for ! !Also, begin be following + tmpl + tmpl quadword alignment end; else {release secondary interlock}; {backup instruction}; {initiate fault}; end; end; {if (header {remove entry from queue}; {release secondary interlock}; begin then done without exception: tmpl + hardware tmpl + NEQU tmpl) NEQU 0} 4} {if 12-Feb-82 -- Rev 7 Instructions QUEUE INSTRUCTIONS Condition Page 4-108 Codes: if {removal succeeded} then (header) EQL @; begin N <- @; 7 <- vV <- tmpl EQL @; C - !queue empty 'no entry to remove 9; end; else begin <- @; N 7 <- 0; vV <= 1; cC <- 1; 1did not remove anything tsecondary interlock failed end; Exceptions: reserved operand Opcodes: 5E REMQHI Remove Entry from Queue at Head, Interlocked Description: The the Qqueue. The queue entry following the header is removed from no If ed. remov entry the ss of address operand is replaced by the addre to g nothin was there either se entry was removed from the queue (becau set; is bit V code tion condi the d), faile lock inter remove or secondary ock succeeded and the queue 1is otherwise it is cleared. 1If the interl the condition code Z-bit is set; n, empty at the end of this instructio al 1is interlocked to prevent remov The ed. otherwise it is clear head or tail of the concurrent interlocked insertions or removals at the ssor environment. The in a multiproce same queue by another processle even tion. Before performing any part of opera removal is a non-interruptib that the entire operation can be the operation, the processor validifates a memory management exception occurs This ensures that completed. left in a consistent state. If the is (See Chapters 5 and 6), the queue second ary interlock, the instruction instruction fails to acquire the . sets condition codes and terminates without altering the queue Instructions QUEUE 12-Feb-82 INSTRUCTIONS -- Rev 7 Page 4-109 Notes: 1. Because the removal kernel (See mode Chapters The INSQHI, is can 5, 6, and INSQTI, implemented such multiprocessor release following 1$: a may access be interrupt and REMQTI cooperating a interlock ... BEQL 23 ;removed in routines instructions list realized running service software shared used: REMQHI processes with 7). REMQHI, software can queues that synchronization., To non-interruptible, share are processes without with in a additional a queue, the last? ;yes BCS 1$ CALL itry ACTIVATE (...) iActivate removing again other waiters 2S: To remove be used: 15: 2S: entries empty, the .., Process removed BR 1$ H 18 itry removing access which access in is memory not NEQU @) fault the address altered. of an or any management fault address if also the can removed? entry started. operand 1is following ;no validation, a reserved (header)) ;janything empty results <2:8> is 2$ BCS operand queue REMQHI During A the BVS queue removal until exception occurs that (header)<2:1> occurs addr if the operand. is 1is cannot be even though if header or not quadword not header In again this case the A + (i.e. reserved operand the queue (header aligned =zero. address completed queue equals is not QUEUE Page 4-110 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS REMQTI Remove Entry from Queue at Tail, Interlocked opcode header.aq, Format: addr.wl Operation: tmpl <- (header){interlocked}; lacquire hardware interlock Imust have access write to theader must be quadword aligned theader cannot equal address of header addr ltmpl<2:1> must be if tmpl<@> EQLU 1 then begin (header) {interlocked} interlock zero <- tmpl; lrelease hardware {set condition codes and terminate instruction}; end; else begin interlock interlock (header){interlocked} <- tmpl v 1; Iset secondary lrelease hardware If {all memory accesses can be completed} then tcheck if the following can be done without lcausing a memory management exception iwrite addr operand tmpl iread contents of header + (header + 4) {if NEQU 0} ! iwrite into header + ! 3} (header + 4) + (header + 4 + (header + 4)) {if tmpl NEQU 1Also, check for quadword alignment begin {remove entry from queue}l; {release secondary interlock}; end; else begin {release secondary interlock}; {backup instruction}; {initiate fault}; end; end; Instructions QUEUE 12-Feb-82 INSTRUCTIONS Condition -- Rev 7 Page 4-111 Codes: if {removal succeeded} then begin N <- Z <- (header V <- tmp3 C <- 0; @; + EQL 4) EQL ¢; !queue 4 !no empty entry to remove end; else begin N <- @; Z <- 0; V <-1; !did C <- !secondary 1; end; not remove anything interlock failed Exceptions: reserved operand Opcodes: 5F REMQTI Remove Entry from Queue at Tail, Interlocked Description: The queue address entry entry was remove is removed or otherwise empty preceding operand from secondary it at is the replaced the interlock cleared. If otherwise end of it 1is cleared. concurrent interlocked same by removal the is a sets the This Chapters instruction this 5 The ensures fails condition codes a acquire if queue is the terminates a the entry there condition the was code the Before the memory left head a secondary without or to tail any operation exception consistent interlock, altering is set; queue Z-bit performing entire bit is the state. the no to is set; prevent of environment. manadement in V interlocked at The If nothing the code multiprocessor that dueue. removed. and condition 1is operation. that to and in from the succeeded removals validates the the removal or even 6), of either interlock insertions process removed (because instruction, processor and is address failed), the non-interruptible operation, completed. (See another the queue the queue header by the The part of can be occurs If the instruction queue. INSTRUCTIONS QUEUE Notes: l. Page 4-112 12-Feb-82 -- Rev 7 Instructions g 1in Because the removal is non-interruptible, processes runnin es routin e servic upt kernel mode can share queues with interr (See Chapters 5, The INSQHI, 6, and 7). INSQTI, REMQHI, and implemented such that cooperating multiprocessor may access a shared REMQTI instructions are queue, the software processes in a list without additional synchronization. with a To release a software interlock realized REMQTI ... ;removed last? BCS CALL 1$ ACTIVATE(...) ;try removing again ;Activate other waiters following can be used: 1$: 2$ BEQL ;yes 2%: To remove entries until the queue is empty, the be 1$: following can used: ;janything removed? ... REMQTI ; no BVS 2$ process removed BR 1$ ; 1$ ;try removing again 2$: BCS queue entry empty be completed During access validation, any access which cannot h the queue thoug even tion excep ement manag y results in a memor removal is not started. (header + 4), or A reserved operand fault occurs if header, is not quadword that address (header + (header + 4)+4) is an is not =zero. :1> er)<2 (head if or aligned (i.e. <2:0> NEQU @) r address heade the if s occur also fault nd A reserved opera case this In operand equals the address of the addr operand. the queue is not altered. Instructions QUEUE 12-Feb-82 INSTRUCTIONS REMQUE Remove opcode entry.ab,addr.wl Entry From -~ Rev 7 Page 4-113 Queue Format: Operation: if {all memory acceses begin ((entry+4)) <- ((entry)+4) addr <- can be completed} (entry); <- (entry then !forward link +4); !backward entry; of predecessor link of successor end; else begin {backup instruction}; {initiate fault}; end; Condition Codes: N <- (entry) LSS (entry+4); Z <- (entry) EQL (entry+4); V <- entry C <- (entry) EQL !queue (entry+4); LSSU !no empty entry (entry+4); to remove is removed Exceptions: none Opcodes: oF REMQUE Remove Entry from Queue the entry Description: The queue queue. removed. If condition empty entry The at there code the specified address V end was bit of by operand no is this the memory left in entire management a entry Set; The of operation exception consistent state. operand replaced in the otherwise instruction, otherwise it is cleared. Before performing any part that is the queue it the by is to can occurs be cleared. condition removal the address the Z-bit is a non-interruptible operation, the processor be completed. (See Chapters This 5 and the the entry removed, 1If code from of is is set; operation. validates ensures that 6), queue the the queue if a is Instructions INSTRUCTIONS QUEUE Notes: 1. Page 4-114 12-Feb-82 -- Rev 7 Three types of removal can be performed by suitable choice of entry operand: Remove at head 1. REMQUE 2. ;h is queue header Remove at tail REMQUE 3. @h,addr @h+4,addr :h is queue header Remove arbitrary entry REMQUE entry,addr ; uptible, processes running 1in Because the removal is non-interr s with interrupt service routines kernel mode can share queue (See Chapters 5, 6, and 7). The INSQUE and REMQUE instructions are implemented such that may access cooperating software processes in a single processor ional synchronization 1if of the a shared 1list without addit the only at the head or tail are insertions and removals queue. realized with To release a software interlock followng can be used: REMQUE BEQL CALL a ... ;jqueue empty? ACTIVATE (...) ;Activate other waiters 1$ To remove entries until the queue is empty, the 1$: the jyes 1$: be queue, following can used: ... ;anything removed? BVS EMPTY ; No BR 19 ; REMQUE s which cannot be completed During access validation, any acces the queue results in a memory management exception even though removal is not started. Instructions FLOATING 4.9 2-Feb-81 POINT -- Rev 6.2 on four Page INSTRUCTIONS FLO POINT ATI INSTRUCTI NG ONS The floating and point instructions D_floating operate instructions are standard and H floating instructions are optional VAX-11/750; standard on the VAX-11/730. and the In order faults to be on consistent reserved point functions that the input is operand(s) a floating In order to move or set, combinations combinations involve a both Specifically: is if wused as .rf, .rd, an addressing .rg, point operand 4.9.1 is are same of .mf, .md, .mg, which autoincrement and an floating or .mh (+ or a K is -) an floating 1/72 the point instruction. simultaneous contents operand) and modifies Rn deferred), the point and number, LEQ fractional normalized. value of VAX-11 floating K K LSS mode These use of of operand as an (i.e., value a register (i.e., address a in autoincrement, of the floating number may 1is a non-negative are uniquely be defined as having the f and f factor, the is f, of point are number zero, data for provided D_floating), precision, precision, by f is must then be formats floating : and the two Single precision, or or For imposing said assigned to the D floating, G_floating, or two extended data data are point range floating, is is 64 64 derived a the data bits bits Four long. long. 9, 32 and this types PDP-11 formats is binary from numbers. standard be value indeterminate. data and the number representation and H_floating). fraction. determined 1. floating point (F_floating £ For mathematical double floating addressing input condition Double the the (2**K)*f, integer non-vanishing The of point UNPREDICTABLE. form the do address. instruction a verify this to on point inconsistent operand the placed floating 1logically should way Introduction Mathematically, where single part VAX-11/780 operand(s). implementations a mode or input both floating processors. the function) reserved. An easy the point on absolute not within .rh, autodecrement, the speed the floating F VAX point instruction set which Chapter 2), software implemented restrictions a types. all floating (See (are) of high within value as is certain usable the (e.g., test facilitate instruction with operands floating Rn data on G_floating The 4-115 of formats (G_floating bits long. Extended range Extended range FLOATING POINT 1. INSTRUCTIONS precision, quadruple is notation magnitude Page 4-116 2-Feb-81 -- Rev 6.2 Instructions Non-zero or used, floating follows: as point Sign 1long. bits 128 1is data H floating, numbers: The most significant bit of the floating point data is the sign bit: g for positive, and 1 for negative. The fractional factor f is assumed bit significant This 1 must be 1. stored in the data word, but of carrying before arithmetic out 1its that so normalized, it is the "hidden" bit: the course operations. hardware The most is not it restores F floating and for £, which D floating data types use 23 and 55 bits, respectively, the hidden bit, imply effective significance of 24 bits and 56 with types, data range extended The bits for arithmetic operations. G floating and H floating, use 52 and 112 bits, respectively, for f, which with the hidden bit, 113 bits for arithmetic imply effective significance and 53 of operations. In the F floating and D_floating data types, eight bits are reserved storage the for the of exponent K in excess 128 notation. For g to 255. reasons given below, Thus in biased form, by exponents from -128 to +127 could be represented, a biased EXP of @ (true exponent for the Thus, zero. floating point for of -128), is reserved to restricted are exponents types, data and D_floating F floating to 1 notation, the range -127 to +127 inclusive, or in excess 128 255. for reserved In the G floating data type eleven bits are the storage In the H floating data in excess 1024 notation. of the exponent in type fifteen bits are reserved for the storage of the exponent for reserved is @ of exponent biased A 16384 notation. excess to -1223 to restricted Thus, exponents are floating point zero. to 2047), and -16383 to 1 (in excess notation, inclusive +1023 +16383 inclusive (in excess notation, 1 to 32767) for the G floating and H floating data types respectively. 2. Floating point zero: Because of the hidden bit, distinguish 1is factor between exactly sign-exponent field zero 1/2. of the and factor fractional non-zero Therefore is not available to numbers the @ for this purpose. @ by the floating point instruction set. floating point operand, whose bits are all ¢'s, and reserves a were an Any positive floating point number with biased exponent of @ is treated as exact whose fractional VAX-11 if it 1In particular, a is treated as zero, this is the format generated by all floating point instructions the result is zero. for which 3. The Reserved Operands: A reserved operand is defined to be any bit pattern with a sign bit operand is of one and a biased exponent of zero. point instructions generate a fault On the VAX-11, all floating 1if a reserved Instructions FLOATING 2-Feb-81 POINT eéncountered. floating 4.9.2 The VAX-11 has, in of the two and fractional argument of standard of with floating all underflow. terms. and discussed The VAX-11 point in 1is instructions to floating in the There is a class NEG, CLR, CMP, and branch) and underflow. All of the operand codes or are exception an of TST. on as the to well in SUB, EMOD types. the MUL, and EMOD product the sense the given respective rounding and POLY, its to exponent the next section, The FU on the degree, on the descriptions. associated overflow and and between are is always the to rounding and exceptions all the VAX-11 by zero, the If PSW, the 1s FU zero is returned of the VAX-11 ACB from types The of exact: (add, errors, fault instructions divide in which there point underflow. underflow a integer the error, floating overflow. Details are instructions. bit, also rounding integer subject Floating DIV and G _floating. Many of these defined In the section on accuracy finally, or conversion generate instructions overflow on for instructions is a Details errors as induce CVT And, of generates into coefficients. their D_floating which point exception the subject move-type floating occurs are a UNPREDICTABLE. disable result set (byte, in 4-117 The results of these section on accuracy. polynomial, of in instructions encountered. of given few may wunderflow, or and floating a table are between instruction, 1is occurrence of description of a of instructions for conversion word, longword) to all floating G_floating, Hfloating), and vice versa. exact, However, overflow, given set except are follow. as complete has types a data 6. types D floating, a to discussed Chapter (F_floating, floating evaluates ADD, types. in the operations, separates then generated operations composite operations, VAX-11 also Page Set and POLY a never point and POLY instructions also has arithmetic integer 6.2 floating pointer Accuracy are is arithmetic two four operands, these Rev four floating data rounded, as described EMOD All operand Instruction addition, for the operation The for all are always implemented product reserved instruction. Of has operations It A point Overview implemented -- INSTRUCTIONS if also and overflow a reserved fault the MOV, compare on the condition available to enable bit 1is clear, no as the result., 1If FU bit is set, a fault occurs on underflow. Further details on the actions taken if any of these exceptions occurs are included in the descriptions of the instructions, and comple tely discussed in Chapter 6. 4.9.3 Accuracy General comments instruction instructions they operate. set may on the accuracy floating are presented here. The descriptions of the include additional details on the accuracy point individual at which Instructions FLOATING POINT INSTRUCTIONS Page 4-118 2-Feb-81 -- Rev 5.2 An instruction is defined to be exact if its on extended result, the of an right by an infinite sequence of zeroes, is identical tos.that The a infinite precision calculation 1involving the same operand etic arithm all For d. ignore priori accuracy of the operands is thus operations, except DIV, a zero operand implies that the instruction is exact. dividend. The statement same But if it is the instruction faults. holds divisor, for DIV if the zero operand is the division Iis and undefined the factor 1is binary For non-zero floating point operands, the fractional ion (F_floating) or precis single for Dbits 56 normalized with 24 or for double precision (D _floating), respectively; and 53 or 113 bits range d extende and range double precision (G_floating), extended for quadruple precision (H_floating), respectively. We show below that bits, guard two and left, the on bit, w overflo an DIV, and ADD, SUB, MUL on the right, are necessary and sufficient to guarantee return of a rounded identical result to the corresponding operation rounded to the specified word length. bits, bit). infinite Thus, with precision two guard a rounded result has an error bound of 1/2 LSB (least significant o bits are lost 1in Note that an arithmetic result is exact if no non-zer to be stored. length data the to chopping the infinite precision result (D _floating), 56 g), floatin (F 24 the that Chopping is defined to mean normalized the of bits order high ating) (H_flo 113 or 53 (G _floating), bits are the of rest the fractional factor of a result are stored; to as the ed referr 1is ng choppi in The first bit lost discarded. chopped the to d relate is result d rounde a of "rounding" bit. The value result as follows: 1. If the rounding bit is one, the rounded result is the result incremented by an LSB (least significant bit). <chopped 2. 1If the rounding bit is zero, the rounded chopped results are and identical. results All VAX-11 processors implement rounding so as to produce a 1l Add thm. algori ing follow the by ed produc s result the identical to a that Note occurs. it if to the rounding bit, and propagate the carry, after rounding takes place; 1if this once. happens, the new rounding bit will be zero, So it can happen only d rounde d, choppe among The following statements summarize the relations renormalization and true 1. may be required (infinite precision) results: If a stored result is exact rounded value = chopped value = true value. 2. 1If a stored result is not exact, it's magnitude 1. is always less than that of the true result for chopping. Instructions FLOATING 2-Feb-81 POINT 2. is the 3. is -- Rev 6,2 Page INSTRUCTIONS always less rounding greater rounding than bit than bit is that of the the true is zero. that of one. true result result for for 4-119 rounding rounding if if the Instructions FLOATING POINT INSTRUCTIONS 2-Feb-81 -- Rev 6.2 Page 4-120 Instruction Descriptions 4.9.4 The following instructions are described in this section. Instructions 1. 2. 3. 4 Add 2 Operand add.rx, ADD{F,D,G,H}2 4 Add 3 Operand CLR{L=F,Q=D=G,O=H} 5. Convert cMP{F,D,G,H} sum.wX 3 Clear Compare add2.rx, addl.rx, ADD{F,D,G,H}3 4, sum.mx dst.wx 4 src2.rx srcl.rx, cvr{F,D,G,H}{B,W,L,F,D,G,H} src.rx, dst.wy cvr{s,w,L}{F,D,G,H} 34 src.rx, dst.wy All pairs except FF,DD,GG,HH,DG, and GD 6. Convert Rounded CVTR{F,D,G,H}L src.rx, dst.wl 4 4 7. Divide 2 Operand 8. Divide 3 Operand 4 Extended Modulus EMOD{F,D} mulr.rx, mulrx.rb, muld.rx, int.wl, fract.wx 4 Move Negated 4 9., DIV{F,D,G,H}2 divr.rx, DIV{F,D,G,H}3 quo.mX divr.rx, divd.rx, quo.wx EMOD{G,H} mulr.rx, mulrx.rw, muld.rx, int.wl, fract.wx 18. 11. 12. 13. 14. MNEG {F,D,G,H} Move MOV{F,D,G,H} src.rx, dst.wX 4 src.rx, dst.wx Multiply 2 Operand 4 Multiply 3 Operand 4 Polynomial Evaluation F floating 1 MUL{F,D,G,H}2 mulr.rx, prod.mx MUL{F,D,G!H}3 mulr.rx, muld.rx, prod.wx POLYF arg.rf, degree.rw, tbladdr.ab, {RE-3.wl} Instructions FLOATING 15, POINT Polynomial POLYD 16. -- 6,2 Page 4-121 tbladdr.ab, {R#-5.wl} G _floating degree.rw, Evaluation arg.rh, Rev D floating degree.rw, Evaluation arg.rg, Polynomial POLYH Evaluation arg.rd, Polynomial POLYG 17, 2-Feb-81 INSTRUCTIONS tbladdr.ab, {R#-5.wl} H floating degree.rw, tbladdr.ab, {RO-5. (SP): w1 -1 ,(SP)16 .wb} 18. Subtract 2 Operand SUB{F,D,G,H}2 19. Subtract 3 The following Control lo sub.rx, min.rx, dif.wx Test TST{F,D,G,H} on dif.mx Operand SUB{F,D,G,H}3 20. sub.rx, src.rx floating point Instructions. Add Compare and ACB{F,D,G,H} Compare add. is LE instructions described in Branch limit.rx, on are add.rx, positive add, index.mx, GE on displ.bw negative the section Instructions POINT FLOATING INSTRUCTIONS ADD Page 4-122 2-Feb-81 -- Rev 5.2 Add Format: opcode add.rx, 2 operand sum.mX opcode addl.rx, addZ2.rx, sum.wx 3 operand Operation: sum <- sum + add; sum <- addl + addZ2; Condition 12 operand 13 operand Codes: N <- sum LSS 0; 7 <- sum EQL @; C K- 8; V <- {floating overflow}; Exceptions: floating floating reserved overflow underflow operand Opcodes: Operand 40 ADDF2 Add F _floating 2 4¢FD ADDG2 ADD G floating 2 Operand 41 60 61 41FD 60FD 61FD ADDF3 ADDD2 ADDD3 ADDG3 ADDH2 ADDH3 Add F floating 3 Operand Add D floating 2 Operand Add D floating 3 Operand ADD G floating 3 Operand ADD H floating 2 Operand ADD H floating 3 Operand Description: In 2 operand format, the addend operand is added to the sum operand and In 3 operand format, the sum operand is replaced by the rounded result. operand and the sum 2 addend the to added is operand the addend 1 operand is replaced by the rounded result. Notes: and 1. On a reserved operand fault, the sum operand is unaffected 2. Zero is On floating underflow, if FU is set a fault occurs. clear. is FU if stored as the result of floating underflow only . unaffected is operand sum the fault, On a floating underflow no and @ by d replace 1is operand sum the clear, If FU is the condition codes are UNPREDICTABLE. Instructions FLOATING 2-Feb-81 POINT INSTRUCTIONS exception 3. On is -- Rev 6.2 Page 4-123 occurs. floating overflow, the instruction faults; the sum operand unaffected, and the condition codes are UNPREDICTABLE. 2-Feb-81 Instructions -- Rev Page 6H.2 4-124 POINT INSTRUCTIONS FLOATING Clear CLR Format: opcode dst.wx Operation: dst <- d; Condition Codes: N <- 0@; Z <- 1; V <- 0; C <= C; Exceptions: none Opcodes: D4 CLRF 7C CLRD CLRG 7CFD CLRH Clear F floating Clear G _floating Clear D floating, Clear H floating Description: The destination operand is replaced by 9. Notes: CLRx dst is equivalent to MOVx #0, dst, but is 5 (F_floating) (D_floating or G _floating) or 17 (H_floating) bytes shorter. or 9 Instructions FLOATING 2-Feb-81 POINT -- Rev 6.2 Page 4-125 The only INSTRUCTIONS CMP Compare Format: opcode srcl.rx, src2.rx Operation: srcl Condition - src2; Codes: N <- srcl LSS src2; Z <- srcl EQL src2; V <- @; C K- 0; Exceptions: reserved operand Opcodes: 51 CMPF Compare F floating 71 CMPD Compare D floating 51FD CMPG Compare G _floating 71FD CMPH Compare H floating Description: The source action is 1 to operand is affect the compared with the condition codes. source 2 operand. Notes: On a reserved operand fault, the condition codes are UNPREDICTABLE. 2-Feb-81 Instructions FLOATING POINT -- Rev 6.2 INSTRUCTIONS Convert CVT Format: opcode src.rx, dst.wy Operation: dst NN 2 Condition <- conversion of src; Codes: <.. dst LSS 0; <- dst EQL @; <- {src 2; <_ cannot be represented in dst}; Exceptions: integer overflow floating floating overflow underflow reserved operand Opcodes: F floating D floating 4c CVTBF Convert Byte to 6C CVTBD Convert Byte to 4CFD CVTBG Convert Byte to 6CFD CVTBH Convert Byte to 4D CVTWF Convert Word to 6D CVTWD Convert Word to D floating 4DFD CVTWG Convert Word to 6DFD CVTWH Convert Word to G floating H floating 4E CVTLF Convert Long to F floating 6E CVTLD Convert Long to D floating 4EFD CVTLG Convert Long to G 6EFD CVTLH Convert Long to G floating H floating F floating floating H floating Page 4-125 Instructions FLOATING POINT 2-Feb-81 -— Rev INSTRUCTIONS 48 CVTFB Convert 68 F_floating CVTDB to Byte Convert 48FD D floating CVTGB to Byte Convert 68FD G floating CVTHB to Byte Convert H floating to Byte 49 CVTFW Convert 69 49FD F floating CVTDW to Convert Word CVTGW D floating to Word Convert 069FD G_floating to CVTHW Word Convert H floating to Word 4A CVTFL Convert F floating 4B to CVTRFL Long Convert 6A Rounded CVTDL Convert Dfloating to F_floating 6B CVTRDL Convert 4AFD CVTGL Convert 4BFD OAFD G_floating CVTRGL Convert CVTHL Convert 6BFD Rounded H_floating CVTRHL Convert Rounded Rounded to Long to Long to Long to Long Long D_floating to Long G_floating to 6.2 Long H_floating 56 CVTFD Convert 99FD F floating CVTFG to Convert D floating 98FD F floating CVTFH to Convert G_floating F floating to H floating 76 CVTDF Convert D_floating 32FD to CVTDH F floating Convert D floating to H _floating 33FD CVTGF Convert 56FD G _floating to CVTGH F_floating Convert G_floating to H floating F6FD CVTHF Convert F7FD H floating to CVTHD F _floating 76FD Convert CVTHG H floating Convert to H_floating D floating to G_floating Page 4-127 Instructions FLOATING POINT INSTRUCTIONS Page 4-128 2-Feb-81 -- Rev 6.2 Description: The source operand is converted to the the data type of CVTHD, and CVTHG destination operand and the destination operand is replaced by the result. The form of the conversion is as follows: CVTBF exact CVTBD exact CVTBG exact CVTBH exact CVTWF exact CVTWD exact CVTWG exact CVTWH CVTLF exact CVTLD CVTLG exact CVTLH exact rounded exact truncated truncated truncated CVTGB truncated CVTHB truncated CVTFW truncated CVTDW truncated CVTGW truncated CVTHW truncated CVTFL CVTRFL rounded truncated CVTDL CVTFB CVTDB CVTRDL rounded CVTGL CVTRGL CVTHL rounded truncated truncated CVTRHL rounded CVTFD exact CVTFG exact CVTFH exact CVTDF rounded CVTDH exact CVTGF rounded CVTGH CVTHF exact CVTHD CVTHG rounded rounded rounded Notes: l. Only CVTDF, CVTGF, CVTHF, can result 1in the destination operand is unaffected floating overflow fault; and the condition codes are UNPREDICTABLE. Instructions FLOATING 2. 2-Feb-81 POINT Only converts with in a floating a reserved operand destination operand is UNPREDICTABLE, Only -- INSTRUCTIONS converts with integer overflow. is replaced by the Only CVTGF, underflow. result of floating If FU by CVTHD, is underflow @ point On unaffected integer 6.2 a Page source operand reserved and the destination can operand condition operand can If FU and no set and a CVTHG fault can occurs. underflow only fault, the 1is clear, exception if the occurs. result Zero result the codes are result FU in is 1is clear. destination in operand floating stored destination 4-129 fault, On integer overflow, the destinatio n low order bits of the true resul t. floating unaffected. replaced CVTHF, an fault. Rev as On the a operand 1is operand is Instructions POINT FLOATING INSTRUCTIONS Page 4-130 2-Feb-81 -- Rev 6.2 Divide DIV Format: 2 operand quo.mx opcode divr.rx, opcode divr.rx, divd.rx, quo.wx 3 operand Operation: quo <~ quo / divr; quo <- divd / divr; N<< N2 Condition 12 operand 13 operand Codes: <- quo LSS #; <- quo EQL @; <- {floating overflow} or {divr EQL @}; <- 0; Exceptions: floating overflow floating underflow =zero divide by DIVF2 Divide 66 DIVD2 Divide D floating 2 Operand 46FD DIVG2 Divide G floating 2 Operand 66FD DIVH2 Divide H floating 2 Operand reserved operand Opcodes: 46 DIVF3 477 67 47FD 67FD DIVD3 DIVG3 DIVH3 F_floating 2 Operand Divide F floating 3 Operand Divide D floating 3 Operand Divide G _floating 3 Operand Divide H floating 3 Operand Description: In 2 operand format, the quotient operand is divided by the divisor operand and the quotient operand is replaced by the rounded result. 1In 3 operand format, the dividend operand is divided by the divisor operand and the quotient operand is replaced by the rounded result. Notes: 1. On a reserved operand fault, the quotient operand is unaffected and the condition codes are UNPREDICTABLE. Instructions FLOATING 2. 2-Feb-81 POINT On -- Rev floating underflow, stored as On floating a the result unaffected. if of wunderflow If FU is FU is Page no exception occurs. On floating overflow, the operand is unaffected, divide by as zero, in 3. the the and quotient above. fault the the operand occurs. only if is the condition and is condition 1is clear. operand operand faults; 4-131 Zero FU quotient quotient 1instruction UNPREDICTABLE. affected a underflow fault, clear, 8 and set floating by On 6.2 INSTRUCTIONS is replaced quotient codes codes are are Instructions FLOATING POINT INSTRUCTIONS Page 4-132 2-Feb-81 -- Rev 6.2 Extended Multiply and Integerize EMOD Format: EMODF and EMODD: opcode mulr.rx, mulrx.rb, muld.rx, int.wl, fract.wx EMODG and EMODH: opcode mulr.rx, mulrx.rw, muld.rx, int.wl, fract.wx Operation: int <- integer part of muld * {mulr'mulrx}; fract <- fractional part of muld * {mulr'mulrx}; NN 2 Condition Codes: <- fract LSS @; <- fract EQL @; <- {integer overflow}; <- 0; Exceptions: integer overflow reserved operand floating underflow Opcodes: 54 74 S4FD 74FD EMODF EMODD EMODG FEMODH Extended Multiply and Integerize F_floating Extended Multiply and Integerize D floating Extended Multiply and Integerize G_floating Extended Multiply and Integerize H floating Description: The multiplier extension operand is operand to gain 8 (EMODD and concatenated EMODF), 11 with (EMODG), the or multiplier 15 (EMODH) the additional low order fraction bits. The low order 5 or 1 bits andof EMODH EMODG the by ignored are operand on 16-bit multiplier extensi ied by instructions respectively. The multiplicand operand onis is multipl the that such licati the extended multiplier operand. The multip (before ed truncat product exact the result 1is equivalent to in F floating, 64 bits in normalization) to a fraction field of 32 bitsng. Regarding the result D floating and G_floating, and 128 in H_floati sign, the integer same the of on as the sum of an integer and fracti Instructions FLOATING POINT 2-Feb-81 -- Rev 6.2 of the operand is replaced by the integer operand is part replaced by the rounded fractional Notes: l. On a reserved fraction operand operand fault, are floating integer underflow, and occurrence floating On bits Floating FU 1is parts underflow the are occurs., by =zero The on the no clear, the integer exception occurs. are and fraction parts are overflow, operand If # FU and of of fault, is the the integer true result. the the Because the is indicated 1is by possible integer 1. and results. fraction part, is fault and codes parts overflow operand operand fraction integer integer a if fraction condition replaced only the result. and overflow signs set are it part 1is is the fraction rounded possible is integer in overflow. The The the integer overflow integer integer and 1is by integer the of 4-133 FU unaffected. order floating underflow replaced if fraction of result part unaffected. UNPREDICTABLE, On Page INSTRUCTIONS that replaced by overflow; absence are after the clear. the of same separation value of the On the a low however floating unless of the fraction POINT FLOATING Page 4-134 2-Feb-81 -- Rev 6.2 Instructions INSTRUCTIONS MNEG Move Negated Format: opcode src.rx, dst.wx Operation: dst <~ -src; Condition Codes: N <- dst LSS 9; Z <- dst EQL 0; V <~ K- C @; 08; Exceptions: reserved operand Opcodes: 52 MNEGF Move Negated F_floating 52FD MNEGG Move Negated G floating 72 72FD MNEGD MNEGH Move Negated D floating Move Negated H floating Description: The destination operand is replaced by the negative of the source operand. Notes: On a reserved operand fault, the destination operand is the condition codes are UNPREDICTABLE. unaffected and Instructions FLOATING 2-Feb-81 POINT -— Rev 6.2 by the source Page 4-135 unaffected and INSTRUCTIONS MOV Move Format: opcode src.rx, dst.wx Operation: dst Condition <- src; Codes: N <- dst LSS 4; Z <- dst EQL 0; V <- 9; C <= C; Exceptions: reserved operand Opcodes: 50 MOVF Move F floating 10 MOVD Move D floating 50FD MOVG Move G 70FD MOVH Move H floating floating Description: The destination operand is replaced Notes: On the a reserved condition operand codes fault, are the destination UNPREDICTABLE. operand. operand is Instructions POINT INSTRUCTIONS FLOATING Page 4-136 2-Feb-81 -- Rev 6.2 Multiply MUL Format: opcode mulr.rx, prod.mX opcode mulr.rx, muld.rx, prod.wx 2 operand 3 operand Operation: prod <- prod * mulr; prod <- muld * mulr; 12 operand 13 operand N<N 2 Condition Codes: <- prod LSS @; <- prod EQL @; <- 0; <- {floating overflow}; Exceptions: floating overflow reserved operand floating underflow Opcodes: 44 MULF2 Multiply F floating 2 Operand 64 MULDZ Multiply Dfloating 2 Operand MULF3 45 65 44FD 45FD 64FD 65FD MULD3 Multiply F _floating 3 Operand Multiply D floating 3 Operand MULG2 Multiply G floating 2 Operand MULH2 MULH3 Multiply H floating 2 Operand Multiply H floating 3 Operand MULG3 Multiply G floating 3 Operand Description: In 2 operand format, the product operand is multiplied by the multiplier 1In 3 r multiplie the by d is multiplie operand and the product operand is replaced by the rounded result. operand format, the multiplicand operand operand and the product operand is replaced by the rounded result. Notes: 1. On a reserved operand fault, ~ Ay~ the pr oauct ope and the condition codes are UNPREDI CTABLE. Instructions FLOATING 2. 2-Feb-81 POINT On floating underflow, stored as On floating a the result floating operand is Rev 6.2 Page UNPREDICTABLE. FU is floating clear, set fault, the a fault underflow the product occurs. overflow, is if of wunderflow unaffected. If FU @ and no exception On -- INSTRUCTIONS the unaffected, instruction and the occurs. only if product operand 4-137 Zero FU is operand is faults; condition replaced the is clear. is by product codes are Instructions FLOATING INSTRUCTIONS POINT Page 4-138 2-Feb-81 -- Rev 6.2 Polynomial Evaluation POLY Format: opcode arg.rx, degree.rw, tbladdr.ab Operation: tmpl <- degree; tmp2 <- tbladdr; tmp3 <- if tmpl GTRU 31 then RESERVED OPERAND FAULT; ltmp3 accumulates the partial result { (tmp2)+1}; if POLYH then -(SP) <while tmpl GTRU 0 do 'tmp3 is of type x arg; lcomputation loop begin tmp4 <- {arg * tmp3}; 1tmp4 accumulates new partial result. 1tmp3 has old partial result. iPerform multiply, and retain the 31 (POLYF) , 163 (POLYD, POLYG), or 127 (POLYH) most significant 1bits of the fraction by truncating the unnormalized Iproduct. (The most significant bit of the 31, 63, tmp4 <- lor 127 bits in the product magnitude will be zero 1if the product magnitude is LSS 1/2 and GEQ 1/4.) IUse the result in the following add operation. tmpd + (tmp2); Inormalize, and round to type X. 1Check for over/underflow only after the combined 'multiply/add/normalize/round sequence. if OVERFLOW then FLOATING OVERFLOW FAULT if UNDERFLOW then begin if FU EQL 1 then FLOATING UNDERFLOW FAULT; 1force result to 0; tmpd <- 0; end; tmpl <- tmpl - 1; tmp2 <- tmp2 + {size of data type}; tmp3 <- tmp4; end; if POLYF then begin RO <- tmp3; R1 <- 0; R2 <- 0; R3 <- tmp2; end; if POLYD or POLYG then begin R1'RO <- tmp3; R2 <- 0; R3 <- tmp2; R4 <- 0; tupdate partial result in tmp3 Instructions FLOATING 2-Feb-81 POINT -- Rev 6.2 Page INSTRUCTIONS R5 <~ 4-139 @; end; if POLYH then begin SP <- SP + 16; R3'R2'R1'RP R4 R5 <~ <- <- tmp3; @; tmp2; end; Condition Codes: N <- R@ LSS @; Z <- R@ EQL @; V <- {floating C <- 0; overflow}; Exceptions: floating overflow floating underflow reserved operand Opcodes: 55 POLYF Polynomial 75 55FD Evaluation POLYD Polynomial POLYG Evaluation Polynomial F floating D floating 75FD POLYH Evaluation Polynomial G Evaluation floating H floating Description: The table The address <coefficient operand of the points highest to a table of polynomial term of the order coefficients. polynomial is pointed address operand. The table is specified with 1lower order coefficients stored at increasing addresses. The data type of the coefficients is the same as the data type of the argument operand. The evaluation 1is carried out by Horner's method and the contents of R® to by the (R1'R@ result. table for POLYD The if d and = x The Notes: R3'R2'R1'R@ for is: POLYH)) are replaced by the arg = unsigned longwords on interrupted. POLYG, computed degree = result coefficient and result C[@] word to the + x*(C[1] degree participate stack to + x*(C[2] operand in the store + ... specifies X*C[d])) the evaluation. arg in <case highest POLYH the numbered requires 1instruction four is Instructions FLOATING POINT INSTRUCTIONS 1. After 2-Feb-81 -- Rev 6.2 Page 4-1490 execution: POLYF result 0 RO R1 = = R2 =0 R3 = table address + degree*4 + 4 POLYD and POLYG R@ = high order part of result R1 = low order part of result R2 =0 R4 R5 = = R3 = table address + degree*8 + 8 0 0 POLY RP = highest order part of result R1 = second highest order part of result R2 = second lowest order part of result R3 = lowest order part of result = R4 0 R5 = table address + degree*l6 + 16 2. On a floating fault: 1. 2. 1If PSL<FPD> = @, the instruction faults and all. relevant side effects are restored to their original state If PSLKFPD> = 1, the instruction is suspended and state saved in the general registers as follows: POLYF RO = tmp3 R1 = 1is to the !partial result after iteration prior erfl ow lone causing the overflow/und arg R2<7:8> = tmpl tnumber of iterations remaining R2<31:8> = implementation specific R3 = tmp2 !points to table entry causing exception POLYD and POLYG R1'R@ = tmp3 the tpartial result after iteration prior to lone causing the overflow/underflow tnumber of iterations remaining !points to table entry causing exception R2<7:0> = tmpl R2<31:8> = implementation specific R3 = tmp2 R5'R4 = arg tion prior to R3'R2'R1'RP = tmp3 !partial result after iteralow/u nderflow POLYH tthe one causing the overf thumber of iterations remaining R4<31:8> = implementation specific lpoints to table entry causing exception R5 = tmp2 R4<7:0> = tmpl Instructions FLOATING 2-Feb-81 POINT arg instruction. 1is saved on Implementation specific coefficients and partial word degree the a If the unsigned reserved operand, unsigned reserved reserved if word operand operand PSLLKFPD> operand = @, if PSLKFPD> R3 (except value 3. The state changed and floating If FU and On floating zero iteration If the table occurs For if the is some after of always be after FPD any the on the the 1is temporary continues. after zero and To compute C@ P(x) =1.0, = Cg Cl + = Cl*x .5, if If an the + is than a 31, C2 = condition is before the of the whether may fault not four .25 the is all at any is set. replaced by zero final last result save arg or at on are the in stack stack arg fault the fault the However, on any terminates operand floating may iteration. operation reserved longwords results other and «coefficients a the FU if instruction occurs. interrupt the codes occurs rounding loop, and at operand operation the this some continuable. case the and reserved (tmp3) one pointing codes is degree or coefficient, is the the operand, a rounding the C2*x**) is result or operands, and argument either 1In operand, stack is fault occurred Example: where the the a computation set. the of handler. greater POLYH) fault the interrupt source allow scaling argument If the implementations an is condition UNPREDICTABLE. POLYH, and (for loop, is # to faulting cla]. exception. contents reserved is operand R5 saved overflow argument is or after fault. fault the computation the a operand or reserved preserved, the by is UNPREDICTABLE. underflow of until of the clear, non a are operation be with the 31), the underflow of is the the the is saved possible operand reserved POLYH) caused of registers iteration 1, for which registers On = is the 4-141 fault: than coefficient. 2. result during occurs. the (greater use after operand the Page in result degree fault 6.2 information continue a Rev stack to If 1. the instruction not On -- INSTRUCTIONS will occurs overlap UNPREDICTABLE. Instructions FLOATING POINT POLYF PTABLE: .FLOAT .FLOAT L.FLOAT 2-Feb-81 INSTRUCTIONS X,#2,PTABLE .25 ;C2 1.0 ;C0O 0.5 ;C1 -- Rev 6.2 Page 4-142 Instructions FLOATING 2-Feb-81 POINT -- INSTRUCTIONS SUB Rev 6.2 Page 4-143 from the Subtract Format: opcode sub.rx, dif.mx opcode sub.rx, min.rx, dif.wx 2 operand 3 operand Operation: dif <- dif - sub; !2 operand dif <- min - sub; !3 operand o< Z Condition Codes: <- dif LSS g; <- dif EQL 9; <- {floating <- 08; overflow}; Exceptions: floating floating reserved overflow underflow operand Opcodes: 42 SUBF2 43 62 SUBF 3 SUBD?2 Subtract F _floating F_floating 2 3 Subtract Operand Operand 63 42FD Subtract D SUBD3 2 Operand SUBG2 Subtract floating D _floating Subtract G_floating 3 2 Operand Operand 43FD SUBG3 62FD Subtract SUBH2 G_floating 3 Operand 63FD SUBH3 Subtract H_floating 2 Operand Subtract H floating 3 Operand Description: In 2 operand difference In 3 operand minuend format, operand the and format, operand subtrahend the the and result. difference subtrahend the difference operand is is replaced operand operand 1is is subtracted by the rounded subtracted replaced by result. from the the rounded Notes: 1. On =& reserved unaffected and operand the fault, condition codes the are difference UNPREDICTABL operand is Instructions FLOATING POINT INSTRUCTIONS 2. 2-Feb-81 -- Rev 6.2 Page 4-144 Zero is occurs. On floating underflow, if FU is set a fault only clear. is FU if flow under stored as the result of floating is nd opera rence diffe the fault, on a floating underflow unaffected. by @ If FU is clear, the difference operand is replaced and no exceptlion occurs. the s; On floating overflow, the instruction fault condition operand is UNPREDICTABLE. unaffected, and the difference codes are Instructions FLOATING 2-Feb-81 POINT -- Rev 6,2 Page INSTRUCTIONS TST 4-145 Test Format: opcode src.rx Operation: src Condition g; - Codes: N <- src LSS 0; Z <- src EQL 4; V <- C <~ g; g; Exceptions: reserved operand Opcodes: 53 TSTF Test F floating 73 53FD TSTD Test D floating TSTG Test G _floating 73FD TSTH Test H floating Description: The condition codes are affected according operand. to the value of the source Notes: 1. TSTx or src 9 is equivalent to src, #0, but G_floating) or 17 operand fault, shorter. 2. On a reserved UNPREDICTABLE. CMPx or (D_floating the is 5 (F floating) (H floating) bytes condition codes are Page 4-146 12-Feb-82 -- Rev 7 Instructions CHARACTER STRING INSTRUCTIONS 4.10 CHARACTER STRING INSTRUCTIONS A character string is specified by 2 operands: 1. An unsigned word operand which 2. The address of the character string string. in bytes. lowest specifies byte addressed length the of the of the character This is specified by a byte operand of address access type. registers RO Fach of the character string instructions wuses deneral control block a n contai to R5 h throug RO or R3, h through R1l, R@ throug of the executi the which maintains updated addresses and state during available toon softwa re are ers regist At completion, these instruction. on tion instruc ent subsequ a for s operand cation to use as string specifi the of ion execut the During . string ter charac uous contig a is instructions, pending interrupt conditions are tested and is 1ifset any the in bit done part first a d, update found, the control block is After the pPSL, and the 1instruction interrupted (See Chapter ©6). format of the The interruption, the instruction resumes transparently. control block is: + mm——— — o e | | | ADDRESS 1 | | LENGTH 1 | : RO + m—————— o fom m e | : R1 + —— - — oo e LENGTH 2 | + R2 o+ | ADDRESS 2 i | | : R3 e+ bbbty itttk etkt itt — o LENGTH 3 | « RS ADDRESS 3 | | + R4 o+ === + ——— oe 3 (if required) The fields LENGTH 1, LENGTH 2 (if required) and LENGTH in the first, sed proces be to ing remain bytes contain the number of ADDRESS 1, fields The . tively respec ds operan string second and third the address n contai d) require (if 3 S ADDRESS 2 (if required) and ADDRES string third and , second first, the in sed of the next byte to be proces operands respectively. Memory access faults will not occur when specified because no memory reference occurs. a zero length string |is Instructions CHARACTER The 12-Feb-82 STRING following -- Rev 7 Page INSTRUCTIONS instructions are described in this 4-147 section. Instructions Compare CMPC3 Characters len.rw, Compare CMPC5 Characters srcllen.rw, src2addr.ab, Locate LOCC 5 Characters lenl.rw, Move Character MOVC3 len.rw, Move Character 3 5 1 dstaddr.ab, srcaddr.ab, {RO-5.wl} 1 fill.rb, dstlen.rw, dstaddr.ab, fill.rb, tbladdr.ab, dstlen.rw, tbladdr.ab, dstlen,rw, Characters Until srclen.rw, dstaddr.ab, 1 {RO-3.wl} operand srclen.rw, Translated addr2.ab, Operand srcaddr.ab, Translated {R@-1.wl} len2.rw, srclen.rw, srcaddr.ab, dstaddr.ab, {R@#-5.wl} 11. src2len.rw, 1 MOVTC 1. 1 fill.rb, addr.ab, addrl.ab, {RO-5.wl} Move {RO-3.wl} Operand srcladdr.ab, len.rw, Match MOVTUC 1 src2addr.ab, Character MATCHC Move Operand {RO-3.wl} char.rb, MOVCS5 3 srcladdr.ab, 1 Character srcaddr.ab, 1 esc.rb, {RO-5.wl} Scan Characters SCANC len.rw, addr.ab, Skip Character SKPC char.rb, Span Characters SPANC len.rw, len.rw, addr.ab, tbladdr.ab, addr.ab, mask.rb, 1 {RO-3.wl} 1 {RO-1.wl} tbladdr.ab, mask.rb, {R@-3.wl} 1 Page 4-148 12-Feb-82 -- Rev 7 Instructions INSTRUCTIONS CHARACTER STRING Characters Compare CMPC Format: srcladdr.ab, opcode len.rw, src2addr.ab opcode srcllen.rw, srcladdr.ab, fill.rb, src2len.rw, src2addr.ab 3 operand 5 operand Operation: 13 operand tmpl <- len; tmp2 <- srcladdr; tmp3 <- src2addr; if tmpl EQL @ then; !Condition Codes affected on tmpl EQL @ if tmpl GTRU then @ begin while {tmpl NEQU 0} do if (tmp3) EQL (tmp2) begin tmpl tmp2 tmp3 then 1Condition Codes affected on ((tmp2) EQL (tmp3)) tmpl <- - 1; <- tmp2 + 1; <- tmp3 + 1; end; else exit while loop; end; RO R1 <<- tmpl; tmp2Z; R2 <- R@; R3 <- tmp3; 15 operand tmpl <- srcllen; tmp2 <- srcladdr; tmp4 <- src2addr; tmp3 <- src2len; if {tmpl EQL 0} AND {tmp3 EQL @} then; 1Condition codes affected on {tmpl EQL @8} AND {tmp3 EQL 0} while {tmpl NEQU @} AND {tmp3 NEQU g} do if (tmp2) EQL (tmp4) then 1ICondition Codes affected on ((tmp2) EQL begin tmpl <- tmpl - 1; tmp3 <- tmp3 - 1; tmp2 <- tmp2 + 1; (tmpd)) Instructions CHARACTER 12-Feb-82 STRING -- Rev 7 NEQU @} Page INSTRUCTIONS tmpd <- tmpd + 4-149 1; end; else if exit while loop; NOT{tmpl NEQU begin while {tmpl NEQU @} AND {tmp3 @} AND {(tmp2) !Condition EQL Codes then fill} do affected on (tmp4)} do affected on begin tmpl <- tmpl - 1; tmp2 <- tmp2 + 1; NEQU @} AND ((tmp2) EQL fill) end; while {tmp3 {fill !Condition EQL Codes begin tmp3 <- tmp3 - 1; tmp4 <- tmp4d + 1; (fill EQL (tmpd)) end; end; RO <- tmpl; Rl <- tmp2; R2 <- tmp3; R3 <- tmp4; Condition Codes: !Final Condition Codes reflect last affecting lof Condition Codes in Operation above. N <- {first byte} LSS {second byte}; Z <- {first V <- 0; C <- {first byte} EQL byte} LSSU {second byte}; {second byte}; Exceptions: none Opcodes: 29 CMPC3 Compare Characters 2D 3 CMPC5S Operand Compare Characters 5 Operand Description: In 3 operand address the 1 length format, operands and the are address bytes of compared 2 string with operands. the 1 specified bytes Comparison of by the string 2 proceeds 1length and specified by until inequality CHARACTER is STRING detected Page 4-150 12-Feb-82 -- Rev 7 Instructions or INSTRUCTIONS all the bytes of the strings have been examined. Condition codes are affected by the result of the last byte comparison. In 5 operand format, the bytes of the string 1l specified by the length 1 and address 1 operands are compared with the bytes of the string is2 specified by the 1length 2 and address 2 operands. 1If one string longer than the other, the shorter string is conceptually extended to equal the length of the longer by appending (at higher addresses) bytes d detecte 1is ity inequal until s proceed son Compari . to the fill operand are codes n or all the bytes of the strings have been examined. Conditio either CMPC3 or affected by the result of the last byte comparison. For set and N, V, is % (i.e. equal compare CMPC5 two zero Llength strings and C are cleared). Notes: 1. After of execution CMPC3: R@ = number of bytes remaining in string 1 byte which terminated comparison); R@ is zero only if strings are equal (including R1 = address of the byte in string 1 which terminated comparison; byte beyond R2 R3 1 RO address of the byte in string 2 which terminated comparison; one 2. if strings are equal, address of one string byte 1if strings are equal, address of beyond string 2. After execution of CMPC5: R@ = number of bytes remaining in string 1 (including byte which terminated comparison); RO is zero only if string 1 and string 2 are of equal length and equal or string 1 was exhausted before comparison terminated R1 = address of the byte in string 1 which terminated if comparison did not terminate comparison; before string 1 exhausted, address of one byte beyond string 1 R2 = number of bytes remaining in string 2 (including byte which terminated comparison); R2 is zero only if string 2 and string 1 are of equal length or string 2 was exhausted before comparison terminated R3 = address of the byte in string 2 which terminated comparison; if comparison did not terminate before string 2 was exhausted, address of one byte beyond string 2. Instructions CHARACTER 3. 12-Feb-82 STRING If both N, V, strings. -- Rev 7 Page INSTRUCTIONS strings have zero and are cleared C length, Jjust condition as in code the Z is case of set two 4-151 and equal Page 4-152 12-Feb-82 -- Rev 7 Instructions CHARACTER STRING INSTRUCTIONS Locate Character char.rb, len.rw, LOCC Format: opcode addr.ab Operation: <- len; tmp2 <- addr; if tmpl GTRU @ begin tmpl then while {tmpl NEQ @} AND {(tmp2) NEQ char} do begin tmpl tmp2 <<- tmpl tmp2 + 1; 1; end; end; RO <- tmpl; Rl <- tmp2; Condition Codes: N <- 7 <- RO 0; Vv <- 0; C <- 0; EQL 0; Exceptions: none Opcodes: Locate LOCC 3A Character Description: The character operand is compared with the bytes of the string specified until equality by the length and address operands. Comparison continues If equality d. compare been have string the of bytes all is detected or is is detected; set. the condition code Z-bit is cleared; otherwise the Z-bit Notes: 1. After execution: RO = number of bytes remaining in the string (including located one) if byte located; otherwise 0 Rl = address of the byte located if byte located; otherwise Instructions CHARACTER 2. STRING If the though 12-Feb-82 -- Rev 7 Page INSTRUCTIONS address of string has each character. one byte beyond the 4-153 string. zero length, condition code 7 is byte of the entire string were set just as unequal to 12-Feb-82 -- Rev 7 Instructions Page 4-154 CHARACTER STRING INSTRUCTIONS Characters Match MATCHC Format: opcode objlen.rw, objaddr.ab, srclen.rw, srcaddr.ab Operation: objlen; objaddr; tmpl tmp2 tmp3 tmp4 tmpb srclen; srcaddr; tmpl; while {tmpl NEQU 0} AND {tmp3 GEQU tmpl} do begin if (tmp2) EQL begin (tmp4) then tmpl <- tmpl - 1; tmp3 tmpd <- tmp3 <- tmp4 + 1; 1; tmp2 <- tmp2 + 1; end else begin tmp2 <- tmp2 - ZEXT (tmpS5-tmpl); tmp3 <- {tmp3 - 1} + {tmp5-tmpl}; tmpd <- {tmp4 + 1} - ZEXT (tmp5-tmpl); tmpl <- tmp5; end; end; if {tmp3 LSSU tmpl} begin tmpd tmp3 then <- tmpd + tmp3; <- 0; end; RO <- R1 <- R2 <- tmpl; tmp2; tmp3; R3 <- tmpéd; { - <{- Exceptions: none EQL @; w0 { - (SRR o B! < - -e A< N2 Condition Codes: Imatch found Instructions CHARACTER 12-Feb-82 STRING —-- Rev 7 Page 4-155 INSTRUCTIONS Opcodes: 39 MATCHC Match Characters Description: The source operands specified string is by substring specified searched the object 1is found, by for a length the the source length and source address substring which matches the object string and object address operands. If the condition code cleared. Z-bit is set; otherwise, it is Notes: 1. After RO execution: = if a match bytes Rl = R2 = if a = the address a if a zero the source If both zero left 3. If match last byte For match source the 2. match object if occurred the the the R3 in string of and occurred, the source have the matched; the source and of + number one byte objlen; number of beyond otherwise of address string object bytes remaining of 1 the i.e. byte beyond address srcaddr strings, R3 + and of the source string length, Rl RP-R3 left are just has zero as though contain respectively. length condition 1 srclen. or if the object string length, condition code Z is set and registers just as though the substring were found. nen-zero in 0. otherwise addresses zero the string. otherwise occurred, byte address objaddr object string; object strings the i.e. the otherwise string. occurred, beyond length #; object length code the and Z 1is the object cleared substring were string and not R@-R3 has are has registers found. 12-Feb-82 INSTRUCTIONS Instructions CHARACTER STRING Character Move MOVC Page 7 -- Rev Format: len.rw, opcode srcaddr.ab, dstaddr.ab fill.rb, opcode srclen.rw, srcaddr.ab, d stlen.rw, dstaddr.ab 3 operand 5 operand Operation: !3 operand len; tmpl <- tmp2 <- srcaddr; tmp3 <- dstaddr; if tmp2 GTRU tmp3 begin while then tmpl NEQU begin (tmp3) tmpl tmp2 tmp3 <<<- @ do <- (tmp2); tmpl tmp2 tmp3 + + 1; 1; 1; end; R1 R3 <<- tmp2; tmp3; end else begin tmpd <- tmpl; ~e tmp2 <- tmp2 + ZEXT(tmpl) tmp3 <- tmp3 + ZEXT (tmpl); while tmpl NEQU @ do begin tmpl <- tmpl - 1; tmp2 <- tmp2 - 1; tmp3 <- tmp3 - 1; (tmp3) <- (tmp2); end; Rl R3 <- tmp2 + ZEXT (tmp4d); <- tmp3 + ZEXT(tmp4); end; RO R2 <<- 8; R4 <- @; R5 <- @; @; 4-1556 Instructions CHARACTER 12-Feb-82 STRING tmpl <- srclen; tmp2 <- srcaddr; tmp3 <- dstlen; tmpd <- if tmp2 -- Rev 7 Page INSTRUCTIONS !5 operand dstaddr; GTRU tmp4 then begin while {tmpl NEQU begin (tmpd) tmpl <- tmp2 tmp3 tmp4 @} <- AND {tmp3 (tmp2); tmpl - 1; <- tmp2 + 1; <<- tmp3 tmp4d - 1; + 1; end; while tmp3 NEQU @ do begin (tmpd) <- fill; tmp3 <- tmp3 - 1; tmpd <- tmp4d + 1; end; R1 <- tmp2; R3 <- tmp4; end else begin tmp5 <- MINU (tmpl, tmp6 tmp2 <- tmp3; <- tmp2 + ZEXT (tmp5); tmp4 <- tmp4 + ZEXT (tmp6); while tmp3 GTRU tmp3); tmpl do begin tmp3 <- tmp3 - 1; tmpd <- tmp4d - 1; (tmpd) <- fill; end; while tmp3 NEQU begin @ tmpl <- tmpl - 1; tmp2 <- tmp2 - 1; tmp3 <- tmp3 - 1; tmp4 <- tmp4d - 1; (tmp4d) <- do (tmp2); end; Rl <- tmp2 + ZEXT (tmp5); R3 <- tmp4 + ZEXT (tmp6); end; RA <- tmpl; R2 K- R4 <- @; 0; R5 <- #; NEQU @} do 4-157 CHARACTER STRING Condition Page 4-158 12-Feb-82 —-- Rev 7 Instructions INSTRUCTIONS Codes: N <- @; Z <- 1; IMOVC 3 V <- @; C K- @; N <- srclen LSS 7Z <- srclen EQL dstlen; V <- @; C <- srclen LSSU dstlen; !MOVCS5 dstlen; Exceptions: none Opcodes: 28 MOVC3 2C MOVC5 Move Character 3 Move Character 5 Operand Operand Description: In 3 operand format, the destination string specified by the length and format, the specified by the addressed bytes of the is shorter than the source string, the highest addressed bytes of the affect the destination address operands is replaced by the source string specified destination string by the length and source address operands. In address operands is replaced by the source string, the highest source length and source address operands. longer than the source string operand are not moved. string If the destination string is destination are replaced by the fill operand. source 5 specified by the destination length and destination If the destination string The operation of the instruction is such that overlap of the source and destination strings does not result. Instructions CHARACTER 12-Feb-82 STRING -- Rev INSTRUCTIONS 7 Page 4-159 Notes: l- 2. After execution RO = 0 Rl = address R2 =0 R3 = address R4 = ¢ R5 = ¢ After execution RO = Rl = MOVC3: of one byte beyond the source of one byte beyond the destination of MOVCHS: address = ¢ R3 = address R4 = 0 R5 = ¢ is of source R2 the one with fill a block of a of one preferred @ byte string another. MOVC5 string string. number of unmoved bytes remaining in source string. RO is non-zero only if source string is longer than destination string in MOVC3 of source memory with beyond that byte way to the last the destination copy one operand is fill byte moved beyond length the was block the character. of string memory preferred way to to Instructions CHARACTER STRING INSTRUCTIONS Characters Translated Move MOVTC Page 4-160 12-Feb-82 —-- Rev 7 Format: opcode fill.rb, srcaddr.ab, dstaddr.ab srclen.rw, dstlen.rw, tbladdr.ab, Operation: tmpl <- srclen; tmp2 <- srcaddr; tmp3 <- dstlen; tmp4 <- dstaddr; if tmp2 GTRU tmp4 then begin {tmp3 NEQU @} while {tmpl NEQU @} AND begin <- (tmpd4) <- tmpl - 1; tmp2 <- tmp2 + 1; tmp3 tmpd <<- tmp3 tmpd - 1; + 1; end; while (tbladdr + ZEXT ((tmp2))); tmpl {tmp3 NEQU @} do begin (tmpd) <- £ill; tmp3 <- tmp3 - 1; tmpd <- tmpéd + 1; end; R1 R5 <<- tmp2; tmp4; end; else begin tmp2 <- tmp2 + ZEXT (tmp5) tmp4 <- tmp4 + ZEXT(tmpb6) while tmp3 GTRU tmpl do - <- MINU (tmpl,tmp3); <- tmp3; - tmp5 tmp6 begin tmp3 <- tmp3 - 1; tmpd <- tmp4 - 1; (tmpd) <- fill; end; while tmp3 NEQU begin tmpl <- tmp2 tmp3 tmpd @ do tmpl <- tmp2 <- tmp3 <- tmp4 (tmp4) <- - - 1! - 1 1 1 <- tmp2 . 1 L [4 (tbladdr + ZEXT((tmp2))); end; R1 . ’ + ZEXT (tmp5); Instructions CHARACTER 12-Feb-82 STRING R5 <- tmp4 + end; R@ <- tmpl; R2 <- R3 <- 0; tbladdr; R4 <- g; Condition -- Rev 7 Page INSTRUCTIONS 4-161 ZEXT(tmp6); O<<N X Codes: <- srclen LSS dstlen; <{- srclen EQL dstlen; <- @; <{- srclen LSSU dstlen; Exceptions: none Opcodes: 2E MOVTC Move Translated Characters Description: The source operands the string is destination accomplished 256 byte address string. by table and length and using each whose operand. If specified translated by the source replaces the destination zeroth byte of entry the translated overlap of result. 1If destination highest and moved. the the address the source address is The byte selected replaces destination string is longer the highest addressed bytes of the fill operand. 1If the destination string, 1length addressed The source destination string is destination string bytes operation and of 1is of the destination string and destination overlaps operands. string as specified the byte than the source string of by Translation is an index by the destination string, the replaced by the does is such affect table, Notes: After R® Rl execution: = = number of untranslated R is non-zero only if destination string bytes remaining source string address the last translated source R2 = ¢ R3 = address of one string of the byte that beyond was translation table. in is byte source longer in source not are not translation UNPREDICTABLE. a table source instruction the into the string are shorter than the the source string strings address specified string; than that the the Instructions CHARACTER STRING 12-Feb-82 -- Rev 7 INSTRUCTIONS = 0 R4 R5 address of one byte beyond the destination string. Page 4-162 —-- Rev 12-Feb-82 Instructions 4-163 INSTRUCTIONS CHARACTER STRING Move MOVTUC Page 7 Translated Character Until Format: opcode srclen.rw, srcaddr.ab, esc.rb, tbladdr.ab, dstaddr.ab Operation: srclen; tmpl {~ tmp?2 { - srcaddr; tmp3 <~ tmp4 { - dstlen; dstaddr; if tmpl GTRU @ and tmp3 GTRU @ then begin while {tmpl NEQU 0} AND {tmp3 NEQU @} do if{(tbladdr + ZEXT(tmp2)) NEQU esc} then begin (tmp4) <- (tbladdr <- tmpl - 1; <- tmp2 + 1; <- tmp3 - 1; <- tmp4 + 1; + ZEXT (tmp2)); tmpl tmp2 tmp3 tmp4 end; else exit while loop; end; RO <- tmpl; R1 <- tmp2; R2 <- 2; R3 R4 <<- tbladdr; tmp3; R5 <- tmp4; <Nz Condition Codes: < {{~{~ srclen srclen LSS dstlen; EQL dstlen; {terminated by escape}l; srclen LSSU dstlen; none Opcodes: 2F MOVTUC Move Translated Until Character dstlen.rw, Instructions CHARACTER 12-Feb-82 STRING -- Rev 7 Page 4-164 INSTRUCTIONS Description: The source operands string 1is the destination accomplished by byte table operand. byte or zeroth byte the the source replaces the entry until source address replaces a of translated byte is string or destination table, and destination addresses through are R5 addresses If not string source and identical, the UNPREDICTABLE. are are the identical, the specified byte of If the is the translation is terminated because set; otherwise it is cleared. UNPREDICTABLE. 1length and destination source string address specified by address operands. Translation is source string as index into a 256 destination byte of the selected continues until by and length and using each whose The Translation specified translated by the the table address destination equal string to is RO 1If escape the condition code V-bit the destination string overlaps the registers destination destination If the translation R@ string source is through strings overlap R5 are their and registers RO destination string and performed correctly. number of bytes remaining in source string (including the byte which caused the escape). RO is zero only if the entire source string was translated and moved Rl = without address of escape the byte string exhaustion escape, address R2 =0 R3 = address R4 = number R5 = of of address the of the byte would have which caused the or if beyond no byte byte in the received escape if or if beyond in destination no exhaustion the the or in the source destination destination the or string would have string or escape, the destination string. string string translated source exhaustion the one remaining which translated resulted escape; table bytes of which or byte received were not address of is and execution: = escape exhausted. Notes: After string. the a exhausted; one byte Instructions CHARACTER 12-Feb-82 STRING -- Rev 7 Page 4-165 INSTRUCTIONS SCANC Scan opcode len.rw, Characters Format: addr.ab, tbladdr.ab, mask.rb Operation: tmpl <- len; tmp2 <- addr; if tmpl GTRU @ then begin while {tmpl NEQU @} AND {{(tbladdr + ZEXT((tmp2))) begin tmpl <- tmpl - 1; tmp2 <- tmp2 + 1; AND mask} EQL 0} do end; end; RO <- tmpl; Rl <- tmp2; R2 <- @; R3 <- tbladdr; Condition Codes: N <- @; Z <- RO V <- 0; C <~ @; EQL @; Exceptions: none Opcodes: 27 SCANC Scan Characters Description: The bytes of successively address is the string used to specified from the table until the result is of by ANDed the have been exhausted. condition code Z-bit is specified index the table with AND by 1into the the a address mask length 256 byte and operand. operand. address table The whose The operands zeroth byte operation are entry selected continues is non-zero or all the bytes of the string If a non-zero AND result is detected, the cleared; otherwise, the Z-bit is set. CHARACTER Page 4-166 12-Feb-82 -- Rev 7 Instructions STRING INSTRUCTIONS Notes: 1. After execution: R@ = number of bytes remaining in the string (including the byte which produced the non-zero AND result) RP is zero only if there was no non-zero AND result. R1 = address of the byte which produced non-zero AND result; or, if no non-zero of one byte beyond the string R2 R3 2. = result, address 0 address of the table T1f the string has zero length, condition code Z though the entire string were scanned. is set Jjust as Instructions CHARACTER 12-Feb-82 STRING -- Rev 7 Page INSTRUCTIONS SKPC Skip opcode char.rb, 4-167 Character Format: len.rw, addr.ab Operation: tmpl <~ len; tmp2 <- addr; if tmpl GTRU @ then begin while {tmpl NEQ begin @} AND {(tmp2) tmpl <- tmpl - 1; tmp2 <- tmp2 + 1 [ EOQL char} do the bytes of - end; end; RO <- tmpl; R1 <- tmp2; Condition Codes: N <- @; Z <- RO V <- @; C <- @; EQL 4; Exceptions: none Opcodes: 3B SKPC Skip Character Description: The character operand is by the 1length and inequality is detected If inequality otherwise the 1is Z-bit compared address or all detected; is with operands. bytes of the the set. the Comparison string specified continues until string have been compared. condition code Z-bit 1is cleared; Notes: 1. After RO execution: = number of bytes unequal one) R1 address = if unequal address of the remaining in the string byte located; otherwise byte located if byte (including the @ located; otherwise Instructions CHARACTER STRING 12-Feb-82 -- Rev 7 INSTRUCTIONS of 2. Page 4-168 one byte beyond the string. If the string has zero length, condition code Z is set Jjust as though each byte of the entire string were equal to character. Instructions CHARACTER 12-Feb-82 STRING -- Rev 7 Page INSTRUCTIONS SPANC Span opcode len.rw, 4-169 Characters Format: addr.ab, tbladdr.ab, mask.rb Operation: tmpl <~ len; tmp2 <- addr; if tmpl GTRU @ then begin while {tmpl NEQU @} AND {{(tbladdr + ZEXT ((tmp2))) begin tmpl <- tmpl - 1; tmp2 <- tmp2 + 1; AND mask} NEQ @0} do end; end; R@ <- tmpl; R1 <~ tmp2; R2 <- @; R3 <- tbladdr; Condition Codes: N <- @; Z <- RO V <- @; C <- @; EQL 0; Span Characters Exceptions: none Opcodes: 2B SPANC Description: The bytes of successively address from until been Z-bit is the string wused to specified the table the result is exhausted. is cleared; of specified 1index by into by the table ANDed with the the a length 256 byte and address table address operand. mask operand. The whose operands zeroth The byte operation are entry selected continues the AND is zero or all the bytes of the string If a zero AND result is detected, the condition otherwise, the Z-bit is set. have code Instructions CHARACTER STRING 12-Feb-82 -- Rev 7 Page 4-179 INSTRUCTIONS Notes: 1. After execution: ding R@ = number of bytes remaining in the string (inclu t) resul AND zero the ced the byte which produ R@ is zero only if there was no zero AND result. R1 = address of the byte which produced a zeros AND result; or, if no non-zero result, addres of one byte beyond the string 2. 0 R2 = R3 = address of the table. 1If the string has zero length, the condition code Z is set Jjust as though the entire string were spanned. Instructions 12-Feb-82 REDUNDANCY 4.11 CYTIJCl(EDLHQDA&«?Y(H{ECILHQSTRL CHECK INSTRUCTION This 4-171 is designed to implement the calculation and checking redundancy check for any CRC polynomial up to 32 bits. Redundancy Checking is an error detection method involving a cyclic Cyclic of represented the data a standard as accomplished by destination, is of lengths. specific see, for such and D. to The the Brown choice 65,535) and the a function table are calculated common operand the to start the but would be sequence of CRC instruction of the data is is included shifted of the CRC polynomial XORed by with the the polynomial is The time CRC. instruction result must multiple right be of adjusted by the resultant algorithm the extracted eight in bits the by of the the a is string can entries the in with string the string the notes. the string, CRC being the bit again with the by in a It The field. the of The not, bits. a two, total CRC value by byte byte CRC bit the CRC and of four the stream is the eight bits at table. polynomials, stream a the most constructed data 3 to be Several polynomial or a the initial right result shorter is 0 set, specially For leading is W, can and for each calculated. The one, 32-bit it (up contents notes, shifted shift 1If the by 1961). bytes used. in here; descriptor, descriptor is in The be the the errors Typically, it has the stream is represented CRC. length., string string. at block given (January, a is is of Detection" The to again choice bits of the CRC. Then on the left, The right to control the XORing of 1is XORed 32-bit in If CRC used from used and Error stream detection The IRE algorithm scanning in the of the included it for are polynomial CRC. appropriate produces end. CRC. to the right 8 inserting zero shift) Source each of strings. Then the conditionally actual using also including by XORing it right 1 bit, with times. are the Codes polynomial correctly. different if the data operates streanm, (lost CRC data of undetected polynomial is not length address the non-contiguous The the polynomial polynomials is wused @ or -1, "Cyclic of The Error number CRC initial starting from CRC a at instruction pair of the of memory. at Proceedings operands to the CRC 16-longword table, and an VAX-11 polynomial. in CRC minimize the CRC computed article in a string the CRC The standard by VAX-11 the as example, Peterson stream computing comparing polynomial The Page instruction a division a 7 KHHOPJ of a -- Rev CYCLIC must must the be be Page 4-172 12-Feb-82 -- Rev 7 Instructions CYCLIC REDUNDANCY CHECK INSTRUCTION CRC Calculate Cyclic Redundancy Check opcode tbl.ab, inicrc.rl, strlen.rw, stream.ab Format: Operation: tmpl <- strlen; tmp2 <- stream; tmp3 <- inicrc; tmpd <- tbl; while tmpl NEQU 0 do begin tmp3<7:0><- tmp3<7:8> XOR (tmp2)+; 1see note 5 for for tmp5 <- 1,limit do 1 limit,s, XOR tmp3 <- ZEXT (tmp3<31:s>) tmpl <- tmpl -1; (tmp4d + {4*ZEXT(tmp3<s—l:@>*i)}; end; L —t 2l + 3 GKQ - -+ n h @] Q. 3 ® h @] <- @; 0; tmp?2; [} |63} n R3 tmp3; lat <~ <- joN joN R1 R2 Q <- RO 2 NN R® {- <- RO <~ <- LSS =X Condition Codes: EQL @; 0; @; Exceptions: none Opcodes: 0B CRC Calculate Cyclic Redundancy Check Description: iptor 1is ibed by the string descr The CRC of the data stream descr @ or -1 ally norm is and rc inic by n initial CRC is give steps. The result 1is left calculated. The calcu in lated in several unless the CRC is be must lt resu the than ordealr-32is, expressed by the al 1is less the polynomi R@. 1f from polynomi CRC The lt. resu the d extracte the notes for the calculation o See e. tabl contents of the l16-longword the table. Instructions CYCLIC 12-Feb~82 REDUNDANCY CHECK -- Rev 7 Page INSTRUCTION 4-173 Notes: 1. If the right If data the CRC extracted The stream adjusted a not the is low polyn<n> multiple zero less order algorithm polynomial a leading polynomial from following given is with can <- than bits be expressed 8-bits order of used as of to of x**{order location of a 64-byte (16-longword) the result will be written. INTEGER*4 DO TMP = DO 150 X 150 199 = INDEX = IF (X 1 (POLY, TABLE(#:15), @, =1, 4 .AND. be the result must be the CRC table -1-n}} library routine table is the table into which The TABLE) TMP, X 15 1 ISHFT (TMP,-1) .EQ. 1) TMP !logical = CONTINUE TABLE (INDEX) 199 = must INDEX TMP TMP LIBSCRC_TABLE POLY, 32, calculate This routine is available as system LIBSCRC_TABLE (poly.rl, table.ab). SUBROUTINE it R®. follows: {coefficient long, fill. = TMP shift .XOR. POLY of some right one bit TMP CONTINUE RETURN END The following polynomials. CRC-16 CCITT (used are in descriptions DDCMP and Bisync) polynomial: x"16 poly: 120001 + x715 initialize: 4] R@<15: 0> in ADCCP, HDLC, + x"2 + 1 x°5 + 1 (octal) result: (used commonly SDLC) polynomial: x"16 poly: 102010 initialize: -1<15: 90> + x"12 + (octal) wused CRC Page 4-174 12-Feb-82 -- Rev 7 Instructions CYCLIC REDUNDANCY CHECK INSTRUCTION one's complement of RO<K15:8> result: AUTODIN-II X 324%x726+x"23+x7224x"716+x712 polynomial: poly: " 2+x+1 T 4+x"5+x +x 114X 104X"8+x"7+x (hex) 320 EDB88 result: one's complement of R@<31:0> -1<31:0> initialize: 5. the This instruction produces an UNPREDICTABLE result 3. unless that Note note in table is well formed, such as producedalways 8 and entry(8] for any well formed table, entry (@] is The operation note 3. is always the polynomial expressed as in two, or four bits at can be implemented using shifts of one, time shift (s) as follows: table index steps per byte (limit) 1 8 (61=0,041,(8],[12] 6. tmp3<9> 4 2 4 a 2 tmp3<3: 98> table index multiplier use table entries 8 (01=0,1(8] (i) 4 tmp3<l: 0> 1 all 1If the stream has zero length, RO receives the initial CRC. Instructions DECIMAL 4.12 12-Feb-82 STRING Rev 7 Page 4-175 DECIMAL STRING INSTRUCTIONS Decimal string instructions String instructions are (Overpunched formats. phrase A -- INSTRUCTIONS Where decimal decimal 1. and string is For all the string. is The and Each of through the updated addresses or completion, R@ use on type as and Part Done set is 6). transparently. of in After The contain the a byte of digits in a function of contains is a general block of addresses sign specified and pending the the registers instruction. available for At to the subsequent interrupt conditions block at R0 maintains a the block byte the instruction control Left a are operands control for by which strings. the (see the string. This for Trailing Numeric, uses interruption, of the types. of digit execution instructions, the string referenced control specification found, Numeric Where data is string type. instructions PSL, format number string byte is the the the decimal containing the identified. is address during Convert Numeric three in addressed significant to Trailing the The R5 strings. of This decimal any length bytes of access state 1if any is strings. string execution tested type strings. string same data lowest most registers the are chapter the Decimal Decimal and Leading Separate operands: of through and the 2 the address decimal R3 by Packed Packed means number Numeric of it strings The of the contains the packed decimal operand the used, decimal Separate During specific address byte software to instruction a specified the length and Chapter 2). 2. on between Zoned) and necessary string operate provided is updated. First interrupted 1instruction completion (See resumes is: 3 1 P 0 e | P | ADDRESS P e | | 1 I ADDRESS | | | 2 @ e I ADDRESS P : R1 + R2 : R3 : R4 : RS + ee o RO + e P : + 1) Fo The + 4 | + | + 3 | + fields address second of and ADDRESS 1, ADDRESS 2 and ADDRESS the byte containing the most third (if required) string 3 (if required) significant operands digit contain of respectively. the the first, Instructions INSTRUCTIONS DECIMAL STRING Page 4-176 12-Feb-82 -- Rev 7 strings as integers with The decimal string instructions treat decimal the least significant digit the decimal point assumed immediately a beyond result is to be stored is If a string in which of the string. longer than the result, its most significant digits are filled with zeros. 4.,12.1 Decimal Overflow Decimal overflow occurs if the destination string is too to short ) of the result. On contain all the digits (excluding leading zeroes «correctly signed the by ed overflow, the destination string is replac the stored result if (even result true the of least significant digits length packed even an of nibble high the neither that Note is -@). nor the sign byte of a Leading Separate Numeric string decimal string, 4.12.2 Zero Numbers is used to store result digits. A zero result has a positive sign for operations all complete which does not fixup a -8 to without decimal overflow, except for CVTPT whichoverfl ow, a zero result of e a +0. However, when digits are lost becaus t result. correc the of receives the sign (positive or negative) A decimal string with value -8 is treated string with wvalue +0. as identical to a decimal Thus for example +@ compares equal to -9. condition codes are affected on a -0 result they are affected as if result were +0: 4.12.3 When 1i.e., N is cleared and Z is set. the Reserved Operand Exception l string A reserved operand abort occurs if the length ofif aan decima d sign or invali through 31, or operand 1is outside the range ¢ CVTTP. opcode the to points PC The digit is encountered in CVTSP, and of the instruction causing the exception. 4.12.4 UNPREDICTABLE Results BLE if any source decimal The result of any operation 1is UNPREDICTA for CVTSP and CVTTP, the Excep data. id string operand contains inval not verify the tvalidi ty of source operand decimal string instructions do data. If the destination operands overlap any source operands, the result of The destination ICTABLE. an operation will, in general, be UNPRED will, in codes ion condit and ction strings, registers used by the instru general, be UNPREDICTABLE when a reserved operand abort occurs. Instructions 12-Feb-82 DECIMAL STRING INSTRUCTIONS 4.12.5 Packed Decimal Operations Packed decimal strings always generated have the "-". An even "@" digit in A packed the packed decimal high nibble 1. A digit occurs in 2. A sign For Zero The length is zero occurs an even of a (plus contain a of packed length of 1s and "@" digit in length trailing access operand is zero length one byte zero length occur if leading numeric faults the the string, operand an is is not numeric always of the nibble non-zero addressed can of for instructions "+" and generated string. 13 for with a if: nibble occurs in the high byte. nibble sign when is numeric 1is this the is occupied. value This byte and the sign the 1low be 0. In destination of a the string sign. a identically this operand case is a 1is no zero 1lost. trailing numeric occurs. The value of 1In this case a @. can 4. in operation be Memory The case, length reserved detected. is the zero identically by and 1In reference separate string a the memory §. can If occupied sign be storage occur specified, 1invalid separate string 12 4-177 position. string string leading invalid string. no a byte high numeric storage first byte because of is string one trailing of decimal string a lowest numeric will Page position. specified length The by sign string, decimal trailing the 7 Strings minus) a Memory the or occupied an digit Decimal nibble. storage a length nibble Length in the Rev representation: the contains 4.12.6 The of string order must sign decimal 3. by preferred length ~-- #. is accessed operand value of abort a zero when a will length Instructions STRING 4.12.7 Instruction Descriptions following INSTRUCTIONS instructions are described in this section. Instructions Add Packed 4 Operand ADDP4 addlen.rw, addaddr.ab, sumlen.rw, sumaddr.ab, Add Packed 6 Operand ADDP6 addllen.rw, addladdr.ab, add2len.rw, sumlen.rw, sumaddr.ab, {RO-5.wl} 1 {RO-3.wl} add2addr.ab, Arithmetic Shift and Round Packed ASHP cnt.rb, srclen.rw, srcaddr.ab, round.rb, dstlen.rw, dstaddr.ab, 1 1 {RO-3.wl} Compare Packed 3 Operand CMPP3 len.rw, srcladdr.ab, src2addr.ab, {R@-3.wl} 1 1 Compare Packed 4 Operand CMPP4 srcllen.rw, srcladdr.ab, src2len.rw, src2addr.ab, {RO-3.wl} Convert Long to Packed CVTLP src.rl, dstlen.rw, dstaddr.ab, Convert Packed to Long CVTPL srclen.rw, srcaddr.ab, {RO-3.wl} 1 - The Page 4-178 12-Feb-82 -- Rev 7 DECIMAL {R@-3.wl}, dst.wl Convert Packed to Leading Separate 1 Convert Packed to Trailing 1 CVTPS srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab, {R8-3.wl} CVTPT srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab, {RO-3.wl} 19. 11. Convert Leading Separate to Packed 1 Convert Trailing to Packed 1 CVTSP srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab, {RO-3.wl} CVTTP srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab, {(RO-3.wl} 12, 13. 14. Divide Packed DIVP divrlen.rw, divraddr.ab, divdlen.rw, divdaddr.ab, gquolen.rw, quoaddr.ab, {R@-5.wl, -16 (SP):-1(SP) .wb} 1 Move Packed 1 MOVP len.rw, srcaddr.ab, dstaddr.ab, Multiply Packed {R@-3.wl} MULP mulrlen.rw, mulraddr.ab, muldlen.rw, muldaddr.ab, prodlen.rw, prodaddr.ab, {R#-5.wl} 1 Instructions DECIMAL 15, STRING Subtract SUBP4 16. 12-Feb-82 Packed 4 sublen.rw, Subtract SUBP6 ~- Rev INSTRUCTIONS Packed sublen.rw, diflen.rw, Page Operand subaddr.ab, 6 7 diflen.rw, difaddr.ab, minlen.rw, minaddr.ab, Operand subaddr.ab, difaddr.ab, {RO-5.wl} 4-179 1 {R@-3.wl} 1 Instructions INSTRUCTIONS DECIMAL STRING Add ADDP Page 4-180 12-Feb-82 -- Rev 7 Packed Format: opcode addlen.rw, addaddr.ab, sumlen.rw, sumaddr.ab opcode addllen.rw, addladdr.ab, add2len.rw, add2addr.ab, sumlen.rw, sumaddr.ab Operation: ({sumaddr + ZEXT(sumlen/2)} : sumaddr) <= ({sumaddr + ZEXT (sumlen/2)} : sumaddr) + ({addaddr + ZEXT (addlen/2)} : addaddr); !4 operand ({sumaddr + ZEXT (sumlen/2)} : sumaddr) <({add2addr + 7EXT (add2len/2)} : add2addr) + ({addladdr + ZEXT (addllen/2)} : 16 addladdr); operand Condition Codes: N <7 <- {sum string} LSS @; {sum string} EQL @; V <- {decimal overflow}; C <- @; Exceptions: reserved operand decimal overflow ADDP4 Add Packed 4 Operand Opcodes: 20 ADDP6 21 Add Packed 6 Operand Description: ied by the addend 1length In 4 operand format, the addend string specif sum string specified by the the to added is nds opera ss and addend addre by sum length and sum address operands and the sum string 1is replaced the result. In 6 operand format, the addend 1 string specified by the addend 1 addend 2 string ss operands is added to the length and addend 1 2addre ds. The sum operan s addres 2 addend and length addend specified by the 1s replaced nds opera ss string specified by the sum length and sum addre by the result. Instructions DECIMAL 12-Feb-82 STRING -- Rev 7 Page 4-181 INSTRUCTIONS Notes: 1. After RO execution = of ¢ R1 address of significant R2 address of significant After RO execution of address of significant address of significant address of significant The the containing the the string addend most the byte digit of containing the sum the most string ADDP6: the byte digit of containing the the addendl most string the byte digit of containing the the addend2 most string 0 = R5 3. of =0 R3 R4 byte =19 R1 R2 the digit =0 R3 2. ADDPA4: sum string, <condition overlaps the RO the byte digit of through codes addend, addendl, addend2 or invalid nibble; or a are containing the R3 sum (or R@ the through UNPREDICTABLE addendl, sum (4 reserved or most string addend2 operand operand if R5 for strings; only) abort ADDP6) the sum the strings occurs. contain an Instructions DECIMAL 12-Feb-82 -- Rev 7 STRING Page 4-182 INSTRUCTIONS ASHP Arithmetic Shift and Round Packed Format: opcode cnt.rb, srclen.rw, dstlen.rw, srcaddr.ab, round.rb dstaddr.ab Operation: ({dstaddr + ZEXT(dstlen/2)} : dstaddr) <{ ({srcaddr + ZEXT(srclen/2)} : srcaddr) + {round <3:9>*{1@ ** {-cnt-1}}}} * {10 ** cnt} ; Codes: Condition N <- {dst Z V <<- {dst string} EQL @; {decimal overflow}; C <- @; string} LSS @; Exceptions: reserved operand decimal overflow ASHP Arithmetic Opcodes: F8 Shift and Round Packed Description: The source string specified by the source 1length and source address operands is scaled by a power of 10 specified by the count operand. The destination string specified by the destination length and destination address operands is replaced by the result. A positive count effectively codes. the When Round operand divides; a negative effectively multiplies; a negative count and a zero count just moves and affects condition count is specified, the result is rounded using Operand. Notes: l. After RG R1 execution: = 8 address digit R2 =0 of of the the byte source containing string the most significant Instructions DECIMAL 12-Feb-82 STRING -- Rev 7 INSTRUCTIONS R3 = address digit of of The destination are UNPREDICTABLE string, the When count significant carry, if source operand the byte through R3, destination string contains operand low R@ the most and the string the abert adding containing destination string, reserved decimally the the Page string an is bits negative, 3:8 order of digit the the condition overlaps result round discarded if significant 1invalid occurs. the 1is If bits the the result When has The 7:4 the no of the round is round accomplished operand contain are an UNPREDICTABLE. count effect round operand operand on the operand by using is zero result is a or except normally zero round non-zero, invalid positive, as five. operand. a by the most propagating the or operand of the if bits 3:0 decimal digit packed the specified or rounded to any, to higher order digits. Both the source and the round operand are consi dered to be quantities same sign for the purpose of this addition, of codes source nibble, operand and 4-183 round in note Truncation operand 4, may be Instructions DECIMAL STRING INSTRUCTIONS Compare CMPP Page 4-184 12-Feb-82 -- Rev 7 Packed Format: 3 operand opcode len.rw, srcladdr.ab, src2addr.ab opcode srcllen.rw, srcladdr.ab, src2len.rw, src2addr.ab 4 operand Operation: ({srcladdr + ZEXT (len/2)} : srcladdr) - ({src2addr + ZEXT(len/2)} : src2addr); ({srcladdr + 7EXT (srcllen/2)} : srcladdr) - ({src2addr + ZEXT (src2len/2)} '3 operand : src2addr); 14 operand Condition Codes: N <- {srcl string} LSS {src2 string}; 7 <- {srcl string} EQL {src2 string}; VvV C 0; 0; <= K- Exceptions: operand reserved Opcodes: CMPP3 35 CMPP4 37 Compare Packed 3 Operand Compare Packed 4 Operand Description: and g specified by the length fied In 3 operand format, the source 1 strin speci g strin 2 e sourc the to source 1 address operands is compared 1is to by the length and source 2 address operands. The only action affect the condition codes. e 1 string specified by the sourc In 4 operand format, the source 1 ands ng stri 2 ce sour the is compared to 1 address oper length and sourcesourc The nds. opera ss addre 2 e e 2 length and sourc specified by the condition codes. only action is to affect the Notes: 1. After execution of CMPP3 or CMPP4: RO = 0 Instructions DECIMAL 12-Feb-82 STRING Rl = address of significant R2 R3 RO address through source nibble Rev the byte digit of 7 Page containing string the 4-185 most 1. ) of significant 2. -- INSTRUCTIONS R3 and strings or if a the byte digit the of containing string condition overlap, reserved if codes either operand the most 2. abort are UNPREDICTABLE, string contains occurs. an if the invalig Instructions INSTRUCTIONS DECIMAL STRING 12-Feb-82 -- Rev 7 Page 4-1856 Convert Long to Packed CVTLP Format: opcode src.rl, dstlen.rw, dstaddr.ab Operation: ({dstaddr + ZEXT (dstlen/2)} : dstaddr) <- conversion of src; Condition Codes: {dst string} LSS N <- @; 7 <- {dst string} EQL @; V <- {decimal overflow}; C 8; <- Exceptions: reserved operand decimal overflow CVTLP Convert Long to Packed Opcodes: F9 Description: The source operand is converted to a packed decimal string the and fied by the destination length and destination string operand speci replaced by the result, destination address operands is Notes: 1. After execution: RO = 0 R1 = 0 R2 = 0 R3 = address of the byte containing the most significant digit of the destination string 2. condition The destination string, R@ through R3, and the . 3. Overlapping operands produce correct results. are UNPREDICTABLE on a reserved operand abort codes Instructions DECIMAL 12-Feb-82 STRING -- Rev 7 Page INSTRUCTIONS CVTPL Convert opcode srclen.rw, srcaddr.ab, conversion of Packed to 4-187 Long Format: dst.wl Operation: dst Q<N 2 Condition <- ({srcaddr + ZEXT (srclen/2)} : srcaddr); Codes: {- dst LSS g; <- dst EQL 4; <- {integer <- 0; overflow}; Exceptions: reserved operand integer overflow CVTPL Convert Opcodes: 36 Packed to Long Description: The source operands replaced string 1is by specified converted the by to a of the the source longword 1length and result. the and source destination address operand is Notes: 1. After execution: R =0 Rl = address digit 2. R2 =0 R3 = The are The an invalid destination as byte source operand, UNPREDICTABLE updated used the containing the most string significant ¢ destination contains 3. of on a R@ through reserved R3, operand and the abort nibble. operand as specified the destination 1is in stored 1 above. operand. after Thus the R@ condition or if the codes string registers through R3 may are be Instructions DECIMAL 4, STRING If INSTRUCTIONS the source -2,147,483,648 Page 4-188 12-Feb-82 -- Rev 7 string through has a value 2,147,483,647 outside the range integer overflow occurs low order 32 and the destination operand is replaced by the ion conversion. precis te infini signed bits of the correctly may be different Thus, on overflow the sign of the destination from the sign of the source. Overlapping operands produce correct results. Instructions DECIMAL STRING INSTRUCTIONS CVTPS Convert opcode srclen.rw, 12-Feb-82 Packed to -- Rev Leading 7 Page Separate 4-189 Numeric Format: srcaddr.ab, dstlen.rw, dstaddr.ab Operation: {dst Condition string} «- conversion of {src string}; Codes: N <- {src Z string} <- LSS {src g; string} EQL ¢; V <- {decimal C <- @; overflow}; Exceptions: reserved operand decimal overflow CVTPS Convert Opcodes: g8 Packed to Leading Separate Numeric Description: The source source string. packed address The destination Conversion decimal string operands destination address is string operands specified converted is specified replaced by to by by the a the the source leading length Separate destination result. and numeric length is and effected by replacing the lowest addressed byte of the string with the ASCIT character '+' or '-', determined by the source string. The remaining bytes of the destination string are replaced by the ASCII representati ons of the values of the corresponding pack ed destination the sign of decimal digits of the source string. Notes: 1, After exXecution: RO = Rl = 0 address digit of R2 = 0 R3 = address of the of the byte source the sign containing string byte of the the most significant destination string Instructions DECIMAL STRING 2' INSTRUCTIONS Page 4-190 12-Feb-82 —-- Rev 7 condition codes The destination string, R@ through R3, and g the aps the source overl strin n natio desti the if are UNPREDICTABLE d nibble, or a an string, the source string contains reserved operand abort occurs. invali This instruction produces an ASCII "+" or "-" in the sign byte of the destination string. d in the destination If decimal overflow occurs, the value storeated by the condition may be different from the value indic the conversion produces codes 1f (Z and N bits). destination a -¢ without overflow, the leading separate numeric string is changed to a +0 representation. Instructions DECIMAL STRING INSTRUCTIONS CVTPT Convert opcode srclen.rw, 12-Feb-82 Packed to -- Rev Trailing 7 Page 4-191 Numeric Format: srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab Operation: {dst Condition string} <- conversion of {src string}; Codes: A<|< N Z <<- {src {src string} string} <- {decimal <- 0; LSS EQL g; 2; overflow}; Exceptions: reserved operand decimal overflow CVTPT Convert Opcodes: 24 Packed to Trailing Numeric Description: The source source destination address bits is the the into table least a string is specified is by replaced by the value using is -@) and byte address significant the the a source length and numeric string. The length source packed highest the byte byte the destination read out byte digit) entry The decimal string significant zeroth and condition addressed source operand. of the The the whose by trailing result. of least table to destination the of by sign the by wvalue 256 specified converted effected string containing index string affected Conversion decimal operands operands are Ssource packed address of address the string. of the destination string are replaced by the ASCII the wvalues of the corresponding packed decimal string. N and string. (even (i.e., as is table The destination code an if the the byte unsigned specified replaces remaining of the bytes of source Notes: 1. After execution: RG = Rl = 0 address digit of of the the byte source containing string the most by the representations digits Z significant Instructions DECIMAL STRING INSTRUCTIONS Page 4-192 12-Feb-82 -- Rev 7 R2 4] R3 address of the most significant digit of the destination string condition codes The destination string, RO through R3, and g the aps the source overl strin n natio are UNPREDICTABLE if the desti contains an table the or g strin e sourc string or the table, the invalid nibble, or a reserved operand abort occurs. The condition codes are computed on the wvalue of the even if overflow results. string N is set if and only if the source is non-zero and minus source In particular, condition code contains a to any sign. By appropriate specification of the table, conversion be realized. See Chapter 2 form of trailing numeric string may ing overpunch, zoned and for the preferred form of trail up for In addition, the table may be set rsion unsigned data. s. conve ed negat or value absolute value, negative absolute of h lengt the if even enced refer be The translation table may the destination string is zero. short destination string is too decim Decimal overflow occurs if the al d t of a non-zero packe to contain the converted resul a of on ersi Conv es). leading zero source string (not including value low. overf in ts resul never source string with zero length Conversion of a non-zero source string to a zero destination string results in overflow. value stored in the destination If decimal overflow occurs, the value indicated by the condition may be different from the codes (Z and N bits). Instructions DECIMAL 12-Feb-82 STRING -- Rev 7 Page INSTRUCTIONS CVTSP Convert opcode srclen.rw, Leading Separate Numeric to 4-193 Packed Format: srcaddr.ab, dstlen.rw, dstaddr.ab Operation: {dst <N =2 Condition string} <- conversion of {src string} Codes: <- {dst <- string} {dst string} <- {decimal <- 0; LSS EQL @; @; overflow}; Exceptions: reserved operand decimal overflow CVTSP Convert Opcodes: 29 Leading Separate Numeric to Packed Description: The source address numeric operands is destination length string string operands is specified converted specified by to the a source packed replaced by the destination by the result. operand abort 1length decimal address and string and source and the destination Notes: l. A 1. reserved The length outside 2. 3. the source range @ The length of the outside the range @ if: Leading through destination through After R digit byte. byte execution: =0 or an ASCII Separate numeric string is 31, packed decimal string 31. The source string contains an byte is any character other in a sign 2. of the occurs invalid byte. than an ASCII "g" "+", "<space>", or An invalid through "-" is in "9" the Instructions DECIMAL STRING INSTRUCTIONS 12-Feb-82 —-- Rev 7 Page 4-194 R1 = address of the sign byte of the source string R2 =0 R3 = address of the byte containing the most significant digit of the destination string. 3. and the condition codes The destination string, R@ through nR3,strin g overlaps the source natio desti the if BLE are UNPREDICTA string, or a reserved operand abort occurs. Instructions DECIMAL 12-Feb-82 STRING -- INSTRUCTIONS CVTTP Convert opcode srclen.rw, Trailing Rev Numeric 7 to Page 4-195 Packed Format: srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab Operation: {dst Condition string} <- conversion of {src string} Codes: N <- {dst Z <- {dst V <- {decimal C K- 8; string}LSS string} g; EQL @; overflow}; Exceptions: reserved operand decimal overflow CVTTP Convert Opcodes: 26 Trailing Numeric to Packed Description: The source Source trailing address destination and the is source zeroth out packed destination Conversion string is the table (i.e. digit). by the string to a by the packed source decimal operands specified by is the replaced by the by the highest addressed as using an specified unsigned by replaces the the order 4 string. 1index table highest byte containing remaining packed low specified converted the The replaced source effected string string is decimal length entry of numeric operands into address destination result. a (trailing) 256 byte operand. The addressed length string byte of the and and the address byte of table whose byte read destination the sign and the 1least significant digits of the destination string are bits of abort occurs the corresponding bytes in the Notes: 1. A 1. 2. reserved The operand the length of the source range ¢ through 31, The length outside the of the range if: trailing destination ¢ through 31. numeric packed string decimal is outside string is Instructions DECIMAL STRING INSTRUCTIONS 12-Feb-82 -- Rev 7 invalid byte. An invalid The source string contains an ASCI through "9" in any than r byte 1is any value othe any byteI "@"exce least pt the , 3. order high byte significant byte). 4. 2. Page 4-196 (i.e. digit produces The translation of the least significant le. invalid packed decimal digit or sign nibb After RO an execution: = 0 R1 = ad@ress of the most significant digit of the source string R2 =0 ant ng the most signific R3 = address of the byte containi string. digit of the destination n codes through R3, and the conditio The destination string, ROdest source the laps over ng ination stri are UNPREDICTABLE if the s. occur t abor and oper reserved string or the table, or a , the produces a -¢ without overflow 1f the convert instruction a +0 to ged chan 1is ng destination packed decimal N stri set. is Z and red clea is representation, condition code ng is @, the destination packed If the length of the source stritica 1s set iden .lly equal to @, and the decimal string is not referenced translation table from any table, conversion Chap ification of the be By appropriate spec ter 2 See . realized may form of trailing numeric string trai and d zone h, punc ling over of for the preferredIn form for up set be may e tabl addition, the unsigned data. ons. ersi conv ted nega or e valu lute absolute value, negative abso ng any uces a sign nibble containi 1f the table translation prod in the ed stor is on tati esen repr d sign valid sign, the preferre mal string. destination packed deci Instructions DECIMAL 12-Feb-82 STRING -- INSTRUCTIONS DIVP Divide Rev 7 Page 4-197 Packed Format: opcode divrlen.rw, divdaddr.ab, divraddr.ab, quolen.rw, divdlen.rw, quoaddr.ab Operation: ({quoaddr + ZEXT (quolen/2)} : quoaddr) ({divdaddr + ZEXT (divdlen/2)} ({divraddr + ZEXT (divrlen/2)} 2 Codes: <- <N Condition <divdaddr) / divraddr); <- {quo string} LSS g; string} EQL g@; {decimal overflow}; {quo <<- 0@; Exceptions: reserved operand decimal overflow divide by zero Opcodes: 27 DIVP Divide Packed Description: The dividend address divisor length specified replaced string operands and by by the the specified by the divided dividend by the divisor is divisor address quotient length result. operands. and length string quotient The and dividend specified by quotient string address the operands is Notes: 1. This instruction After execution contents 2. of The division l. The that 2. The is absolute a 16 restored performed value absolute product absolute is of the value of value of of are such the value the its workspace original on the contents stack. and the is less UNPREDICTABLE. that: remainder of absolute the byte to {(SP)-16}:{(SP)-1} absolute the allocates SP the (which divisor. value divisor is dividend. of is lost) the quotient times less than or equal to the the Instructions DECIMAL STRING INSTRUCTIONS 3. 12-Feb-82 —- Rev 7 Page 4-198 mined by the rules of The sign of the quotient is deter and the divisor. If divid algebra from the signs of the zero,end the sign is always the value of the quotient 1is positive. After execution: RO = R1 1] 3. 0@ address of the byte containing the most significant digit of the divisor string = @ R2 address of the byte containing the most significant R3 R4 digit of the dividend string = 0 t RS = address of the byte containing the most significan digit of the quotient string. the condition codes are The quotient string, RO through R5, and laps the divisor or over ng stri UNPREDICTABLE if the quotient dend string contains an dividend strings, the divisor oris divi @ or a reserved operand abort invalid nibble, the divisor OCCUrLS. Instructions DECIMAL 12-Feb-82 STRING INSTRUCTIONS MOvVPp Move -- Rev 7 Page 4-199 Packed Format: opcode len.rw, srcaddr.ab, dstaddr.ab Operation: ({dstaddr + ZEXT (len/2)} : dstaddr) <({srcaddr + ZEXT(len/2)} - srcad dr) Condition ; Codes: N <- {dst string} Z <- LSS {dst g; string} EOQL 2; V <- @; C <= C; Exceptions: reserved operand Opcodes: 34 MOVP Move Packed Description: The destination operands source is string specified replaced address by the by the source operands. length string and destination specified by the address length and Notes: 1. After execution: RO =0 Rl = address of the significant R2 @ R3 address of the significant 2. The destination are UNPREDICTABLE string, reserved the source operand R@ the string abort of byte digit string, if byte digit of containing the containing the through contains the most string the most destination R3, destination occurs. source and string an the string. condition overlaps invalid the nibble, codes source or a Instructions DECIMAL STRING INSTRUCTIONS 3. 12-Feb-82 -- Rev 7 1f the source is -0, the result is +@, N is cleared set. Page 4-200 and Z 1is Instructions DECIMAL 12-Feb-82 STRING INSTRUCTIONS MULP Multiply -- Rev 7 Page 4-201 Packed Format: opcode mulrlen.rw, mulraddr.ab, muldaddr.ab, muldlen.rw, prodlen.rw, prodaddr.ab Operation: ({prodaddr + ZEXT (prodlen/2)} : prodaddr) <({muldaddr + ZEXT (muldlen/2)} : mulda ddr) * ({mulraddr + ZEXT (mulrlen/2)} : mulra ddr); A< N =2 Condition Codes: <- {prod string} <- {prod LSS string} @; EQL 0; <- {decimal <- 0; overflow}; Exceptions: reserved operand decimal overflow MULP Multiply Opcodes: 25 Packed Description: The multiplicand multiplicand specified by string address the product string operands is specified operands is multiplier length specified by replaced by the by the multiplied and the multiplicand by multiplier product result. the address 1length and After execution: RO = Rl = 0 address of significant R2 =0 R3 = address of significant R4 = 0 the byte digit the of byte digit of containing the containing the the multiplier the most string most multiplicand string and string operands. product Notes: 1. 1length multiplier The address Instructions DECIMAL STRING INSTRUCTIONS 12-Feb-82 -- Rev 7 Page 4-202 R5 = address of the byte containing the most significant digit of the product string 2. codes are The product string, R¥ through R5, and the condition plier or multi the UNPREDICTABLE if the product string overlaps strings nd plica multi or multiplicand strings, the multiplier ved s. occur abort nd opera reser a or contain an invalid nibble, Instructions DECIMAL 12-Feb-82 STRING -- Rev 7 Page INSTRUCTIONS SUBP Subtract 4-203 Packed Format: opcode sublen.rw, subaddr.ab, difaddr.ab opcode diflen.rw, sublen.rw, subaddr.ab, minlen.rw, minaddr.ab, diflen.rw, difaddr.ab 4 operand 6 operand Operation: ({difaddr + ZEXT (diflen/2)} : difaddr) <({difaddr + ZEXT(diflen/2)} : difaddr) ({subaddr + ZEXT(sublen/2)} : subaddr); !4 operand ({difaddr + ZEXT(diflen/2)} : difaddr) <({minaddr + ZEXT(minlen/2)} : minaddr) ({subaddr + ZEXT(sublen/2)} : subaddr); !6 operand A< 2 Condition Codes: <- {dif <<- string} LSS 0; {dif string} EQL 4; {decimal overflow}; <- 0; Exceptions: reserved operand decimal overflow 22 SUBP4 Subtract Packed 4 Operand 23 SUBP6 Subtract Packed 6 Operand Opcodes: Description: In 4 operand length string operands In 6 string The and operand length format, the difference format, the subtrahend specified by the operands subtrahend string is string address operands the difference and difference address the and subtrahend specified by string subtrahend address minuend specified replaced by is replaced string operands length by the specified is subtracted length and the by the specified is and by the from minuend subtrahend result, subtracted difference result. by from the difference difference address address length and subtrahend the minuend operands. difference Page 4-204 12-Feb-82 -- Rev 7 Instructions DECIMAL STRING INSTRUCTIONS Notes: 1. After execution RO = R1 = of SUBP4: 0 address of significant R2 =0 R3 = address of the byte containing the most the byte containing the most digit of significant digit of 2. execution After address R1 of SUBP6: of the byte containing the most of the byte containing the address R3 of the byte containing the most significant digit of address significant digit of the difference string The difference string, R@ through R3 and most the minuend string 0 = RS subtrahend string 0 = R4 string the difference string significant digit of the R2 3. subtrahend 0 = RO the the string <condition overlaps subtrahend, contain an the minuend, <codes subtrahend or invalid nibble; (R@® through R5 for SUBP6), are UNPREDICTABLE if the difference or difference or a minuend strings; the (4 operand only) strings reserved operand abort occurs. Instructions EDIT 4.13 instruction which occur packed in PL/I, The but by the operation output symbol, designed to a to MOVE Rev 7 Page string, insertion when of it operands to the string descriptor, the output string. the the pair of starting starting interpreted string defines a a the common output. character numeric editing operates string. editted generating It 4-205 other input special is operation item in applications decimal for the When leading floating representations, and or as well. number to output. fill, 1is COBOL zero currency blanking an zero. EDITPC instruction are an input packed decimal a pattern specification, and the starting address of The packed decimal descriptor is a standard VAX-11 the length address address of of much of the decimal string in digits the a string. The pattern pattern operation editing (up to specification sequence which the way that the normal instructions are. described by only its starting address because length unambiquously. 1is the converting packed characters sign functions by This (PICTURE) digits, options include 1leading =zero insertion of floating sign, insertion of field operand implement format instruction can be used for consists of converting an The and to fixed string character converting protection, entire is handling decimal exemplified an -- EDIT INSTRUCTION This a 12-Feb-82 INSTRUCTION The the 31) is is output pattern While the EDITPC instruction is operating, it manipulates two character registers and the four condition codes. One character register contains the fill character. This is normally an ASCII blank, but would be changed contains the blank or a minus to asterisk changed to plus/blank allow such or as CR for check protection. The other character. 1Initially this contains sign and sign depending other can DB. be The upon the sign representations manipulated in order to sign register can sign in order to implement a floating the condition codes contain the sign of zero source (Z), an sign of overflow also the character either input. be changed RO-R5 proceeds. contain the When the conventional EDITPC values (V), instruction after a can be to the currency After execution, the presence of a and the significant digits (C). Condition code N is determined the instruction and is not changed thereafter (except -@ input). The other condition codes are computed and instruction ASCII This such as plus/minus or output special notations currency sign. the input (N), condition register an presence of at the start of for correcting a updated as the terminates, registers decimal instruction. Page 4-206 12-Feb-82 -- Rev 7 Instructions EDIT INSTRUCTION to Character String Edit Packed EDITPC Format: opcode srclen.rw, pattern.ab, srcaddr.ab, dstaddr.ab Operation: if srclen GTRU 31 then {reserved operand abort}; PSW<V,C> <- @; PSW<KZ> <- 1; PSWKN> <- {src has minus sign}; RO <- srclen; tmpl <- R@; R1 <- srcaddr; R2 <- 2?22 ' {if PSW<N> EQL @ then " " else "-"} R3 <~ pattern; R4 <- 227; 1<15:8>=sign, ' " "; <7:08>=fill R5 <- dstaddr; exit flag <- false; while NOT exit flag do begin {fetch pattern byte}; {if pattern @:4 no operand}; {if pattern 40:47 increment R3 and fetch one byte operand}; {if pattern 8@:AF except 80, 90, A0 {else operand is rightmost nibble}; {reserved operand}}; {perform pattern operator}; if NOT exit flag then {increment R3}; end; if R@ NEQ O then {reserved operand}; RO <- tmpl; Rl <- Rl - {tmpl/2} R2 <- @; R4 <- 0; if PSW<Z> EQL Condition tlength of source string lpoint to start of source string 1 then PSW<IN> <- @; Codes: N <- {src string} LSS 0; IN <- @ if src is -0 V <- {decimal overflow}; 'non-zero digits lost 7 <- C <- {src string} EQL @; {significance}; Exceptions: reserved operand decimal overflow Instructions EDIT 12-Feb-82 ~-- Rev 7 Page INSTRUCTION 4-207 Opcodes: 38 EDITPC Edit Packed to Character String Description: The destination string specified operands specified 1is by replaced by the source editting is performed address pattern operator pattern a repeat 1is and encountered. count itself. operator length described or on The is contained rest take a byte a in the one character. string end string consists operands. no rightmost nibble operand operand The starting (EOSEND) take byte This following pattern pattern operators immediately. the the a pattern pattern The to until Some which operator integer according extending operators. pattern are by the pattern and destination address the editted version of the source string 1length and source address operands. The of the individual the byte take pattern follows either an pattern pages. one Some of which 1is at pattern the unsigned operators Notes: l. 2. A reserved The operand destination contains outside strings an the abort string invalid range 1 overlap, occurs is through After R = Rl = length address R2 =0 R3 = address R4 = If the R5 = source the source ©pattern of source string and and string operand is destination destination strings of is occurs set at unless of the byte digit the of containing the the string source most byte containing the EOS$END byte beyond last byte operator address the destination condition V the EO$ADJUST INPUT 0 of 4. if if 31. execution: pattern the 31, the the significant If if if overlap. 3. srclen GTRU UNPREDICTABLE nibble, or if string codes the the of are end one destination is the string UNPREDICTABLE, R@ through R5 and overflow trap UNPREDICTABLE. and DV conditions is in enabled, note 9 are numeric satisfied. EDIT Page 4-208 12-Feb-82 -- Rev 7 Instructions INSTRUCTION 5. specified is The destination length exactly by pattern the operators in the pattern string. If the pattern is incorrectly formed or if it 1is modified during the execution of the the destination string 1is of length the instruction, UNPREDICTABLE. result If the source is -8, the included is operator pattern may -0 be unless a (EOS$SBLANK ZERO fixup or EO$REPLACE_SIGN). The contents of the destination string and the memory preceding it are UNPREDICTABLE if the length covered by EO$SBLANK_ZERO or EOSREPLACE SIGN is 0 or is outside the destination string. If more input digits are requested by the pattern than are specified, then a reserved operand abort is taken with RO = -1 and R3 = location of pattern operator which requested the extra The condition codes and other registers are as digit. specified in note 11. This abort is not continuable. If fewer input digits are requested by the than pattern are specified, then a reserved operand abort is taken with R3and= location of EOSEND pattern operator. The condition codes other registers are as specified in note 11. This abort is not continuable. 19. On an unimplemented or reserved pattern fault operand 1is pattern operator. with taken R3 operator, a reserved = location of the faulting The condition codes and other registers are as as specified in note 11. This fault is continuable as long the to ng accordi the defined register state 1is manipulated pattern operator description and the state specified as ?2?? is preserved. 11. On a reserved operand exception as specified in notes 8 through 19, FPD 1is set and the condition codes and registers are as follows: {src has minus sign} N = 7 = all source digits 0 so far V = non-zero ¢ = significance digits R = -zeros<l5:9> ' lost remaining srclen<l5:0> R1 = current source location R2 = 22?2 R3 ' sign ' fill location of edit pattern operator causing exception Instructions EDIT 12-Feb-82 INSTRUCTION R4 = R5 -- Rev 7 Page 227? location of next of source destination byte where: zeros sign fill = = count zeros to supply current contents of sign character register current contents of £ill character register 4-209 12-Feb-82 Instructions EDIT -- Page 7 Rev 4-210 INSTRUCTION Summary of EDIT pattern operators operand summary EOSINSERT ch insert EOSSTORE SIGN EOSFILL - insert sign r insert fill EQOSMOVE r EOSFLOAT EOSEND FLOAT r - move digits, move digits, EOSBLANK ZERO len fill EOSREPLACE SIGN len replace EOSLOAD FILL ch load fill character EOSLOAD SIGN EOSLOAD PLUS EOSLOAD MINUS ch ch ch load sign character name insert: fill character, if insignificant move: end floating filling insignificant floating sign sign fixup: backward with zero when if -0 f£ill load if if sign character sign character load load positive negative control: set EO$SET_SIGNIF EOSCLEAR_SIGNIF EOSADJUST INPUT - EOSEND len - significance clear flag significance adjust source end edit flag length where: ch r len one character repeat count in the range 1 through 15 length in the range 1 through 255 Instructions EDIT 12-Feb-82 -- Rev INSTRUCTION EDIT pattern operator 7 Page 4-211 encoding (hex) 20 EOS$END 01 EOSEND FLOAT EOSCLEAR_SIGNIF g2 23 EO$SET _SIGNIF g4 EO$STORE SIGN 85..1F Reserved to 20..3F Reserved for 40 41 42 43 DEC all EOSLOAD FILL EOSLOAD SIGN time \ | EO$SLOAD PLUS | -- character EOSLOAD MINUS 44 EOSINSERT / 45 EO$BLANK ZERO EOSREPLACE SIGN EO$ADJUST_INPUT \ 46 47 48, .5F Reserved to DEC 60..7F Reserved to CSS, 80,90,A0 Reserved to DEC 81..8F EOSFILL 91..9F Al..AF EOSMOVE EOSFLOAT B@..FE Reserved to FF Reserved for | | -- unsigned / is in next byte length is in customers \ / | -- DEC all time repeat count is <3:0> next byte EDIT Page 4-212 12-Feb-82 -- Rev 7 Instructions INSTRUCTION The following pages define each pattern operator in a format similar to 15, an that of the normal instruction descriptions. repeat an operand it is either a unsigned byte descriptions, READ: (len), 1length count (r) In each case, 1f there 1s from 1 through or a character byte (ch). the following two routines are invoked: In the formal 1 function value @ through 9 if R EQL @ then {reserved operand}; if Rg LSS then 0 begin READ <- 0; RP<31:16> <- R@<31:16> + 1; end; 1see EOSADJUST INPUT o else begin READ <RO <- RO (R1)<3+4*R@<0>:4*RP<A>>; - 1; if ROKP> EQL 1 then R1 <~ R1 + 1; end; return; STORE (char) : (R5) <- char; R5 <- R5 + 1; return; Also the following definitions are used: fill R2<7:0> sign R2<15:8> !get next nibble talternating high then low Instructions EDIT 12-Feb-82 -- Rev 7 Page INSTRUCTION EOSINSERT Insert 4-213 Character Purpose: Insert a fixed character, substituting significant the fill character if not Format: pattern ch Operation: if PSWKC> EQL Pattern operators: 44 EOSINSERT 1 then STORE (ch) Insert else STORE (fill); Character Description: The pattern set, then is not operator the set, destination. is character then the followed is placed contents of by a character. into the the fill If destination. register is significance If is significance placed into the Notes: This pattern operator comma) and fixed that significance is used for blankable inserts (e.qg., inserts (e.g., slash). Fixed inserts require be set (by EO$SET_SIGNIF or EOSEND_FLOAT). EDIT Page 4-214 12-Feb-82 -- Rev 7 Instructions INSTRUCTION EO$STORE_SIGN Store Sign Purpose: Insert the sign character Format: pattern Operation: STORE (sign); Pattern 24 operators: EOSSTORE SIGN Store Sign Description: The contents of the sign register is placed into the destination. Notes: This pattern operator is used for any non-floating arithmetic should be preceded by a EOSLOAD_PLUS and/or It sign. EOSLOAD MINUS if the default sign convention is not desired. Instructions EDIT 12-Feb-82 -- Rev 7 Page 4-215 INSTRUCTION EOSFILL Store Fill Purpose: Insert the fill character Format: pattern r Operation: repeat Pattern 8x r do STORE (fill); operators: EOSFILL Store Fill Description: The right contents nibble of the of the fill pattern operator register times. is 1is placed used for the into repeat the count. destination Notes: This pattern operator is fill (blank) insertion. The repeat Page 4-216 12-Feb-82 -- Rev 7 Instructions EDIT INSTRUCTION EOSMOVE Move Digits Purpose: Move digits, filling for insignificant digits (leading zeros) Format: pattern r Operation: repeat r do begin tmp <- READ; if tmp NEQU @ begin then PSW<KZ> <- 0; PSWLC> <- 1; !set significance end; if PSW<KC> EQL @ then STORE(fill) else STORE ("@" + tmp); end; Pattern 9x operators: EOSMOVE Move Digits Description: operator is the repeat moved from the source to the destination. If the digit The right nibble of the pattern repeat the times, 1is significance is =zero and set significant (i.e., is a leading zero) the fill register in the destination. cleared. it If count. For The next digit is following algorithm is executed. the 1s digit non-zero, 1is not 1in the is replaced by the contents of Notes: 1. If r is greater source string, 2. a than the number of digits remaining reserved operand abort is taken. This pattern operator is used to move digits without a floating =zero suppression is desired, significance significance must be set. A string of EOSMOVEs intermixed with sign. must be If leading clear. 1f leading =zeros should be explicit, EOSINSERTs and EOSFILLs will handle suppression correctly. 3. 1If check protection the EOSMOVE. (*) is desired EOSLOAD_FILL must precede Instructions EDIT 12-Feb~-82 ~-- Rev 7 Page INSTRUCTION EOSFLOAT Float 4-217 Sign Purpose: Move digits, floating the sign across insignificant digits Format: pattern r Operation: repeat r do begin tmp <- READ; if tmp NEQU @ then begin if PSWKC> EQL @ then begin STORE (sign); PSWKZ> <- 8; PSWLC> <- 1; !set significance end; end; if PSWKC> EQL else @ then STORE (fill) STORE ("@" + tmp); end; Pattern AxX operators: EOSFLOAT Float Sign Description: The right repeat the nibble times, source set, is then of the pattern examined. the destination, the following If it contents significance operator algorithm is of is significant, it is stored in the the fill register is stored in the is and sign and the repeat executed. non-zero the set, is The count. next significance register is For digit from not vyet in the is stored zero is cleared. 1If the digit destination, otherwise the contents is of destination. Notes: 1. If r is source 2. This greater string, pattern arithmetic than a the operator sign. EOSSTORE_SIGN. number reserved A is The of operand used sign sequence of to digits abort move must one is remaining digits already or more in with be a floating setup EOSFLOATsS can as must be terminated by one EOS$SEND FLOAT. for include intermixed EOSINSERTs and EOSFILLs. Significance must be before the first pattern operator of the sequence., sequence the taken. clear The Instructions EDIT 12-Feb-82 -- Rev Page 7 4-218 INSTRUCTION 3. This pattern operator sign. currency EOSLOAD SIGN. The is used to move digits sign must the with be a setup A sequence of one or more EOSFLOATs can intermixed EOSINSERTs and EOS$FILLs. before already first pattern operator floating with a include Significance must be clear of the sequence must be terminated by one EOSEND_ FLOAT. sequence. The Instructions EDIT 12-Feb-82 INSTRUCTION EOSEND FLOAT End -~ Floating Rev 7 Page 4-219 Sign Purpose: End a floating sign operation Format: pattern Operation: i1f PSW<KC> EQL begin 4 then STORE (sign) ; PSWLC> <- 1; !set end; Pattern 21 significance operators: EOSEND FLOAT End Floating Sign Description: If the if in significance is the destination floating sign has not and not yet been placed set), the contents of significance is set. in the the sign destination register is (i.e., stored Notes: This pattern EOSFLOAT The EOSFLOAT EOSFILLs. operator pattern is used operators sequence can after which a start include sequence with of one or significance intermixed more clear. EOSINSERTs and Page 4-220 12-Feb-82 -- Rev 7 Instructions EDIT INSTRUCTION EOSBLANK ZERO Blank Backwards When Zero Purpose: Fixup the destination to be blank when the value 1s zero Format: len pattern Operation: if len EQLU @ then {UNPREDICTABLE}; if PSW<Z> EQL 1 then begin R5 <- R5 - len; repeat len do STORE (£i11); end; Pattern operators: EOSBLANK ZERO 45 Blank Backwards When Zero Description: integer length. Tf followed by an unsigned byte The pattern operator 1is ce ents of the fill cont the ng is zero, then the sour stri the valueis of ination string. dest the of s byte th leng stored into the last register Notes: 1. n the destination string The length must be non-zero and withi ents of the If it 1is not, thepreccont already producedng. and g it are edin ry memo the destination stri UNPREDICTABLE. 2. blank out any characters This pattern operator is used r toa forc ed significance, such as ion unde stored in the destinat following the radix point. a sign or the digits Instructions EDIT 12-Feb-82 INSTRUCTION EOSREPLACE_SIGN Replace -- Rev Sign When the value 7 Page 4-221 Zero Purpose: Fixup the destination sign when is =zero Format: pattern len Operation: if if len EQLU @ PSW<Z> EQL Pattern operators: 46 EOSREPLACE then 1 SIGN {UNPREDICTABLE}; then (R5 - len) <- fill; Replace Sign followed by When Zero Description: The pattern the wvalue operator is of the source of the fill which register is contents string length string bytes is an is unsigned zero stored before the byte (i.e., into the current integer if byte Z is of length. set), the position. 1If then the destination Notes: 1. The length must be already produced. destination string non-zero If and UNPREDICTABLE. 2. This pattern (EO$END_FLOAT source value operator or turned can and it within is the be used EO$STORE_SIGN) out to be the not, memory to if zZero. destination the contents preceding correct a minus was a string of the it are stored sign stored and the EDIT Page 4-222 12-Feb-82 -- Rev 7 Instructions INSTRUCTION Load Register EOSLOAD _ Purpose: Change the contents of the fill or sign register Format: pattern ch Iselect one depending on pattern operator Operation: Pattern £i11 <- ch; 'EOSLOAD FILL sign <- ch; 'EOSLOAD SIGN if PSWKN> EQL @ then sign <- ch; 1EOSLOAD PLUS if PSW<KN> EQL 1 then sign <- ch; 1EOSLOAD MINUS operators: 40 EOSLOAD FILL 43 EOSLOAD MINUS EOSLOAD_SIGN EOSLOAD PLUS 41 42 Load Fill Register Load Sign Register Load Sign Register If Plus Load Sign Register If Minus Description: For EOSLOAD FILL this The pattern operator is followed by a character. For EOS$SLOAD_SIGN this er. regist character 1is placed into the fillregist EOSLOAD PLUS this For er. sign character is placed into the e string has a sourc the if ter regis sign the into d character 1is place into the sign placed is ter positive sign. For EOSLOAD MINUS this charac register if the source string has a negative sign. Notes: (* instead 1. EOSLOAD FILL is used to setup check protection 2. EOSLOAD SIGN is used to setup a floating currency sign. EOSLOAD PLUS is used to setup a non-blank plus sign. 3. 4. of . space) EOSLOAD MINUS is used to setup a non-minus minus sign (such CR, DB, or the PL/I +). as Instructions EDIT 12-Feb-82 INSTRUCTION EOS_SIGNIF -- Rev 7 Page 4-223 Significance Purpose: Control the significance (leading zero) indicator Format: pattern Operation: Pattern g2 PSW<C> <- g; !EO$CLEAR_SIGNIF PSW<C> <- 1; !EOSSET_SIGNIF operators: EOSCLEAR_SIGNIF 63 Clear EOSSET SIGNIF Set Significance Significance Description: The significance treatment of significance indicator leading zeros indicator is 1is set (leading clear). or zeros cleared. are zero This digits controls the for the which Notes: 1. EOSCLEAR SIGNIF (EOSMOVE) (EOSINSERT 2. is used to initialize or floating sign (EOSFLOAT) with significance set) . leading zero following EOSSET SIGNIF is used to avoid leadin g zero EOSMOVE) or to force a fixed insert (before a suppression fixed suppression EOS$INSERT). insert (before EDIT Page 4-224 12-Feb-82 —-- Rev 7 Instructions INSTRUCTION EOSADJUST INPUT Adjust Input Length Purpose: Handle source strings with lengths different from the output Format: len pattern Operation: if len EQLU @ or len GTRU 31 then {UNPREDICTABLE}; if RP<K15:8> GTRU len then begin RP<31:16> <- 0@ repeat RO<15:8> - len do if READ NEQU @ then begin PSWKZ> <- @; PSWKV> <- 1; PSWLKC> <- 1; !set significance end; end; fill Pattern 47 else R@<31:16> <- RO<L15:8> - len; inegative of number to operators: EOSADJUST INPUT Adjust Input Length Description: byte integer length in The pattern operator is followed by an unsigned has more digits than this the source string the range 1 through 31. ng If digit I1f any s are read and discarded. leadi length, the excess is set, ce fican signi set, is then overflow discarded digits are non-—-zero sourc this than s digit fewer has g e strin and zero is cleared. 1If the This y. suppl to zeros ng leadi of r numbe the length, a counter is set of counter is stored as a negative number in R@O<K31:16>. Notes: the destination If length is not in the range 1 throughR5 31 UNPREDICTABLE. are gh throu R@ string, condition codes, and Instructions EDIT 12-Feb-82 INSTRUCTION EOSEND End -- Rev 7 Page 4-225 Edit Purpose: End the edit operation Format: pattern Operation: exit flag <- true; !terminate !end ldescribed instruction Pattern 20 edit processing loop is under EDITPC operators: EOSEND End Edit Description: The edit operation is terminated. Notes: 1. If there are still taken. 2. If the source value input digits is the —-@, a N reserved condition operand code is abort cleared. is Instructions OTHER VAX-11 4.14 INSTRUCTIONS 12-Feb-82 -- Rev 7 OTHER VAX-11 INSTRUCTIONS The following instructions are document as indicated below. specified 1in Page 4-226 other chapters of this Instructions 5: Chapter Probe {Read, Write} Accessability PROBE {R,W} mode.rb, len.rw, base.ab Chapter 6: Change Mode CHM{K,E,S,U} param.rw, {-(ySP) .w*} Where y=MINU (X, PSL<current_mode>) Return from Exception or Interrupt RET {(SP)+.r*} Chapter 7: Load Process Context Save Process Context LDPCTX {PCB.r*, - (KSP).w*} SVPCTX {(SP)+.r%*, PCB.w*} Chapter 9: Move To Process Register MTPR src.rl, procreg.rl Move From Processor Register MFPR procreg.rl, dst.wl Instructions OTHER VAX-11 12-Feb-82 INSTRUCTIONS BUG -- Rev 7 Page 4-227 Bugcheck Format: opcode message.bx Operation: {fault Condition to report error} Codes: N <- Z K- Z7; V K- V; C K- ¢C; N; Exceptions: reserved instruction Opcodes: FEFF BUGW Bugcheck FDFF with BUGL word Bugcheck with longword message identifier message identifier Description: The hardware treats The VAX/VMS operating detected longword VAX/VMS these errors. The (BUGW) and opcodes system in-line as treats RESERVED these message interpreted as as to identifier a DIGITAL requests condition Run Time Library Reference Manual). privileged to report bugs, a log entry is made. Privileged, a reserved inst ruction is signalled. to and faults. report software is zero extended to value (see Appendix If If the the process process is a c, is not CHAPTER 5 MEMORY MANAGEMENT 17-Jun-81 5.1 the management consists allocation and multiprogramming at the address time. spaces to or further provide the The 5.3 hardware and of read/write for mode one Furthermore, also be The CPU before must be where the virtual tables each utilizes mode, of mapping virtual mapping addresses. be is memory and memory mapping management meets several development a address 2. Allow ‘not and in a memory multiple affect other data large is structures the up an Any location more that image access can is (page tables) when translates that of both VAX-11. track of The CPU addresses the memory The memory goals: space for one instructions gigabyte. and they software keep virtual can However, data, memory. provides the and that physical modes. written management in scheme be executed. located it accessible privileged instructions Memory mechanisms to is specified at the inaccessible, read-only, or location information page protection Provide physical protection will all addresses. information management to when to Therefore, l. in Protection be modes. any used physical 512-byte this physical access addresses can into user. page may accessible access addresses and a four also each translated maintains memory control reliability, four hierarchical access modes control. They are, from most to least privileged : of is generates reside process which Typically, system. read. these may uses one software memory. software each for Processes VAX-11 executive, supervisor, individual page level, where to physical that operating access kernel, the several ensure improve memory of use system, same processes to Rev INTRODUCTION Memory To -- data. Memory Management Page 5-2 17-Jun-81 -- Rev 5.3 INTRODUCTION 3. Provide convenient and efficient sharing 4. Contribute to software reliability. of instructions and data. allows a large address space, yet Progr A virtual memory system provides ams ions. gurat small memory confi programs to run on hardware with m syste y memor al virtu The ss. d a proce execute in an environment terme ss space. for VAX-11 provides each process with a 4 billion byte addre the into two equal size spaces,syste The virtual address space is divided m The . space ss addre s roces per-p system address space andfor the ting opera the ins all processes. It conta all system code address space is the sameen as calla ble procedures. Thus writt 1is system which via a simple CALL. em other syst and useresscode can be available to all address space. However, Each process has 1its own separate proc page, thus providing several processes may have access to the same controlled sharing. 5.2 VIRTUAL ADDRESS SPACE fying a Dbyte bit unsigned integer speci A virtual address is a 32 space r array of linea a sees ammer progr The . location in the address ss space is broken into 512 byte 4,294,967,296 bytes. The virtual addre ction. units termed pages. The page is the unit of relocation and prote ntly large to be contained in any prese This virtual address space is ytoomanag map to nism mecha the ement provides available main memory. Memor cal physi able avail the to space address the active part of the virtualement en also provides page protection betwe address space. Memory manag ical -phys al-to the virtu ting system controls ive processes. The operas, but used parts of the inact the swaps and table ng address mappi storage media. virtual address space onto the external the ed into two parts. The half with The virtual address space is asdivid each for nct disti is ," space ss proce "persmaller addresses, known the 1larger addresses, system. The half with process running on the sses. Virtual address proce known as "system space," 1is shared by all space is illustrated in Figure 5-1. Memory Management VIRTUAL ADDRESS 17-Jun-81 SPACE -- Rev 5.3 Page o 00000000 + | | length | in I | PO | (Program) | Region I of pages ~ I (PULR) | | I growth | 140000000 - | | | Pl | (Control) | | | P1 | growth | direction ___._____.__ __._______._ S, Region length of in pages —-eeo | | BFFFFFFF a c e | ___+______ System Region | (SLR) | | | System Region | growth direction v B I S | | y s | t | e I m + |CO000000 | | | I I | | | I | I | I | S P i | | | | I _____._____. ‘ | S | of Pl Region pages (2**21-P1LR) ____________ | | | S | ______ +___ | | | | 80000000 o c length in r I e —eomm I p | I Region | Region - + | l r | | direction v e e l P@ Region | p I ———o— o __ | 3SFFFFFFF FFFFFFFF | Region | I JEFFFFFF PO I I I Reserved | Region : I | | e I + Figure Virtual 5-1 Address Space S p a C e 5-3 17-Jun-81 -- Rev 5.3 Memory Management VIRTUAL ADDRESS SPACE Process 5.2.1 Page 5-4 Space hex) of the esses aap00n00-7FFFFFFF, The smaller—addressed halfis (addr per-process The ." space cess termed "per-pro virtual address space region) (P@ n regio am progr the , parts space is divided into two equal address rate has a sepa region). Each process and the control region (Pl all of es spac ess proc perthe per-process space, SO translation map forlete end the at ing Shar on ion sect the ly disjoint (see per—-process space is context processes are comp of this chapter). The address map for ing on the system 1is changed switched ess runn (changed) when the Pproc ture) . (see the chapter on Process Struc System Space 5.2.2 the -FFFFFFFF, hex) of (addresses 8000000 e." The 1arger—addressed half the use s esse All proc "system spac sSyst space 1is termedsyst virtual address ed shar is e spac em em space, so for same address translats.ion map ext cont not is e spac em syst for The address map among all processe switched. Virtual Address Format 5.2.3 each ual address for syst rates a 32-pit virtess The VAX-11 processor anddgene em the , utes in memory. As the proc addrexec instruction and operual addr ual virt The ess. ess to a physical translates each virt g form at: address has the followin 9 8 3 1 2 ib+ S S l byte ¥ l VPN | + et e S SSE S Figure 5-2 virtual Address Format VPN the Number field specifies ual ¢31:9> The Virtual Page virt The ed. renc virtual page to be refe pages address space contains 8,388,608 of - } e o h AT 3 Byte # 1 b <8:0> (2**23) 512 bytes each. ifies the byte address The byte number field specconta ins 512 bytes. within the page. A page ess is in the system space. When bit 31 1is it 31 is one, the addr the per-process space. zero, the address is in program ishes between the regi ess space, bit 30 3¢dist1isinguone, Within the per-procons. on 1is rol cont the bit and control regi it iswhen ed. zero, the program region is referenc referenced, and when Memory VIRTUAL 5.2.4 The Management ADDRESS Virtual 17-Jun-81 SPACE Address Space -- Rev 5.3 Page 5-5 Layout layout of virtual address space is illustrated in Figure 5-1, Note access to each of the three regions (P@, P1, System) is controlled by a length register (POL R, P1lLR, SLR). Within the limits set by the length registers, the access is further cont rolled by page tables that specify the that validity, Page in 5.3 MEMORY The the action governed MAPEN requirements, and physical location of each MANAGEMENT CONTROL of translating by the internal privileged access memory. MAP a setting virtual of processor ENable the address Memory register. to a Mapping Figure register, bhysical Enable 5-3 address (MME) bit in illustrates is the the 3 1 10 et tt | | M| MBZ l +-+ IM]| lE | o +-+ Figure MAP MAPEN<O> memory is is the disabled. At @. 5.3.1 Memory Setting MME Virtual physical is ( to #56, write: MTPR src.rl, is turns address bit, are always of no bit PA page is Mapping = (MME) When MME dst.wl bit. is initialization ) 455 When set time, ) to 0, MAPEN MME is memory is set to 1, management initialized to Disabled off n, zero. is 1is for n translation copied = VA<n> g to is implementation VA<29:0> brotection: maintained. address VA<n>, PA<n>, bits Enable enabled. processor PA There MFPR bit number modify read: address PA<31:30> (The ¢ (MAPEN) to Management to 5-3 Register ( Memory management ENable modulo all and directly the VA<31:30> 29, ignored if dependent.) (2** accesses number are access to of PA<n> PA allowed control. corresponding are ignored; doesn't exist. bits) in all modes. No Page 5-5 17-Jun-81 -- Rev 5.3 Memory Management ADDRESS TRANSLATION ADDRESS TRANSLATION 5.4 ol are on. The translation and access hercontr When MME is a 1, address owin intended access 1is an g to determine whet processor uses the foll allowed: 1. The virtual address, which is used to index a page table, 2. The intended access type (read or write), and 3. the Processor Status Longword, The current privilege level frommapp ing references. or Kernel level for page table mapped, the result is and the address can beifie If the access is allowed d virtual address. the physical address corresponding to the spec be performed is a read. if the operation to tion The intended access sis READ to be performed is a if the opera The intended acces 1is to WRITE y (that is, read modif a is be performed write. 1If the operation . WRITE followed by write) the intended access is specified as a nd, then no reference is made. If an operand is an address operaand need not even exist. the page need not be accessible 5.4.1 Hence Page Table Entry (PTE) (PTE) to translate virtualt.addresses to The CPU uses a Page Table Entry 5-4a illustrates the PTE forma physical addresses. 33 1 9 Figure 4] 22222222 76543210 S i+ | PFN V] PROT IM|ZI|OWNI[SI|SN] SR + t i +—t——————- P S R S ISR +—t——————- PR Figure 5-4a Page Table Entry V <31> the M bit Valid bit - governs the validity of; V=8 for not wvalid for v=l and PFN field. valid. When V=0, the M and reserved for DIGITAL software. PFN fields are PROT this field is always valid <3@:27> PROTection field - CPU hardware even when V=0. M <26> and is used by the , M 1is Modify bit - When the valid bit is clear reserved for not used by CPU hardware, and is When the DIGITAL software and 1I/0 devices. page has the er wheth shows M valid bit 1is set, has not page the , clear is M If been modified. Memory Management ADDRESS 17-Jun-81 TRANSLATION been modified. been modified. M cleared is hardware only on page. In a implied is an For and the the is in the It is Pprocess PTE that that the bits the (that test that Software DIGITAL (Software The symbols operating bits Among to defined system implement the for software its fhese uses some pPage them between whenever a in page active PTEs fault only if is zero 22, swapped-out Valid occurs. bit, of bits the the the not 21 to does not because use page page examined of the page. Used DIGITAL and not and 21 necessarily the are PTES as of PTE is reserved for and this is prefix.) software functions. way page states. PTE<31>, the the structures implemented and is software alter of combinations data table. bit software. use copy-on-reference, whose page of the system. RESERVED fields of v=1, bit M page. M page); base hardware bits mapping whether owner upper the The management reference PTE modification to the software. above functions functions - the the the the privileged the initialize—pages—with—zeros, transitions bits the 25,is by page a accessible hardware. of this Crosses not DIGITAL of is occurs have process for it modification of allowed - established that an page otherwise second the causes delete Number bit is in the by fault UNPREDICTARLE mode mode zero. page multiprocessor address - a would whether bit a hardware bit if the the the that, set CPU by or if accessible, wupdate any be set reference mapping maps by Zero not is or must set It to CPU be which reserved the Frame may is or Page to unchanged protection physical <22:21> in - altered by is access is, set page PTE<M> interlocked OWNer is M PTE have modify (PROBEW) first may page It is write UNPREDICTABLE system S a 5-7 or is M Page write Beyond the page. a as if second set Note <25> M the page. where first set, it whether fault. the VA software. is instruction example, will by by instruction boundary <20:0> M inaccessible. in PFN If probe-write. modified 5.3 addition, UNPREDICTABLE <24:23> Rev successful probe-write OWN -- VAX/VMS a are sharing, 0 and and encodes processes ADDRESS 5.4.2 Page 5-8 17-Jun-81 -- Rev 5.3 Memory Management TRANSLATION For I/0 Devices (PTE) Page Table Entry Some I1/0 devices, such as the DR32, VAX-11 wuse memory management to These 1/0 devices use a Page Table Entry format translate addresses. The the CPU. which is an extension of that in Figure 5-4a |used by ons CPU the that functi some re extended PTE implements for I/0 hardwa ular, partic 1In . faults page and bits re softwa does with software using combinations. Some of PTE bits 31, 25, and 22 are decoded into four format , and some are PTE CPU the these are used in the same way as in The four combinations are: used in different ways. interpretations and their SRS N Y P —: S X S o PTE<31,26,22> PTE Type Valid PFN Valid PFN Global Page Table Invalid, 1/0 Index abort are: This is a valid PFN field. PTE<31,26,22>=1xx, Figure 5-4b. PTE<20:0> CPU the for 5-4a Figure in rated illust is identical to the PFN field PTE. 3 2 3 22 22 2 272 4 765432140 1 9 oo + oo —— ——— oo dodmfmmmmmmm e —mm——— et ——— bt PFN IMIZ|OwWNIS|S| 11| PROT ot fododmm et m e m e —m e mmmm e — Figure ! - - === + 5-4b PTE<31,26,22>=1xx, Valid PFN This PTE<31,26,22>=000, Figure 5-4c. PTE<20:0> is a valid PFN5-4afield. CPU the for Figure in rated is identical to the PFN field illust PTE. 3 3 2 22 22 2 22 7554321690 e bododom—fofofmmmmmmmmmm |91 PROT |31 ZIOWN IO ]S | 10 t—t—m e ————————— - f ot tmm oo mm—mm—mmmm e Figure PEN 4] oo oo + | — e —————— oo + 5-4c PTE<31,26,22>=000, Valid PFN Page Table Index PTE<31,26,22>=001, Figure 5-4d. PTE<21:0> is a GlobalBase Register (GBR) table page The 1/0 device has a Global (GPTX) . The 1/0 s. addres l virtua system a with re softwa which is loaded by of a addres l virtua device calculates GBR + GPTX * 4 to get the system PFN, and musts have valid a n second PTE. The second PTE must contai If either of these PTE<31,26,22> equal to either 000 or 1xx, binary. For those devices requirements is not met, the result is UNDEFINED. PTE. first the from that use it, the PROTection field always comes Memory Management ADDRESS 17-Jun-81 TRANSLATION 3 3 2 1 @ 76 -- Rev 5.3 Page 5-9 222222 54 321 Y e TR Ft e e ___ + 10| PROT |0 |Z]OWN]|1 | GPTX e e e e R e Figure PTE<31,25,22>=001, PTE<31,26,22>=01x, I1/0 devices will Figure abort 33 22222222 10 765432109 a 5-44 Global 5-4e. in This DEVICE | + Page PTE Table format DEPENDENT Index is RESERVED to DIGITAL. manner. Y e T Fot et b e ___ + |61 PROT |1|Z|OWN|S|S| S Fofmm e e e e e o Figure PTE<31,26,22>=p1x, I/0 devices may bit; this is them I/0 the same look way that their own described buffer devices Page in 5.4.3 do Base Changes CPU of mapping of the use the SBR same and SPT as the SLR. Buffer loaded by CPU, but they addresses are a system virtual address of the PTE for the first byte offset within that Page. 1In addition the I1/0 Page Table in memory and an 1I/0 hardware Global Register To abort does. memory and a Global I/0 check the PROTection field or modify the M DEPENDENT. Those devices that do use them, use copies terms page use a table the 5-4e TInvalid, and DEVICE devices have at Page (GBR) Table which must be software. Entries The operating system changes PTEs as part of its memory functions. For example, VMS sets and clears the valid bit the PFN The software field itself. the in single must An instructions it tables read PTE that the consistent that one would could The and each PTE is set PTE<V> another. An with an address can moving time solve the new this PTE MOVL. the problem CPU more or an first processor, CPU is In I/0 changing. order to may changes consistent within give would problem to can the routine by page this, between using building table Another the a new with a processor, the processor first system instruction map reference second quarantee one interrupt complicated. The incorrect with that makes PTEs. always to a management and out. at be use in field software register and then instruction such as another swapped PTE<PFN> a Multiprocessing be a example PTE. are guarantee establishing two inconsistent PTE pages Changing operation. before as | + same must note page always that PTEs ADDRESS TRANSLATION Then two requirements must be met: are longwords, longword-aligned. 1. Whenever the software modifies a PTE in more than one byte, 1t a longword, longword-aligned, write-destination use must such instruction, 2. Page 5-10 17-Jun-81 -- Rev 5.3 Memory Management as MOVL, and The hardware must guarantee that a write an is cannot read (or M"atomic" operation. results. partial any over) write longword-aliqgned longword, That is, a second processor first the of processor's ACCESS CONTROL 5.5 type Access control is the function of validating whether a particularto each Access page. lar particu a to allowed be to is of memory access page is controlled by a protection code that specifies for each access nally, mode whether or not read or write references are allowed. Additio P1, PO, the within lies it that certain make each address is checked to region. system Processor 5.5.1 Modes In the order of most privileged to least privileged , the T or four processor are: modes 0 - Kernel - used by the kernel of the operating management, scheduling, 1 - Executive - used for calls, and I1/0 drivers. many of the operating including the record management system. system system for page service 2 - Supervisor - used for such services as command interpretation. compilers, utilities, code, 3 - User - used for user level debuggers, etc. The access mode of a running process 1is the current processor mode, stored in the Current Mode field of the Processor Status Longword (PSL) (see the Chapter on Exceptions and Interrupts). 5.5.2 Protection Code Every page in the virtual address space is protected according to its use. Even though all of the system space is shared, in that the program g, may generate any address, the program may be prevented from modifyin from d prevente be also may program A it. of or even accessing portions accessing or modifying portions of per-process space. Memory Management ACCESS CONTROL For example, whereas spaces is highly executable with accessibility of 1. 2. Each If If any also The in a 4 for is access for field Page are by information normal a for highly code be be user code access write then access then access. the 15 in the mode, all all combinations Page Table in protected, privilege. per-process in per-process describes The 5-11 code the allows a within the following read-only, or no-access. more privileged 1levels more privileged levels of Entry any that mode. read-write, of may code processor processor can read protection each access. has 5.3 queues executable while each has Rev privilege. page write codes bit low page read level have protection encoded level have be accounting at -- scheduling may protected, the level's any also 3. each of protection limits: Space, routines per-process but Associated choice system library Similarly space, in 17-Jun-81 pPage as protection follows: are Memory Management 17-Jun-81 -- Rev 5.3 MNEMONIC CODE DECIMAL BINARY PRIVILEGE LEVEL S E ACCESS CONTROL K a NooQ NA - 2 3 0010 goll KW KR RW R EW RW 1 4 5 6 7 8 9 10 11 12 13 14 15 Page 5-12 ceal 2100 0101 g11¢ 0111 1000 1901 1210 1311 1100 1191 11190 1111 Uw ERKW ER SW SREW SRKW SR URSW UREW URKW UR U - - - - - - RW - - UNPREDICTABLE RW RW RW RW RW R - - RN RW RW R RW RW R R RW R R R - R R RW RW R R RW RW RW R COMMENT no ACCESS RESERVED ALL ACCESS - - - R R R R RW R R R Key K - Kernel - - no access R - read only RW - read write E - Executive S - Supervisor U Figure - User 5-5 Protection Mnemonics (Software symbols are defined by using PTESK as a prefix to the mnemonics.) above are access checking for This encoding was chosen to simplifyer.hardw access is allowed if: The decod table implementations not using a {{CODE EQLU 4} OR {CM LSSU wM} OR {READ AND {CM LEQU rRM} 1} {CODE NEQU @} AND CM is current processor mode RM is left 2 bits of code WM is one's complement of right 2 bits of code Memory Management ACCESS CONTROL 5.5.3 Length Every valid addressing (POLR, check wvirtual or address (P#, or Rev lies within System) and Virtual The formal case Pl, SLR). violation. whose -- 5.3 Page 5-13 Violation region P1LR, length 17-Jun-81 addresses addressing notation bounds the outside bounds determined associated these algorithm is: length bounds is a by the register cause simple a limit VAddr<31l:30> Set (2] if ZEXT( then VAddr<29:9> {length [1]: if ZEXT( if ZEXT( then (37: {length {length GEQU !P@ region !Pl region P@LR violation}; vaddr<29:9> then [(2]: ) ) LSSU P1LR violation}; VAddr<29:9> {length !5 ) GEQU violation}; region SLR !reserved violation}; region tes; 5.5.4 An Access access Control control determined by if the address 5.5.5 If an Access access bages control 5.5.6 A are is made accessed violation virtual address fault A Page across is if an illegal with a takes Address access page's is attempted, protection field, as or Boundary page boundary, UNPREDICTABLE. always Space address space., occurs Fault the current PSL mode and the causes a length violation. Across System Violation the However, precedence over for order a in given translation which page, not the access valid. Translation <31:30>=2 is an address in the system virtual ACCESS CONTROL Figure System Virtual 5-56 Page Format The system virtual address space is defined by (spT), Page 5-14 17-Jun-81 -- Rev 5.3 Memory Management which 1is vector a of System the Page Table Entries (PTEs). Table Page The SPT 1is The base address of the SPT always located in physical address space. in the System Base Register contained is also a physical address and is (SBR). The size of the SPT in longwords (that is, the number of PTEs) is contained in the System Length Register (SLR). The SBR points to the In turn, this PTE maps the first page first PTE in the SPT. Space, that is, virtual byte address 80000000 (hex) . GSystem of The PTEs in the System Page Table contain the mapping information themselves, or point to the mapping information in the Global Page Table (See the section on PTEs for I/0 devices if the PTE is in GPTX format. for 3 the GPTX format.) a description of 32 2 1 0 1 99 e e +-——t IMBZ| Physical Longword Address IMBZ | e Figure 2 1 So e U MBZ I ) ) 2 2 1 5-7 System Base Register (SBR) #12, dst.wl MFPR to read: src.rl, #12 to write: MTPR ( ( 3 +-——t | Y ———————— e + | Length of SPT in longwords oe+ Figure ( ( 5-8 System Length Register (SLR) #13, dst.wl MFPR to read: src.rl, #13 to write: MTPR Bits <31:9> of the virtual address contain the ) ) Virtual Page Number. Thus, there system virtual addresses have VAddr<31:39>=2. However, (Typically the could be as many as 2**21 pages in the system region. value is in the range of a few hundred to a few thousand system pages; see the section at the end of this chapter on Sharing.) The length field in the System Length Register requires 22 bits to express the values 0 through 2**21 inclusive. of both registers are At processor initialization time, the contents illustrates the Figure ©5-9 UNPREDICTABLE. Memory Management ACCESS CONTROL translation of 17-Jun-81 a system virtual 3 address -- Rev to a 5.3 physical 9 e (System I Virtual 2 T 8 0] -+ | | | Extract 3 212 1 312 Check byte 0 | + and | | Length | 2110 | t——————— o | address. Fomm e e tom Address) | | +--+ | Fmm——_—— o l 2] | +-——+ l l Add I | | Fm e _ +——+ SBR: | Phys Base Adr of Fo SPT | | 3] | +-—-+ | l Yields | Frm . | Phys Adr of 33 2 2 1 1 0 e PTE: —_— | 7] | +--+ | | Fetch | | Y | Re access PFN of Data: | | 312 1 819 pa = | 918 V Fomm | Figure SYS | | Virtual The algorithm to generate virtual address is: | | R e TS System I | | 3 @ | o+ Fem Adr | | | Physical | o+ |1 | check | +--+ PTE Fom 0 5-15 32 199 SVA: Page a to | | Fom e + 5-9 Physical physical 0 o+ Translation address (SBR+4*SVA<29:9>)<2®:G>'SVA<8: ®> from a system !System Region region 17-Jun-81 -- Rev 5.3 Memory Management SYSTEM VIRTUAL TO PHYSICAL TRANSLATION Page 5-16 Note all For chapter, this within occurrences indicate parentheses the brackets angle the of," "contents the and bits, ed referenc indicate apostrophe indicates concatenation. 5.5.7 Process Space Address Translation sized, The process virtual address space 1is divided into two equal s addres the 0, is 30 bit s addres separately mapped regions. I1f virtual 1, the address is in is in region P@. region If virtual address bit 30 is a Pl. The P@ region maps a virtually smallest address (0) in the direction of larger addresses. contiguous area that begins at the process virtual space and grows in the PP is typically used for program images and can grow dynamically. begins at the The Pl region maps a virtually contiguous area that and grows in space l virtua s proces the in 1) largest address (2**31 the direction of smaller addresses. Pl is typically used for system-maintained, per—-process context. It may grow dynamically for the user stack. of Page Table Each region is described by a virtually contiguous vectoraddres sed with a is which Table, Page System Unlike the Entries. wvirtual with ed address physical address, these two page tables are for Thus, space. address virtual the addresses in the system region of System in s addres l virtua a is PTE the of s per-Process Space, the addres Space and the fetch of the PTE is simply a longword fetch using a system virtual address. storage into page-sized l There is a significant reason to address process page tables inpagewvirtua table process ed rather than physical space. A physically address mapped more than that required more than a page of PTEs (that is, that lly contiguous physica require would space) virtual 64K bytes of process process page of pages. Such a requirement would make dynamic allocation to fragment tends system table space very awkward since a running areas. buffer A process space address translation that <causes a translation If the PTE. process the for ce referen memory miss will cause one missing also is PTE process the ing contain page the of virtual address from the translation buffer, a second memory reference is required. Memory Management ADDRESS When a process Page Table Space. This reference containing a System page protection code Similarly, (SLR). in a access or 5.5.8 P@# PO length of illustrates in the virtual the P@ for a is a the entry a System a (see Page reference kernel either from faults 5.3 read. "No the Access" page section on is, non-zero). Length table to system (that code table process the made Thus (protection page is 5-17 Register can result Faults and P@ address PTE space the P@BR PO 1s contains base Base Register. that mapped Base a is, the the of The the P@OLR number Pg and address P@# Page Page Table the in the Table (P@PT) PO Length the Table. contains of Page (POBR) wvirtual address the by Register system Figure size 5-1¢ of Entries. the Figure Py Length Register. The Page Table Entry addressed Register maps the first page of the P% region of the space, that is, virtual byte address 0. Base PTEs in themselves, or the as accessible against the 1longwords, The if table be address by The 1is illustrates by the (PQLR). which PPPT page made Rev fetched, made will of an violation defined Register 5-11 is fetch is is -- Region 1is region or the region which Entry process zero) check Thus, Parameters). The 17-Jun-81 TRANSLATION is the Pg point in GPTX description Page to of the Table format. the contain the information in the section on mapping (See GPTX mapping format.) the Global PTEs for information Page I1/0 Table devices 332 1 2 9 210 Be | 2 | System Virtual et Longword Address +———4 IMBZ | +———4 Figure PO ( ( to to 3 2 2 2 1 2 7 6 4 321 e I R MBZ | IGN Fom - e 2 Base read: write: 5-19 Register MFPR dst.wl src.rl, #8 MTPR 0] Fo e e _+ |MBZ| Length P e of ( ( Length to read: to MFPR write: MTPR Virtual Page Number is conta ined address, A 22-bit length field 2**21 in longwords | inclusive. There 5-11 Register The region. POPT e e ___ + Figure P@ ) ) 2 PO through (P@BR) #8, could (POLR) #9, dst.wl src.rl, #9 in is be bits required as many ) ) <29:9> to of express as 2*#*2] the the pages virtual values in 8 the Memory Management ADDRESS TRANSLATION 17-Jun-81 -- Rev 5.3 page 5-18 At processor 0 on MFPR. : are ignored on MTPR and read backregi 24> POILR<26 EDICTABLE. UNPR sters are of both contents initialization time, the 1 or greater than a value less than 2**3 with An attempt to load POBR and fault in some oper rved in a rese 2%%3] + 2%*30 - 4 results virtual address to PO the tes stra implementations. Figure 5-12 illu physical address translation. Memory P@ Management VIRTUAL TO 17-Jun-81 TRANSLATION PHYSICAL 3 32 1 09 -- Rev 5.3 9 Fom PVA: (Process | Virtual o 8 | 3 | 212 1 Extract 312 Check o ——— Fo | @ + | byte | o+ | and | l Length | 2]10 | +-—+ | Fm————— e | l o] | +-—+ l | | Add I | P POBR: | t-—+ Sys Virt Base P Adr of P@PT | | 7] | +--+ | | Yields I Fm | Sys Virt P Fetch by Adr System translation including Kernel 3 3 2 2 10 1 0 of 2| | +-—+ | l | algorithm, | and access | checks | | | ) 1] l PFN t—t—————— o check Physical access | this | in | 3 312 1 219 access current check mode | of Data: | g | Figure PO algorithm address to Virtual generate is: a to physical address = POBR+4*PVA<29:9> PA = (SBR+4*PVA_PTE<29:9>)<2@ (PTE I | | | l vV 0 e + | | .+ from PTE = | Translation PTE PA | | 5-12 Physical PVA PROC | + | Fmm e Adr | | 918 BS The | | Space length mode +--+ PTE -t ——— R e T+ PTE: 5-19 Y e Fommt e Address) Page PA)<20:0>'PVA<CS: §> a Pg region !P@ :®>'PVA_PTE<8:@> wvirtual Region ADDRFSS 5.5.9 Page 5-20 17-Jun-81 -- Rev 5.3 Memory Management TRANSLATION Pl Region Pl Page Table (P1PT) The Pl region of the address space is mapped by the and the Pl Length (P1BR) er Regist Base which 1is defined by the Pl addresses, and r smalle s toward Jgrows space Pl e Register (PlLR). Becaus retation of the base and length because a consistent hardware interp be the portion of Pl space descri registers is desirable, PIBR and P1LR rates the Pl Base Regilster. illust 5-13 that is NOT accessible. Figure Note that PILR contains er. Regist Length Pl the Figure 5-14 illustrates virtual address of what a ns the number of nonexistent PTEs. PI1BR contaithat is, virtual byte address Pl, of would be the PTE for the first page 40000000 (hex) . The address in PLBR is not necessarily an address. in System all the addresses of PTEs must be in System Space Space, but the mapping information, or point The PTEs in the Pl Page Table contain Global Page Table if the PTE is in the 1in to the mapping information PTEs for 1/0 devices for a description GPTX format. of (See the section on the GPTX format.) 3 219 1 i +-—=+ S S PP IMBZ | Virtual Longword Address | iuti b +-—— S P Figure 5-13 Pl Base Register 1 9 fmpm |11 2 2 33 MBZ (P1BR) #19, dst.wl ) src.rl, #10 ) MFPR ( to read: ( to write: MTPR 2 1 Y I | 2%%¥2]1 - Length of PlPT in longwords —— = + m e m e ————— === + o ——— e fotmm e o Figure 5-14 Pl Length Register MFPR ( to read: ( to write: MTPR (PlLR) #11, dst.wl ) src.rl, #11 ) P1LR<31> is ignored on MTPR and reads back @ on MFPR. At processor both registers are UNPREDICTABLE. initialization time, the contents ofless than 2**31 - 2**23 (7F800000, An attempt to load P1BR with a value - 4 results in a reserved 2*%*23 hex) or greater than 2**31 + 2%%3p operand fault in some implementations. Memory Pl Management VIRTUAL TO 17-Jun-81 PHYSICAL -- TRANSLATION Rev 5.3 Page 5-21 332 1 9 Fm PVA: (Process | Virtual 9 9 1 ] | ittt | Extract 3 212 1 312 R Check g byte | R tom + and | Length | | | 2110 - | 4] T+ sB Address) 8 b —————— | | e +--+ | Fm—————— R L | 2| l T +--+ | | Add | | t-————————————— e ———__ — +-—+ P1BR: | Sys o ———————— Virt Adr of P1PT | e | 2| | __ +--+ | | Yields | | t-—————————— | ———— +-——+ Sys Virt Adr of PTE | 2] | — +-—+ | F————————— Fetch by System translation including Kernel 33 2 10 10 | Space access checks | 2 + | this | in | access current check mode Adr of Data: | @ | algorithm to PVA PTE PTE PA PROC PA Virtual generate 1is: a | | I | | vV 7 to | e physical p—— + 5-15 Physical Translation address from = P1BR+4*PVA<29:9> (SBR+4*PVA_PTE<29:9>)<2®:®>'PV a Ji address | | T Figure The | o ——_—— + Be Pl | + | 918 B Physical l | | 312 919 1 | PFN t—t————— to 3 I | | access | 2 |1] check | and e Fom PTE: | algorithm. length mode | (PTE_PA)<20:03>'PVA<S8: 0> Pl region !P1 A_PTE<8:@> virtual Region TRANSLATION 5.6 Page 5-22 17-Jun-81 -- Rev 5.3 Memory Management BUFFER TRANSLATION BUFFER when repeatedly referencing In order to save actual memory references on may include a mechanism to entati implem re hardwa a the same ©pages, Such and page states. ations remember successful virtual address transl a mechanism is termed a translation buffer. the translation buffer When the process context is loaded with LDPCTX, proces s virtual address the is, (that updated automatically is re changes any softwa the when r, Howeve . dated) invali translations are t pProcess part of a wvalid Page Table Entry for the system or a curren address within the corresponding region, it must also move a virtualInvali date Single (TBIS) register with Buffer n latio page to the Trans rates the TBIS register. the MTPR instruction. Figure 5-16 illust a System Page Table Entry which Additionally, when the software changes pade table, all process pages SO maps any part of the current process n buffer. They may be latio trans the mapped must be invalidated in addre such page into the TBIS each n withi ss an g movin invalidated by entire clearing the by They may also be invalidated register. Buffer n latio Trans the to A g movin by translation buffer. This is done 5-17 e Figur n. uctio instr MTPR the with ter regis Invalidate All (TBIA) illustrates the TBIA register. Therefore, the d PTEs. The translation buffer must not store invali translation buffer entries when software 1is not required to invalidate dy invalid. making changes for PTEs that are alrea map is changed When the location or size of the systemed. entire translation buffer must be clear (SBR, SLR) the is a @0, the contents of the Whenever Memory Management Enable (MME) There fore, before enabling memory translation buffer are UNPREDICTABLE. or any other time, the time, management at processor initialization entire translation buffer must be cleared. Figure 5-16 Translation Buffer Invalidate Single (TBIS) ( to write: MTPR src.rl, #58 ) Memory Management TRANSLATION 17-Jun-81 Figure Translation ( An internal presence a the a the valid TBCHK reserved for prior write: condition is Digital based use. V that on Its notice. 5-23 bit (TBIA) #57 available 1in the code for Page All src.rl, 1is to 5.3 5-17 translation translation Rev Invalidate MTPR written register without 5.7 is Buffer register wvalid address instruction, holds to processor of virtual -- BUFFER ) for interrogating the translation TBCHK register is if set virtual page. VAX/VMS usage. the with a MTPR translation buffer The 1is the When a The specification buffer. specification of TBCHK is register subject to change FAAND UL PARAM TS ETERS Two types (see of the faults chapter faults). A are associated with on Exceptions and Translation Not reference indicates the be that the illegal. System Violation Fault 1is of associated the same protection length also as word that takes if page the a To Such a PTE faults faults violation" in Fiqure the have field An Access of PTE access distinct mode vectors occur, is "No software is then the Control violation" indication write specified Access fault of or the specifies the protection description a read (PTE<31>=0). referenced "length a when could An address a in and for protection that having "length the precedence. table. illustrated taken invalid PTE two both virtual avoid is reference these If referencing field. page Block. Fault taken check, parameter Note Control Control the intended mapping Interrupts Fault 1is attempted through an Violation Fault is taken when Control would Valid memory Violation beyond is the end essentially Access" in recompute stored in Access in the its the fault 5-18. 3 1 o 210 e I +-+-+-+ 0 IMIPIL] oe __ +—+-+-+ I some Fm | P address in the faulting e | o virtual PC of e PSL faulting at page | + instruction | + time of fault | + Figure Fault 5-18 Parameter Block :(SP) FAULTS AND Page 5-24 17-Jun-81 -- Rev 5.3 Memory Management PARAMETERS first The fault. of types hoth The same parameters are stored for parameter pushed on the stack aiter the PSL and PC is some virtual address in the same page with the virtual address that caused the fault.e A Process Space reference can result in a System Space virtual referenc for the PTE. 1If the PTE reference faults, the virtual address that 1is in bit saved is the process virtual address. In addition, a 1 is stored per-process the 1 of the fault parameter word if the fault occurred in PTE reference. following the The second parameter pushed on the Kernel stack contains information: L <B> an Set to 1 to indicate that Length Violation. the result of a Control Violation was Access Translation Not Valid P <1> is bit This violation. than rather violation length fault the during 1indicate reference process page table associated with This address. protection M <2> that the intended 5.8 @ for a the that to the the virtual be set on either length or can faults. Write or Modify Intent - Set to or modify. protection Fault. PTE Reference - Set to 1 to occurred a always 1 to indicate the program's program's intended access was a write This bit access was a is read. @ 1if PRIVILEGED SERVICES AND ARGUMENT VALIDATION 5.8.1 Changing Access Modes Four instructions allow a program to change 1ts access mode to a more privileged mode and transfer control to a service dispatcher for the new mode. CHMK CHME CHMS CHMU change change change change mode mode mode to Kernel to Exec to Super mode to User These instructions, described in detail in the chapter on Exceptions and Interrupts, provide the normal mechanism for less privileged code to call more privileged code. When the mode transition takes place, the previous mode is saved in the Previous Mode field of the PSL, thus allowing the more privileged code to determine the privilege of 1its caller. Memory Management PRIVILEGED 5.8.2 Two Validating Instructions, addresses system, caller (see do a this passed service could the 17-Jun-81 SERVICES have appendix AND ARGUMENT Address PROBER as Arguments and directly on verification. (PROBE PROBEW, parameters. routine must always referenced Address -- Rev 5.3 Page VALIDATION allow To instructions) privileged avoid verify the Validation 5-25 that 1its addresses Rules). services protection The less passed PROBE to holes check in the privileged as parameters instructions Page 5-25 -- Rev 5.3 17-Jun-81 Memory Management PRIVILEGED SERVICES AND ARGUMENT VALIDATION PROBEx Purpose: verify Format: PROBE that opcode arguments ACCESSIBILITY base.ab len.rw, mode.rb, accessed be can Operation: probe mode <- MAXU (mode<1l:0>, PSL<KPRV_MOD>) condition codes <- {accessibility of base} and {accessibility of {base+ZEXT(len)-1}} probe mode using Condition Codes: N <- @; V <- @; C <~ C; 7 <- if then @ {both accessible} else 1; Exceptions: translation not valid Opcodes: PROBER PROBEW 0C @D Probe Read Accessibility Probe Write Accessibility Description: or write accessibility of the address and the zero extended base the by specified byte and last The PROBE instruction checks the read first length. software Note that accessed. the bytes in are between not checked. System must check all pages between the two end bytes if they will be The protection 1is checked against the larger (and therefore less privileged) of the modes specified in bits <1:0> of the mode operand and Note that probing with a mode the Previous Mode field of the PSL. is equivalent to probing the mode specified in Y of operand PSL<previous-mode>. Example: MOVL 4 (AP) ,R0O ;Copy the address of first arg so that PROBER #0,#4, (RO) ;Verify that the longword pointed to by can't be changed. ; it ; the first arg could be ; Pprevious access mode. read by the Memory Management PRIVILEGED 17-Jun-81 SERVICES AND ARGUMENT iNote ; BEQL violation that iCopy #@,R#, (R1) so the arg been length that iVerify ; 2nd i that the i gives known iBranch if either access buffer args be by written the by mode. list must already and that the be less than 512. gives an access to byte violation. an described access arg be of could probed must change. buffer must ;7 byte args the itself 5-27 probed address previous been list can't the 3rd that have ;i and they and iNote violation Page have if either violation. i BEQL 5.3 iBranch 8 (AP) ,R0O PROBEW Rev already ; MOVQ -- VALIDATION 2nd arg Flows: The following flows describe virtual addresses only accessibility the residency. the system 1. it However, address Look up found, is of Check space the use for 3. If and For 1. up the buffer, the PTE, page System in length form use physical address, and address the <- Page Table 4. If the access, by not for field Kernel), valid of then pointer Tl to PTE then of to a PTE, If the the to as No fetch determine the in length return virtual in of field the memory translation PTE if found, determine the of the PTE for length then return No Access and page indicates a buffer. determine for address do the return their fault the containing PTE. protection readable Entry on page address EXIT. the System virtual address violation. If length violation, per-process a the returns per-Process address protection of chapter field must of physical the effect cause wviolation Check T1 or PTE. the eceach address tables. this EXIT. 3. no may EXIT. virtual form has protection virtual accessibility 2. address, the the and on an in the translation protection field to for If PROBE probing address elsewhere flows. and of that per—-process violation use for fetch the EXIT. virtual per-Process Look process EXIT. PTE, reference page (s) a See accessibility 4. Note address associated the check and System the on length violation operation virtual appropriate, Access the probing accessibility 2. the checking. no access No Access and page of PTE's (not EXIT. the even A no conserves Page 5-28 17-Jun-81 -- Rev 5.3 Memory Management PRIVILEGED SERVICES AND ARGUMENT VALIDATION space storage for a page full of no access, not valid PTE's. 5. If the valid bit in Tl is @, then take a Translation Not This case allows for the demand Valid Fault and EXIT. N paging of per-process page tables. . Finally, calculate the physical address of the PTE from the PFN field of Tl per-process (see the section on System the use Space Address Translation), fetch the PTE, EXIT. and bility, accessi protection field to determine the 5.8.3 Notes On The PROBE instructions If the Valid bit of the examined Page Table Entry is set, it is Page Table UNPREDICTABLE whether the Modify bit of the examined <clear, the is bit Valid the If PROBEW. a by set Entry is Modify bit is not changed. Except for 1, above, the valid bit of the Page PTE<31>, mapping the probed address is ignored. Table Entry, A length violation gives a status of "not-accessible.” valid bit of On the probe of a process virtual address, if the tion Not Valid Transla a then 0 is Entry Table the system Page Fault occurs. page This allows for the demand paging of the process tables. On the probe of a process virtual address, if the protection , then field of the system Page Table Entry indicates No a Access No single Thus, given. a status of "not-accessible"TM is 128 to ent equival is map system the in Entry Access Page Table No Access Page Table Entries in the process map. CHAPTER 6 EXCEPTIONS AND INTERRUPTS 12-Dec-80 6.1 At certain the times require during the the operation execution of explicit forcing 7.1 the Some the events and process. The a events are system, relevant primarily to invoke software in normally notification are whole, primarily and are process for system-wide context 1is Further, of such relevant therefore notification (IS). a pieces events of within software the outside flow of control. The ©processor transfers control by change in the flow of control from that explici tly indicated currently executing process. of Other of particular a process, as Rev INTRODUCTION system in -- these events to other serviced events described as is is in the the currently context termed an processes, a "executing an on executing the or to the system context. interrupt, the current exception. system-wide termed of and interrupt The the stack" some interrupts are of such urgency that they require service, while others must be synchronized with independent events. To meet these needs, the ©processor has priority logic that grants interrupt service to the highest priority event at any point in time. The priority associated with an interrupt is termed its interrupt priority level (IPL). high-priority 12-Dec-8¢ -- Rev 7.1 Exceptions and Interrupts Page 6-2 INTRODUCTION Processor Interrupt Priority Levels 6.1.1 (IPL) 15 The processor has 31 interrupt priority levels (IPL), divided into (19 levels hardware 16 and OF), to 01 software levels (numbered, in hex, to 1F, hex). User applications, system calls, and system services all run at process level, which may be thought of as IPL @. Higher numbereatd interrupt levels have higher priority, that is to say, any redquests an interrupt 1level higher than the processor's current IPL will interrupt immediately but requests at a lower or equal level are deferred. Interrupt levels 01 through OF (hex) exist entirely for use by software. No device can request interrupts on those levels, but software can force (See Chapter 9 and section on an interrupt by executing MTPR src,#SIRR. chapter). Once a software this in later ts interrup d software generate interrupt request is made, it will be cleared by the hardware when the interrupt is taken. Interrupt levels 10 to 17 (hex) are for use by devices and controllers, including UNIBUS devices; UNIBUS levels BR4 to BR7 correspond to VAX-11 interrupt levels 14 to 17 (hex). Interrupt levels 18 to 1F (hex) are for use by urgent conditions, including the interval clock, serious errors, and power fail. 56.1.2 Interrupts The processor arbitrates interrupt requests according to priority. Only when the priority of an interrupt request is higher than the current IPL (Bits 200:16 of the Processor Status Longword) will the processor raise The interrupt service the IPL and service the interrupt request. and will not request t interrup the of IPL the at routine is entered that this is Note r. processo the by set IPL the change usually s the IPL specifie different from the PDP-11 where the interrupt vector for the ISR. Interrupt requests can come from devices, controllers, other processors, or the processor itself., Software executing in kernel mode can raise and lower the priority of the processor by executing MTPR src, #IPL where src contains the new priority desired; see Chapter 9. However,orea Furtherm processor cannot disable interrupts on other processors. the priority 1level of one processor does not affect the priority level Thus in multiprocessor systems interrupt of the other processors. levels cannot be used to synchronize access to shared priority resources. Even the wvarious urgent interrupts including those exceptions that run at IPL 1F (hex) do so on only one processor, inthusa special software action is required to stop other processors multiprocessor system. Exceptions and Interrupts 12-Dec-84 INTRODUCTION 6.1.3 Most exception serious system minimize however trap service routines conditions Exception A Rev eéxecute at 7.1 Page 6-3 Exceptions exception to -- failures, nested an are exception condition stack is address executed. caused of Any with a next single described highest in to the wuntil the occurs enable instruction; Chapter the the the 4. (1F, corrected. exceptions, of the on normally of BISPSW is hex) saved some to this end PC would disable see is avoid at that and from level problem to Therefore instruction response variation coded that can in IPL exception. software @ A occur. the the IPL software. usually can been instructions raise exceptions that conditions the interruption routines instruction the by which processor service is caused have the and the trap BICPSW ' A fault is an exception condition that occurs during an instructio n, and that leaves the registers and memory in a consistent state such that elimination of the fault condition and restarting the 1instruction will give correct as it was An abort results. Note that faults do not always leave everything to the faulted instruction, they only restore enough to allow restarting. Thus, the state of a process that faults may not be the same as that of a process that was interrupted at the same point. and prior is an exception potentially leaves the instruction cannot simulated, or undone. 6.1.4 Contrast Generally initiated, are pushed differences: 1. An both onto An the Interrupts in computing exception condition process is that IPL of processor raised an when the by that usually the interrupt is may be from usually initiated. the not while caused independent in the is (PC) important execution is serviced exception, is the that either counter seven exception independently an are such completed, When program interrupt system processor 1initiates an is the there Caused produced serviced process, The is while instruction, restarted, similar. and instruction. interrupt 3. very (PSL) However condition the are status stack. instruction activity current 2. And interrupts an indeterminate, Exceptions processor exception during memory correctly the current occurs and be and the that registers necessarily Between exceptions condition the of the by some of the context of condition, while currently changed when the is 1IPL an running the always Exceptions and Interrupts Page 6-4 12-Dec-80 -- Rev 7.1 INTRODUCTION 4. Exception service routines usually stack while per-CPU interrupt execute on a per—-process service routines normally execute on a stack. Enabled exceptions are always initiated immediately no matter held off until what the processor IPL is, while interrupts are the requesting of IPL the the processor IPL drops below interrupt. Most exceptions can not be disabled. while that However, if an exception exception 1is disabled, no event occurs even when enabled exception is initiated for that event 1is the only which ow This includes overfl subsequently. ion code condit a by ted indica exception whose occurrence 1is ed, or disabl is it while occurs lion condit upt (V). If an interr will ion condit the the processor is at the same or higher IPL, ng enabli proper the when upt eventually initiate an interr causing conditions are met if the condition is still present. The previous mode field in the PSL is always set to an Kernel on interrupt, but on an exception it indicates the mode of the exception. Exceptions and PROCESSOR STATUS 6.2 Interrupts 12-Dec-80 be an exception preserved Basically, and the the Return status or so this is in the information Instead, by Status to 7.1 serviced, the Refer to processor status privileged register The Processor of privileged Word (PSW). Refer automatically is occurs and Page be terms current status is Longword PSL in the the and saved information when memory.) Bits of <31:21> the current return from considers program the current attempts available to all to mode |CIT| s I PSL when e e | e | e IPL | Z | it T other or context the exception. in chapter refer switch. to and when by The time, PSL PSL, and this means. handling IvIigivli O T I | cleared for IPL and IS. are by REI faults if a Thus REI is routines. 11 I \ except this it only | | -ttt —t—F—t—F—+-+ Longword can (The (REI). 76543214¢ [ Tt P R is of explicitly Fmmm e PSW—=m e —— + bootstrap PSL IDIFITITIN|Z|VIC] MBZ Status word Status between copies instruction exception | Processor a 4. t-t—t—F—F-+—-+-+-+ \ the The PSL interrupt chapter distinguish the of the PSW. exception or refer 8 | is 7. to Processor of changed 5 | is mapping switching consisting with interrupt user the interrupt context to be as frequently; privilege including Any instruction 9. processor or (PC) with such longword restoring its |F|I|CUR|PRVI|M]| ID] a used can exception Counter restored instructions TP e IMIP|MBZ|P|S|MOD|MOD|B| [ less process the 11 e e is are in 6 e SVPCTX chapter a 332222222222 s each must normally. later (REI). process instruction; 1098766543210 e on when concatenated on PSL increase software context status continue interruptable for a description the stack when an is a executing an 2 MOVPSL it in even (PSL) PCB by and in status to chapter saved on saved stored LDPCTX changed processor materialized At 6-5 Program are instruction restored only processor may the These Process restored the saving resume or process (PSL). Interrupt descriptions Status is also or saved and performed. Other automatically Longword registers. not saved is interrupted «correctly general is the Exception is it interrupt done Processor from an that required stored R Rev PROCESSOR STATUS When R -- / / Page 5-6 12-Dec-84 -- Rev 7.1 Exceptions and Interrupts PROCESSOR STATUS Bits Description 3:0 Condition Codes: N, Z, V, C (See chapter 2) an of beginning When set at the Trace enable (T). end the at set instruction, causes TP to be set. When TP is of an instruction, a trace fault is taken before the execution of the next instruction. When TP is clear, no trace exception occurs. Most programs should treat T as UNPREDICTABLE because it is set by debuggers and trace programs for tracing and for 4 proceeding from a breakpoint. Integer Overflow overflow trap enable When (IV). forces set, an trap after execution of an instruction that integer a conversion produced an integer result that overflowed or had ow trap occurs. When IV 1is <clear, no integer overfl error. (However, the condition code V bit is still set.) Floating Underflow exception enable (FU). When set, forces a of the execution after exception underflow floating a (i.e., result owed underfl an d produce that instruction than less g, roundin and result exponent, after normalization When the smallest representable exponent for the data type). FU 1is clear, no exception occurs. On the original VAX-11/780 on all other VAX processors a fault occurs. a trap occurs; decimal Decimal Overflow trap enable (DV). When set, forces a produce d that overflow trap after execution of an instruction ) decimal packed or string, c an overflowed decimal (numeri result (i.e., no room to store a non-zero digit) or had a occurs. trap When DV is <clear, no conversion error. (However, the condition code V bit is still set.) 15:8 Reserved to DIGITAL, must be zero. 20:16 Interrupt priority, Priority the 1in Level range accept interrupts only on level. (IPL). The current levels greater than @ to 1F (hex). processor The processor will the current At bootstrap time, IPL is initialized to 1F (hex). 21 Reserved to DIGITAL, must be zero. 22:23 by Previous Access Mode (PRV_MOD). Loaded from current mode and upts, interr by d exceptions and CHMx instructions, cleare 25: 24 restored by REI. Current Access Mode (CUR_MOD). currently executing process, 1 2 KERNEL - EXECUTIVE - SUPERVISOR 3 - @ - USER The as follows: access mode of the Exceptions and PROCESSOR STATUS 25 Interrupt Interrupts the Stack interrupt current mode restore a a 12-Dec-84 reserved When Any mechanism IPL above and non-zero raises with IS=1 operand fault executing on bootstrap time, IS First Part addressed must be point PC the is its the When set, simply be However, if it make hardware routine PSL FPD, software encounters reserved a for fault Reserved 30 Trace to Pending beginning set DIGITAL, at the interrupt tracing (TP). of 1is Compatibility processor is mode in (CM). (see native the or TP), of mode. its taken instruction beginning, and the the specific, exception general results of the If a UNPREDICTABLE. instructions, with the or registers, simulation. with At the the unimplemented 1in to IPL, processor current also fault Set by If FPD the set, saved clearing When TP when the instruction. a PSL<FPD> Any must set set at processor also instruction, chapter mode. zero UNPREDICTABLE. are trace interrupted Mode compatibility attempts or zero. a an routine the UNPREDICTABLE. 31 of REI the on clears mode and FPD, are instruction. beginning of be Forces any service must set instruction set. 29:28 T FPD reserved 1instruction jis results of also 1implementation FPD simulating use by 5-7 executing IS clear, execution started at execution is free an When modifies the If is sets current other, If (except instruction's sets may some that specified set. at Page processor 0. taken. stack operation. saved routine is the (FPD). service restarted set cannot restarted in interrupt or Done by 7.1 (IS). is 27 Rev stack. and PSL -- if exception clear if T or any, the processor is in 10). When is clear, CM the T is or the is PDP-11 the Page 6-3 12-Dec-80 -- Rev 7.1 Exceptions and Interrupts INTERRUPTS 6.3 INTERRUPTS The between instructions. The processor services interrupt requests g durin s point ed defin well at sts processor also services interrupt reque g strin instructions such as the the execution of 1long, iterativeuctio g savin avold to ns, 1in order For these instr instructions. interrupts are initiated when y, memor in state n uctio instr additional the instruction state can be completely contained in the registers, and PC. The following events cause interrupts: 1. Device completion (IPL 1#-17 hex) 2. Device error 3. Device alert (IPL 10-17 hex) 4. Device memory error (IPL 10-17 hex) (IPL 18-17 hex) 5. Console terminal transmit and receive (IPL 14 hex) 5. Interval timer 7. Recovered memory or bus specific, interrupts (IPL 18 hex) IPL at 1B 18 to or 1D processor hex); on memory errors. The 8. Unrecovered memory or bus or processor 9. Power fail 10. 11. PSL, specific, IPL 18 to 1D hex) €errors (implementation €errors (implementation VAX-11/780 processor (IPL 1lE hex) Software interrupt invoked by MTPR ¥STRR (IPL 01 to OF hex) mode greater than AST delivery when REI restores a PSL with g2) equal to ASTLVL (see chapter 7) (IPL or locations ate set of interrupt vector routi Fach device controller has a separ nes do ce servi rupt inter Thus . in the system control block (5CB) determine which controller not need to poll controllers in orderfor to each controller 1is fixed by interrupted. The vector address hardware. is no memory mapping information and In order to reduce interrupt overhead, data, ns, uctio instr the s. Thus changed when an interrupt occur an interrupt service routine must contents of the interrupt vector for prese nt in every process at the same Or space ss be in the system addre address. Exceptions and Interrupts 12-Dec-8¢ INTERRUPTS 6.3.1 Urgent Interrupts -- Levels -- 18-1F Rev processor provides 8 priority levels for including serious errors (e.g., machin on these levels are initiated certain For conditions. example, Some Machine is priority level Interrupt (hex) is on level Check the 1E reserved use by check) e of is those until by these usually interrupt (hex) for of an Page the urgent and processor conditions exception are but reserved for power that fail. must conditions power fail. upon not it stack. exceptions 6-9 (Hex) The Interrupts 7.1 detection interrupts. runs at Interrupt lock out all a high level 1F processing handled. This includes the hardware and software "disasters" (machine check and kernel stack not valid). It might also be used to allow a kernel mode debugger to gain control on any exception. 6.3.2 The Any Device processor given interrupts. correspond Interrupts -- provides priority 8 implementation The to the minimal UNIBUS Levels may 10-17 levels or (Hex) for may implementation levels BR4 to BR7 not is if use by peripheral implement levels the all 14-17 system has 8 devices. levels (hex) a of that UNIBUS. Page 6-10 12-Dec-80 -- Rev 7.1 Exceptions and Interrupts INTERRUPTS (Hex) Goftware Generated Interrupts -- Levels 01-0F 6.3.3 6.3.3.1 Software Interrupt Summary Register - The processor provides 15e Pending softwar priority interrupt levels for use by software. Register Summary t Interrup Software the interrupts are recorded 1in to onding corresp ns positio bit the in 1's s contain SISR The (SISR) . of levels, such All . levels on which software interrupts are pending course, be lower than the current processor IPL, or the processor must would have taken the requested interrupt. 11 3 1 9 6 5 1 +-+ m e m—— it e | | | Pending Software Interrupts |M] |B] l IFEDCBA9 87654372 112 MB?Z | e bodmt ettt -ttt -ttt -ttt o Software Interrupt Summary Register The SISR is privileged read/write a privileged software (see Chapter 9). register accessible MFPR #SISR,dst Reads the software interrupt summary register. MTPR src,#SISR Loads it, but this is not the normal way of It is making software interrupt requests. useful for clearing the software interrupt system, and for reloading its state after a power request to The mechanism for accessing it 1is: SISR is cleared. 6.3.3.2 only At bootstrap time, the contents of fail, for example. Software Interrupt Request Register - The register (SIRR) used for making software is software interrupt a write-only four bit privileged register interrupt requests. Software Interrupt Request Register ed by Executing MTPR src,#SIRR requests an interrupt at the level specifi cleared be will it made, is request pt src<3:@>. Once a software interru If src<3:9> 1is greater by the hardware when the interrupt is taken. than the current IPL, the interrupt occurs before execution of the following instruction. If src<3:08> is less than or equal to the current less IPL, the interrupt will be deferred until the IPL is lowered .to This pending than src<3:0> and that there is no higher interrupt level src<3:0> is @, lowering of IPL is by either REI or by MTPR x,#IPL. 1If Exceptions and Interrupts INTERRUPTS no interrupt Note that no selected there will indication a requests 3. A requester request The the requester uses MTPR appropriate level. The service the queue If REMQUE to 6.3.4 to priority the loaded from will read the bits <31:5> are bootstrap Interrupt IPL ©processor ignored, would the IPL however it this in could REI ensures is the to to 6-11 (an item reading IPL the that no generated and correspondence a describing interrupt control routine was an REMQUE and block returns exits removed with from at from failure RET. the returns 1load (PSL), with from bits <31:5> to (1F, 31 the If queue) , to step 3 stack a On instruction writing returned IPL zero. hex). do, nesting intermediate code. are processor PSL<28:15> is, MFPR PSL. discipline they the that the the Register Actually, unreliable will Level follow level. . request service IPL field Priority faulting probably from priority cause a Register Reading must the that block routine. If the at assume not control remove service initialized initial result if is routines level a requests, request such service requests. on their intermediate the a must interrupts the MTPR instruction Program Status Longword IPL<4:0>. IPL already of place performs Level service below Page routine with the time, 7.1 denerating REMQUE success routine is src,#SIRR uses queue), Interrupt At to for the Priority in INSQUE service other for queue of returns IPL field a routine for Interrupt Writing is look uses onto service there protocol the the Rev service correspondence wvalid in if the The (nothing 4, given one-to-one is: 2. is Therefore, made. l. -- occur. level. 1is 12-Dec-80 to of an be service levels not lowering interrupt improper. routine could could at an This lower interrupt, Exceptions and Interrupts Page 6-12 12-Dec-8% -- Rev 7.1 INTERRUPTS 6.3.5 Interrupt Example As an example, assume the processor in running is response to an to 8, and then posts software interrupt at IPLS5, it then e interrupt arrives at requests at IPL3, IPL7, and IPL9. Then a devic The sequence of Finally IPL is set back to IPL5S. IPL11 (hex). execution sets IPL 1is: state after event contents of IPL event PSL on (initiel) MTPR #8,#IPL MTPR #3, #SIRR 5 8 8 Y ) 8 4 0 ? MTPR #7, #SIRR MTPR #9,#SIRR interrupts to device interrupts to 8 9 11 88 88 88 0 8,0 9,8,0 device service routine REIL IPL9 service routine REI 9 8 88 88 8,0 ) granted immediately 7 8 5,0 IPL7 service routine REI 5 8 Y =2 stack 2 (hex) IPL in w (hex) STSR MTPR #5,#TIPL changes IPL to 5 and the request for 7 is initial IPL5 service routine REI back to IPLO and the request for 3 is granted immediately IPL3 service routine REI J Exceptions and Interrupts 12-Dec-8¢ EXCEPTIONS 6.4 -- Rev 7.1 Page EXCEPTIONS Exceptions can be grouped into six classes: l. Arithmetic 2. Memory 3. Exceptions detected during 4. Exceptions occuring as 5. Tracing 6. Serious traps/faults management system exceptions failures a operand reference consequence of an instruction 6-13 Page 5-14 12-Dec-80 -- Rev 7.1 Exceptions and Interrupts EXCEPTIONS 5.4.1 Arithmetic Traps/Faults occur as This section contains the descriptions of the exceptions that on. They operati ion convers or tic arithme an the result of performing SCB, the in vector same the d assigne are all and ve exclusi are mutually es that an and hence the same signal "reason" code. FEach of them indicat that the and ction 1instru 1last the exception had occurred during An . (fault) up backed or (trap) ed complet been instruction has d: longwor a as appropriate distinguishing code is pushed on the stack o= + —— be | :(SP) | type code | PC of next instruction to execute¥* | | PSL | + SS S S B R IS e+ R S S SL SR it + 8 S SRS S SR *same as the instruction causing exception in case of fault type code exception type software mnemonic TRAPS T OVF T SRM$K_IN (hex) 1 2 3 4 5 5 7 8 9 A 6.4.1.1 integer overflow integer divide by =zero SRMSK INT DIV T OVF T FLTSK SRM floating overflow floating/decimal divide by zero SRMSK FLT DIV T T UND T SRM$K_FL floating underflow T OVF DEC SRMSK w decimal overflo SRMSK_SUB_RNG_T subscript range FAULTS floating overflow floating divide by zero floating underflow Integer Overflow Trap - An integer SRMSK_FLT OVF_F DIV_F FLT$K SRM SRMSK_FLT UND_F overflow trap is an executed had an exception that 1indicates that the last 1instructioninteger overflow that and code ion condit V the g settin ow integer overfl of the part der low-or the is stored was _enabled (IV set). The result The result. stored the to ng accordi set are Z correct result. N and the that Note T). OVF INT (SRMSK_ 1 is stack the on pushed type code not do BISPSW and MOVTUC, REMQTI, instructions RET, RET, REMQUE, REMQHI, g floatin EMODX the that note Also V. set they if cause overflow even point instructions can cause integer overflow. Exceptions and Interrupts EXCEPTIONS 6.4.1.2 an Integer exception Divide that Floating exception an that exponent type in after the sign reserved are 3 set rounding. Z in and and will By =zero instruction. The type Zero the condition codes are divide can divisor type code pushed (SRMS$K_F DIV LT T). Floating exXception that exponent type after enabled (FU V, C and on completion underflow. an that always for type Decimal exception decimal string decimal set., the by zero R5, +0 of result value of to the - the is too for of and and of Z which stack is - A the the 5 the that divisor. The UNPREDICTABLE. divide zero is trap is an resulted for the final in data underflow many the The by executed was the the N, trap operations result in K_F UND LT T). string string The V overflow executed condition codes. trap had provided descriptions condition last indicates zero instruction set). the is be destination (DV is and POLYx, instruction bits trap, 1In (SRM a floating set. decimal last A POLYxXx on a in stack that for may one 1is overflow floating set a code the in data used Except is an stored exponent that is result wunderflow zero. are enabled individual and types codes Trap that result are instruction instruction, was codes is the if - that string representable condition large exception and This on String overflow. an contains condition pushed floating is had resulted for fault The trap stack trap indicates floating last cleared Overflow the an rounding on that decimal both A indicates overflow Refer for stored are V -g. the and and code Decimal for condition smallest pushed String that is a Trap the The above had N the fields. operand 6-15 dividend on stored divisor. floating stack result zero trap or that codes code in and the the The the is as normalization set). after 6.4.1.6 on than condition The set Underflow occurs POLYx. described indicates less or exception floating either The Floating executed through be - an a as instruction zero an 1is had operand, R@ Trap The the exponent result reserved zero executed executed fraction cleared. executed destination, a The and by overflow representable point are to pushed instruction C trap string cause divide equal floating largest Page instruction code last exponent Divide 6.4.1.5 A the zeros reserved 4 the and and floating last is type normalization by decimal Trap 7.1 integer stored The that An Rev last the the the result - -- the than instruction A Trap that set. Overflow greater and 6.4.1.4 4 The (SRM$K_FL OVF T). T divide Zero indicates operand, subsequent By indicates integer zero divisor. condition code V is 2 (SRM$K_IN DIV T). T 6.4.1.3 12-Dec-8¢ The in a and code is Chapter type code Page 6-16 12-Dec-88 -- Rev 7.1 Exceptions and Interrupts EXCEPTIONS pushed on the stack is 6 6.4.1.7 VF _T). (SRMSK_DEC_O Subscript Range Trap - A subscript range trap is an exception tion with a that indicates that the last instruction was an INDEX instruc of the wvalue The check. subscript operand that failed the range high the than greater or operand low the than subscript operand is lower are codes ion condit the and t, indexou in stored is result operand. The the on pushed code type The range. set as if the subscript were within stack is 7 6.4.1.8 RNG_T). MSK SUB (SR Floating Overflow Fault - A floating overflow fault is an ction executed resulted in exception that indicates that the last instru e exponent for the data entabl repres t an exponent greater than the larges ation was unaffected destin The ng. roundi and n type after normalizatio saved PC points to and the saved condition codes are UNPREDICTABLE. The POLY instruction, a of case the In the instruction causing the fault. 4 for details). r Chapte (see set FPD with the instruction is suspended LT OVF _F). The type code pushed on the stack is 8 (SRMSK_F 6.4.1.9 Divide By Zero Floating Fault - A floating divide by zero faulta ction executed had is an exception that indicates that the lastd instru unaffected and the was operan nt quotie The r. floating zero diviso points to the saved The saved condition codes are UNPREDICTABLE. pushed on PC the stack is code type The instruction causing the fault. 9 DIVLT _F). (SRMSK_F 6.4.1.1¢0 exception Floating Underflow Fault - A floating underflow fault 1is an ed resulted in that indicates that the last instruction execut t for the data an exponent less than the smallest representable exponen g underflow was type after normalization and rounding and that floatin The saved enabled (FU set). The destination operand 1is unaffePCcted. to the points saved The CTABLE. UNPREDI codes are condition the tion, instruc POLY a of case the 1In fault. the causing tion instruc The s). detail for 4 r instruction 1is suspended with FPD set (see Chapte type code pushed on the stack is 10 (SRM K FLT UND _F). Exceptions and Interrupts 12-Dec-809 EXCEPTIONS 6.4.2 Memory 6.4.2.1 fault not Access 1is Chapter after on at the the the as stack as for valid parameters. Violation, which an - the mode at which the Access for parameters. Not indicating Management, page Fault that address Translation which Violation indicating Management, stack bit Valid 7.1 Page in the a Note that Control the - page 6-17 if process a may A of reference operating. the restart the translation not reference of was not the set. valid See information attempts specifies Fault a both occurs. Not to See information attempted process Violation was wviolation a process information. table entry control attempted description process description table access process Software Fault the An a translation that for page Rev Exceptions access Memory exception for the changing Memory Control exception 5, 6.4.2.2 an an allowed pushed Management -- fault to a is page Chapter pushed on reference Valid and 5, the a Access Page 6-18 12-Dec-8( -- Rev 7.1 Exceptions and Interrupts EXCEPTIONS 6.4.3 Exceptions Detected During Operand Reference mode 6.4.3.1 Reserved Addressing Mode Fault - A reserved addressing fault 1is an exception indicating that an operand specifier attempted to use an addressing mode that is not allowed in the situation in which it occurred. No parameters are pushed. The situations in which each specifier type is reserved are: SPECIFIER RESERVED SITUATION Short Literal Modify, destination, Register Address source or within index mode. Index Mode Within index mode, or with PC as index. source, within or address index mode. See Chapter 3 for combinations of addressing modes and registers that The VAX-11/780 processor also faults on cause UNPREDICTABLE results. pCc, @pPC, 6.4.3.2 and - (PC). Reserved Operand Exception - A reserved operand exception is an for exception indicating that an operand accessed has a format reserved always n exceptio This pushed. are rs future use by DIGITAL. No paramete backs up the PC to point to the opcode. The exception service routine may determine the type of operand by examining the opcode wusing the Note that only the changes made by instruction fetch and stored PC. Therefore, because of operand specifier evaluation may be restored. as labelled are ns exceptio These ble. restarta not are ions some instruct unless properly restored ABORTs rather than FAULTs. The PC is always the 1instruction attempted UNPREDICTARLE results. it modify to in a manner that results in The PSL other than FPD and is not changed bit set and TP except for the conditon codes, which are UNPREDICTABLE. The reserved operand exceptions are caused by: the sign the 1. A floating point number that has 2. A floating point number that has the sign bit set and the exponent =zero in the POLY table (FAULT; see chapter 4 for exponent zero except in the POLY table restartability) large (FAULT) 3. POLY degree too 4, Decimal 5. Invalid digit in CVTTP, CVTSP string too long (ABORT) (ABORT) (FAULT) Exceptions and Interrupts 12-Dec-8¢ EXCEPTIONS 6. Bit 7. 1Invalid 8. Reserved field too wide Rev of bits operator in 19. Incorrect Invalid source string in restored EDITPC (FAULT; see completion of length combination of bits in bits in (FAULT) 11. Invalid combination of 12. Invalid CALLx mask 13. Invalid register 14, Invalid combinations 15. Unaligned 16. Invalid entry number operand in register registers for NEQU in 6§-19 PSW/MASK REI Chapter EDITPC longword BISPSW/BICPSW (FAULT) 4 for (ABORT) during RET (FAULT) (FAULT) in MFPR PCB ADAWI or loaded MTPR by (FAULT) LDPCTX (ABORT) (FAULT) in MTPR instructions implemantations (FAULT): NEQU to some ¢ @ POBR LSSU 2**3] PABR GTRU 2**3]1+4+2%*3p-1 P1BR<1:@> NEQU P1BR 2**3]1-2%%23 LSSU at by contents some SISR<31:16>'SISR<KAI> PUBR<1:@> Page PSL restartability) 9. 7.1 (FAULT) combination pattern -- @ P1BR GTRU 2#**3]1+42**3g-2%*23_] POLR<31:27>'PPLR<23:22> NEQU ¢ 17. P1LR<30:22> NEQU @ ASTLVL<2:8> GTRU 4 Invalid (FAULT) operand addresses in INSQHI, INSQTI, REMQHI, or REMQTI Exceptions and Interrupts 12-Dec-84 -- Rev 7.1 Page 6-20 EXCEPTIONS 6.4.4 Exceptions Occurring As The Consequence Of An Instruction 6.4.4.1 Opcode Reserved To DIGITAL fault - An current mode. opcode reserved to DIGITAL fault occurs when the processor encounters an opcode that is not or that requires higher privileges than the specifically defined, No parameters are pushed. Opcode FFFF (hex) will always fault. 6.4.4.2 Opcode Reserved To Customers (and CSS) Fault - An opcode reserved to customers fault is an exception that occurs when an opcode reserved to the customers or DIGITAL's Computer Special Systems group is executed. The operation is identical to the opcode reserved to DIGITAL fault except that the event is caused by a different set of opcodes, and faults through a different vector. All opcodes reserved to customers If the instruction. (and CSS) start with FC (hex), which is the XFC special instruction needs to (generate a unique exception, one of the reserved to CSS/Customer vectors should be used. An example might be an unrecognized second byte of the instruction. Exceptions and Interrupts 12-Dec-80 EXCEPTIONS 5.4.4.3 is A an Compatibility exception longword as other vector, Error, are 2 reserved 1 BPT 2 I0T 3 EMT TRAP illegal odd in from in the PSL instruction - (i.e., Note 1if exception that PSL<KT> both processed by A by the the the BPT a point, both was BPT See a T at trace or contains handler. original is a a of regular Not code 1is an tracing When occur again BPT), typically BPT, sets breakpointed (see section re-insert (usually trace that parameters the the can the No program will normal Memory Mode. exception containing state VAX-11 Valid, executed. breakpointing time and the Compatibility resumes. program and the restoration 19, location exception its to fault (BPT) and tracing tracing set the fault, to occur Translation chapter debugger of trace the restore if mode breakpoint contents completes, instruction, resume. which FAULT instruction breakpoint, this stack, Violation, Abort. Fault original At mode exception compatibility mode. in ABORT compatibility Check saved is FAULT Control breakpoint a the instruction pushed. the on opcode Access Breakpoint compatibility processor address Machine proceed A 6-21 FAULT 5 the pushed - Page FAULT 6 when tracing). be is the 7.1 FAULT 4 and Exception when Rev FAULT exceptions restores BPT information e.g., 6.4.4.4 occurs T Mode occurs follows: All To of that -- clear), are in then on on the and progress the exception trace should Page 6-22 12-Dec-86 -- Rev 7.1 Exceptions and Interrupts EXCEPTIONS 65.4,5 Tracing when trace 1is A trace is an exception that occurs between instructions for performance s, program tracing for wused 1is Tracing enabled. and only one that so designed is It . purposes g debuggin or on, evaluati traced each of on trace exception occurs before the executi one instruction. The saved PC on a trace 1is the instruction that would normally be executed. address of the next If a trace fault and a bility memory management fault (or an odd address abort during a compati the which in order the , neously simulta mode instruction fetch) occur an for The trace exceptions are taken is UNPREDICTABLE. ns. exceptio other all over ce preceden takes ion instruct fault In order to ensure that exactly one trace occurs per instruction despite other traps and faults, the PSL contains two bits, trace enablence(T)of and an trace pending (TP). If only one bit were used then the occurre two or zero produce either would tion instruc an interrupt at the end of Instead of the PSLKT> bit being traces, depending on the design. defined to produce a trap after any other traps or aborts at the end of an instruction, the trap effect is implemented by copying PSL<KT> to a e the exception. second bit (PSL<KTP>) that is actually used to generat the start of at ing PSL<TP> generates a fault before any other process the next The rules instruction. of operation for trace are: trace a 1. At the beginning of an instruction, if TP is set then fault is taken after clearing TP. 2. TP is loaded with the value of T. 3. If the instruction faults or an interrupt is serviced, PSL<TP> is cleared before the PSL is pushed. The pushed PC is set to the start of the faulting or interrupted Instruction execution is resumed at Step l. instruction. 4. 1If the instruction aborts or takes an arithmetic trap, 5. If an interrupt is serviced after is not changed before the PSL PSLLTP> is pushed. instruction completion and arithmetic traps but before tracing is checked for at the start of the next instruction, then PSLKTP> is not changed before the PSL is pushed. TP The routine entered by a CHMx is not traced because CHMx clears T and the CHMX of g beginnin the at set was T 1if However, in the new PSL. saved PSL will have both T and TP set. Trace faults resume with the An instruction following the REI in the routine entered by the CHMx. REI the when set was T 1f either fault will REI instruction following an was executed or if TP in the saved PSL is set; in both cases TP is set tion after the REI. Note that a trace fault that occurs for an instrucThus, PSL. new the with taken be will following an REI that sets TP special care must be taken 1if exception or interrupt routines are traced. If the T bit is set by a BISPSW instruction, trace faults begin Exceptions and Interrupts 12-Dec-80 EXCEPTIONS with In the second instruction the Rev 7.1 Page the CALLx instructions save a clear T, although T unchanged. This 1is done so that a debugger or trace is proceeding from a that matches the The detection of fault. during The or reserved detection exceptions at does not get instruction of execution. interrupt automatically restored fault CALL. instruction exception is BPT the totally 1is saved end this on transparent spurious and case, initiated. with a faults interrupts 1In The trace occurs other TP interrupt or REI. This is the executing after cleared PSL exception makes from in the occur before initiation program. RET trace can (including interrupts the program the exceptions entire an to 5-23 BISPSW. addition, PSL TP) after -- and the T and and is benign Page 6-24 12-Dec-80 -- Rev 7.1 Exceptions and Interrupts EXCEPTIONS 6.4.5.1 Trace Instruction Summary - The following table shows all of the cases of T enabled at the beginning of the instruction, enabled at the end of the instruction, and TP set in the popped PSW or PSL for ordinary instructions (XXX), CHMx...REL, interrupt or exception...RET, CALLx, RETURN, CHMx, REI, enabled at beg XXX BISPSW, and BICPSW: Trace exception enabled at end TP bit at end (T) (T) (TP) N N N Y Y Y CHMx...REI N N N Y Y Y interrupt or exception...REI N Y N Y N Y N N N N N* N Y N* Y * Y N N N N N* N Y Y* Y N N Y N* Y* N* Y Y * Y Y Y BISPSW N Y N Y Y Y BICPSW N N N CALLX RET Y N Y CHMx RET (if PSLLKTP>=0 on stack) RET (if PSLLTP>=1 on stack) interrupt or exception Y N Y Y Y* N Y* N* Y N (pushed PSWKT> clear) (no fault before next instruction) Y N (pushed PSLKTP> clear) (pushed PSL<KTP> set) N Y Y Y N Y N Y N N N N (pushed PSL<TP> clear) (pushed PSL<TP> depends on above description) Exceptions and Interrupts 12-Dec-80 EXCEPTIONS * 6.4.5.2 trace = depends Using Trace handlers. on - PSW<T> Routines They l. When the trace program, 2. it will be RET, REI, The trace restored. or continuing maintained 3. 4. tracing is that a being 5. 1in If a routine by setting after 6. T in Tracing or any is to catch CHMx or it would the is T traces that after being a then call the if a such recursion a only if desired preserve allow multiple when turning to T simulate the traced bit when this bit is REI 1If <cleared. is will the only be give program one executed can by is the a trace at full regained will CHMx exception by resume must be placed recursive, breakpoint trace on routine at off alters its breakpointing is not on handlers, and that instruction service exception. code via TP be Tracing instruction with that T RET. or routine an REI. control entered CHMx traced PSL clearing should with the frame. routines breakpoint to the and occur. instruction following for TP traced, trace instruction have and will termed the in programs completes mode CALLx its Thus, If each a T, in to on tracing. both also by off PSW disabled traced, will If ended, was entered bit are 6-25 conventions back T against continue further instruction is REI the generated. point. should to facility never examine or alter the hardware flows ensure that restored exception. be to Page following its force defends routine turning the entry 7. is the performs always be no the restored speed to service exception trace should tracing. The ensures trace the handler This a using BICPSW. When Tracing stack This correctly 7.1 from observe handler should Rev popped should restrictions: -- the all handlers trace. They also or reads T. Exceptions and Interrupts Page 6-26 12-Dec-80 -- Rev 7.1 EXCEPTIONS 6.4.6 Serious System Failures abort is 6.4.6.1 Kernel Stack Not Valid Abort - Kernel stack not validvalid while not was stack Kernel the that es indicat that on excepti an the during stack Kernel the processor was pushing information onto the on indicati an is this Usually t. initiation of an exception or interrup d attempte The error. software e executiv other or of a stack overflow stack. t interrup the uses that abort an into med transfor 1is n exceptio to PSL No extra information is pushed on the interrupt stack in addition process the abort may e Softwar (hex). 1F to IPL is raised and PC. tion, without aborting the system. However, because of the lost informa valid not is Stack If the Kernel the process cannot be continued. REI), or CHMK ing (includ tion instruc an during the normal execution of n the normal memory management fault is initiated. If the exceptio the of r behavio the vector <1:0> for Kernel Stack Not Valid 1is 3, processor is UNDEFINED (see section on SCB vectors). 6.4.6.2 Interrupt Stack Not Valid Halt - An interrupt stack not wvalid halt is an exception that indicates that the interrupt stack was not valid or that a memory error occurred while the processor was pushing information onto the interrupt stack during the initiation of an dged exception or interrupt. No further interrupt requests are acknowle reason the and PSL, the PC, the on this processor. The processor leaves for the halt in registers so that it is available to a debugger, the normal bootstrap routine, or an optional watch dog bootstrap routine. A watch dog bootstrap can cause the processor to leave the halted state. 6.4.6.3 Machine Check Exception - A machine check exception indicates for that the processor detected an internal error in itself.1IPL As 1isusual raised IPL. exceptions, this exception is taken independent of to 1F (hex) only if vector<l:8> is 1.. Implementation specific information is pushed on the stack as longwords. The processor specifies the number of bytes pushed by placing the number if one, of bytes pushed as the last longword pushed. (@ 1if none, ds.4 Softwar e longwor count and PSL, PC, the s exclude count This cee) e abort to whether d, can decide, on the basis of the information presente the current process if the machine check came from the process. anyMachine other check includes uncorrected bus and memory errors anywhere, and Some processor errors cannot ensure the processor—-detected errors. For such errors, the state will be state of the machine at abhl. If the exception vector <1:0> for basis. effort” preserved on a "best machine check is 3, the behavior of the processor is UNDEFINED (see section on SCB vectors). Exceptions and SERIALIZATION 6.5 The Interrupts OF 12-Dec-8¢ NOTIFICATION OF -- Rev MULTIPLE 7.1 Page EVENTS 6-27 SERIALIZATION OF NOTIFICATION OF MULTI PLE EVENTS interaction multiple between interrupts arithmetic 1is traps, complex. In useful implementations, it is at a necessary detailed level. T=1 As and an TP=0, example, gets recognized, l. it the The an at the end sequence occurs: finishes, storing of this The overflow (with 3. 4., new PSL. The interrupt sequence is PC vector, from the the and is new all from trap the a new a higher priority interrupt is instruction of the interrupt service the part interrupt service interrupt The overflow The sets trace with and PSL appropriate initiating routine The which PC of routine service new will then trap service since occurs, TP=0g, via routine PSLKTP> fault the terminates runs, saved again Trace 9. The next instruction is executed. routine runs, to and interraction is started PSL<KTP> is is was set at the pushing the PC and vector, PSL and creating the routine, PC and loading a PSL a new PSL. noticed, routine that the is not routine executed and exits with and exits runs, PSL<TP> PC was and with are when saved original the higher REI. with REI, this time set. PSL RET. first executed. The be exits with results. PSL<LT> interrupt. pushing 8. service this REI. routine the and pushing service creating and consistent request its initiated, PC exceptions, ensure interrupt since initiated, overflow and an If priority 7. a to Instead, 6. sequence other instruction instruction loading appropriate as 5. trap TP=1), to understand an trap, beginning. 2. to if arithmetic following instruction set tracing, order but Exceptions and Interrupts 12-Dec-8¢ -- Rev 7.1 SERTIALIZATION OF NOTIFICATION OF MULTIPLE EVENTS Page 5-28 This is accomplished by the following operation hetween instructions: lhere at completion of instruction including ! 1S: at end of REI from an exception or interrupt routine {possibly take interrupts or console halt}; IPSL<TP> is not modified before PSL is saved if PSLKTP> EQLU 1 then begin PSLLTP> <- §; 1if trace pending, take trace fault. ITrace fault takes precedence lover other exceptions. {initiate trace fault}; end; {possibly take interrupts or console halt}; IPSL<TP> is not modified before PSL is saved 1if trace enable, set trace pending PSLLTP> <- PSLLT>; {go start instruction execution}; IReserved instruction faults are taken here IFPD is tested here, thus TP takes ! precedence over FPD if both are set. if {instruction faults} OR {an interrupt or console halt is taken before end of instruction} then begin {back up PC to start of opcode}l; {either set PSL<FPD> or back up all general register side effects}; PSLLTP> <- 83; {initiate exception or interrupt}l; if {arith trap needed and no other abort or trap} then {initiate arith trap}; end; lnote: all instructions end by flowing ! through 1%, thus the REI from a service ! routine will return to 1% Exceptions SYSTEM 6.6 and Interrupts CONTROL BLOCK 12-Dec-8¢ (SCB) -- Rev System Control exceptions and 6.6.1 The System SCBB System 3 is Block Control a is Block, pPage containing dispatched to are Block privileged Control a interrupts routines. Base register which containing must be vectors by which appropriate service the physical address of the 32 9 IMBZ | Physical page P address 8 bootstrap length time, is 5.6.2 the SCB Control contents implementation address. | MBZ | of Block SCBB Base is dependent UNPREDICTABLE. because it The represents a actual physical Vectors vector is a exception Separate each of ) Fmm e + TP .+ System . longword or of in interrupt vectors class hardware. are the defined exceptions. Bits 1:0 this on interrupt the 1. Service this exception, 2. Service to event control 3. is codes a Operation 9 and which each a code on the raised event in writable to 1, exist UNDEFINED. Reserved bits 31:2 begin on is contain a device a and follows the already stack. If this running interrupt event is not passing there. loaded, the DIGITAL. virtual boundary the On address and bits If the of will is an 15:2 writable operation operation HALT. the the by (hex) . store, when event. controller on processor, longword the unless 1F to as processor service microcode HALT. must service case control or VAX-11/780 operation the to stack interrupt the the by interpreted which the not is kernel in is does how interpreted: on On examined interrupting vector IPL store processor, routine, is determine installation-specific UNDEFINED, case that to stack, event the this the for Each contain Service SCB occurs, stack. For the the page-aligned, Ie an 6-29 (SCBB) 1989 A Page SYSTEM CONTROL BLOCK (SCB) The At 7.1 in is this VAX-11/78¢ the service ordinarily be Exceptions and Interrupts SYSTEM CONTROL BLOCK (SCB) in the system space. CHMx 12-Dec-8¢ -- Rev 7.1 Page 6-31 is serviced on the stack selected by the new Bits <1:¢> in the CHMx vectors must be zero or the operation is mode. in the On the VAX-11/780 processor, these bits are ignored UNDEFINED. CHMx vectors. Exceptions SYSTEM and Interrupts CONTROL BLOCK System Vector 12-Dec-80 -- Rev (SCB) Control Block (exception and Number Name Type (hex) 20 Unused 24 Machine 7.1 Page interrupt vectors) of Params Notes Reserved Check Abort/ * Fault/ to DIGITAL. Processor—-and errorinformation specific Trap is pushed stack, on if the possible. Restartability processor If is raised and the is used * is specific. vector<l:9> IPL —— is to Kernel Stack Not Valid Abort Y] (i.e. the IS number of parameters on the stack Serviced on interrupt (i.e. IS raised gc Power Fail Interrupt 0o IPL to 19 Reserved/Privileged Fault Instruction 0 Customer Reserved 18 Reserved Operand 1F Y Type IPL raised (hex). to instructions. instruction. depends on circumstances. See on reserved operand exceptions,. 1C Reserved 20 Access Addressing Control Mode Fault Y Violation Fault 2 Virtual causing pushed See is (hex). reserved Fault/ Abort l). and XFC is dependent. Opcodes ) bytes pushed and DIGITAL Fault Instruction of is 1).. the <- privileged 14 stack <- stack to is 1E 1, 1F (hex) interrupt implementation 38 5-31 address fault onto chapter is stack. 5. section Exceptions Interrupts and (SCB) SYSTEM CONTROL BLOCK 24 Translation Not 28 Trace 2C Breakpoint 30 Compatibility Valid 12-Dec-80 Fault (TP) Fault Instruction Fault Pending -— Fault/ Abort Rev Page 7.1 Virtual 5-32 address causing fault is pushed onto stack. See chapter 5. A type code is pushed onto the stack. See section on compatibility mode exceptions. 34 Arithmetic 38-3C Unused 49 CHMK Trap/ Fault Trap is pushed A type code onto the See 65.4. stack. Reserved to DIGITAL. sign extended and pushed onto the stack. Vector<l:90> 44 48 Trap CHME Trap CHMS MBZ. CHMU 50 SBI 54 Corrected Read SILO sign extended and stack. pushed onto the Vector<l:0> MBZ. The operand word is sign extended and pushed onto the stack. MBZ. Trap The operand word Compare Interrupt IPL is 19 (hex). VAX-11/780 only. Memory Interrupt IPL is 1A Also used Data is The operand word Vector<l:0> 4C is The operand word is sign extended and pushed onto the stack. Vector<l:0> MBZ. (hex). for Read Data Substitute on VAX-11/780. Number of parameters is implementation dependent. 58 SBI Alert Interrupt IPL is 1B (hex). VAX-11/780 only. 5C SBI Fault Interrupt IPL is 1C (hex). Exceptions SYSTEM and Interrupts CONTROL BLOCK 12-Dec-8¢0 -- Rev (SCB) 7.1 Page VAX-11/780 50 Memory Write Timeout Interrupt * IPL only. is 1D (hex). Number of parameters implementation 64-80 Unused 84 Software Level 1 Interrupt @ 88 Software Level 2 Interrupt @2 Reserved Software Level 3 Interrupt o Software Levels Co Interval Timer C4-DC Unused EG-EC Unused Fg Console 4-F Storage Rec. Interrupt @ Interrupt @ Interrupt @ Console Storage Trans. Interrupt is used 18 (hex). Reserved to DIGITAL to CSS/Customers is 17 (hex). IPL is 17 only. (hex). VAX-11/758 only. F8 Console Terminal Rec. Interrupt 0 IPL is 14 (hex). FC Console Terminal Trans. Interrupt 0 IPL is 14 (hex). 10@-3FC Device Interrupt 9 In Vectors for Reserved IPL 0 for Scheduling. VAX-11/758 F4 DIGITAL. used Ordinarily IPL the VAX-11/780 processor, only interrupt priorit y 1levels 17 (hex) are available to a NEXUS external to the CPU, there is a limit of 16 such NEXUS. A NEXUS is a connection the SBI, which is the internal interconnection structu re. to NEXUS vectors are assigned as 100-13C IPL 14 (hex) NEXUS @-15 IPL 15 (hex) NEXUS @-15 180-1BC IPL 16 (hex) NEXUS 1C@-1FC @-15 IPL 17 (hex) NEXUS @g-15 In the VAX-11/750 (hex) the to the range levels 14 processor, directly. to vector The to 17 (hex) 3FC UNIBUS vector supplied 2080 14 and on The follows: 149-17C processor is dependent. delivery. Process 9¢-BC to Ordinarily AST 8C 6-33 1is devices determined by the device. (hex) are allowed. correspond to UNIBUS Only interrupt adding 200 SCB vectors in Interrupt levels the by BR4 to priority BR7. Page 6-34 12-Dec-80 -- Rev 7.1 Exceptions and Interrupts STACKS STACKS 6.7 At any time, the processor is either in a process context one in (IS=0) (kernel, exec, super, user), or in the system-wide of four modes interrupt service context (IS=1) that operates with kernel privileges. There 1is a stack pointer associated with each of these five states, and any time the processor changes from one of these states to another, ©SP stored in the process context stack pointer for the old state is (R14) and loaded from that for the (KSP=kernel, pointers new ESP=exec, state. The context process stack S5P=super, USP=user) are allocated in the PCB (see Chapter 7), although some hardware implementations may keep them in privileged registers. privileged register. The interrupt stack pointer (ISP) is in a Operating system design must choose a priority 1level that 1is the boundary between kernel and interrupt stack use. The SCB interrupt vectors must be set such that interrupts to levels above this boundary run on the interrupt stack (vector<l:¢> = 1) and interrupts below this Typically, AST (vector<l:0> = a) . boundary run on the kernel stack are on the levels higher all and stack kernel the on is 2) (IPL delivery interrupt 5.7.1 stack. Stack Residency The USER, SUPER, and EXEC stacks do not need to be resident. The kernel can bring in or allocate process stack pages as Address Translation Not Valid faults occur. However, the kernel stack for the current process, and the interrupt stack (which is process-independent) must be resident and accessible. Translation Not Valid and Access Control Violation faults occurring on references to either of these stacks are regarded as serious system failures, from which recovery is not possible. If either of these faults occurs on a reference to the kernel stack, the processor aborts the current sequence and initiates Kernel Stack Not If either of these faults (hex). Valid abort on hardware level 1F occurs on a reference to the interrupt stack, the processor halts. that this does not mean that every possible reference 1is checked, rather that the processor will not loop on these conditions. one be resident, selected to run by the but than the Further, any It is not necessary that the kernel stack for processes other current Note but it must be resident before a process is software's process dispatcher. mechanism that uses Translation Not Valid or Access Control Violation faults to gather process statistics, for instance, must exercise care not to invalidate kernel stack pages. Exceptions and Interrupts 12-Dec-809 STACKS 6.7.2 Stack Except on CALLx For align stack longword convert and instructions, best word on to convert words The is Bits stack bit interrupt Processor Status currently in IS The The as ISP KSP g 1 Y ESP 2 SSP Y 3 Usp does achieved and by which to 6-35 not allow by clearing causing both be PSL<IS> stack and makes no and attempt the allocate to long convert and current specify mode which to bits of in MOVZBL), (CVTLB), recommended off in the the should stack and byte are them align the (CVTBL long popping to software in the five for order to privileged stack pointers REGISTER Y stack Page instructions follows: 0 in current use MOVZWL), (PSL) 1 is PSL (IS) 7 exception, a the Longword MODE processor This 7.1 processors, byte (CVTLW) aligned. Status boundary and word on all convert (CVTWL and longword Stack The to bytes hardware on longword long pushing 6.7.3 a long keep the performance increments. it Rev Alignment stacks. the -- IS used for bits the mode an mode mode reserved and and current operand are of be non-zero when taking fault if REI non-zero. interrupt <1:0> to bits the or exception vector for is the when an IS=1. interrupt attempts selected event as or to load by the follows: vector<l8> : 20 21 PSL<IS> 18 (binary) purposes. 6.7.4 Accessing Reference one Refer of to five SP and to Stack (the executive, the of U I 11 (binary) on of SCB the vector<l:0> vectors for are used for other details, Registers stack possible the | section supervisor, values | tmmm e oo + - Values - wn e pointer) in architecturally kernel, current mode or the interrupt and IS general defined bits stack in registers stack the pointers; pointer, PSL. will the access user, depending Some on processors Exceptions and Interrupts Page 5-36 12-Dec-R8@ -- Rev 7.1 STACKS might implement these five stack pointers sors, as five internal processor software can access any of the five On these proces registers. by the current mode and IS bits in stack pointers not currently selectedctions . Results are correct even if the PSL via the MTPR and MFPR instru mode and IS bits in the PSL the stack pointer specified by the current space by an MTPR or MFPR is referenced 1in the processor register rs as implemented are pointe stack s proces the If instruction. the ing access for registers, then these instructions are the only method s stack pointers proces stack pointers of the current process. If the registers might not these of MFPR and MTPR PCB, the are kept only 1in followed when access the PCB. See Chapter 9 for conventions to be processor the in also are referencing per-process registers that register space. to be the same as The internal processor register numbers were chosenpointe r is the same as stack us previo The 9). r PSL<26:24> (see Chapte the previous mode PSL<23:22> unless PSL<KIS> is set. cannot be determined from the PSL<23:22>. TIf PSLLIS> is set, PSL since interrupts At bootstrap time, the contents of all stack UNPREDICTABLE. always pointers clear are Exceptions INITIATE 6.8 and Interrupts EXCEPTION OR 12-Dec-8¢ -- Rev INTERRUPT 7.1 Page 6-37 INITIATE EXCEPT OR INTER IO RUPT N Condition Codes N <- @; Z <- @; V <~ @; C K- 8; (if vector(l:fl) code is @ or 1): Exceptions: interrupt kernel stack stack not not valid valid Description: The handling System being is determined control block processed. stack, then If the The old PSL (unless this is an onto the the new changed vector<l:0> of a indexed by the is executing is 1. Any is previous mode in the Finally, the PC is vector<31:2>,. new is saved onto the between PSL an is longword and new on the or if it pushed. PSL is set changed to point to or a is old the in interrupt PC a pointer is trap) backed and canonical an the interrupt stack The Except the to to or the new stack. initialized are vector exception instructions interrupt parameters mode. the pushed The this not pointer interrupt stack. 1if code processor stack fetched. is contents 1is the is IPL the current up pushed by which exception for value is state. with interrupts, of the current indicated by longword Notes: 1. Interrupts 2. If the 3. On an are vector<l:0> abort, fault the or during code saved is they completion abort or registers _instruction fault In this the of information is SP a on initiated abort, and saved behavior to that UNDEFINED. UNPREDICTABLE. condition codes the extent sets are is are instruction FP both stopped with type gets an Valid the kernel and 1IPL SP means results different Not codes the and UNPREDICTABLE processor Translation of the On necessary to resumed. On when FPD, the UNPREDICTABLE FP are unspecified; are general unless set cannot engineering Access Control while stack, Kernel Stack to (hex). is a changed 1F On a wupon REI This implies be Viclation The on level. attempting Not the resumed change condition the the UNPREDICTABLE. predictable. FPD or and a are specifies a setting. If FP 1is case, then it is also UNPREDICTA BLE. Valid behavior processes processors If this Not case, instruction that 1in Stack only sequence. saved interrupt PC, description destination Kernel are or except invalid, the ensure correct this condition interrupt, UNPREDICTABLE; an 4. disabled or a to push Valid abort additional Page 6-38 12-Dec-80 -- Rev 7.1 Interrupts Exceptions and INITIATE EXCEPTION OR INTERRUPT exception is information, if any, associated with the originalinterr upt stack the on pushed are PC and PSL r Howeve lost. the kernel with the same values as would have been pushed on stack. If processor the dets an Access Control Violation A or to push Translation Not Valid condition while attempting and halted is sor proces the stack, upt interr the information on for t correc be only the state of ISP, PC, and PSL is insured to would that values the have PC and subsequent analysis. The PSL have been pushed on the interrupt stack. The value of PSL<TP> that is saved on the stack is as follows: clear clear fault trace clear interrupt abort trap CHMx BPT, XFC reserv.instr. 7. The value of PC (if FPD set) from PSL<TP> (if after traps, before trace) that from PSLLTP> from PSLLTP> from PSLLTP> clear clear saved on the stack points to the following: instruction faulting next instruction to execute fault trace i.e. instruction at the beginning of which the trace fault was taken. instruction interrupted or next instruction to execute instruction aborting or interrupt abort detecting Kernel Stack Not Valid (not ensured on machine check) next next trap CHMX BPT, BPT, XFC reserv.instr. instruction instruction XFC to to instruction execute execute reserv.instr. by The non-interrupt stack pointers may be fetched and stored ted alloca their in hardware 1in either privileged registers or always fetch and Only LDPCTX and SVPCTX MFPR and MTPR always fetch see Chapter 7. the in and store the pointers whether in registers or the PCB. slots in the PCB. PCB, Exceptions RELATED 6.9 and Interrupts 12-Dec-80 INSTRUCTIONS -- Rev 7.1 Page 6-39 RELATED INSTRUCTIONS REI Return from Exception or Interrupt Format: Opcode Operation: tmpl <~ (SP)+; ! Pick up tmp2 <- (SP)+; ! and PSL if if if PC {tmp2<CUR_MOD> LSSU PSL<KCUR_MOD>} OR {tmp2<IS> EQLU 1 AND PSL<IS> EQLU #} OR {tmp2<IS> EQLU 1 AND tmp2<CUR MOD> NEQU @} OR {tmp2<IS> EQLU 1 AND tmp2<IPL> EQLU @} OR {tmp2<IPL> GTRU # AND tmp2<CUR_MOD> NEQU @} OR {tmp2<PRV_MOD> LSSU tmp2<CUR_MOD>} OR {tmp2<IPL> GTRU PSL<IPL>} OR {tmp2<PSL_MBZ> NEQU 0} then {reserved operan d fault}; {tmp2<CM> EQLU 1} AND {{tmp2<FPD,1S5,DV,FU,IV> NEQU @} OR {tmp2<CUR_MOD> NEQU 3}} then {reserved operan d fault}; PSLKIS> 1f PSL<KTP> PC <- PSL if saved EQLU EQLU 1 then ISP else PSL<CUR 1 then tmp2<TP> @ then <- SP tmpl; <- !save MOD> SP <- 1; <- old stack pointer SP; !TP <~ TP or stack TP tmp2; PSL<KIS> EQLU begin SP <- if PSL<CUR_MOD> PSL<CUR_MOSP; D> then GEQU {request ASTLVL interrupt end; {check {clear at 2}; Codec- e <{- saved {- saved PSL<K2>; | D 2 NS A NSRS saved PSL<1>; <{- saved PSL<@>; PSL<K3>; Exceptions: reserved operand Opcodes: g2 RET Return from Exception or stack for for software interrupts}; instruction look-ahead} LN = —t ( Condition !switch !check Interrupt IPL AST delivery RELATED Page 5-40 12-Dec-89 -- Rev 7.1 Exceptions and Interrupts INSTRUCTIONS Description: A longword is popped from the current stack and held in a temporary A second longword is popped from the current PC. stack and held in a The current temporary PSL. Validity of the popped PSL is checked. stack pointer is saved and a new stack pointer is selected according to the new PSL CUR _MOD and IS fields (see section on Stack Status Bits). the highest privilege AST is checked against the current The level of mode to see whether a pending AST can be delivered; refer to chapter 7. Execution resumes with the instruction being executed at the time of the exception or interrupt. Any instruction lookahead in the processor 1is reinitialized. Notes: 1. The exception or interrupt service routine is restoring the 2. for stack. As usual for faults, any Access Violation or Translation Not Valid conditions on the stack pops restore the stack pointer and 3. responsible any registers saved and removing any parameters from fault. The non-interrupt stack pointers may be fetched and stored either 1in privileged registers or in their allocated slots in the PCB. Only LDPCTX and SVPCTX always fetch and store in the (see Chapter 7). MFPR and MTPR always fetch and store the PCB pointers whether in registers or the PCB. Exceptions RELATED and Interrupts 12-Dec-8@ INSTRUCTIONS CHM Change Purpose: -- Rev 7.1 Page 5-41 Mode request services of more privileged software (K=0, S=2, Format: opcode code.rw Operation: tmpl <- {mode tmp2 <- MINU (tmpl, tmp3 <- SEXT (code); if {PSL<IS> EQLU PSL<CUR_MOD> tmp4 selected SP <- tmp2 SP; PROBEW (from if tmp4-1 then HALT; !illegal SP; !save through tmp4-12 and exception with parameter=tmp3 using using 40+tmpl*4 tmp4 not as (hex) the new storing SP as again}; we we S oTM SCB SP e < <- old Exceptions: halt Opcodes: BC CHMK Change Mode to BD CHME Change BE Mode CHMS to Change Executive Mode BF to CHMU Supervisor Change Mode to User Kernel U=3)}; privilege from I stack stack pointer lget new stack pointer with mode=tmp2); new new mode=tmp?2 Codes: {- !maximize ! CHMx and {- E=1, stack control violation} then {initiate access violation fault}; {translation not valid} then {initiate translation not valid fault}; {initiate O<<N=Z <- opcode {access if Condition 1} by PSL<CUR_MOD>) ; offset !check access Exceptions and Interrupts RELATED 12-Dec-89 -- Rev 7.1 Page 65-42 INSTRUCTIONS Description: Change Mode instructions allow processes to change their access mode in The instruction only increases privilege (i.e., a controlled manner. the decreases access mode). the old A change in mode also results in a change of stack pointers; and code PC, PSL, The pointer is saved, the new pointer is loaded. mode. new the of stack the onto pushed are on passed by the instructi The saved PC addresses the instruction following the CHMX instruction. appearance After execution, the new stack's The code is sign extended. is: o | — + ee | : (SP) sign extended code S S+ SR I S P S PRS | PC of next instruction | | old PSL | + ——— o S LSS S + S PR The destination mode selected by the opcode is used to obtain a location the from Block. Control System dispatcher for the specified mode. the operation is This location addresses the CHMx TIf the vector<l:9> code NEQU @ then UNDEFINED. Notes: As usual for faults, any Access Violation 1. or Translation Not and leaves SP as it was at the Valid fault saves PC, PSL, beginning of the instruction except for any pushes onto the kernel stack. may be fetched and stored in their allocated slots in or registers d either in privilege fetch and store in the always SVPCTX and LDPCTX Only PCB. the PCB, see Chapter 7. MFPR and MTPR always fetch and store the The non-interrupt stack pointers 2. pointers whether in registers or the PCB. By software convention, negative codes are reserved to CSS 3. customers. Examples: CHMK #7 ;jrequest the kernel mode service CHME #4 ;request the executive mode service CHMS -2 ;request the supervisor mode service ; ; ; specified specified specified by by by code code 7 4 customer B g S (LY code -2 and Exceptions and PROCESSOR STATE 6.10 Interrupts TRANSITION 12-Dec-8¢0 -- Rev TABLE 7.1 6-43 PROCESSOR STATE TRANSITION TABLE FINAL STATE \ User INITIAL| Super 1IS=0 Exec Kernel 1IPL=@ I1S=0 Kernel STATE I15=0 IPL=0 I1S=0 IPL=0 I15=0 IPL=0 IPL># | Fo—————— e e fmm User | CHMU 1S=¢ | | REI I I | | IPL=0 | CHMS | CHME | 1S=0 | IPL=0g REI* | Exec I | IPL=0 CHMU,S | REI | | o I1S=0 | | ———— | REI* | | | | | 1S=0 | IPL=0 | | I | I I I I | | CHMK REI* | | | REI | | | | | CHMK | ——— | | I | | | I I I | I REI * to———_— e o —_—— | IPL>2 | REI* | | REI* | I I | REI* REI* | I o ——_—— S |MTPR | I I I | o ——_——— -R e | CHMUSEK | | REI * | SVPCTX I I | I | SVPCTX ——— + |HALT LDPCTX | REI | | REI* | Excep |CHMUSEK I | | Inter | IMTPR IPL| is Interrupt (@) is is vector<l:9> Exception = (1) is vector<l:g> =1 ¢ REI that increases mode can cause an interrupt request at IPL 2 for AST delive ry. State Transitions I I | + | Instr.| | | | ———— om———— + Inter Any I | 1Instr.| | Excep Processor I I |HALT |Excep(0) |Excep(l)]| o —— o ———— o o * I te—————— e ——_——— e ——_—— REI* | | |Inter(8)|Inter (1) | IMTPR IPL| I | LDPCTX | I | | sible IPL| SVPCTX |HALT I |I(@) nt |Excep er (l)] Instr.| | [ Inter (1) ] I REIL* R impos- |MTPR IPL| I I | | I e —— - + o ——— o -e + I | I I IS=1 |Inter(1)| |MTPR IPL| | LDPCTX | | I I |I(%) nt |Excep er (l)| |Excep () | | | sible | | | | R+ impos- | CHMUSEK REI* I REI * | |Inter(l)| | I1S=0 | | e |Excep (0) | IPL>3 REI * | sible |Inter (@) |Excep(l) | S St —— tmm——_— Fmm——— oR Kernel ———— + impos- o —— - o —_—— o ——— tmm I | R |Excep(0) | e ——— -e . e Kernel REI* | | o ——— Fmm | |CHMU,S,E| | Halt IPL>Q e ——— - tom————— S R o ———— o I REI* Program IS=1 CHMK |T() nt |Excep er (l)| |[Excep (@) | |Inter(l)| CHME o ——_—— R Kernel | e tem—————— o —_— Super Kernel Page CHAPTER 7 PROCESS STRUCTURE 21-May-80 7.1 A process is a single thread that 1is address executed space and both context of contains images status a longword pointers, order of by 5 process is of the 14 (PSL), the a process to 1s Structure the process context another not termed being the program and privileged and then scheduled a new Context for software a the its in and Control (PC), the by 4 of schedulable consists The Block of (PCB) the base minor the that processor and must stack length control PCB an hardware per-process the several majority fields. be moved a process is executing, some of its the internal registers. When a hardware Block the context switching execution. basic registers, defined P1LR the process context. Process counter Control registers loading switching. is executed A purpose memory execute, Process is by general into the internal registers. While hardware context is being updated in process It processor. and defined process virtual P@BR, POLR, P1IBR, for execution. the hardware the registers of Rev PROCESS DEFINITION entity In -- context (PCB). PCB of from occurs is stored Saving the currently another as one in the PCB a data contents executing is termed process after PROCESS Page 7-2 21-May-88 -- Rev 5 Process Structure CONTEXT PROCESS CONTEXT 7.2 Process Control Block Base (PCBB) 7.2.1 currently executing process is pointed The process control block for the Contr ol Block Base (PCBB) register, an to by the content of the Process ol internal privileged register. Figure 7.1 depicts the Process Contr Block Base. 33 210 2 1 29 ee IMBZ | mm e — e ——mm oo oo —— o oo s ——o oo +-——4 IMBZ | physical longword address of PCB l +-——+ i S P (read/write) Process Control Block Base (PCBB) Register At bootstrap time, the contents of PCBB is UNPREDICTABLE. 7.2.2 Process Control Block (PCB) process contains all of the switchable and The process control block (PCB) ct from to ent movem of ease for form context .collected into a compa ting in any normal opera the registers. Although xt the privileged internal ional for each process, conte software system there 1is addit the PCB known to the of on porti that to following description 1is limited the are described in nts conte whose PCB, ts hardware. Figure 7-2 depic Table 7-1. Process Structure PROCESS CONTEXT 21-May-8¢ -— Rev 5§ Page AP (R12) +76 AST MBZ LVL IMBZ| P1BR +88 +92 P1LR Figure 7-2 Process Control Block (PCB) 7-3 -- Rev 21-May-88 Process Structure PROCESS CONTEXT Table Page 5 7-4 7-1 Description of Process Control Block Longword Bits Mnemonic Y] <31:0> KSP Description stack pointer to be used when the current access mode field in the PSL is <31:08> the Contains Kernel Stack Pointer. ESP and @ IS 0. = Contains Executive Stack Pointer. the stack pointer to be used when the PSL current access mode field in the is <31:0> SSP 1. Contains Supervisor Stack Pointer. when the used be to er the stack point PSL current access mode field in the is <31:0> usp 2. User Stack Pointer. stack pointer to be Contains the used when the PSL current access mode field in the is 3. General registers RO through R11, <31:0> RO-R11, 18 <31:0> PC Program Counter. 19 <31:0> PSL Program Status Longword. 20 <31:0> P?OBR Base AP,FP AP, FP. register describing from @ to 2**3g-1. 21 <21:0> PPLR 21 <23:22> MBZ for page table process virtual addresses See chapter 5. table page for Length register located by P@BR. Describes effective length of page table. See chapter 5. Must be zero. Process Structure PROCESS CONTEXT 21 <26:24> 21-May-80 ASTLVL -- Rev 5 Contains access (established privileged AST is mode of interrupt the during REI 3 4 MBZ Must 22 <31:0> P1BR Base pending @ AST pending mode 1 AST pending mode 2 be pending 3 access for access for access AST to DIGITAL for page process 2**3¢0 to of P1BR. page 23 <30:22> MBZ Must 23 <31> PME Performance be virtual 2**31-1, register table addresses See for chapter page Describes table. See table effective chapter 5. controls a zero. signal Monitor visible hardware Enable to performance is processes be for zero. by from access (user) pending located to for (supervisor) AST register desired an the (executive) mode Length bit most which (kernel) Reserved length the AST delivery instructions. AST describing from 5. for mode No 5-7 <31:27> number of Meaning 2 21 7-5 Controls triggering 1 P1LR mode software) pending. Y <21:0> by access ASTLVL 23 Page external monitor. This identify those set to for which monitoring permit their and to observed other an without system is behavior interference activity. PROCESS CONTEXT Software symbols for these locations consist of the the Page 7-6 21-May-808 -- Rev 5 Process Structure mnemonic. example, For the PCB offset prefix to R3 1is PTXSL and PTXSL R3. s are: Exceptions are longwords 21 and 23, for which the software symbol longword 21 longword 23 PTXSL POLRASTL PTX$L P1LRPME or PME, a process must be To alter its P@#BR, P1BR, POLR, PILR, ASTLVLstore the desired new value in first executing in kernel mode. It mustmove to the appropriate value the the memory image of the PCB then these are that privileged register. This protocol results from the )fact the PCB. in ctions instru switch t contex read-only fields (for the 7.2.3 Process Privileged Registers are contained in registers when the The ASTLVL and PME fields of the PCBaccess them, two privileged registers process 1is running. 1In order to Level Register. are provided. Figure 7.3 depicts the AST |AST- | ignored; returns 0 l (read/write) Figure 7-3 AST Level Register s in a reserved operand An MTPR src,#ASTLVL with src<2:0> GEQU 5 result ASTLVL is 4. Figure 7.4 of ts conten At bootstrap time, the fault. (PME) Register. depicts the Performance Monitor Enable 1 0 3 1 e e I | l e m—— e — e — s = oo — oo o= s oo oo T T +-+ MBZ P e S SS SSS PS Figure 7-4 (read/write) Performance Monitor Enable Register At bootstrap time, PME is cleared. [Pl IM| |E | +-+ Process Structure ASYNCHRONOUS 7.3 events delay 1in an system that processing are for access mode (current access access the mode for in Rev § access containing pending. pending ASTLVL, AST. General Software an Page 7-7 ASTLVL IPL most possible process handling detect in 2 in access AST block in is of the four user) may receive must not access mode. access a mode triggered to mode execution comparison privileged than cause AST's; permitted Since outward number greater VAX-11 access be instruction, with This in in REI is AST's mode made mode delay. non-residence for or of register which an equal to the delivery of the processing: with to the which the is interrupt for field for only of of initiating changes any and privileged new associated currently 2. least either to process and to process field a execution the due super, notifying 1its efficient A occur the control mode be PSL). the Flow event AST The be assistance mode 1If pending An with may exec, transitions 1. events for with less privileged access execution in a more protected mode 1is technique a <current (ASTLVL) a AST mismatch. (kernel, AST interrupt access AST an of hardware modes however, are synchronized asynchronous some the -- (AST) traps not delivery requires to TRAPS ASYNCHRONOUS SYSTEM TRAPS (AST) Asynchronous or 21-May-8@8 SYSTEM an the AST hardware an AST executing, causes software the PCB is PCB to the pending. ASTLVL the most 1If When an REI instruction detects that can be interrupted by a AST, target an to an IPL 2 of sets privileged register transition pending enqueuing software the privileged set. a software and an the access process also has access is to mode interrupt is triggered to cause delivery of the AST. Note that the REI instruction does not make pending AST checks while returning to a 3. routine The (IPL 2) new delivery interrupts PCB value and the actually dispatching executes At the receiving conclusion recomputed software. the and interrupt service for ASTLVL while in ASTLVL normally pProcess on interrupt correct the 4. executing the on the of routine that kernel register AST. the stack. This kernel should prevents mode and move before in the AST that value to IPL and 1lowering interrupt stack compute additional service the context routine of AST. processing moved to the for an PCB and AST, the ASTLVL the ASTLVL is register by Process Structure PROCESS STRUCTURE 7.4 Page 7-8 21-May-84 -- Rev 5 PROCESS STRUCTURE INTERRUPTS Two of the structure They INTERRUPTS software software. interrupt priorities reserved are ©process for are: (IPL 2) - AST delivery interrupt. This interrupt 1is triggered by a REI that detects PSL<CUR_MOD> GEQU ASTLVL and indicates that a pending AST may now be delivered for the currently executing process. (IPL 3) interrupt. - Process scheduling This interrupt is only triggered by software to allow the running at IPL 3 to cause the currently software to be blocked and the highest priority process ng executi executable process to be scheduled. 7.5 PROCESS STRUCTURE INSTRUCTIONS stack (PSL<KIS> Process scheduling software must execute on the interrupt ble for use. availa stack ed set) in order to have a non-context-switch then any stack, kernel s's proces a on If the scheduler were running s 1is proces new a when ear disapp would there had it state information the of result the as selected. Running on the interrupt stack can occur onous synchr some r howeve , of scheduling events origin interrupt scheduling requests such as a WAIT service want to cause privileged and require may the rescheduling without any interrupt occurrence. For thisd reason, on while execute be can Save Process Context (SVPCTX) instruction to ion transit a forces and stack pt interru the or either the kernel execution on the interrupt stack. All of the process structure instructions kernel mode. are Process Structure PROCESS STRUCTURE Purpose: 21-May-80 -- Rev 5 Page INSTRUCTIONS LDPCTX Load restore register Process and 7-9 Context memory management context Format: opcode Operation: if PSL<CUR_MOD> NEQU @ then {privileged instruction fault}; {invalidate per-process translation buffer entries }; IPCB if is located {internal by physical registers begin for KSP <- (PCB); ESP <- (PCB+4); SSP <- (PCB+8); USP <- (PCB+12); address stack in PCBB pointers} then end; RO <- (PCB+16); R1 <- (PCB+20); R2 <- (PCB+24); R3 <- (PCB+28); R4 <- (PCB+32); R5 <- (PCB+36); (PCB+40); R6 <- R7 <~ (PCB+44); R8 <- (PCB+48); R9 <- (PCB+52); R10 <- (PCB+56); R11 <- (PCB+60); AP <- (PCB+64); FP <- (PCB+68); tmpl if POBR if if (PCB+80); <- tmpl; <- <- <- (PCB+88); tmp2 <- tmpl <- <- <- then {reserved operand then abort}; {reserved operand abort}; 5 then {reserved operand abort}; 2*%*23,; tmpl; (PCB+92)<30:22> PILR PME + {tmp2<31:30> NEQU PIBR @ (PCB+84)<26:24>; tmpl if GEQU then ¢ (PCB+84)<21:0>; (PCB+84)<26:24> ASTLVL if 2} OR {tmpl<l:¢> NEQU @} {reserved operand abort}; (PCB+84)<31:27> NEQU (PCB+84)<23:22> NEQU PALR if <- {tmpl<31:38> NEQU 2} OR {tmp2<l:@> NEQU @} {reserved operand abort}; NEQU then ¥ then {reserved operand abort}; @ then {reserved operand abort}; (PCB+92)<21:0>; (PCB+92)<31>; if (PCB+92)<30:22> if PSL<KIS> EQLU 1 NEQU then Process Structure PROCESS STRUCTURE Page 7-10 21-May-808 -- Rev 5 INSTRUCTIONS begin ISP <- SP; {interrupts off}; <- PSLLKIS> 8; lget KSP Sp <- (PCB); {interrupts on}; -(SP) -(SP) Condition <<- end; !push PSL !push PC (PCB+76); (PCB+72); Codes: N <- N; Z <= Z7; V C <~ V; K- C; Exceptions: reserved operand privileged instruction Opcodes: LDPCTX 06 Load Process Context Description: ged register The Process Control Block is specified by theers privile from the loaded are regist l Process Control Block Base. The genera address process the ing describ rs registe PCB. The memory management buffer tion transla the in entries process the and loaded space are also PSL and PC The stack. are cleared. Execution is switched to the kernel are REI moved from instruction. the PCB to the stack, suitable for use by a subsequent Note: 1. Some processors keep a copy of each of the per-process stack pointers in internal registers. In those processors, LDPCTX loads the internal registers from the PCB. Processors thats do not keep a copy of all four per-process stack pointer in r internal registers, keep only the current access mode registets conten PCB the with this switch in an internal register and whenever the current access mode field changes. 2. Some implementations may reserved operand checks. not perform some or all of the Process Structure PROCESS STRUCTURE 21-May-80 SVPCTX Purpose: -- Rev INSTRUCTIONS save Save register Process § Page Context context Format: opcode Operation: if PSL<CUR_MOD> !PCB if NEQU @ then {privileged is located {internal by instruction physical registers for begin (PCB) <- stack in PCBB pointers} then KSP; (PCB+4) <- ESP; (PCB+8) <- SSP; (PCB+12) fault}; address <- USP; end; (PCB+16) <- (PCB+249) <- R1; (PCB+24) <- R2; (PCB+28) <- R3; (PCB+32) <- R4; (PCB+36) <- R5; R@; (PCB+49) <- R6; (PCB+44) <- R7; (PCB+48) <- RS8; (PCB+52) <- R9; R1l0; (PCB+56) <- (PCB+60) <{- R1ll; (PCB+64) <- AP; FP; (PCB+68) <- (PCB+72) <- (SP)+; (PCB+76) <- (SP)+; If PSL<IS> EQLU 4 !pop PC !pop PSL then begin PSL<IPL> <- (PCB) SP; KSP <- <~ {interrupts <- K- end; Condition Codes: N <- N; Z <- Z7:; \ off}; 1; 1ISP; {interrupts PSL<IPL>); !save SPp; PSLKIS> SP MAXU (1, on}; KSP 7-11 Process Structure INSTRUCTIONS PROCESS STRUCTURE Page 7-12 21-May-884 -- Rev 5 Exceptions: instruction privileged Opcodes: SVPCTX a7 Save Process Context Description: ged register The Process Control Block 1is specified by the privile into the saved are ers regist l genera The Base. Block l Process Contro are stack current the of PCB. The PC and PSL currently on the top when ed execut is ction instru SVPCTX a popped and stored in the PCB. If ted, and IS is clear, then IS is set, the interrupt stack pointer activa stack. pt IPL is maximized with 1 because of the switch to the interru Notes: 1. The map, ASTLVL, and PME contents of the PCB are not saved because they are rarely changed. Thus, not writing them saves overhead. 2. Some processors keep a copy of each of the per-process stack pointers in internal registers. 1In those processors, SVPCTX stores the internal registers into the PCB. processors that do not keep a copy of all four per-process stack pointers in internal registers, keep only the current access mode register in internal register and switch this with the PCB contents an whenever the current access mode field changes. 3. Between the SVPCTX instruction that saves state for one process l and stack the LDPCTX pointers that loads the state of another, the interna may not be referenced by MFPR or MTPR This implies that interrupt service routines instructions. invoked at a priority higher than the lowest one used for must not reference the process stack switching context pointers. Process Structure 21-May-88 USAGE EXAMPLE 7.6 USAGE EXAMPLE The following be that this used example to simple illustrates implement dispatch how process routine the Rev 5 process dispatching is Page always structure software. entered via instructions It an 7-13 is assumed interrupt. e ENTERED e Wy can -- IPL=3 RESCHED: VIA INTERRUPT SVPCTX ; {set state to <and place current <on proper <Remove of queue.> MTPR @#PHYSPCB, REI in PCB physical PCB address PCB> queue> highest> non-empty, <RUN LDPCTX context runnable> RUN head {priority, Save PCBB > ;i Set ;in PCBB i Load i For i Place context new from PCB process process in execution CHAPTER 8 SYSTEM ARCHITECTURAL IMPLICATIONS 17-June~-809 8.1 -- Rev INTRODUCTION Certain portions of the system structure of implementations. interaction: data interrupts and VAX-11 architecture sharing errors. and Of 8.2 are implications four broad synchronization, these, data sharing is on the categories of restartability, most visible to the DATA SHARING AND SYNCHRONIZATION The memory access the another a maximum accesses of the 5 INCB by REMQTI) ("interlock") instructions write of performing termed out an by operations are operation sets be regardless the of that hardware programmer provided implemented other interlock. must of does allow in such on sequence. On the be the a way and the Only and interlock and the @ of must that same 6 read, devices of control interlocking the write. The interlocked write the to data INSQTI, control modify, locked variable. operations SBI be interlocked test, are 7. accessing INSQHI, These and must Before programmer I/0 1 and execution, be written control VAX-11/780, interlock and ADAWI, wvariable. processors @ INCB order acquire the read interlock, this executes designer. BBCCI, control operations interlocked that locations contents may (BBSSI, to a the final or while granularity Note processor data to the byte. suppose one shared interlocked the example, Suppose programmer the that the of one byte but only that independent bytes produce the same results regardless instructions are happen 6. Then access must and For and 1. data, Seven such is size simultaneous, the writeable structure, locked execution. explicitly synchronized REMQHI, implemented modification adjacent effectively to be reference to wvalues executes including shared must independent order contain Access system for not imply modifying is have There programmer. of 5 out This are primitive interlocked read releases 1it. Page 8-2 17-Jun-8¢ -- Rev 5 System Architectural Implications DATA SHARING AND SYNCHRONIZATION operations BBSST and BBCCI instructions use hardware provided primitive to make a read reference, then test, and then make a write reference to The ADAWI a single bit within a single byte in an interlocked sequence. instruction uses a hardware provided primitive operation to make a read interlocked an in and then a write operation to a single aligned word interlocks. other without maintained be to allow counters to sequence reads to be longword of The INSQUE and REMQUE instructions provide a series allow queues to sequence uninterruptible an in writes and maintained without other INSQTI, REMQHI, The INSQHI, the interlocks header queue multiprocessor to in a uniprocessor system. and REMQTI allow .mw the of read The ADAWI instruction takes the hardware lock on the operand (the second operand which is the one being modified). instructions use an interlock on queues to be maintained consistently in a system. peripheral UNIBUS some In order to provide a functionality upon which processors must insure that all instructions making byte rely, devices DATIP the use .mw) and (.mb or word sized modifying references operand physical address selects a UNIBUS the when functions DATO(B) field, quadword, longword, This constraint does not apply to device. operations if implemented using byte or word string or floating, all to apply not does also constraint This references. modifying instructions precluded from I/0 space references (see Appendix A). In a multiprocessor system, any software clearing PTEKV> or changing the protection code of a page table entry for system space such that it issues a MTPR xxx,#TBIS must arrange for all other processors to issue a The original processor must wait until all the other similar TBIS. it allows access to the processors have completed their TBIS before system 8.3 page. CACHE A hardware implementation may include a mechanism to reduce access time Such a recently used memory contents. local copies of by making A cache must be implemented in such a way mechanism is termed a cache. transparent to software (except for timing and 1is existence 1its that In particular, the following must be error reporting/control/recovery). true: a peripheral 1. starting by followed Program writes to memory output transfer must output the updated value. 2. Completing a peripheral 3. followed A write or modify followed by a HALT on one processor a read or modify on another processor must read the updated by reading value. of memory must input transfer followed by the read the program input value. System Architectural Implications CACHE 4. A write or modify restoration updated does of value not 17-Jun-80 followed power provided exceed by a followed that the by In multiprocessor processors must systems, be interlocked to by On the Valid instructions accesses VAX-11/780, memory and this to I/0 is achieved that watches time, the by must a bootstrap 8.4 cache must be bus either be writes all empty main between one of the ADAWI, cached. that for the failure the shared executing by read or through external to writes to valid. RESTARTABILITY The VAX-11 architecture requires that after a fault or interrupt that instruction registers For some are or stored contents may have memory no most instructions operand any that result in only the when a to which store system the or used are virtual any state may that are produce peripheral them must not The condition I/0 permit a fault instructions are listed and in or SPACE." Memory modifications e.g. memory that produced access memory as a side statistics, are not be In order registers, interrupt altered effect due a both in the insure that subject stored or to used having to access instruction that software may instructions used to after modes the that can first be used 1/0 to "INSTRUCTIONS USABLE of execution, instruction specifically until spans of sequence. registers results A, For this addresses, device Appendix requires operand, must 1information addressing case 4, latter completed. results they non-terminating UNPREDICTABLE the operand intermediate that execution. Chapter accessibility integrity, or be multibyte or non-interruptable former can the modified 1In written test and in registers. but modified necessary that start of 1indicated instruction faults or interrupts. access peripheral device access. constraint at general altered the single it after Space REFERENCE a operands access this a the been compromise stored effects restarting dependably meet not checking, Instruction side making instructions addresses cannot only had restartable before means operand. registers protection in unless processing boundary the order written with special of general be this instructions, are case parts iterative results that implies instructions be terminated execution completed. Generally, restored to the value they complex protection all was intermediate In must BBCCI, not cache memory memory. At variables 8-3 followed modify (BBSSI, registers the Page failure or software INSQHI, INSQTI ,REMQHI ,REMQTI). 6. 5 of the power non-volatile period of access interlocked read Rev duration maximum memory. 5. power a the -- the TO excluded from the instruction can be Page 8-4 17-Jun-8¢ -- Rev 5 System Architectural Implications RESTARTABILITY completed. Instructions that abort are constrained only to insure memory protection (e.g., 8.5 registers can be changed). INTERRUPTS Underlying the VAX-11 architectural concept of an interrupt 1is the notion that an interrupt request is a static condition, not a transient event, which can be sampled by a processor at appropriate times. Further, if the need for an interrupt disappears before a processor has honored an interrupt request, the interrupt request can be removed implementation dependent timing constraints) without to (subject consequence. is In order that software be able to operate deterministically it(IPL) priority r processo the necessary that any instruction changing such that a pending interrupt is enabled must allow the interrupt to occur before executing the next instruction that would have been executed had the interrupt not been pending. Similarly, instructions that generate requests at the software interrupt levels (See Chapter 6) must allow the interrupt to occur, if processor subsequent apparently the executing before permits, priority instruction. 8.6 ERRORS Processor errors, if not inconsistent with instruction <completion, should <create high priority interrupt requests. Otherwise, they must (fault, trap or execution with an exception t request. interrup ed associat an be also may there case abort), in which terminate instruction Error notification 1interrupts may be delayed from the apparent completion of the instruction in execution at the time of the error but if enabled, the interrupt must be requested before processor context 1is switched, priority permitting. An example of a case where both an interrupt and an exception are associated with the same event occurs when the VAX-11/780 instruction In buffer gets a read data substitution (i.e. read memory data error).taken be not will error with ed associat this case the interrupt request if the priority of the running program is high, but an abort will occur when an attempt 1is made to execute interrupt is still pending and will be lowered. the instruction. taken when the However, the priority is System I/0 Architectural Implications STRUCTURE 8.7 The Rev 5 Page 8-5 Introduction VAX-11 principal as the 1/0 architecture difference PSL) address Space in address used data the upper 1length. Use mapping when include a and (see On half of of For any member be one or in length, of these 8.7.2 of more the areas which areas is must following is 1. On a registers. pProgramming series I/0 the through" I/0 list physical address of the using register the UNPREDICTABLE word-length or modifying In all a "o, Only byte ".mb" or interlock UNIBUS an a I/0 references the in UNIBUS, space each addresses. 2**29 virtual the 1/0 there will 2%*]8 bytes The length collection (which must not devices, by that 1is set bit to and device position prevent between an must aligned on and integral be on a power natural than the 1length of references may produce a byte reference to a necessarily respond by supplying error the be design other example addressed. set be constraints register must bytes, attribute unaligned For programming hardware in registers byte to is the in Chapter 5 to be Implementations that register the This physical and all space. and both size and/or status must and be not clearing reading and bits that cleared by affected by bits writing a that may be software writing may be register. and word ".mw") references of a read-modify-write (i.e., type in UNIBUS I/0 spaces are guara nteed to correctly. References in the I/0 space other than in spaces are the BBSSI includes UNIBUS will asynchronously 4. of results. "1" for address UNIBUS hardware register peripheral writing the device the space permits described implementing the in the (such by normal memory implementation, this 1/0 Note: register asynchronously Peripheral locations address caching affect all References a both 1items of two); i.e., boundaries. 3. to considerations. The physical physical as structure, registers Registers of These multiple 2. to at instructions suppress PDP-11 manipulated mechanisms of referred Constraints the VAX-11 "maps be the processor 9). appear registers. space. to which VAX-11/789 general 1/0 by Chapter the protection feature similar therefore referencing cache very method registers and can instructions. occupies is the accessed and space, reference bytes being are control/status I/0 -- I/O STRUCTURE 8.7.1 The 17-Jun-8¢ UNDEFINED and BBCCI with respect to instructions. interlocking. This System Architectural Implications 17-Jun-8A4 -- Rev 5 Page 8-6 I1/0 STRUCTURE 5. F floating, String, quad, octa, H floating, and field references UNDEFINED behavior. G floating, D floating, in the 1/0 space result in CHAPTER 9 PRIVILEGED REGISTERS 13-May-81 9.1 The Rev 5.2 PROCESSOR REGISTER SPACE processor control register and registers, are and -- status the PSL, explicitly Move kernel mode All the end of (See instructions to by general are need to means R registers, are several mapping registers context some or and write per-process context save all of them 1load and these back may this reason, MTPR instruction, implementation. will space not or reading register the retain For the level, (see or or the copy writing 1in the during any modifying the Some PCB a of to main these to current registers (MTPR) which require tables are R13, the at the described the SP, and MTPR and MFPR appear in the the PCB during implementations into in CPU base loaded from the PCB exception of the memory scratchpad context reference the are the back 7). registers through Likewise necessarily update SP. from PCB which with written Chapter registers into or write registers operation and, AST operation implementations by and There of Register the space. PER-PROCESS REGISTERS AND CONTEXT SWITCHING a in through 9.2 during These explanation referenced types management Processor summarized Registers many instructions further processor to memory pointers. Move (MFPR) registers 2). access the stack registers which as the Register designated register provides such multiple Those Chapter are (PRS) only processor section. Reference processor the Processor internal PC and accessible privileges. this below. the from space registers save may registers operation. memory Other in the PCB. registers via the SP, PCB, may or may depending a copy not MFPR read on or the one of these registers in the PCB register which appears in the register Privileged Registers 13-May-81 -- Rev 5.2 PER-PROCESS REGISTERS AND CONTEXT SWITCHING Page 9-2 An implementation may retain some or all per-process internal registers only in the PCB. 1In this case, MTPR and MFPR for these registers must that access the corresponding PCB location. have 1internal registers in hardware However, implementations scratchpads are not required to access the corresponding PCB locations for MTPR and MFPR, 9.3 STACK POINTER IMAGES access Reference to SP (the stack pointer) in the general registers will executive, sor, one of five possible stack pointers; the user, supervi wvalues of the the on ing depend r, pointe kernel, or interrupt stack Additionally, current mode and IS bits in the PSL (see Chapter 6). ing the one (includ rs software can access any of the five stack pointe via the PSL) the in bits IS and mode current currently selected by the KSP, the nt impleme that ors process on (even tions instruc MTPR and MFPR stack the if even t correc ssp, ESP, or USP only in the PCB) Results are IS bits in the PSL |is pointer specified by the current mode and that a referenced in the PRS by an MTPR or MFPR instruction. This means to a ent equival is MFPR/MTPR to the KSP (if IS=0) or the ISP (if IS=1) MOVL from/to the SP. Privileged MTPR AND 9.4 Registers MFPR 13-May-81 INSTRUCTIONS -- Rev 5.2 Page 9-3 MTPR AND MFPR INSTRUCTIONS MTPR Move opcode src.rl, To Processor Register Format: procreg.rl Operation: if PSL <CUR_MOD> NEQ instruction PRS [procreg] Condition <- 0 then {reserved fault}; src; Codes: N <- src LSS g; Z <- src EQL 0; V <- @; C <= C; N <- N; Z <- 7; V <-V; C K- !if register !except !if TBCHK register is replaced register is not (see Chapter 5) replaced C; Exceptions: reserved operand reserved instruction fault fault Opcode: DA MTPR Move To Processor Register Description: Loads the source specified operand by procreqg. the processor side effects. register specified The pProcreg number. by source operand Execution into is a the processor longword may have does not which register contains register-specific Notes: 1. If the operand 2. A processor fault reserved attempted internal instruction in register occurs. other than fault occurs kernel mode. if exist instruction a reserved execution is Privileged Registers MTPR pPage 9-4 13-May-81 -- Rev 5.2 AND MFPR INSTRUCTIONS 3. A reserved operand fault occurs register. on a move to a read only Privileged MTPR AND Registers MFPR 13-May-81 INSTRUCTIONS MF PR Move From Processor -- Rev 5.2 Page 9-5 Register Format: opcode procreg.rl, dst.wl Operation: if PSL dst <- Condition <CUR_MOD> NEQ 0 then instruction fault}; {reserved PRS|[procreq]; Codes: N <- dst LSS @; Z <- dst EQL @; V <- @; C <- C; N <- N; Z <-7; V <-V; C K- !if destination is replaced !if destination is not replaced C; Exceptions: reserved operand reserved instruction fault fault Opcode: DB MF PR Move From Processor Register Description: The destination operand register specified contains the by is replaced procreg. processor register-specific side by The the contents procreg operand register number. of is the a processor longword Execution effects. may which have Notes: 1. 1If the operand 2. A processor fault reserved attempted 3. A reserved register. internal instruction in register does not exist occurs. other operand fault than fault occurs kernel occurs if instruction a reserved execution is mode. on a move from a write only Privileged Registers VAX-11 9.5 SERIES REGISTERS Page 9-6 13-May-81 -- Rev 5.2 VAX-11 SERIES REGISTERS Mne- Register Name monic Number Type Scope Init? Kernel Stack Pointer Executive Stack Pointer Supervisor Stack Pointer User Stack Pointer Interrupt Stack Pointer P?® Base Register Pg Length Register Pl Base Register Pl Length Register System Base Register System Limit Register Process Control Block Base System Control Block Base Interrupt Priority Level AST Level Software Interrupt Request Software Interrupt Summary Interval Clock Control Next Interval Count Interval Count Time of Year (optional) KSP ESP SSP UspP ISP POBR PALR P1BR P1LR SBR SLR PCBB SCBB IPL ASTLVL SIRR SISR ICCS NICR ICR TODR ) 1 2 3 4 8 9 10 11 12 13 16 17 18 19 29 21 24 25 25 27 R/W R/W PROC PROC -— -— Console Transmit C/S Console Transmit D/B Memory Management Enable Trans. Buf. Invalidate All Trans. Buf. Invalidate Single Performance Monitor Enable System Identification Translation Buffer Check TXCS TXDB MAPEN TBIA TBIS PMR SID TBCHK 34 35 56 57 58 61 52 63 R/W R R/W W R/W W W R/W R CpPU CpPU ves —— Console Receiver C/S Console Receiver D/B RXCS RXDB 32 33 R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W R/W W R/W R/W W R R/W W PROC PROC CPU PROC PROC PROC PROC CPU CPU PROC CPU CPU PROC CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU CPU PROC CPU CPU -— ----— -— --— yes yes yes yes --— no yes -— yes -= -yes no -— Privileged Registers 13-May-81 VAX-11 SERIES REGISTERS 9.5.1 System Identification The SID type. is a The field may read only entire be SID used by 3 2 2 1 4 3 Register constant register software -- to 5.2 Page that included specifies in distinguish the error processor the log processor and TYPE | type (read System A unique | + only) Identification number + specific assigned by Register engineering to processor: @ = Reserved 1 = VAX-11/789 2 = VAX-11/750 3 = VAX-11/730 4 through 128 type specific to 127 = through 255 format type. and It DIGITAL a specific (error) to DIGITAL Reserved to CSS and = content is identify Reserved is intended as serial For the VAX-11/780, | ECO level number and a function of to include such revision the type |plant| customers the value in information level. specific serial format is: number e TP ——S . e For | type g Fom e F o Type the types. Fom e Fo | 9-7 (SID) register is Rev the VAX-11/750, | the type microcode specific rev | format hardware I + is: rev | oe Se + Page 9-8 13-May-81 -- Rev 5.2 Privileged Registers VAX-11 SERIES REGISTERS 9.5.2 Console Terminal Registers a data buffer Two four internal registers. The console terminal is accessed through termin to g writin with two and al the from are associated with receiving and er the terminal. In each direction there is a control/status regist register. 3 0 8 7 6 5 1 it -t ——_———— + VU | ID{T| 101E | MBZ | | IN| | | I MBZ | ——— e —— bt ———— + o 11 111 1 W Y 8 7 2 1 6 5 4 R 0O (RXCS) Console Receive Control/Status 3 R e— f—t———— o ———— it + I l | |E | IR| IR | Y @ | | | 1ID | | | DATA | | l — e fomm———— o— + o (read only) Console Receive Data Buffer (RXDB) Whenever a datum is At bootstrap time, RXCS is initialized to @. the console. If IE received, the read only bit DONe is set anby interru pt is generated then e (interrupt enable) is set by the softwar re sets 1IE, softwa the and set y alread is DONe at IPL 20. Similarly, if er the whenev is generated an interrupt is generated (i.e., an interrupt 1). d data receive the If to function {IE AND DON} changes from # ERR is set contained an error such as overrun or loss of connection then#RXDB,d st is MFPR a When DATA. in appears data d receive The in RXDB. then & is ID If request. pt executed, DONe is cleared as is any interru the then o non-zer is ID If l. termina the data 1is from the console entire register is implementation dependent. Privileged VAX-11 Registers SERIES 13-May-81 REGISTERS -- Rev 5.2 Page 9-9- 3 1 8 7 6 5 @ oe _ ot + I | IRIT | MB?Z | IDIE | ly| I MBZ | I | Fom e _ et + Console Transmit Control/Status 11 1 2 e | MBZ 8 | 7 ) —— e ID | T+ DATA I Te+ (write Console bootstrap (ready). only the bit time, RDY. software software TIf 1is generated is the sets send IE, then then at an the a the datum VAX-11/780 VAX-11/788 RXDB enable) 20. by is ID sent register is console one is {IE it to any to the is register 2 2 11 4 3 11 6 21 MBZ I | | Used by DL-11 RDY o ——_—— e -R is (i.e., an When a read is 7 sent - 4 | I | I | Data then an set and interrupt 8 to MTPR 1). is The src,#TXDB If If ID ID is is dependent. te——— to—————— + Select set the terminal. I I | I i bit sets request. — Fomm e + I | | RDY already from interrupt implementation 8 it software changes DATA. datum e e +-—— | | | the if console the 1 MBZ by busy, implementation 3 R set RDY} is the not generated AND as then 5 is just is Similarly, writing cleared entire if IPL with transmitter interrupt datum (TXDB) initialized function 1is the Buffer (interrupt RDY disk. 9.5.2.1 console whenever can 8 non-zero is the IE only) Data TXCS generated executed, written Transmit Whenever interrupt | I I 1 e Fo On R W (TXCS) 3 At R O to the floppy Page 9-10 13-May-81 -- Rev 5.2 Privileged Registers VAX-11 SERIES REGISTERS TXDR 11 ————— o —_———— o o | | I 6 5 4 3 1 I l MBZ e 11 2 2 3 I I 8 7 | | l | l ———— T o ———— - o I I Select Code Device l l l ———— + Data Select (in Hex) | I Field Field Select Field Values Y ———— + I | MBZ | MBZ 21 ———— R e Data Field Values Y Operator's Terminal g thru 7F - ASCII Data 1 Drive @ (Data) g thru FF - Binary Data 2 Function Complete (Status) 9 Drive @ (Command) @ = Read Sector 1 2 3 Sector = Write = Read Status = Write Deleted Data Sector 4 = Cancel Function 5 Error 1l = Software Done Misc. Communication F = Protocol 2 = Boot CPU 3 = Clear Warm-start 4 = Clear Cold-start Code 5 (Protocol Error), following 1. 2. occurs: is sent by the console when one flag flag of the n) is Another load device command (except for Cancel Functio ted. comple issued by the 0S before a previous command 1is The console gets a 'Drive 0 (DATA)' when expecting a command. Privileged VAX-11 Registers SERIES 9.5.2.1.1 Status determine the Status Byte Status (code 2). Byte Definition success is Read 13-May-81 REGISTERS sent to or The Status Bit The 0S at The 5.2 Status Page Byte is or Write completion of of the Rev Read failure the operation. - -- Select a code assignments are is a always as used by 9-11 VMS operation. Read, Write, 'Function follows: to The or Complete!’ RXDB 3 2 2 1 11 4 3 11 6 2 oe | | | MBZ | 5 Fom I MBZ 1 8 I I MBZ Fmm Fom————————o- I | Bit Floppy's 9.5.3 The is Clock of is R e e e | | I | ———————————— | || I '2! identical 7. Bit Register. consist clock for used software 9.5.3.1 O (I || are Bit I to 7 ks st 1 o | CRC ERR I | I || | | PARITY ERROR | | | || | INI DONE | e | | DELETED DATA I Tt T | ERROR those supplied corresponds to by the Bit 15 Floppy of the Registers year required clock the 'RXCS' clocks time assignments excepting (R I I CODE Status 219 [ I controller, 6 I | I The 7 t-———- -ttt -+ of a is used time unattended for date of to time. Time-of-Year Clock clock the restart accounting, and year measure for after time and an interval duration a power dependent of power failure. events, and resolution of T o -~ ~ T . approximat ely 1least 10 AN 497 significant milliseconds. A - days. and to 1interval maintain - time-of-year clock consists of one longword register. forms an unsigned 32-bit binary counter that is driven clock source with at least .0025% accura cy (approximately The The failures The The month) . clock. bit Thus, the of the counter counter cycles The register precision by a 65 seconds represents to @ per a after Page 9-12 13-May-81 -- Rev 5.2 Privileged Registers VAX-11 SERIES REGISTERS The counter has an optional battery hack-up power supply sufficient for or lose any at least 100 hours of operation, and the clock does not gain batter y 1s The by power. ticks during transition to or from standthat time is not so failed, has y batter the recharged automatically. If up. One of two things accurate, then the register 1is cleared upon power then happens: 1. Thus, if software The register starts counting from 0. to a large time onding initializes this clock to a value corresp after a power time of loss for check can (e.g., a month), it restore by checking the clock value. This is the VAX-11/780 implementation. 2. a non-zero a non-zero ns only when it contai The register stays at # until the software value value. into 1it. It counts writes This is the VAX-11/750 implementation. (read/write) Time of Year (TODR) Privileged VAX-11 Registers SERIES 9.5.3.2 Interval IPL at 24 day). The register Clock - The programmed microsecond 13-May-81 -- interval clock Rev REGISTERS intervals. The 5.2 Page provides counter an 1is intervals, 9-13 interrupt incremented at at 1 with at least .01% accuracy (8.64 seconds per interface consists of three registers in the privileged clock space: 3 1 g P | interval + count | P + (read interval only) count register (ICR) 3 1 4] oe _+ | next P interval e (write next count l + only) interval (NICR) 33 1 0 8 Fb—————————— 76 5 4 3 14 t—t—F-t—F———— +-+ |E | IR | ITITISIX] MBZ IR | IR | INIEIGIF| IT] - MBZ ILIR] IN| e W W C Interval 1. 1Interval Count incremented once from NICR upon a interrupts 2. Next RUN of ICCS, 24 if - the The R W (ICCS) interrupt reload is enabled. register 1is a write only be loaded into ICR when it The value is retained when ICR is loaded. NICR is being loaded regardless of the current values of ICR holds Interval Clock control When RWW CWOO interval register is a read only register every microsecond. It is automatically loaded carry out from bit 31 (overflow) which also Count contains <@> Control/Status +-+ The IPL that overflows. capable and at Intérval register 3. Clock |U| set, ICR does run is the Control and ICR not value Status status cleared. (ICCS) information increments increment to each - The for the microsecond, automatically. At 1ICCS register interval When bootstrap clock. 1 clear t Page 9-14 13-May-81 -- Rev 5.2 Privileged Reglisters VAX-11 SERIES REGISTERS is set, NICR 1is XFR <4> A write only bit. Each time this bit SGL <5> A write only bit. If RUN is clear, each time this bit is 1E <H> When set, an interrupt request at transferred ICR set, every is time to ICR. incremented by one. ICR IPL 24 overflows (INT is set). interrupt is requested. 1is generated When clear, no Similarly, if INT is already set and the software sets IE, an interrupt is generated (i.e., an interrupt is generated whenever the function {IE AND INT} changes from @ to 1). INT <7> Set by hardware every time ICR overflows. clock tick interrupt ERR <31> If IE 1is set then ERR set then an interrupt is also generated. An attempt to the ling reenab y this bit via MTPR clears INT, thereb (if IE is set). Whenever ICR overflows, if INT is already set, is set. Thus, ERR indicates a missed clock tick. attempt to set this bit via MTPR clears ERR. An negative of the desired Thus, to setup the interval clock, load the will enable interrupts, ,#ICCS #7°X51 MTPR a Then interval into NICR. Every "interval count” reload ICR with the NICR interval and set run. interr upt to be requested. an and microseconds will cause INT to be seta MTPR to clear the 4$ICCS #°XC1, e execut The interrupt routine should upt has not interr the If 1INT has not been cleared (i.e., interrupt. will be bit ERR the ow, overfl ICR been handled) by the time of the next set. cleared. At bootstrap time, bits <6> and <@> of ICCS are ICTABL E. I1CCS and the contents of NICR and ICR are UNPRED The rest of Privileged Registers VAX-11/780 SPECIFIC 9.6 REGISTERS 13-May-81 -- Rev 5.2 Page 9-15 VAX-11/780 SPECIFIC REGISTERS Mne- Register Name monic Number Type Scope Init? Accelerator Control/Status Accelerator ACCS 40 Maintenance R/W CpPU yes ACCR 41 R/W CPU WCSsSA no 44 R/W WCSD CPU 45 no R/W CpU ves yes WCS Address WCS Data SBI Fault/Status SBI SBIFS Silo 48 R/W CPU SBI Silo SBIS 49 R SBISC CPU 50 no R/W CPU yes Comparator SBI Maintenance SBIMT SBI 51 Error R/W CPU yes SBI Timeout SBIER Address 52 R/W CpPU yes SBI SBITA Quadword 53 Clear R CPU SBIQC -- 54 W CPU MBRK -- 50 R/W CPU no Micro Program 9.6.1 The Register Breakpoint VAX-11/780 VAX-11/780 instructions. Accelerator processor Two ACCR. ACCS is the whether the accelerator an identifies type has internal and type and reports enable are set; e e e e e e R R R R 0 0O 00 etk <7:0> and errors for a subset accelerator, register. whether status. are 5 4 It it At of the ACCS and 1indicates is enabled, Dbootstrap time, cleared. 8 R, B e T it |E | IN | IB| MBZ 7 ) e Fomm e -+ | | I MBZ TYPE TS ot Fom - R I I l + RO W Accelerator TYPE status the 111 6 lEIMIU|O|R] IRIBIN|VI|S| IRIZIFIF|V| R accelerator control controls errors the 332222 e and exists, 109876 R optional registers control accelerator its an Read only Control/Status field follows: @ = 1 Numbers in the point range Numbers to the accelerator type as Accelerator Floating DIGITAL. reserved No specifying (ACCS) 2 in accelerator through the CSS/customers. range 127 128 are reserved through 255 to are Privileged Regis ters VAX-11/780 SPECI FIC REGISTERS is accelerator Read/write field specifying whether the <155 ENB Page 9-16 13-May-81 -- Rev 5.2 this 1is set 1f the At bootstrap time, enabled. accelerator is installed and functioning. An attempt to set this if no accelerator is installed is ignored. RSV <27> Read only bit specifying that the last operation had a OVE <28> Read only bit specifying that the last operation had an UNF <29> Read only bit specifying that the last operation had an ERR <31> Read only bit specifying that at least one of bits RSV, operand. reserved overflow. underflow. Note that bits <31:27> are OVF, and UNF 1is set. processor microcode before main the normally cleared by starting the next macro instruction. ACCR is the accelerator's UNPREDICTABLE. accelerator microprogram counter. 19 the 2 9 8 6 5 4 3 4 3 controls At bootstrap time its contents are 1111 2 2 33 It register. maintenance + m e mmm ot o -ttt frm IE | MBZ |T | IL | | |E M| | IL 1M | TRAP ADDRESS IM|P | | MICRO PC i MBZ l | i I —— o -ttt o— + b 0 RW W R RW W 0 0 Accelerator Maintenance Register PC <@:8> NEXT MICRO PC on read. to address be executed. next micro If EML is also set, then this This MATCH MICRO PC on write. (ACCR) the contains updates the micro PC match register. MPM <14> MICRO PC MATCH. A read only bit that 1is set whenever the accelerator's micro PC matches the micro PC match This is useful register. primarily as a scope Sync signal. EML <15> ENABLE MICRO PC MATCH LOAD. A write only bit that when set causes <8:8> to Dbe loaded into the accelerator's micro PC match TRAP <16:23> register. TRAP ADDRESS. A read/write field used by the main processor to force the accelerator to a specified micro location ER VAV S P VR ¥ ) Privileged Registers VAX-11/78@ SPECIFIC ETL <K31> 13-May-81 ENABLE set TRAP ADDRESS causes trap 9.6.2 VAX-11/78@ LOAD. <23:16> address processor's to -- REGISTERS to Rev A be write loaded register. micro code this location by Micro Control Store can 5.2 Page only into bit the asserting the an that the accelerator internal when accelerator's Subsequently, force 9-17 main to trap signal. The VAX-11/780@ processor has three registers for control/status of its microcode. Two are wused for writing into any writable control store (WCS) and one is used to control micro breakpoints. 3 1 11111 6 e 54 3 2 7 -t + I | |P | MB?Z | |T|CTR| I IN | o WCS I ADDR I I e D R RW I RS+ RW W Writable Control Store Address (WCSA) 3 1 Y Fo + | WCS Data I F + (on Write) 3 1 8 P I Y Fo 7 Y S+ | PRESENT | o+ (on Writable Reading WCSD WC5D<n> is (i.e., that Control read) Store indicates which set, addresses then WCSA<12:10> EQLU Data control n n=4 (WCSD) store n*1024 addresses through corresponds to are writable. n*1024+1023 writable If are writable control store). corresponds to WCS that is reserved to DIGITAL for diagnostics and engineering change orders. Other fields correspond to blocks of control that can be used to implement customer or CSS specific microcode . Each word of control store contains 96 bits plus 3 parity bits. To write one or each more MTPR increment words, to CTR. initialize WCSD When will CTR WCS write would ADDR to the next 32 3, is become the it address bits and and CTR to . Then automatically automatically cleared and Privileged Registers VAX-11/780 WCS ADDR SPECIFIC REGISTERS incremented. is Page 9-18 13-May-81 -- Rev 5.2 is set, T1f PIN then any writes to WCSD are An attempt to execute a microword with bad done with 1inverted parity. parity results in a machine check. At bootstrap time, the contents of WCSA are UNPREDICTABLE. 11 3 4] 32 1 e fmmm e- + l MB?Z | | MICRO PC —o + e e (read/write) Micro Program Breakpoint Address (MBRK) an external Whenever the microprogram PC matches the contents of MBRK, then mlcrobreak on stop enabled has If the console signal is asserted. the If asserted. 1is signal this when stopped is clock the processor console has not enabled microbreak, then this signal is available as a instruction to Many diagnostlcs use the NOP diagnostic scope point. time, the bootstrap At point. scope a giving of method trigger this contents of MBRK are UNPREDICTABLE. SBI 9.6.3 3322 FAULT/STATUS (SBIFS) REGISTER 211111 22272 4 @ 987 65 19987654 + — -t —t—t—F -ttt ottt [PIMIUIMIM|XIN] ITIBIN|IBILIMIS]| Y 1ZIX|ZITITITI MBZ R 0 ITIN|TIT]| |IHITIGIL MB?Z I | | -ttt + SeAT e e e R 0 ILITIsIs| W C R R 0 0O R W 0O C 15:8 MBZ 16 SIL SILO FLT LOCK 17 SIG SIG FLT Fault Silo Lock (set if Silo Locked due to Fault Signal) Fault Signal 19 LTH LTH FLT Fault Latch 20: 24 MBZ 26 27 29 XMT MLT UNX 18 INT INT FLT EN Fault Interrupt Enable 25 NST NST ERR Nested Error 31 PTY PTY FLT SBI Parity Fault Flag XMT FLT MLT XMT UNX RD Transmitter during Fault cycle Multiple Transmitter Fault Flag Unexpected read Data Fault Flag Privileged Registers VAX-11/780 SPECIFIC 9.6.4 SILO The SBI SBI the Silo past asserted in R the 16 DATA is a SBI 13-May-81 REGISTERS REGISTER history cycles. of state SBI Silo Comparator match occurs. following format: 332 2 2 2 2 1 @ 1 9 111 5 4 2 1 8 7 s S SR TP —— +———— o ITIT| I | | SBI cycle the TAG indicated every has | the updated silo | of is or ID Page silo SBI |FIN| 5.2 6 -t SBI | CNF | I Each e @:15 SBI 17:16 CNF SBI CNF1-0 21:18 SBI SBI SBI I | TR<15:0> | | M3-M@ + ONLY TR OR B31-B2S8 SBI Transmit/Receive SBI Confirmation SBI bits with SBI TAG FIELD address are 24:22 TAG SBI 29: 25 30 31 iD INT AFT SBI 9.6.5 The SBI Silo COMPARATOR Comparator conditions are provided the by TAG IDI INTLK AFT FLT SILO allows detected. Silo is entry _+ s SR ST —— t———— o t—t READ for FAULT Y —————— I I signals until 5 —— I 9-19 (SBIS) the the AT Rev The on an -~ 21-18 are B31-B28 TAG. the SBI this M3-Mg field. FAULT cleared (SBISC) to become Conditional Comparator. SBI command Otherwise, in SBI Interlock First Entry after REGISTER written when specifies written Lines Lines and locked when unconditional pre specified lock modes are Privileged Registers VAX-11/780 332 SPECIFIC 2 2 222 3 2 1 098 75 2 Page 9-2¢ 13-May-81 -- Rev 5.2 REGISTERS 11 1 Y 6 5 g 9 -4t ———— R o ————— e + IclT|L| L |COMPARE| COMP| COUNT | l | IMIN|C] O | CMD OR| lP|TIK| C | MASK | TAG | FIELD | N oo et | | MBZ l — + —— - o e * *CLEARED ON ANY WRITE TO SBISC 15: 0 MB?Z 19:16 22: 20 COUNT COMPARE TAG 30 INT INT EN 26: 23 28: 27 29 FIELD Command or Mask Conditional Lock Codes Lock Unconditional COMPARE CMD or MASK LOCK COND CODES LOC LCK UNCOND LCK Silo Lock Interrupt Enable Compare Silo Lock CMP SILO LOCK 31 CMP 9.6.6 SBI MAINTENANCE REGISTER (SBIMT) The SBI Maintenance register allows error conditions to diagnostic purposes. be forced for Privileged VAX-11/780 Registers SPECIFIC REGISTERS 33222 2 19987 32140 tmt -t 2 4e e IPIWI|U|M]| |0 IRIN|L|] | 2 MAINT 2 ITIX|T]| -- Rev 5.2 11111111 it e e T |FIFIFIFIDIP|IGIG|T] REV IVIT| I IGIGIRIRISI1IL|O]T| tg111al11Bl | | [IM] i HE e e e R R R R R R RRRR 00O O O 0 O 0O0OO0O0 F OUT I MBZ | | U 0O @:77 Y] it i STS R R Page 76543210987 ITIE] ID|N|N| +—t—t—t - —t- B 13-May-81 Y MBZ 8 TIM TIME 9 G0 G@# MAT 10 Gl Gl MAT 11 P1 REV 12 DSB DSBL SBI Pl SBI CYC Force Timeout Group @ Match Group 1 Match Force Pl Disable on Read reversal SBI on SBI Cycles 13 FR1 F Gl REP Force 14 Cache Replacement FRO Group F G@ 1 REP Force Cache 15 Replacement FG1 Group F Gl MISS 0 Force Cache Miss 16 Group FGO 1 MISS F Force 20 :17 Cache REV Miss REV Group 0 CACHE PAR 21 ENT G@ EN SBI INV F FIELD Reverse INV Enable 22 INV 27:23 MAINT 28 MLT MLT 29 UNX UNEX 30 31 WRT P@ WRT F SEQ P@ REV SBI 9.6.7 SBI SBI 1ID ERROR F F Force Cache SBI SBI Parity Write Invalidate Maintenance ID and Comparator as SILO - to XMIT Force Multiple RD Force Unexpected Force Force Write Sequence P# Reversal on REGISTER Field Invalidate (SBIER) force Transmitter Read Data Fault SBI to Cache faults Fault Fault 9-21 Privileged Registers VAX-11/780 SPECIFIC REGISTERS Page 9-22 13-May-81 -- Rev 5.2 1111111 3 65432193 987654321790 1 —— t—t—-F+-+—-F-——--F+-+-+-+-+-——+-+-+-+-+ o | | I |cicIrlcicp IMIcCITIIlIB |TIIMITI (M| ITIRIDIPITIMIBIEIR|B|ITIM|E|LIN|B] IEIDIS| louTlzicl | louTiclTIBlZ]| MBZ e -4+ —-+-F-4+-——-F+-+-+-+-+--—F+-+-+-+-+ W WWRR cccoo MBZ Y 1 2 INB MLT 5:4 IB 5 IB IEC 3 INT NOT BSY SBT MLT CP ERR IB SBI CNF ERR TIM IR MBZ 9 11:19 Cp TIM IB RDS CP TIME OUT 15 CIE 31:16 MBZ 9.6.8 SBI SBI Interface Not Busy Multiple CP Error Error Confirmation STATUS OUT Error Confirmation STATUS Read Data Substitute set whenever returned to RDS 1is CPU. CRD (Corrected Read Data) CRD 14 RRR 00O OUT CP TIME OUT RDS 13 TIME OUT CP 12 TIME IB CP SBI CNF ERR CEC 8 R o OUT IR 7 RWW occ is CRD INT EN RDS TIMEOUT ADDRESS set whenever CRD returned to is CPU. CRD/RDS Interrupt Enable (SBITA) This register is a holding register for the Physical Address sent on the SBI. When a timeout occurs on the SBI, this register will latch up with the physical address of the timeout. It 1is reset by clearing bit 12 of the SBI error register. Privileged VAX-11/78@ 332 22 1 8 49 Registers SPECIFIC REGISTERS 13-May-81 -- Rev 5.2 Page 7 Y -tt IMIMIP| t+ | 111a1c|a] PHYSICAL ADDRESS | <29: 2> e e e e READ 27:0 PHYSICAL 28 Y 29 30 PC M@ 31 M1 9.6.9 SBI ADDRESS NO PROT CLEAR + ONLY <29:2> CHK Protection checked Mode @ reference Mode QUAD | 1 reference. reference (SBIQC) 332 1 9 9 Y Fe e IMBZ | Fom PHYSTICAL e S N QUADWORD ADDRESS | —— + MBZ | S SR + WRITE ONLY 9-23 Privileged Registers VAX-11/750 9.7 SPECIFIC REGISTERS VAX-11/750 SPECIFIC REGISTERS Mne- monic Register Name Number Type Scope Init? R R/W R R/W W CPU CPU CPU CPU CPU yes yes -ves - R/W R/W W R/W CPU CPU CPU CpU -= --- Console Storage Transmit Data CSTD 23 28 29 30 31 Cache Error Accelerator Control/Status Initialize UNIBUS Translation Buffer Data CAER ACCS IORESET TBDATA 39 49 55 59 CMIERR CMI Error Register Console Storage Receiver Status CSRS CSRD Console Storage Receiver Data Console Storage Transmit Status CSTS TBDR CADR MCESR Translation Buffer Disable Cache Disable Machine Check Error Summary 9.7.1 Page 9-24 13-May-81 -- Rev 5.2 CMI Error 36 37 38 Register 321 5 5 109 1 111 11 2 21 3 | 4 sMmR 1 | ©® | | TBGPR | @ 5 4 3 8 7 e f-tm—————— e -t - s | -= -= -- CPU CPU CPU R/W R/W R/W @ | | BER + | o e bt ————— - -t e -t + @:3 BER Y Error Bus Corrected Data Lost 1 Error Error 4 TBHIT Uncorrectable Data Error Non-exXxistent memory TB hit on last reference 11:8 TBGPR TB 2 3 8 9 10 11 12 18:16 17:16 18 20 RLTO SMR TB TB TB TB Group Error Group @ Data error Group 1 Data Error Group @ Tag Error Group 1 Tag error Read Lock Timeout Saved Mode Register Processor access mode for last reference Virtual=@, CMIDIS Disable CMI Physical=l references Privileged Registers VAX-11/750 SPECIFIC 9.7.2 The Console VAX-11/750 registers that terminal. The console 13-May-81 REGISTERS Storage Device accesses are the terminal Rev 5.2 Page console of storage from these registers. device those through used registers to is four access similar internal the to console that 3 1 8 o 76 5 @ R e R | | e + MBZ | IDIT] MBZ I | |0 |E | IN | P I RT+ Console Storage Receive Status R R O W (CSRS) 3 1 8 P I 7 Y R 0 iT+ | DATA | Pe __ B T + (read Console Storage only) Receive Data Buffer (CSRD) 3 1 8 7 6 5 1 ¢ oe _ Fotop e +-+ | | IRIT ] MB?Z l IDI|E | Y| o | |B| MBZ IR | IK | t—t—t——m——_— +-+ Console Storage Transmit Status R R W O W 0 (CSTS) 3 1 P 8 e | Y (write Storage 7 @ U+ oe Console 9-25 Registers distinct architecture -- l DATA R et only) Transmit Data Buffer (CSTD) | T pp—— + of the Privileged Registers VAX-11/75¢ SPECIFIC 9.7.3 REGISTERS Page 9-26 13-May-81 -- Rev 5.2 Translation Buffer Group Disable Register (TBDR) 3 4 3219 1 — o - —— - +-+-+-+-+ e (I O % \ s — oo oo +-t+—+-4-+ m e m e —— e @ 1 Force Miss Group Force Miss Group 1 3 # = Random replacement, 1 = Force replacement if {<3> EOL 1} then this bit selects group to be replaced 2 9.7.4 Cache Disable Register (CADR) 19 3 1 oo +-+ —— e I MB?7, | —— = — o= - oo e +-+ eDisable cache 4] 9.7.5 Machine Check Error Summary Register (MCESR) 3 4 32190 1 oo — oo +-+-+-+-+ me —e— oe L1l | 0 | +-+ +-+-4+oo oo o= o — e — e 4 Reference was through prefetch logic 3 Bus 2 9.7.6 TB parity error error Cache Error Register (CAER) Privileged Registers VAX-11/75@0 SPECIFIC 13-May-81 REGISTERS -- Rev 5.2 Page 9-27 3 1 4 32109 Pe __ +-+—+-+-+ | Y P e e O N +-+-+-+-+ g Cache hit 1 Lost error 2 Cache 3 data Cache Tag 9.7.7 I e Accelerator parity parity error error Control/Status Register The accelerator control and status register subset of the ACCS on the VAX-11/780. 3 on the VAX-11/750 is a 111 1 6 Fr 5 4 8 7 4 ot R e | | |E | MBZ I Fom IN | MB2Z |BI e I | + | TYPE I | e e T Fomm e W I + RO 0 <7:0> TYPE <15> ENB ACCS<15> 1 to read always ACCSK15> as 9.7.8 @ = no 1 = Floating accelerator Point or disabled Accelerator Numbers in the range Numbers 2-127 in the range Enable 128-255 FPA. reads and as then 0. To read 0. 1Initialize UNIBUS determine ACCSK< 2>. If are if (FPA) reserved are to DIGITAL. reserved to CSS/customers. an FPA is present, there is no FPA, write ACCS<O> (IORESET) 3 1 1 o | P <@> MB?Z e e 0 +-+ || +-+ Initialize Unibus a will Privileged Registers VAX-11/75@ SPECIFIC REGISTERS 9.7.9 13-May-81 -- Rev 5.2 Translation Buffer Data Register Page 9-28 (TBDATA) and write locations in This internal processor register is used to read page table entry for the the r, registe this to MFPR a On TB. the tion. On a virtual address in P@BR is read from the TB into the destina table entry page MTPR, the source operand is written into the TB as theMTPR/MF PR on the an of results The P@BR. in address virtual for the register are UNPREDICTABLE if memory management is enabled. CHAPTER 10 PDP-11 COMPATIBILITY MODE 23-March-81 10.1 -- Rev 5.2 INTRODUCTION VAX compatibility mode software environment excludes mode provided the hardware, executive to following user features Privileged 2. Special 3. Access switch to internal register). 4. Direct access to trap 5. Direct access to I/0 6. Interrupt 7. Stack 8. Alternate 9. Any 1. of instructions instructions normal such such as processor and as with VAX a PDP-11. PDP-11 HALT traps emulate This the environment RESET. WAIT. registers interrupt compatibility can operation: and and a mode), (e.g., PSW and console vectors. devices. protection. general processor are not point This mode register other supported) than user (i.e., separate I Kernel and D and Supervisor spaces. instructions. 1is based on Compatibility UNPREDICTABLE there where sets. and specification implementations. implementations, on in servicing. overflow Floating conjunction runs programs 1. modes in (which 1is a the mode behavior behavior difference between of all is defined any two PDP-11 as PDP-11 PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 COMPATIBILITY MODE USER ENVIRONMENT 10.2 COMPATIBILITY MODE USER ENVIRONMENT 14.2.1 General Registers And Addressing Modes Page 10-2 provided in All of the PDP-11 general registers and addressing modes are tion address destina a by caused effects 5ide compatibility mode. and JSR), in (except values source on effect no have tion calcula , However PC. new the affect not do auto-increment modes in JMP and JSR the affect might tion calcula address source a side effects caused by All value of a register wused for destination address calculation. 16-bit @ mode, bility In compati PDP-11 addresses are 16 bits wide. PDP-11 address is zero-extended to 32 bits. In register mode addressing, the operand is the contents of register n: operand = Rn low order Byte operations, except for MOVB to a register, accessd 1fthea regist er is is sign-extende byte, i.e. bits <7:8>. The low byte the as used is PC the If ction. instru used as the destination of a MOVB destination of a byte instruction, the result is UNPREDICTABLE. The assembler notation for register mode 1is Rn. 1¢.2.1.2 Register Deferred Mode - The addressing format for register deferred mode is: In register deferred mode addressing, the address of the operand is contents register of OA = n: Rn operand = (OA) the PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT The assembler 16.2.1.3 The notation Autoincrement addressing format If Rn is termed In autoincrement for of of the mode operand of in replaced register is incremented OA = Rn if n LEQ operand assembler mode the which follows 16.2.1.4 termed In autoincrement the contents denotes PC, a absolute and address operand byte; in result,. and Rn <- Rn for + of the or 10-3 @Rn. word) case of Rn else Rn is SP Rn + mode 1is added the and PC), or by the to SP replaced <- the determined, denotes is and operand is for register size the address 2 If the autoincrement kconstant Deferred mode where for 16-bit Mode the and the PC, the the result. 2 address deferred a address the mode word is register deferred follows addressing, whose is (Rn) +. constant For is the mode is: 1immediate immediate data - autoincrement mode. of operand n, (Rn) instruction, the (except 2 the instruction. format Rn is Page is: the for by is Autoincrement is the (1 the mode follows bytes n mode 5.2 (0A) notation the data After by then = If register 5 notation addressing After autoincrement n. register is deferred Rev - addressing, register register The Mode PC, immediate immediate mode. contents The register denotes contents size for -- address instruction, the address is determined, 2 is by replaced the the is added the of contents to result. the and the mode the operand is of register n, contents of PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 COMPATIBILITY MODE USER ENVIRONMENT OA = (Rn) Rn <- Rn operand + Page 1¢-4 2 (OA) = For mode is @(Rn)+. The assembler notation for autoincrement deferred which word the is s absolute mode the notation is @#address where addres follows the 10.2.1.5 instruction. Autodecrement Mode - The addressing format for autodecrement mode 1is: of the operand in bytes (1 In autodecrement mode addressing, the sizefrom the contents of register n 2 for word) is subtracted for byte; ter 1is replaced by the regis the (except in the case of SP and pCc), and is decremented by 2 and ter regis the PC, or If Rn denotes SP result. nts of the register is replaced by the result. The updated conte register n is the address of the operand: if n LEQ 5 then Rn <- Rn - size else Rn <- Rn - 2 OA = Rn operand = (OA) The assembler notation for autodecrement mode is - (Rn). 1¢.2.1.6 Autodecrement Deferred Mode - The addressing format for autodecrement deferred mode 1is: is subtracted from the In autodecrement deferred mode addressing,is 2repla ced by the result. The ter contents of register n, and the isregis the word whose contents of ss addre the updated contents of register n is the address of the operand: PDP-11 Compatibility COMPATIBILITY USER 2 Rn <- Rn OA = (Rn) operand The assembler 10.2.1.7 The - = addressing 23-March-81 -- ENVIRONMENT Rev 5.2 Page 10-5 (0A) notation 1Index 5 Mode MODE Mode autodecrement deferred mode of is @-(Rn) - format 32 for for index mode is: Y] e +-——— + | 6 | Rn | oo+ In index mode, instruction) address of the OA = In updated contents of the operand: PC, the relative assembler the 1Index format is a word OA = (Rn mode, whose + = index is used, mode 1s index(Rn), instruction. deferred index the PC following The result and where the is the the the mode index - index the to mode (contents contents contents index) (OA) the Mode for added of operand for following Deferred deferred instruction) mode. notation word addressing address n. (0A) denotes index word register = 1.2.1.8 The the of operand termed is contents index Rn (contents the to + is value index added Rn If The the is is the of is: of the register address of word following the result the n. The the operand: is PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 COMPATIBILITY MODE USER ENVIRONMENT Page 10-6 the mode mode is @index (Rn), where The assembler notation for index deferred instruction. the 1f Rn denotes PC, the updated contents of the PC is used, and is termed relative deferred mode. index value is the word following the 19.2.2 The Stack in as the stack pointer byused certa General register R6 1s wused the by er, howev not, is 1t 1, instructions, as in the PDP-1 . There 1is also no stack hardware for any exceptions or interrupts mode. overflow protection 1in compatibility 19.2.3 Processor Status Word t of the full PDP-11 PDP-11 compatibility mode uses a subsetibil ity mode PSW is: Status Word. The format of the compa 1 fomm g Processor 54321090 5 ? i s 2 R ITINIZIVIC] fmmm e t—t—t—+-+—-+ n is executed, bits 15 through 5 When an RTI or RTT instructio ignored. saved PSW on the stack are in the PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIR ONMENT 13.2.4 Table -- Rev 5.2 Page Instructions 1#.1 lists the instructions provided TABLE Compatibility 000002 RTI NOBAB6 RTT @021DD JMP POO20R RTS p00240-000277 Condition @@3@3DD SWAB PQO0ARD-003777 g@4RDD Branches JSR .250DD CLR (B) COM (B) INC (B) .953DD DEC (B) .254DD NEG (B) .255DD ADC (B) .356DD SBC (B) .957ss .360DD TST (B) ROR (B) .361DD ROL (B) .262DD ASR (B) .¥63DD ASL (B) #B365SS MFPI * @@66DD MTPI * 1365Ss MFPD* 1066DD MTPD* P@67DD SXT @70RSS MUL @71RSS DIV @72RSS ASH @73RSS ASHC @74RDD XOR @77RNN SOB .1SSDD MOV (B) . 25S8SS CMP (B) BIT (B) . 35SS8S .4SSDD = source DD = destination @ for BIC (B) . 5SSDD BIS (B) @6SSDD 165SDD ADD SUB specifier SS = codes Branches 100000-103777 .251DD .252DD register Instructions Mnemonic (octal) = compatibility 14,1 Mode Opcode R in operand word specifier operand operations specifier and 1 for byte operations mode. 10-7 Page 10-8 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT a PDP-11 in user * These instructions execute exactly as they would on More specifically, overmapped. mode with Instruction and Data space and act 1like level s acces ous previ the they ignore instructions referencing the current stack. PUSH and POP cause the machine to fault Table 10.2 lists the trap instructions thattrap may be serviced, or where to VAX mode, where either the complete the instruction may be simulated. TABLE 10.2 Compatibility Mode Trap Instructions Opcode Mnemonic gooa9N3 ppe204 BPT 10T 104400-104777 TRAP (octal) 1040300-104377 EMT and all other opcodes not 1listed The instructions listed in Table 1@.3 dered reserved instructions in consi are in Tables 16.1 or 1#.2 mode. See Section 10.5. compatibility mode, and fault to VAX TABLE 10.3 Compatibility Mode Reserved Instructions Opcode Mnemonic PoCa0d goen0l 000035 Peaee7 g@@323N HALT WAIT RESET MFPT SPL MARK CSM (octal) g364ANN @Q7dDD @7580R @7501R A@T7502R @7503R FADD--FIS FSUB--FIS FMUL--FIS FDIV--FIS 1364SS MTPS B76XXX 1367DD 17XXXX Note that no floating point mode. instr Extended Instructions MFPS FP11 Floating Point are included 1in compatibility PDP-11 Compatibility COMPATIBILITY 10.2.4.1 MODE Single Arithmetic and Mode USER 23-March-81 ENVIRONMENT Operand Instructions - Logical: CLR DEC INC CLRB NEG DECB TST INCB COM NEGB TSTB COMB Shifts: ASR ASL ASRB ASLB Multiprecision: ADC SBC ADCB SBCB SXT Rotates: ROL ROR ROLB RORB SWAB Page 1¢-9 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT CLR Clear Format: 1 4 6 5 5 eo Opcode l | me+ dst.wx e bomm | e+ Operation: dst Condition <- 0; Codes: N <- 0; 7 V <<- 1; 0; C <~ 0; Exceptions: none Opcodes (octal): gas59 1059 CLR CLRB Clear Word Clear Byte Description: The destination operand is replaced by zero. Page 10-10 PDP-11 Compatibility COMPATIBILITY MODE DEC Mode USER 23-March-81 ENVIRONMENT -. Rev 5.2 Page 19-11 Decrement Format: 1 5 5 R et T | 5 ) .R+ Opcode | dst.mx tom e o | + Operation: dst A< NN 2 Condition <- dst - 1; Codes: <- dst LSS @; <{- dst EQL g; <- {integer <- C; overflow}; Exceptions: none Opcodes (octal): 2053 DEC 1953 Decrement Word DECB Decrement Byte Description: One is subtracted operand is from replaced by the the destination operand and result. the destination is decremented. Note: Integer On overflow overflow, integer. the occurs if the destination largest operand is negative replaced integer by the largest positive 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Page 10-12 Increment INC Format: 1 ) 5 5 5 —— + e e o Opcode | | dst.mx eo l ———— + Operation: dst Condition <- dst + 1; Codes: dst N <- 7 <- dst C <= LSS @; EQL #; Vv <- {integer overflow}; C; Exceptions: none Opcodes (octal): g@52 1952 INC INCB Increment Word Increment Byte Description: One is added to the destination operand and the destination replaced by the operand is result. Note: r is incremented. Integer overflow occurs if the largest positive intege the largest negative On overflow, the destination operand is replaced by integer. PDP-11 Compatibility COMPATIBILITY MODE NEG Mode USER 23-March-81 -- Rev 5.2 complement) and ENVIRONMENT Page 10-13 Negate Format: 1 5 6 Fm 5 J o | Opcode | ———— + dst.mx I it Fom——————— + Operation: dst Condition <- -dst; Codes: N <- dst LSS ¢; Z <- dst EQL @; V <- dst EQL most C <- dst NEQ @; negative integer; Exceptions: none Opcodes (octal): P@54 NEG Negate 1854 Word NEGB Negate Byte Description: The destination operand is operand replaced by is negated the result. (2's the destination Note: Integer overflow occurs (which has operand positive is no replaced by if the operand counterpart). itself. 1is the On most negative overflow, the integer destination 23-March-81 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT —— Page Rev 14-14 Test TST Format: 1 Opcode | + ______________ ) 5 5 5 + ______________ ————— e | ————+ src.rx | ——— -+ ————— b Operation: - src @; src LSS @; <~ src EQL J; 2; ! <N NN 2 Condition Codes: <- @; Exceptions: none Opcodes (octal): pa57 TST Test Word 1057 TSTB Test Byte Description: The condition codes are affected according to the value operand. of the source PDP-11 Compatibility COMPATIBILITY MODE COM Mode USER 23-March-81 ENVIRONMENT -- Rev 5.2 Page 1¢-15 Complement Format: 1 5 6 Fo | 5 Y e ——_—— + Opcode | R e T Fmm dst.mx | + Operation: dst Condition <- NOT dst; Codes: N <- dst LSS 0; Z <- dst EQL ¢; V <- @; C K- 1; Exceptions: none Opcodes (octal): @851 COM 1851 Complement Word COMB Complement Byte Description: The destination destination operand operand is is replaced complemented by the (1's result. complement) and the Page 10-16 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Arithmetic Shift Right ASR Format: 1 Y 6 5 5 fomm e fom - + Opcode I fmm | fom dst.mx | e ———— + Operation: dst <- dst shifted one place to the right; O<TMN Z Condition Codes: <- dst LSS 0; <- dst EQL 0; <- bit shifted <- {bit shifted out} XOR {dst LSS 0}; out; Exceptions: none Opcodes (octal): 052 1062 ASR ASRB Arithmetic Shift Right Word Arithmetic Shift Right Byte Description: The destination operand is arithmetically shifted right by one the destination operand is replaced by the result. bit and Notes: 1. The sign bit of the destination operand is replicated in shifts to the right. The condition code C bit stores the bit shifted out. 2. 1f the PC is used as the destination operand, the the next instruction executed are UNPREDICTABLE. result and PDP-11 Compatibility COMPATIBILITY MODE ASL Mode USER 23-March-81 -- ENVIRONMENT Arithmetic Shift Rev 5.2 Page 10-17 Left Format: 1 5 6 5 ) eo | Opcode | + dst.mx te— e e | + Operation: dst dst shifted one place to the left; =2 Codes: <{- dst LSS ¢; AN Condition <- <- dst EQL @; <- {integer <- bit overflow}; shifted out; Exceptions: none Opcodes (octal): 7063 ASL 1063 Arithmetic ASLB Shift Arithmetic Left Word Shift Left Byte Description: The the destination destination operand is operand arithmetically is replaced by the shifted left by one zero in shifts result. bit and to the Notes: l. The least left. 2. Integer the The significant bit is condition code C overflow shift,. occurs if filled bit the with stores the destination bit shifted changes sign out. due to 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode Page 10-18 COMPATIBILITY MODE USER ENVIRONMENT Add ADC Carry Format: 1 4] 6 5 5 fr e b + Opcode | | dst.mx | -+ — -o o Operation: dst NN 2 Condition <- dst + C; Codes: <{- dst LSS @; <- dst EQL @; <- {integer overflow}; <- {carry from most significant bit}; Exceptions: none Opcodes (octal): @es55 10355 ADC ADCB Add Carry to Word Add Carry to Byte Description: added to the destination The contents of the condition code C bit are ed by the result. operand and the destination operand is replac Note: Integer overflow occurs if the most positive integer is incremented. overflow, the result is the most negative integer. On PDP-11 Compatibility COMPATIBILITY MODE SBC Mode USER 23-March-81 -- Rev 5.2 Page 10-19 ENVIRONMENT Subtract Carry Format: 1 5 6 5 @ oe+ | Opcode | dst.mx | oe+ Operation: dst NN 2 Condition <- dst - C; Codes: <{- dst LSS @; {- dst EQL 4; <<- {integer overflow}; {borrow into most significant bit}; Exceptions: none Opcodes (octal): @356 SBC Subtract Carry 1356 from SBCB Word Subtract Carry from Byte Description: The contents destination of the operand condition and code C bit destination the result. are subtracted from operand 1is replaced by the the Note: Integer overflow overflow, the occurs result is if the the most most negative positive integer integer. is decremented. On 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE Sign SXT Page 10-20 USER ENVIRONMENT Word Extend Format: 1 | 4] 5 65 5 et pmmm———————— + et Opcode | TD dst.ww | + Operation: if N EQOL Condition 1 then dst <- -1 else dst <- 0; Codes: N <- dst dst 7 <- VvV <- @; C <= C; LSS EQL #; 0; SXT Sign IN <- N Exceptions: none Opcodes (octal): pa67 Extend Description: If the condition code N bit is set then the destination operand replaced by -1; otherwise the destination operand is cleared. Iis Note: If the PC is used as the destination operand, the results and instruction executed are UNPREDICTABLE. the next PDP-11 Compatibility COMPATIBILITY MODE ROL Mode USER Rotate 23-March-81 -- Rev ENVIRONMENT 5.2 Page 1¢-21 Left Format: 1 5 6 R | 5 A Te —+ Opcode i | dst.mx | To+ Operation: dst'C Condition <- dst'C rotated left; aO<LN 2 Codes: <{- dst LSS @; {- dst EQL @; <<- {integer overflow}; {bit rotated out of dst}; Exceptions: none Opcodes (octal): g6l ROL Rotate 1961 Left Word ROLB Rotate Left Byte Description: The one condition bit code C position; destination operand, shifted 1left by significant bit. bit and 1i.e. the one the the C destination bit gets destination bit with the is the operand most replaced initial are rotated significant ¢ by bit the left by of the bit destination filling the least Notes: 1. 2. The rotate the condition Integer the instructions code overflow rotate, C bit occurs operate taken if the on as the a destination circular destination operand and datum. changes sign due to 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT ROR Rotate Page 10-22 Right Format: 1 4 5 6 5 o pom e + | Opcode | dst.mx | e pmmm———————— + Operation: dst'C Condition dst'C <- rotated right; Codes: N <- dst LSS 0; 7 <- dst EQL @; V <- {C bit changed due to rotate}; C <- {bit rotated out of dst}; Exceptions: none Opcodes (octal): ROR RORB 0p60 1060 Rotate Right Word Rotate Right Byte Description: The condition code C bit and the destination operand are rotated right 1i.e. the C bit gets the least significant bit of by one bit position; the destination operand, the destination is replaced by the destination initial C bit filling the most shifted right by one bit with the significant bit. Note: The rotate instructions operate on the destination condition code C bit taken as a circular datum. operand and the PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT SWAB Swap -- Rev 5.2 Page 14-23 Bytes Format: 1 5 6 5 2 R p—— e + | Opcode | - dst.mw tom | + Operation: dst Condition <- dst<7:0>'dst<15:8>; Codes: N <- dst<7:0> LSS ¢; Z <- dst<7:0> EQL g; V <- @; C <- 02; Exceptions: none Opcodes (octal): PoA3 SWAB Swap Bytes Description: The high and low bytes used as the executed are of the destination word operand are swapped. Note: If the PC is instruction destination operand, UNPREDICTABLE. the result and the next PDP-11 Compatibility Mode Page 23-March-81 -- Rev 5.2 1(-24 COMPATIBILITY MODE USER ENVIRONMENT Double Operand Instructions - 19.2.4.2 Arithmetic and Logical: ADD MOV MOVB SUB CMP CMPB MUL DIV XOR BIS BISB BIC BIT BICB BITB Shift: ASH ASHC d specifier 1in If a register that 1is wused 1in the source operan destination (or the in used also is modes t autoincrement or autodecremen er 1is used regist the source 2) operand specifier, the updated value of by a caused ts to evaluate the destination specifier. Side effec destination address calculation have no effect on source values. PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT MOV -- Rev Page 5.2 10-25 Move Format: 1 11 5 2 1 6 oR |Opcode 5 o —— e + | src.rx | dst.wx fom———— o eo ——— + Operation: dst Condition <- src; Codes: N <- dst LSS @; Z <- dst EQL @; V <- @; C <- C; Exceptions: none Opcodes (octal): g1 MOV Move Word 11 MOVB Move Byte operand is Description: The destination replaced by the MOVB to source operand. Note: The low of the operand. byte is sign-extended destination register on a are a replaced register;i.e. by bit <7> bits of the <15:8> source 23-March-81 PDP-11 Compatibility Mode -~ Rev 5.7 Page 10-26 COMPATIBILITY MODE USER ENVIRONMENT Add ADD Format: 1 11 5 2 d 5 6 1 —— + Fmm———— b b src.rw | |Opcode | dst.mw l fom———— fomm i + Operation: dst Condition N Z <- dst + src; Codes: <- <- dst LSS §; dst EQL @; Vv <- {integer overflow}; Cc <- {carry from most significant digit}; Exceptions: none Opcodes (octal): 06 Add Word ADD Description: The source operand 1is added to the destination destination operand is replaced by the result. operand and the Note: Integer overflow occurs if the input operands have the same sign and the is result has the opposite sign. On overflow, the destination operand replaced by the low order bits of the true result. PDP-11 Compatibility COMPATIBILITY MODE SUB Mode USER 23-March-81 -- ENVIRONMENT Rev 5.2 Page 10-27 Subtract Format: 1 11 5 21 pmm 6 5 Y oo T T |Opcode | src.rw | + dst.mw tom—— T R I + Operation: dst dst - src; b Codes: <{- dst LSS @; Q<N Condition <- {- dst EQL 0; <<- {integer overflow}; {borrow into most significant digit}; Exceptions: none Opcodes (octal): 156 SUB Subtract Word Description: The source destination operand is operand subtracted is replaced from by the the destination operand result. and the signs and Note: Integer the overflow result operand is has occurs if the the sign of the low replaced by input the operands source. order bits are On of of different overflow, the true the result, destination 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Page 10-28 Compare CMP Format: 11 1 ? 6 5 21 5 m+ e ————— fom—————— fmm - fomm srcl.rx | |opcode | src2.rx | to————— e fommm——————— + Operation: tmp <- - src2; Codes: NN 2 Condition srcl <- tmp LSS 0; <- tmp EQL @; <- {integer overflow}; <- {borrow into most significant digit}; Exceptions: none Opcodes (octal): 22 12 CMP CMPB Compare Word Compare Byte Description: The source 1 operand is compared with the source 2 action is to set the condition codes. operand. The only Note: the Integer overflow occurs if the operands are of different sign theandsource as sign same the has src2) result of the subtraction (srcl 2 operand. PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMEN T MUL -- Rev 5.2 Page 1¢-29 The most Multiply Format: 1 5 9 8 6 5 Fom e +o— ) — Fmm I Opcode | reg Fom e R e | —— + src.rw I LR + Operation: tmp<31:0> Rn <- R{n Condition <~ Rn * src; tmp<31:16>; OR 1] <- tmp<l5:0>; <{- tmp LSS ¢ W {- tmp EQL @ e NN Z2 Codes: <- 0; <- {result unrepresentable in 16 bits}; Exceptions: none Opcodes (octal): 270 MUL Multiply Word Description: The destination significant Then the least condition register 16 codes bits is of significant are set multiplied the 32-bit 16 bits based on by are the the product source are stored 32-bit operand. stored in in R[n result. register OR 1]. Rn. The Note: 1. The C bit is set represented -2**15 2. 3. If an in or greater odd numbered order sixteen If or R6 if 16 eXecuted PC and than bits is used the the result bits; or as result the the equal to register are of 1i.e. is stored the are product 2**]15, used as multiplication 32-bit the as the the UNPREDICTABLE. less destination, result. destination, cannot is next the be than low instruction 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Page 10-30 Divide DIV Format: 1 6 5 9 8 5 — - f———— b b Opcode I | reg | ——— src.rw 4] -+ } fom e - o + Operation: tmp <- Rn'Rin OR 1] Rn <- tmp / src; R[n OR 1] <- REM(tmp , src); Condition Codes: N <- Rn LSS 0; 7 <- Rn EQL 0; IUNPREDICTABLE if V is set IUNPREDICTABLE if V is set v <- {src EQL @} OR {integer overflow}; C <- {src EQL 0}; Exceptions: none Opcodes (octal): @71 DIV Divide Description: is the 32-bit integer in Rn'R[n ORand1] the 1f the source operand is not zero, Rn, in d store is ent quoti The divided by the source operand. sign as 1]. The remainder has the same remainder is stored in R[n eOR opera nates termi n uctio instr nd is zero, the the dividend. TIf the sourc without modifying the destination registers. Notes: 1. 2. -2*%%15 or Integer overflow occurs if the quotient is less erthan On integ overflow, the greater than or equal to 2**15, are UNPREDICTABLE. contents of the destination registers the destination, the If an odd register or R6 is used as PC is used as results are UNPREDICTABLE. Furthermore, if R6 or execu is ted the destination, UNPREDICTABLE. the next instruction PDP-11 Compatibility COMPATIBILITY MODE XOR Mode 23-March-81 ENVIRONMENT USER Exclusive -- Rev 5.2 Page 1¢0-31 OR Format: 1 5 9 8 5 5 Y R.e I Opcode | R reg | dst.mw + | S AR i + Operation: dst Condition <- Rn XOR dst; Codes: N <- dst LSS @; Z <- dst EQL 4; V <~ 0; C <~ C; Exceptions: none Opcodes (octal): @74 XOR Exclusive OR Word Description: The source destination register is XORed with operand is replaced by the the destination result. operand and the 23-March-81 PDP-11 Compatibility Mode -—- Rev 5.2 Page 10-32 COMPATIBILITY MODE USER ENVIRONMENT Set Bit BIS Format: 11 1 T @ 6 5 2 1 5 e fom - + src.rx |Opcode | | dst.mx | ——— b + fmm e fom e Operation: dst Condition <- dst OR src; Codes: 7 dst LSS <- dst EQL VvV C <<= N <- #; 8; @; C; Exceptions: none Opcodes (octal): 25 15 Bit Set Word BIS Bit Set Byte BISB Description: The source operand is ORed with the destination destination operand is replaced by the result. operand and the PDP-11 Compatibility COMPATIBILITY MODE BIC Mode USER Bit 23-March-81 ENVIRONMENT -- Rev 5.2 Page 1¢-33 Clear Format: 1 11 5 21 6 Fmm——— T |Opcode | src.rx $om——— R 5 Y TT+ | dst.mx | e Te+ Operation: dst Condition <- dst AND {NOT src}; Codes: N <- dst LSS g; Z <- dst EQL 4; V <- 0; C <- C; Exceptions: none Opcodes (octal): g4 BIC Bit Clear 14 Word BICB Bit Clear Byte operand is Description: The destination operand and the destination ANDed with operand is the 1l's complement replaced by the of the result. source 23-March-81 -- PDP-11 Compatibility Mode Rev 5.2 Page 10-34 COMPATIBILITY MODE USER ENVIRONMENT Test Bit BIT Format: 11 1 65 5 2 1 5 0 b e pomm |opcode | srcl.rx pom - fomm e | =+ src2.rx l ————— + e mm — fm Operation: tmp <- srcl AND src?; Condition Codes: N <- LSS @; tmp EQL d; tmp 7 <- vV C <- @; <= C; Exceptions: none Opcodes (octal): 23 13 BIT BITB Bit Test Word Bit Test Byte Description: The source 1 operand is ANDed with the action is to set the condition codes. source 2 operand. The only PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT ASH Arithmetic -- Rev 5.2 Page 10-35 Shift Format: 1 5 9 8 6 Fmm e +———— l Opcode | reg 5 o) e+ | Fom e Fmm src.rw | e + Operation: Rn Condition <- Rn shifted src<5:0> bits; NN 2 Codes: <- Rn LSS ¢; <- Rn EQL &; <- 1f src<5:0> <- EQL 1if @ src<5:0> then 8 else EQL @ then {integer @ else {last overflow}; bit shifted out}; Exceptions: none Opcodes (octal): 972 ASH Arithmetic Shift Description: The specified register is arithmetically shifted by the number of bits count operand (bits <5:0> of the source operand) and the register is replaced by the result. The count ranges from -32 to +31. A negative count signifies a right shift. A positive count specified by the signifies a codes affected. are left shift. A zero Rn is count implies no shift; but condition Notes: 1. The sign least left. 2. of bit 1is stores the overflow occurs on sign C position register. 3. If the next replicated bit The Integer the bit significant PC is used instruction as last a differs the executed in filled bit left to the with zero in shifted shift from destination are shifts the if out. any bit initial operand UNPREDICTABLE. right. shifts the The to shifted sign bit result the into of the and the 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Page 10-36 Arithmetic Shift Combined ASHC Format: 1 ) 6 5 9 8 5 fom e e fom e + Opcode l src.rw | reg | | ———— + emm fmm e f————- fo Operation: tmp <- Rn'Rn OR 1]; tmp <- tmp shifted src<5:%> bits; <- tmp<31l:16>; Rn R[n OR 1] <- tmp<1l5: 8>; Condition Codes: N <- tmp LSS 0; tmp EQL @; {integer overflow}; V <- if src<5:0> EQL @ then 0 else {last bit shifted out}; else 0 then 8 EQL 0¢> src<5: C <- if 7 <- Exceptions: none Opcodes (octal): ASHC a73 Arithmetic Shift Combined Description: 1] Rn, and the register R{n OR of The contents of the specified register, r numbe the by ed e 32-bit operand and are shift are treated as a singlcount e operand) operand (bits <5:0> of the , sourc the by fied bits speci <31:16> of bits First t. resul the by and the registers are replaced result the <15:8> of register Rn. Then, bits the result are storedterin R[n A +31. to -32 from s range OR 1]. The count are stored in regis a fies signi count ive posit A . shift negative count signifies a right are codes ; but condition left shift. A zero count implies no shiftthe 32-bit result. affected. Notes: 1. 2. Condition codes are always set on The right. The sign bit of Rn is replicated in shifts to the shift s to the least significant bit 1is filled with zero in 1eft. The C bit stores the last bit shifted out. 32-bit operand. if any bit shifted into Integer overflow occurs on a left shift initial sign bit of the the from rs diffe ion posit the sign PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT 3. TIf and the the SP or next PC is used instruction as the -- Rev destination executed are 5.2 operand, UNPREDICTABLE. Page 1¢-37 the result PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 Page 10-38 COMPATIBILITY MODE USER ENVIRONMENT 16.2.4.3 BR Branch BNE BEQ Instructions - BPL BMI BVC BVS BCC BCS BGE BLT BGT BLE BHI BHIS BLOS BLO SOB PDP-11 Compatibility COMPATIBILITY MODE BR Mode USER 23-March-81 ENVIRONMENT -- Rev 5.2 Page 1¢-39 Branch Format: 1 5 8 7 A eTo | Opcode | displ.bb tomm e tm— e + | + Operation: PC Condition <~ PC + SEXT (2*displ); Codes: N <- Z <- 7; V <- V; C <- C; N; Exceptions: none Opcodes (octal): 0oa4 BR Branch Description: Twice the replaced sign-extended by the result. displacement is added to the PC and the PC s 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT (condition) Branch on B Page 10-49 Format: 1 @ 8 7 5 —— — e + e Opcode l | displ.bb l o=- o= + Operation: if condition then PC <- PC + SEXT (2*displ); Condition Codes: N; N <- 7 <= Z; V <~ V; C <= C; Exceptions: none Opcodes Condition (octal): Branch on Equal Branch Not Equal Branch on Minus Branch on Plus Branch on Carry Set, gol4 3010 1004 1009 1034 BEQ BNE BMI BPL BCS, Z EQL 1 Z EQL 0 N EQL 1 N EQL @ C EQL 1 1039 BCC, C EQL ¢ 1924 1020 2024 BVS BVC BLT Branch on Overflow Set V EQL 1 Branch on Overflow Clear vV EQL 0 h on Less Than Branc 1 EQL V} XOR {N 3934 BLE P20 RLO BHIS BGE Branch on Lower Branch on Carry Clear, Branch on Higher or Same {N XOR V} EQL @ Branch on Greater Than or Zqual 0030 BGT {z OR {N XOR v}l Branch on Less Than or Equal EQL 1 V}} XOR {N {z OR 1010 BHI {C OR Z} EQL @ 1014 BLOS EQL 0 {c OR Z} EQL 1 Description: Branch on Greater Than Branch on Higher Branch on Lower or Same and if the condition indicated byto the The condition codes are tested signthe extended displacement is added instruction is met, twice the result. pCc and the PC is replaced by the PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT SOB Subtract One and -- Rev 5.2 Page 10-41 Branch Format: 1 5 9 8 6 5 4} eS R o + | Opcode | tmm e S reg | displ.bs | To+ Operation: Rn <- Rn if Rn NEQ Condition - 1; @ then PC <- PC - ZEXT (2*displ); Codes: N <- N; Z <- 7; V <-V; C K- C; Exceptions: none Opcodes (octal): a77 SOB Subtract One and Branch Description: One is subtracted replaced by the zero-extended replaced from the result. 1If displacement by the result. If the PC specified the is register register subtracted is not from and the equal the to PC register Zzero, and twice the ©PC is the is Notes: 1. next 2. The the is specified instruction 6-bit as the register, executed are UNPREDICTABLE, displacement instruction. operand 1s the contained in results and the bits <5:8> of PDP-11 Compatibility Mode 23-March-81 -- Rev 5.7 COMPATIBILITY MODE USER ENVIRONMENT 19.2.4.4 JMP Jump And Subroutine Instructions JSR RTS Page 1¢-42 PDP-11 Compatibility COMPATIBILITY MODE JMP Mode USER 23-March-81 ENVIRONMENT -- Rev 5.2 Page 1¢0-43 Jump Format: 1 5 6 - | Opcode 5 g o —————— + | dst.aw | R e o+ Operation: PC Condition <- dst; Codes: N <- Z <- 7; V <~ V; C <= C; N; Exceptions: compatibility Opcodes mode illegal instruction (octal): goo1 JMP Jump Description: The PC is replaced by the destination operand. Note: A compatibility mode @ is used. mode illegal instruction fault occurs if destination 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Page 10-44 Jump to Subroutine JSR Format: 1 fmm 9 8 5 Opcode l ) 6 5 f————= o + | reg | dst.aw l o-o+ Operation: dst; <- tmp -(SP) <- Rnj; Rn <- PC; PC <- tmp; ivalue of Rn affected by dst specifier evaluation Condition Codes: N; N <- 7 <- 17; V <~ V; C - C; Exceptions: compatibility mode illegal instruction Opcodes (octal): Q04 JSR Jump to Subroutine Description: stack and the source register The source register is pushed on the ced by the destination operand. replaced by the PC. The PC is repla Notes: compatibility mode illegal instruction fault occurs is if 1. A 2. as the source in the 1If the destination uses the same register modes, the updated autoincrement or autodecrement addressing . stack the destination mode 6 is used. contents of the register are pushed on PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT RTS Return from Page 1¢-45 Subroutine Format: 1 5 te—————— | 32 J ee Opcode t—————————— | e reg + | __ +m—— + Operation: PC <- Rn; Rn <- (SP)+; Condition Codes: N <- Z <- 7; V <~ V; C - C; N; Exceptions: none Opcodes (octal): 30020 RTS Return from subroutine Description: The PC register is is replaced replaced by by the a word destination popped from register. t he stack. The destination PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 COMPATIBILITY MODE USER ENVIRONMENT 10.2.4.5 RTI Return From Interrupts And Traps RTT Page 10-46 PDP-11 Compatibility COMPATIBILITY MODE Mode USER 23-March-81 -- ENVIRONMENT RTI Return from Interrupt RTT Return from Trap Rev 5.2 Page 10-47 Format: 1 5 Y Fom + | Opcode e l + Operation: PC <- (SP)+; PSW<4:0> a<g<N =z Condition <- {(SP)+}<4:0>; Codes: {- saved PSW<3>; <{- saved PSW<2>; <{- saved PSW<K1>; <{- saved PSW<®>; Exceptions: none Opcodes (octal): Q00302 RTI 003306 Return from RTT Return Interrupt from Trap Description: The PC bits word is of replaced the popped by PSW from the are the first word replaced by the corresponding the RTI and popped stack. from the stack. bits The of the 1low 5 second Notes: l. In compatibility high 2. In 11 bits of mode, the compatibility identical. RTT instructions PSW popped from the stack. mode, the RTI and RTT ignore the instructions are PDP-11 Compatibility Mode COMPATIBILITY MODE 1.2.4.6 MTPI MFPI Miscellaneous SCC MTPD MEFPD CCC 23-March-81 -- Rev 5.2 USER ENVIRONMENT - Page 10-48 PDP-11 Compatibility COMPATIBILITY MODE MTP Mode USER Move To 23-March-81 ENVIRONMENT Previous -- Rev 5.2 Page 10-49 Space Format: 1 5 6 5 @ eS | Opcode | + dst.ww | eo ~+ Operation: dst Condition <- (SP)+; Codes: N <- dst LSS ¢; Z <- dst EQL 0; V <- @; C <= C; Exceptions: none Opcodes (octal): 0066 MTPI Move 1066 To MTPD Previous Move To Previous Instruction Data Space Space Description: In compatibility instruction. the The stack. mode, this destination PDP-11 operand instruction is replaced works by a word 1like a POP popped from Note: The implied specifier. source operand specifier is evaluated before the destination 23-March-81 PDP-11 Compatibility Mode COMPATIBILITY MODE USER ENVIRONMENT Move MFP From Previous -- Rev Page 5.2 10-50 Space Format: 1 @ 5 5 5 eo+ Opcode | | src.rw ee | ———— + Operation: -(SP) Condition <- src; Codes: N <- src LSS @; 7 <- src EQL 0@; VvV <- 0; C <- C; Exceptions: none Opcodes (octal): MFPI MFPD ga65 1355 Move From Previous Instruction Move From Previous Data Space Space Description: In compatibility instruction. mode, this PDP-11 1inst ruction works The source operand is pushed onto the stack. 1like a PUSH PDP-11 Compatibility Mode 23-March-81 COMPATIBILITY MODE USER ENVIRONMENT CcC Condition Code -- Rev 5.2 Page Operators Format: 1 5 5 Fom | 4 e ——— + | mask Opcode Fo Y Fm | o+ Operation: if mask<4> EQL else Condition 1 then PSW<3:0> PSW<3:0> <- <- PSW<3:@> PSW<3:0> OR AND mask<3:0>}; {NOT mask<3:0> Codes: if mask<4> EQL 1 then begin N <- N OR mask<3>; Z <- 7Z OR mask<2>; V <- V OR mask<1l>; C <- C OR mask<@>; end else begin N <- N AND {NOT Z <- Z AND {NOT V <= V AND {NOT mask<3>}; mask<2>}; mask<1>}; C <- C AND {NOT mask<@>}; end Exceptions: none Opcodes (octal): 000249 No operation @g00241 CLC Clear g@3242 C CLV Clear V 00d244 CLZ g@025¢ Clear Z CLN Clear N all ge@257 ccc Clear Pg@3261 SEC Set C V @30262 SEV Set PAAB264 SEZ Set Z AAG270¢ SEN Set N @ga@277 sccC Set all Combinations of the above set or Condition Condition clear Codes Codes operations may be 1¢-51 PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 COMPATIBILITY MODE USER ENVIRONMENT Page 10-52 ORed together to form combined instructions. Description: ORed with I1f the mask<4> bit is set, the PSW condition code bits are If the result., the by d replace are codes on conditi the mask<3:8> and 1's the with ANDed are mask<4> bit is clear, the PSW condition code onbits the by d replace are codes conditi the complement of mask<3:8> and result. PDP-11 Compatibility ENTERING 10.3 AND Mode LEAVING 23-March-81 COMPATIBILITY mode compatibility bits in the is mode PSL entered bit have set the by in executing the Bits Effect NZVC Condition T Page 10-53 fault if not Reserved if not operand zero fault if not zero zero Reserved MOD operand fault if not CUR Reserved operand MOD fault Reserved if not 3 operand fault if not 3 IS Reserved FPD operand fault if not Reserved zero operand fault if not zero T PSL pushed above that pending bit. restored an 11 as compatibility the has set RTI mode, the RTT from or bits the PSL when those bits must PSW Compatibility general Register mode RO register mode. R7 (PC) is registers R8 halves entering registers or cleared or zero. left mode, R6, through R14 mode or by executed from or a by an VAX leaving operand in but the interrupt. when reserved ignored, zero, faults compatibility when the native reserved through from the upper there there and are are the no no R4 are bits 15 respectively. @ of (SP) occurs unchanged. Since compatibility RO and is a faults state,. are through compatibility interrupt UNPREDICTABLE 15 through of exception RO through bits When trace PSW mode oparand is to fault Usage registers registers bit for stack cause going be T mode. interrupt that instruction the how exception, appropriate of on mode compatibility an occurs. General of compatibility kernel the Section description bits of See compatibility causing all to or high part in re-entered on table in program mode when the 1is mode compatibility VAX zero PRV mode the Other Codes fault native with stack. effects: operand compatibility 10.3.1 the operand work Note on Reserved complete mode, instruction PSL Bit operation the REI the Reserved TP The an of FU IPL is 5.2 DV v VAX image following T is Rev ENTERING AND LEAVING COMPATIBILITY MODE Compatibility in -- MODE VAX are mode, R6 general not VAX and upper FP1l1 floating of half VAX mode register register R15 of VAX through the R15 (PC) . compatibility and the upper ignored. When an mode, floating by R7 are RO 0 of affected compatibility halves through Compatibility register R6 stacked point accumulators. are R15 R7 either (PC) instructions in PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 COMPATIBILITY MODE MEMORY MANAGEMENT 10.4 Page 10-54 COMPATIBILITY MODE MEMORY MANAGEMENT hence compatibility mode PDP-11 addresses are 15-bit byte addresses, first 64k bytes of the per the in te programs are confined to execu There is a one-to-one process part of the wvirtual address space. ity mode virtual address and its VAX correspondence betw=2en a compatibil on in counterpart (e.g., virtual address 0 references the same as locati follows: both modes). A compatibility mode address is interpreted VAX pages of H4 bytes. PDP-11 segments can consist of 1 to 128 blocks access rent diffe ding provi of are 512 bytes long. Thes PDP-11 capability since chunks block 8 in ed provid protection to different segments is . ecture archit VAX the in level page the protection is specified at tes compatibility mode The memory management system protects and reloca Thus, all of the memory . manner mode native addresses in the normal are available to the management mechanisms available in VAX mode virtual and physical the both ng compatibility mode executive for managi A1l of the except ion conditions ms. progra memory of compatibility mode also occur when can that can be caused by memory management in VAX mode relocating a compatibility mode address. See Chapter 5. the user environment can be Most of the KT-11 features that affect ement system. Table 10-4 briefly simulated with the VAX memory manag to Chapt er 5 of this manual and Refer d. describes the simulation metho s of each system. the appropriate PDP-11 documents for detail PDP-11 Compatibility Mode COMPATIBILITY MODE MEMORY 23-March-81 Table KT11-D feature T T 8 S e e i to e be o - —— ———> — seqments per Rev — simulation _——__.- segments the of 128 16 _.——_.- can pages be of address pages —--_—_— spac each size from bytes (1 128 blocks) increments, in 54 using contiguous memory. Forward 54 to (1 byte growing Backward Direction=3). growing into byte be are not Can be are begin on boundary. any 512 in using simulated no _—————- by 8K byte using page for (1 page) memory. table those entries pages allocated. simulated not Segments no using access page for table those allocated. begin on any 512 groups different bytes discontiquous access mode logical possibly to 512 8 ——-_—.— dividing compatibility having from pages) specifying (ED=1). Segments size 16 specifying segments 64 to increments, Can segments (Expand Segment _—-—_—. simulated the protection. 8K 10-55 1¢-4 __-_.-— virtual to Page method ——-—_—. 8 user. Segment 5.2 VA X simulated —— -- MANAGEMENT byte that entries pages that boundary. PDP-11 Compatibility Mode Page 10-56 23-March-81 -- Rev 5.2 COMPATIBILITY MODE MEMORY MANAGEMENT The following example shows how a PDP-11 environment can be simulated Segments 0, 1, and 2 of the PDP-11 using VAX memory management. environment are program segments; 3 is unused; 4 and 5 are stack; and 6 and 7 are read-write data. VAX Page Table 11 Environment e ——— o ——— —— - — ——— . —— —————— —— — Access Seg # Size Expand Access Page 2 1 2 3 4 5 6 7 8K 8K 255 3 1K 8K 8K 2K Up Up Up -Down Down Up Up Read only Read only Read only None Read-Write Read-Write Read-Write Read-Write Read only 3-15 Read only 16-31 Read only 32 No Access 33-77 Read-Write 78-79 Read-Write 80-95 96-111 Read-Write 112-115 Read-Write (bytes)Direction 116-127 No Access PDP-11 Compatibility COMPATIBILITY 10.5 MODE Mode 23-March-81 EXCEPTIONS AND -- Rev 5.2 Page INTERRUPTS 10-57 COMPATIBILITY MODE EXCEPTIONS AND INTERRUPTS All interrupts and exception conditions that occur while the machine is compatibility mode cause the machine to enter VAX mode, and are serviced as indicated in Chapter 6 (note that this includes backing up instruction side effects if necessary). The exception conditions discussed in this section are specific to compatibility mode. All these in exceptions PC, A and of create one this exception a 3-longword longword of 1longword and bits frame exception contain 31 through a 16 on code are mode the A Reserved reserved reserved for the The The EMT BPT the indicating zero. IOT for There 1Illegal are the are traps 15 PSL, through specific type of no compatibility (see Chapter 6 for opcodes section is on that are defined Instructions). 9. The as code Fault fault is 1. fault is 2. Fault group of group of instructions is 3. TRAP instructions is 4, Fault mode,J¥P illegal. EMT Fault Instruction compatibility destination the in Bits Fault Instruction for fault instruction the for (see instruction Instruction code occurs mode instruction Instruction code TRAP fault 13.5.6 In for fault 10.5.5 The 10T the containing Fault fault compatibility Instruction for code 10.5.4 The BPT code 1.5.3 instruction 1in reserved 10.5.2 Instruction stack information. exception conditions that result definition of trap, fault, and abort). 13.5.1 kernel specific The and JSR fault instructions code for illegal with a register instructions is 5. 23-March-81 -- Rev 5.2 PDP-11 Compatibility Mode COMPATIBILITY MODE EXCEPTIONS AND INTERRUPTS 0dd 13.5.7 Address Error Page 10-58 Abort y mode whenever @ An odd address error abort is caused 1in compatibilit The code for odd ry. word reference 1is attempted on a byte bounda address errors is 6. T BIT OPERATION IN COMPATIBILITY MODE 10.6 at the beginning of an at the beginning of a occurs in the PSW at the beginning of the instruction when the T bit t isis set achieved by using the TP bit in the prior instruction. This effec word kernel stack frame PSL (see Chapter 5). On trace faults, a 2-long zero and CM is one in are IS and IPL is created, containing PSL and PC. the same vector as uses fault trace mode ity the stacked PSL. Compatibil The rules for trace fault 5. VAX mode trace fault. See Chapter ident to those for native mode. ical are generation in compatibility mode fetch may precede the n uctio instr an for abort However, an odd address In compatibility mode, a trace fault trace fault for that instruction. There are two ways compatibility mode 1. to get the instruction: T bit set ibility mode with An RTT/RTI instruction is executed in compat this case, the T bit is set in the PSW image on the stack. In the PC by to d pointe one the next instruction is executed (the wing follo the e befor taken is fault on the stack), and a trace instruction. 2. both the T An REI instruction is executed in VAX mode which hasimage on the PSL saved the in clear) TP (and set bit and CM bit fault trace the and ted, stack. Again, one instruction is execu of ction intera the of ption descri te (For a comple is taken. that ions operat The 0. r Chapte see bit, TP REI, T bit, and whether or occur as a function of these conditions are the same the REI.) not compatibility mode is being entered from PDP-11 T BIT The (for see T Compatibility OPERATION bit IN interacts interaction Chapter l. Mode T 23-March-81 COMPATIBILITY with other compatibility with other than set (but TP bit mode In the this fault case, 1is the T can take taken bit 1If set one it of in instruction TP the wants the to wants the The following the courses the on 1If it program, continue returns the PDP-11 saved to PSL or tracing an then the set The the want TP leave T stack kernel bit in continue RTT clear) next the or at bit bit TP not T bit which it an mode, it the T bit set simulate the effect on the changes T the service service image The on bit in saved PC routine, and routine can its stack if compatibility executes beginning and instruction TP is is of an set. A executed. depending on whether or not the T the PSW which was popped from the RTI or trace There it mode RTI. the of the RTT. fault are two bit was stack by set the set, TP nor not other set 1if with T will be set in the saved PSL on is the the kernel set. will for set exits with mode tracing. the T longer no compatibility mode PSW has executive it it It clears stack, compatibility T stack. T to then a trace PSL clear if instruction: Neither 2. can program. compatibility with is the different cases, in the image of 1. the can it to It it stack the A saved mode kernel PSW User The any action: (16-bit) trap. instruction before RTT/RTI to returns (but RTT/RTI occurs REI. not routine The on to of exception and mode trace clear does bit trace PC image point does T the a (l6-bit) compatibility the of cause not executes. directly, the follows operations, beginning compatibility exception PSL and 1@-59 does instruction. REI. pushes the TP as specific which sets next clear. saved trace to operations mode at Page fault, services bit <clear) instruction before and 5.2 mode compatibility 1is mode compatibility 2. Rev 6): compatibility 1. -- MODE (but causes be set, and compatibility a TP is clear) compatibility T will mode at the mode be set, as instructions. beginning fault. of any case as instruction PDP-11 Compatibility Mode 23-March-81 -- Rev 5.2 T BIT OPERATION IN COMPATIBILITY MODE The fault condition is serviced first. TP is clear set in the saved PSL pushed on the kernel stack. UNIMPLEMENTED PDP-11 TRAPS 10.7 Page 10-60 and T s tibility Several traps that occur in PDP-lls are not implemented in compa mode: 1. 1is equivalent to the There is no stack overflow trap. This 1is also non overflow there where User Mode of the KT1ll, by the Stack overflow can be provided protection. ement manag y memor compatibility mode executive wusing the mechanisms. 2. There is no concept of a double mode, since the first error mode. 3. error trap in compatibility always puts the machinea in VAX failure, memory All other exception conditions such as power the machine to cause tions excep ement parity, and memory manag enter VAX mode. PDP-11 Compatibility COMPATIBILITY 10.8 MODE Mode I/0 23-March-81 -- REFERENCES 5.2 Page 10-61 COMPATIBILITY MODE I/O REFERENCES Neither to I/0 from instruction stream space. results The compatibility 10.9 references are mode. nor data reads UNPREDICTABLE if I/0 nor writes space is can be referenced PROCESSOR REGISTERS The only processor the PSW, and instructions, in VAX mode. 10.10 it register maybe RTI, and available explicitly RTT. in compatibility referenced Access to all only other PDP-11s guarantee that read -modify-write registers are 1interlocked; that is, the time of the read that the same register will cycle. This synchronization also works in compatibility perform with mode the registers is part condition must be of code done PROGRAM SYNCHRONIZATION All for Rev this memory. mode, instructions synchronization for that have UNIBUS I/0 operations device can be written memory modify device on to I/0 determine as most the device at next PDP-1ls. destinations registers and the bus 1In will never APPENDIX A INSTRUCTION SET AND OPCODE ASSIGNMENTS 23-Mar-81 Al The Rev 17.1 INSTRUCTION OPERAND FORMATS format of convention a -- list have of data two operands the types forms appended encloses 1instructions described in the of which differing to the all implied next is one in must the opcode for a suffix description may be omitted. of as when be number operands. Manual given section. the a wusing For the the selected. of operands digit. Refer to data type For the qualified mnemonics name encloses Instructions which have the the operands, VAX-11 suffix {} and Macro number Move mov{B,w,L,F,D,G,H,0,0} 2. Push PUSHL 3. operand number src.rl, Clear Move Move Move src.rx, 7 dst.wx Complemented src.rx, 3 dst.wx Zero-Extended MOVZ {BW,BL,WL} 7. 5 dst.wx Negated MCOM{B,W,L} 5. 1 {-(SP).wl} MNEG {B,wW,L,F,D,G,H} 5. 9 dst.wx Long CLR{B,W,L=F,Q=D=G,0=H} 4. src.rx, src.rx, 3 dst.wy Convert cvri{s,w,L,F,D,G,H}{B,W,L,F,D,G,H} All pairs except 49 src.rx, BB,WW,LL,FF,DD,GG,HH,DG, dst.wy and GD {} Reference Instructions l. of Instruction Set and Opcode Assignments INSTRUCTION OPERAND FORMATS 8. 9. 19. 11. 12. 13. 14, 15, Convert Rounded CVTR{F,D,G,H}L src.rx, 23-Mar-81 -- Rev 17.1 dst.wl Compare cMp{B,W,L,F,D,G,H} srcl.rx, src2.rx Test TsT{B,W,L,F,D,G,H} Add 2 Operand Add 3 Operand src.rx apD{B,w,L,F,D,G,H}2 add.rx, sum.mx ADD{B,wW,L,F,D,G,H}3 addl.rx, add2.rx, Increment sum.mx INC{B,W,L} Add Sum.wx Carry With ADWC add.rl, sum.ml Add Aligned Word ADAWI add.rw, sum.mw Subtract 2 Operand Subtract 3 Operand DEC{B,W,L} dif.mx sup{B,w,L,F,D,G,H}2 sub.rx, dif.mx 17. 18. 19. 20 . sug{B,wW,L,F,D,G,H}3 sub.rx, min.rx, dif.wx Decrement Subtract With Carry SBWC sub.rl, Multiply 2 dif.ml Operand MUL{B,W,L,F,D,G,H}2 mulr.rx, prod.mx Multiply 3 Operand 21, MUL{B,W,L,F,D,G,H}B mulr.rx, muld.rx, prod.wx 22, Extended Multiply 23. 24, 25, EMUL mulr.rl, muld.rl, add.rl, prod.wqg Divide 2 Operand Divide 3 pDIV{B,W,L,F,D,G,H}2 divr.rx, quo.mx Operand pIv{B,wWw,L,F,D,G,H}3 Extended Divide divr.rx, divd.rx, quo.wX EDIV divr.rl, divd.rg, quo.wl, rem.wl Page A-2 Instruction Set INSTRUCTION OPERAND 26, and Bit Bit Set 2 Bit Set Bit Bit 3 Clear mask.rx, 2 Clear Exclusive Exclusive Rotate ROTL 35. 37. OR 38. dst.mx 3 src.rx, dst.wx Operand dst.mx Operand mask.rx, src.rx, src.rl, dst.wl mulr.rx, mulr.rx, dst.wx int.wl, fract.wx int.wl, fract.wx tbladdr.ab, {RO-3.wl} floating tbladdr.ab, {RO-5.wl} G_floating degree.rw, Evaluation arg.rh, D degree.rw, Evaluation arg.rg, muld.rx, muld.rx, F_floating degree.rw, Evaluation arg.rd, Polynomial mulrx.rb, mulrx.rw, Evaluation arg.rf, Polynomial POLYH dst.wx Modulus Polynomial POLYG 39, 2 mask.rx, OR Polynomial POLYD src.rx, Long Extended POLYF dst.mx Operand mask.rx, cnt.rb, EMOD{F,D} EMOD{G,H} 36. dst.wx Operand mask.rx, 3 XOR{B,W,L}3 34, Page Operand XOR{B,W,L}2 33. 17.1 src.rx mask.rx, BIC{B,W,L}3 32, Rev Operand BIC{B,W,L}2 31. src.rx, mask.rx, BIS{B,W,L}3 30. -- Test BIS{B,W,L}2 29. 23-Mar-81 Shift cnt.rb, BIT{B,W,L} 28. Assignments FORMATS Arithmetic ASH{L,Q} 27. Opcode H degree.rw, tbladdr.ab, {RO-5.wl} floating tbladdr.ab, {R@-5.wl,~16 (SP):-1(SP).wb} 49 . Move Address MOVA{B,W,L=F,Q=D=G,O=H} 41, Push dst.wl Address PUSHA{B,W,L=F,Q=D=G,0=H} 42, src.ax, src.ax, {-(SP).wl} Index INDEX 1 subscript.rl, indexout.wl L low.rl, high.rl, size.rl, indexin.rl, A-3 Instruction Set and Opcode Assignments INSTRUCTION OPERAND FORMATS 23-Mar-81 -——- Rev 17.1 1 Field 43. Extract 44. Extract Zero-Extended Field 45, Insert Field 46. Compare 47. Compare Zero-Extended Field , src.rl CMPZV pos.rl, size.rb, base.vb, {field.rv} 48 . Find First 49. Page A-4 v}, dst.wl EXTV pos.rl, size.rb, base.vb, {field.r v}, dst.wl EXTZV pos.rl, size.rb, base.vb, {field.r INSV src.rl, pos.rl, size.rb, base.vb, 1 1 {field.wv} 1 Field CMPV pos.rl, size.rb, base.vb, {field.rv}, src.rl 1 2 pos.wl FF{S,C} startpos.rl, size.rb, base.vb, {field.rv}, find 12 Conditional Branch B{condition} displ.bb Condition Name LSS Less Than EQL, EQLU NEQ, NEQU GEQ Equal, Equal Unsigned Not Equal, Not Equal Unsigned Greater Than or Equal Greater Than Less Than Unsigned, Carry Set Less Than or Equal Unsigned LEOQ GTR Lssu, CS LEQU GEQU, CC GTRU VS vC Less Than or Equal Greater Than or Equal Unsigned, Carry Clear Greater Than Unsigned Overflow Set Overflow Clear 5¢. Branch With {Byte, Word} Displacement 2 51. Jump 1 52. Branch on Bit 2 53. interlock) Branch on Bit (and modify without , {field.mv} l.bb disp .vb, base BB{s,c}{s,C} pos.rl, Branch on Bit (and modify) Interlocked 4 54. BR{B,W} displ.bx JMP dst.ab BB{S,C} pos.rl, base.vb, displ.bb, {field.rv} BB{SS,CC}I pos.rl, base.vb, displ.bb, {field.mv} 2 Instruction Set INSTRUCTION OPERAND 55. and Branch on Assignments is Add One LE and AOBLEQ 58. Add on One 59. add.rx, add, Subtract 61. 53. 65. Jump 1 Than 1 displ.bb Greater Than or Greater Equal selector.rx, Procedure Than base.rx, 1 limit.rx, Word} Displacement Return from Stack dst.ab, Argument List {-(SP).w*} Argument List {-(SP).w*} Procedure Fault 1 {-(KSP).w*} in Kernel mode, Assigned opcode 4. Push Registers PUSHR mask.rw, 1 1 {-(KSP).w*} Halt HALT 1 1 {(SP)+.r*} Breakpoint 2 1 dst.ab, with numarg.rl, 3 displ.bw-list 1 with General arglist.ab, Procedure 1 displ.bb Call Halts 78. Branch from Subroutine {(SP)+.rl} BPT 69. Equal Return RET 68. and 7 displ.bw negative displ.bb RSB CALLS 67. or on to Subroutine dst.ab, {-(SP).wl} Call Page displ.bb Branch to Subroutine With {Byte, BSB{B,W} displ.bx, {-(SP).wl} CALLG 66. GE index.mx, Case JSB 64. Less Branch index.ml, CASE{B,W,L} 62. and One Than index.ml, index.ml, Subtract SOBGTR Branch One Less index.ml, limit.rl, SOBGEQ 60. Branch and 17.1 2 positive limit.rl, AOBLSS Rev displ.bb add. 57. -- Bit src.rl, Add Compare and Branch ACB{B,W,L,F,D,G,H} limit.rx, Compare 23-Mar-81 FORMATS Low BLB{S,C} 56. Opcode faults {-(SP).w*} otherwise. 1 A-5 Instruction Set and Opcode Assignments INSTRUCTION OPERAND FORMATS 23-Mar-81 -- Rev 17.1 Page A-6 71. Pop Registers 72. Move from PSL 1 73. Bit Set PSW 1 Bit Clear PSW 1 75. No Operation 1 76. Extended Function Call 1 77. Insert Entry in Queue 1 78. Insert Entry into Queue at Head, Interlocked 1 TInsert Entry into Queue at Tail, Interlocked 1 8¢. Remove Entry from Queue 1 81. Remove Entry from Queue at Head, Interlocked 1 Remove Entry from Queue at Tall, Interlocked 1 Move Character 3 Operand MOVC3 len.rw, srcaddr.ab, dstaddr.ab, {RE-5.wl} 1 74, 79. 82. 83. 84. 1 {(SP)+.r*} POPR mask.rw, MOVPSL dst.wl BISPSW mask.rw BICPSW mask.rw NOP XFC {unspecified operands} INSQUE entry.ab, INSQHI entry.ab, INSQTI entry.ab, pred.ab header.aq header.aq REMQUE entry.ab, addr.wl REMQHI header.aq, addr.wl REMQTI header.aq, addr.wl 1 Move Character 5 operand r.ab, dstadd .rw, dstlen b, fill.r MOVCS srclen.rw, srcaddr.ab, {RO-5.wl} 85. 1 Move Translated Characters .rw, dstlen r.ab, tbladd b, fill.r MOVTC srclen.rw, srcaddr.ab, dstaddr.ab, 86. 1 Move Translated Until Character n,rw, dstle , dr.ab tblad b, esc.r , dr.ab srcad MOVTUC srclen.rw, dstaddr.ab, 87. {RO-5.wl} {R@-5.wl} Compare Characters 3 Operand CMPC3 len.rw, srcladdr.ab, src2addr.ab, {RO-3.wl} 1 Instruction Set INSTRUCTION OPERAND 88. and Compare CMPC5 Opcode Characters srcllen.rw, src2addr.ab, 89. 90. 91. 92. 93. 94, 95. 96. Characters SCANC len.rw, Span Characters SPANC len.rw, 97. Skip Character SKPC char.rb, 99. {RO-3,wl} tbladdr.ab, mask.rb, {RO#-3.wl} len.rw, addr.ab, {RO-1.wl} lenl.rw, Cyclic Redundancy CRC tbl.ab, Move Packed MOVP len.rw, Compare addrl.ab, 181. 3 Packed 6 1 1 {RO-3.wl} stream.ab, {RZ-3.wl} Subtract 4 1 src2addr.ab, {RO-3.wl} srcladdr.ab, 1 src2len.rw, 102, addaddr.ab, 1 sumlen.rw, sumaddr.ab, Packed Divide DIVP 4 6 1 add2addr. ab, Operand subaddr.ab, 1 diflen.rw, difaddr.ab, minlen.rw, minaddr.ab, {R@-3.wl} Operand subaddr. ab, difaddr.ab, {RO- 5 wl} 1 Packed mulrlen.rw, prodlen.rw, 103. {RO-3.wl} Operand sublen.rw, Multiply MULP src2addr.ab, Operand Packed diflen.rw, 1 {R#-3.wl} Operand sublen.rw, Subtract 1 Operand addlen.rw, Packed 1 addr2.ab, dstaddr.ab, srcladdr.ab, srcllen.rw, 4 len2.rw, strlen.rw, srcaddr.ab, Packed Packed SUBP6 1 Check inicrc.rl, len.rw, Compare SUBP4 1 mask.rb, ADDP6 addllen.rw, addladdr. ab, add2le n.rw, sumlen.rw, sumaddr.ab, {R@-5. wl} 100. Page 1 tbladdr.ab, {RO-1.wl} Characters Add 17.1 src2len.rw, addr.ab, Match Add fill.rb, len.rw, MATCHC ADDP4 Rev Operand addr.ab, {RO-3.wl} 98. ~- Character char.rb, CMPP4 5 srcladdr.ab, addr.ab, LOCC CMPP3 23-Mar-81 {R@-3.wl} Scan Locate Assignments FORMATS mulraddr. ab, prodaddr.ab, muldlen.rw, {R@-5.wl} muldaddr. ab, Packed divrlen.rw, quolen.rw, 1 1 divraddr. ab, quoaddr.ab, divdlen.rw, {R#-5.wl, divdaddr. ab, -16(SP): -1 (SP) .wb} A-7 Instruction Set and Opcode Assignments INSTRUCTION OPERAND FORMATS 23-Mar-81 -- Rev 17.1 Page A-8 104. Convert Long to Packed 1 105. Convert Packed to Long 1 186. Convert Packed to Trailing ed 2 CVTLP src.rl, dstlen.rw, dstaddr.ab, {RE-3.wl} CVTPL srclen.rw, srcaddr.ab, {RO-3.wl}, dst.wl Convert Trailing to Pack cvT{PT, TP} srclen.rw, srcaddr.ab, tbladdr.ab, dstlen.rw, dstaddr.ab, {R@-3.wl} 1¢7. 2 Convert Packed to Leading Separate Convert Leading Separate to Packed cVT{PS,SP} srclen.rw, srcaddr.ab, dstlen.rw, dstaddr.ab, {RE-3.wl} 198. 1 Arithmetic Shift and Round Packed n.rw, dstle .rb, round , dr.ab ASHP cnt.rb, srclen.rw, srcad dstaddr.ab, {R@-3.wl} 199. FEdit Packed to Character String 1 11¢. Probe {Read, Write} Accessability.ab 2 111. Change Mode 4 .wl} EDITPC srclen.rw, srcaddr.ab, pattern.ab, dstaddr.ab, {RO-5 PROBE {R,W} mode.rb, len.rw, base CHM{K,E,S,U} param.rw, {-(ySP) .w*} Illegal on interrupt stack. Where y=MINU(x, pPSL<current_mode>) 112. Return from Exception or Interrupt 1 113. Load Process Context 1 REI {(SP)+.r*} LDPCTX {PCB.r*, —(KSP).W*} Legal only on interrupt stack. 114. 115. Save Process Context SVPCTX {(SP)+.r*, PCB.w*} Legal only in Kernel mode. 1 Move To Process Register MTPR src.rl, procreg.rl Legal only in Kernel mode. 116. 1 Move From Processor Register MFPR procreg.rl, dst.wl Legal only in Kernel mode. Total 304 Instruction OPERAND A.2 The Set and SPECIFIER Opcode Assignments 23-Mar-81 -- Rev 17.1 Page NOTATION OPERAND SPECIFIER NOTATION standard VAX notation <{name>.<access for operand type><data specifiers is: type> where: Name is a context of name a of suggestive the register Access type is a specifier access a - name for instruction. or block letter type. Calculate the the It operand is for the implied denoting effective the Context b - by No of address branch displacement. 3. Data is operand is modified - operand is read if - operand type not is "Rn", a is of MO D HDTTQ names, the byte D _floating - F _floating - G_floating - H_floating - longword | *C X E QO For - octaword - quadword - field (used - word first data - second same by <data read as a. only denoting - multiple following l. add 2. addr 3. arglist - only type data If the and address - argument list given is type>. and "Rn", data implied specified type addend - on written) (used R[n+1]'R[n]. type of the operands) by specified longwords names is in a operand. branch (both operand - the returned instruction only written letter of is <data type>. Operand specifier Size given | L <~ 3 displacement operand calculation data type given by operand reference. the operands. address specified operand. Address pointer which is the actual in capitalized by only abbreviations instruction instruction on are implied used: operands) A-9 Instruction Set and Opcode Assignments OPERAND SPECIFIER NOTATION base - base char - character cnt - count dif - difference displacement - displ divd - dividend divisor - 10. divr 11. dst - destination 12. entry 13. esc 14, £i1l 15. findpos - find position 16. fract - fraction 17. index - index 18. inicrc - 19. int - integer 20. len length 21. limit - 22. mask 23. min - minuend 24, muld - multiplicand 25, mulr - multiplier 26. mulrx - multiplier extension 27. numarg - number of arguments 28. option 29. param - parameter entry - escape - fill - - - initial crc limit mask - option 23-Mar-81 -—- Rev 17.1 Page A-10 Instruction OPERAND Set and SPECIFIER Opcode 30. pos 31, pred 32. procreg 33. prod 34, quo - quotient 35. rem - remainder 36. selector 37. size 38. src 39. startpos - 40. stream - stream 41. strlen - string 42. sub - subtrahend 43, sum - sum 44, tbl - table - Assignments NOTATION 23-Mar-81 position - - - - predecessor - internal processor product - selector size source starting position length register -- Rev 17.1 Page A-11 Instruction Set and OPCODE ASSIGNMENTS A3 Opcode Assignments 23-Mar-81 -- Rev 17.1 Page A-12 OPCODE ASSIGNMENTS SINGLE BYTE Binary 00000000 000006031 00000019 goeeeoll 00000108 00000181 9000@110 Hex @00 @1 02 @3 064 @5 @6 OPCODES Mnemonic HALT Binary §P100006@ Hex 2@ PP1000@1 00100010 g0100011 9010010608 21 22 23 24 ADDPG6 SUBP4 SUBP6 CVTPT LDPCTX 00190110 26 CVTTP RSB 90106061061 @7 SVPCTX g@160111 00001000 08 CVTPS §0101000 000010061 00001014 P0021011 90001100 00P@1101 0PQ@111¢ 99001111 09 ©OA @B ¢C @D OE @F CVTSP INDEX CRC PROBER PROBEW INSQUE REMQUE g0@l100908 10 BSBB 25 27 28 MOVC3 p011080008 30 BSBW 901100810 32 CVTWL 34 35 36 37 MOVP CMPP3 CVTPL CMPP4 EDITPC MATCHC LOCC SKPC MOVZIWL ACBW PUSHAW 31 11 BRB 9¥@P10011 13 14 15 16 17 BEQL,BEQLU BGTR BLEQ JSB JMP 90119011 P90110008 g@@11001 99911914 g@9#11911 993111068 96@11161 18 19 1A 1B 1C 1D BGEQ BLSS BGTRU BLEQU BVC BVS g01110060¢ 931110081 g2111018 99111011 Pg1111608 99111101 38 39 3A 3B 3C 3D g@®11111 1F BLSSU,BCS 99111111 3F 00010109 P0@101061 9910119 ge@10111 g@@11119 1E BGEQU,BCC DIVP 29 2A 2B 2C 2D 2E 2F 003186081 BNEQ,BNEQU MULP 90101001 90101018 99101611 99101108 90101101 91011198 p@141111 g@110001 12 ADDP4 NOP REI BPT RET 9000808111 98010019 Mnemonic 90110100 9@110181 p@1106118 p@118111 $4111110 33 3E CMPC3 SCANC SPANC MOVCS CMPC5S MOVTC MOVTUC BRW CVTWB MOVAW Instruction OPCODE Set and Opcode Assignments 23-Mar-81 -- ASSIGNMENTS Binary Hex 01000000 010000801 40 41 Mnemonic Binary ADDF2 ADDF3 Hex Rev 17.1 011000060 60 ADDD2 011000061 61 ADDD3 01000019 42 SUBF2 43 01100010 SUBF3 62 SUBD2 91100011 63 SUBD3 21300100 44 MULF2 45 MULF3 21000110 46 DIVF2 01000111 47 DIVF3 01100190 64 MULD2 01190161 65 MULD3 21100116 66 DIVD2 81100111 67 DIVD3 01001900 48 CVTFB 01001001 211010006 49 CVTFW 68 CVTDB 21101001 69 CVTDW 91001016 4A CVTFL 01001811 211010190 4B CVTRFL 6A CVTDL 01101011 6B CVTRDL 01001109 4C CVTBF 01081101 4D 01101100 CVTWF 6C CVTBD 21001119 @1001111 21101181 4E 4F CVTLF ACBF 6D CVTWD 01101119 6E CVTLD 91161111 6F ACBD MOVD 01010000 50 MOVF 911100066 01910001 70 51 CMPF P1010019 52 01110001 MNEGF 71 CMPD 01010011 211100106 53 72 MNEGD TSTF 210101069 01010101 9111080611 54 55 73 EMODF POLYF TSTD 21110109 74 EMODD 01010119 01119101 56 CVTFD 75 POLYD #l1910111 57 RESERVED 01011000 58 ADAWI 01911001 59 RESERVED A-13 Mnemonic 010000611 91000141 Page 91110119 76 CVTDF to DEC 91110111 77 RESERVED 21111940 78 ASHL to DEC 91111001 79 ASHQ 01011010 5A RESERVED to DEC 91211011 21111010 5B 7A RESERVED EMUL to DEC 91111011 7B EDIV to DEC #1011100 5C INSQHI 016011141 5D @11111686 INSQTI 7C CLRQ,CLRD,CLRG 21011119 21111101 5E REMQHI 7D MOVQ #1111119 7E MOVAQ,MOVAD,MOVAG 21011111 5F REMQTI PUSHAQ, PUSHAD, PUSHAG P1111111 7F Instruction Set and Opcode Assignments 23-Mar-81 -- Rev 17.1 Page A-14 OPCODE ASSIGNMENTS Binary Hex Mnemonic Binary Hex Mnemonic 10000000 109002301 10000019 80 81 82 83 84 85 86 87 ADDB2 ADDB3 SUBB2 SUBB3 MULB2 MULB3 DIVB2 DIVB3 101000008 19100001 10100810 19160011 10100100 19100101 10100110 191006111 A0 Al A2 ADDW2 ADDW3 SUBW?2 SUBW3 MULW2 MULW3 DIVW2 DIVW3 10001000 10001001 199081016 19901611 19991190 109081181 100061119 88 89 8A 8B 8C 8D B8E BISB2 BISB3 BICB2 BICB3 XORB2 XORB3 MNEGB 10101008 191010601 10101010 19191611 101061108 19181181 19101116 A8 A9 AA AB AC AD AE AF BISW2 BISW3 BICW2 BICW3 XORW2 XORW3 MNEGW CASEW MOVB 19110000 BO MOVW CLRB TSTB 101108108 19118181 191108110 10110111 B4 BS B6 B7 CLRW TSTW INCW DECW 19000011 109001060 10000161 10000119 109090111 10601111 10010060 100140601 19010910 10010011 8F 90 91 92 93 100810118 10610111 94 95 96 97 199110006 98 10010188 10410191 160110061 10011018 10911411 10911108 10911101 19911114 19911111 99 O9A 9B 9C 9D 9E O9F CASEB CMPB MCOMB BITB INCB DECB CVTBL 10101111 16118001 191106010 10110011 141110600 CVTBW 19111001 MOVIBW 19111011 MOVZIBL ROTL ACBB MOVAB PUSHAB 14111018 19111108 19111141 19111119 19111111 A3 A4 A5 A6 A7 Bl B2 B3 B8 CMPW MCOMW BITW BISPSW B9 BICPSW BB PUSHR BA BC BD BE BF POPR CHMK CHME CHMS CHMU Instruction OPCODE Set and Opcode ASSIGNMENTS Binary Hex Mnemonic 110000006 Co ADDL2 11000001 cC1 ADDL3 110000618 11000011 C2 SUBL2 C3 SUBL3 11000100 11000101 C4 MULL2 CS5 MULL3 11000110 C6 DIVL2 11900111 C7 DIVL3 11001000 C8 BISL2 110061001 C9 BISL3 11001010 11001011 CA BICL2 CB BICL3 110011008 CC XORL?2 11001161 CD XORL3 11001118 11901111 CE MNEGL CF CASEL Assignments 23-Mar-81 Binary -- Hex Rev 11100000 EO BBS 111900081 E1 BBC 111000108 E2 BBSS 11100611 E3 BBCS BBSC 11100100 E4 111908101 ES BBCC 111001108 E6 BBSSI 111969111 E7 BBCCI 11101000 ES8 BLBS 11191901 E9 BLBC 11191610 EA FFS 11191011 EB FFC 111011060 EC CMPV 11191101 ED CMPZV 11101114 EE EXTV 11101111 EF EXTZV 11010000 D@ MOVL D1 11110000 CMPL F0O INSV 111100061 F1 ACBL 1101006106 D2 MCOML D3 BITL 11019108 11910101 D4 CLRL,CLRF DS TSTL 11010118 D6 INCL 118010111 D7 DECL 1190110008 D8 ADWC 11011001 D9 11011010 11911911 SBWC DA MTPR DB MFPR 11011160 11911181 DC DD MOVPSL 11011116 DE 11411111 MOVAL ,MOVAF DF PUSHAL, PUSHAF PUSHL Page Mnemonic 11910001 11010011 17.1 11110010 F2 AOBLSS 111100611 F3 AOBLEQ 11110100 F4 SOBGEQ 11116101 FS5 SOBGTR 111101168 Fe6 CVTLB 11110111 F7 CVTLW 11111000 F8 ASHP 11111001 F9 CVTLP 11111018 FA CALLG 11111011 FB CALLS 11111148 FC XFC 11111101 FD ESCD to DEC 11111110 FE ESCE to DEC 11111111 FF ESCF to DEC A-15 Instruction Set and Opcode Assignments OPCODE 23-Mar-81 -- Rev 17.1 Page A-16 ASSIGNMENTS TWO BYTE OPCODES Hex Mnemonic Hex Mhemonic 33FD CVTGF ADDH?2 ADDH3 goFD to 31FD RESERVED 32FD CVTDH to DIGITAL 34FD to 3FFD RESERVED to DEC 40FD 41FD ADDG?2 ADDG3 6@FD 61FD 43FD SUBG3 63FD 42FD SUBG2 62FD 44FD MULG 2 64FD 4°7FD DIVG3 67FD 45FD 46FD MULG3 DIVG2 SUBH2 SUBH3 MULH2 65FD 66FD MULH3 DIVH2 DIVH3 48FD CVTGB 68FD CVTHB 4EFD CVTLG 6EFD CVTLH 49FD 4AFD 4BFD 4CFD 4DFD 4FFD CVTGW CVTGL CVTRGL CVTBG CVTWG 69FD 6AFD 6BFD 6CFD 6DFD ACBG 6FFD CVTHW CVTHL CVTRHL CVTBH CVTWH ACBH Instruction OPCODE Set and Opcode Assignments 23-Mar-81 -- ASSIGNMENTS Rev 17.1 50FD MOVG 51FD 70FD CMPG 52FD 71FD MNEGG CMPH 72FD MNEGH Page A-17 MOVH 53FD TSTG 54FD EMODG 73FD TSTH 74FD 55FD POLYG EMODH 56FD 57FD 75FD POLYH CVTGH RESERVED to DEC 76FD 77FD CVTHG RESERVED to DEC 58FD RESERVED to DEC 59FD RESERVED to DEC 5AFD 78FD 79FD RESERVED RESERVED RESERVED to DEC to to DEC DEC 7AFD 5BFD RESERVED RESERVED to to DEC DEC 5CFD 7BFD RESERVED RESERVED to DEC to DEC 7CFD CLRH,CLRO 5DFD RESERVED to DEC 7DFD 5EFD MOVO RESERVED to DEC 5FFD RESERVED 7EFD to DEC MOVAH ,MOVAOQ 7FFD PUSHAH, PUSHAQ 97FD RESERVED to DIGITAL 98FD CVTFH 99FD CVTFG F7FD CVTHD FEFF BUGW 80FD to 9AFD to F5FD RESERVED FG6FD CVTHF to DIGITAL F8FD to FCFF RESERVED FDFF BUGL FFFF RESERVED to (used DIGITAL by for VMS all for time BUGCHECK) 23-Mar-81 -- Rev 17.1 Page A-18 Instruction Set and Opcode Assignments INSTRUCTIONS USABLE TO REFERENCE I/0 SPACE INSTRUCTIONS USABLE TO REFERENCE 1/0 SPACE A4 reference Some of the instructions are not usable to reasons for 1I/0 space. The this are: instructions are restartable via PSL<FPD> 1. String 2. The instruction is not in the kernel set 3. The PC, 4. 1/0 space does not support operand types of quad, floating, field, or queue; nor can the position, size, length, or base them be of or PCBB can not point to I/0 space SP, from I/O space potentially 5. The instruction may be interruptible because it is 6. Only instructions with a maximum of one modify or write The destination must be the last destination can be used. a slow instruction in some implementations operand For any memory reference to I/0 space, the 15, and programmer must use an pts instruction from the following lists and must ensure that no interru space 1/0 first the after faults, page g includin occur, will or faults To ensure no interrupts, the programmer must avoid operand reference. modes specifier 9, 11, 13, and indexed. these modes other interrupts ), and (Symbolically, these are @(Rn)+, @B"D(Rn), @W'D(Rn), and @L"D(Rn in modes these for ts these indexed.) The hardware may allow interrup the in tions instruc the For order to minimize interrupt latency. following lists, the hardware ensures occur after the first I/0 space access. that no Since these instructions are not interruptable after I/0 space will accesses extend the (except for the addressing modes above), their execution will keep them to effort some interrupt latency. The programmer should make R13 through R@ Use ces. referen short by minimizing the number of memory instead, for example. Instructions for which any explicit operand can be in 1/0 space: Mov{B,wW,L}, PUSHL, CLR{B,W,L}, MNEG{B,W,L}, MCOM{B,W,L}, MOVZ{BW,BL,WL}, CVT {BW,BL,WB,WL,LB,LW}, CMP{B,W,L}, TST{B,W,L}, app{B,W,L}2, ADD{B,wW,L}3, ADAWI, INC{B,W,L}, ADWC, suB{B,W,L}2, SuB{B,W,L}3, DEC{B,W,L}, SBWC, BIT{B,W,L}, BIS{B,W,L}2, Bis{B,w,L}3, BIC{B,W,L}2, PUSHA{B,W,L}, BIic{B,w,L}3, XOrR{B,W,L}2, XOR{B,W,L}3, MOVA{B,W,L}, MOVAQ, W}, PROBE{R, S,U} CHM{K,E, BICPSW, BISPSW, PUSHAQ, CASE{B,W,L}, MOVPSL, MTPR, MFPR Instructions for which all operands except the branch be in I/0 space: BLB{S,C} displacement can Instruction Set INSTRUCTIONS Instruction and USABLE for Opcode TO which Assignments REFERENCE some XFC (depending REMQUE addr I/0 operand on 23-Mar-81 -- Rev 17.1 can be in I/0 implementation) (destination) REMQHI addr (destination) REMQTI addr (destination) the above rules, it is possible for a specific implementation to execute macro code from the I/0 space and/or the stack or PCB to be in I/0 space. This might, for example, as part of to the bootstrap transfer A-19 space: Notwithstanding software Page SPACE to process. this code. 1If this is done, then it is hardware to be allow used valid for Page Index-1 INDEX () as a notation, 3-4 as a notation, 3-4 {} synchronization, read, write, Abort, 6-1, ACCR 6-3 ACCS addressing Absolute indexed addressing Absolute indexed Absolute mode, mode, mode, 3-7 3-14 - Byte, ACBD - Dfloating, ACBF - Add Ffloating, ACBG - G Branch ADDB2 - Add Byte 2 ADDB3 Operand, 4-11 - Add Byte Branch 3 ADDD2 Operand, Add Compare ACBH - Add 4-11 - Add D floating 2 Operand, Branch ADDD3 Add D floating 3 Operand, Add F floating 2 Operand, Add F_floating 3 Operand, - Compare Add Long, ADD G floating 2 Operand, ACBW - and ADD G _floating 3 Operand, ADD H floating 2 Operand, ADD H floating 3 Operand, Branch and Branch and Branch and Branch Register (ACCS), 9-15 (ACCS), 9-27 (ACCR), page 5-13 Access control, Access control 9-15 boundaries, mode, memory, Access Executive, Kernel, violation 6-5 memory, Access 5-10 5-10 5-19 operand, address, 3-2, 3-18 branch, 3-2, 3-18 modify, 3-2, - ADDL2 - Add Long 2 Operand, 4-11 ADDL3 - Add Long 3 ADDP4 Operand, 4-11 - Add Packed 4 Operand, Add Packed 6 Operand, 4-1849 fault, Address, 2-1 Address access type, operand, 3-2, 3-18 Address arguments, validating, 5-25 instructions, Address 3-18 translation, Addressing 5-190 type, ADDH3 Address 5-10 Supervisor, User, - 4-180 6-5 mode, - ADDP6 5-10 6-17 Access ADDG3 4-122 Maintenance across - 4-122 Control/Status register Access ADDG2 ADDH2 9-15 Register - 4-122 Accelerator Accelerator ADDF3 4-122 Compare VAX-11/788, - 4-122 4-50 Accelerator ADDF2 - 4-122 4-50 Compare - 4-122 4-50 Add Word, 4-122 and 4-5¢ H_floating, ACBL and 4-50 floating, register, 9-27 4-10 and 4-50 Compare Accelerator - Accelerator Control/Status Register, 9-15 ADAWI - Add Aligned Word 4-50 Compare - Maintenance 9-15 ACCS 4-99 Compare Add 3-18 3-14 3-7 queues, Add 3-2, Accelerator Control/Status mode, Interlocked, Absolute - 3-19 3-18 Register, Absolute ACBB 3-2, 3-2 modes 4-38 5-6 notation, 3-4 ADDW2 - Add Word 2 Operand, ADDW3 4-11 - Add Word 3 Operand, 4-11 ADWC - Add With Alignment stack, 6-35 Carry, 4-12 Page of control, 4-48 Add One and Branch 4-52 Less Than or Equal, - AOBLSS - Add One and Branch Less Than, BBCC 4-53 AP - Argument Pointer Register, 2-15 Argument Pointer Register, Arithmetic faults, 6-14 Arithmetic instructions decimal string, 4-175 floating point, 4-115 integer, 4-7 Arithmetic traps, 6-14 Array addressing, 3-14 ASHL - Arithmetic shift 4-13 - Arithmetic shift Packed, 4-182 ASHP 2-15 and Round 6-34 Asynchronous System Traps, - Aynchronous Trap Level, 6-19, 6-39 7-5 3-8 Autoincrement deferred indexed 3-14 3-7 Autoincrement indexed mode, 3-14 register, 2-15 - Branch on Greater Than 4-54 BICB3 - Bit Clear Byte 3 Operand, 4-14 BICL2 - Bit Clear Long 2 Operand, 4-14 BICPSW - Bit Clear PSW, 4-79 BICW2 - Bit Clear Word 2 Operand, 4-14 BICW3 - Bit Clear Word 3 Operand, 3-14 3-6 3-13 BISB2 - Bit Set Byte 2 Operand, 4-15 BISB3 - Bit Set Byte 3 Operand, 4-15 3-14 Autoincrement deferred mode, Autoincrement indexed Base 4-54 BGTRU 4-14 Autoincrement deferred addressing mode, 3-7 Base operand specifier, BGEQ - Branch on Greater Than or Equal, 4-54 BGEQU - Branch on Greater Than or Equal Unsigned, 4-54 BGTR - Branch on Greater Than, 4-14 3-14 3-6 Autoincrement mode, BCS - Branch on Carry Set, 4-54 BEQL - Branch on Equal, 4-54 BEQLU - Branch on Equal Unsigned, BICL3 - Bit Clear Long 3 Operand, Autodecrement mode, 3-8 Autoincrement addressing mode, mode, 4-56 - Branch on Bit Set and Clear, 4-57 BBSS - Branch on Bit Set and Set, 4-57 4-14 System Autodecrement indexed addressing mode, 3-14 Autodecrement indexed mode, addressing 4-57 BICB2 - Bit Clear Byte 2 Operand, Autodecrement addressing mode, addressing mode, Set, Unsigned, System ASTLVL - Pending AST Level, mode, and - Branch on Bit Set, BBS 4-54 6-8, 6-33, 6-40 AST - Aynchronous System Trap, ASTLVL BBCCI - Branch on Bit Clear and Clear Interlocked, 4-59 BBCS - Branch on Bit Clear 4-54 Long, 4-13 ASTLVL - Asynchronous 6-8 Trap Level, 4-56 Clear BBSSI - Branch on Bit Set and Set Interlocked, 4-59 BCC - Branch on Carry Clear, AST - Asynchronous System Trap, 77 - Branch on Bit and Clear, 4-57 BBSC ASHQ - Arithmetic Shift Quad, AST, - Branch on Bit Clear, BBC target AOBLEQ Index-2 BISL2 - Bit Set Long 2 Operand, 4-15 BISL3 - Bit Set Long 3 Operand, 4-15 BISPSW - Bit Set PSW, 4-80 BISW2 - Bit Set Word 2 Operand, 4-15 BISW3 - Bit Set Word 3 Operand, Page 4-15 Bit 3-9 efficiency Byte as a goal, BITB - Bit Test Byte, BITL 4-16 - Bit Test Long, 4-16 BITW - Bit Test Word, BLBC - Branch on Low Bit Clear, Branch on Low Bit Set, Branch on Less Equal, 4-54 - addressing or - or Equal - Branch BLSS BLSSU - on Branch - BNEQU - Than Than a Branch 3-2, notation, access Equal, Not 4-54 Equal 4-81 type, displacement 3-17 BRB - Branch Byte 4-62 Breakpoint BRW - fault, Branch Word 4-62 BSBB - Branch to Displacement, 6-21 Subroutine 4-227 4-227 BVC Branch Branch Byte, 2-1 data Byte Byte Cache Error - register, - Procedure Argument Call Stack on type, Overflow Overflow Argument Case List, Byte, Clear, Set, displacement - Case Long, 4-64 - Case Word, 4-64 Change mode instructions, Character, 2-8 addressing 3-14 displacement mode, 3-14 deferred mode, 6-41 4-205 sign, 4-2¢5 Character string data Character instructions, string 4-145 Check CHME protection, - Change type, -- Change CHMK - Change CHMK -- Change - Change to Mode Executive, to Mode Mode Mode to Executive, Change Mode CHMU - CHMU -- Change Mode Change Mode 4-226 to to Supervisor, Supervisor, User, to Registers, 9-11 Clock, interval, 9-13 CLRB Clear Byte, Kernel, to Clock - Kernel, to 6-41 -- 2-8 4-222 Mode 4-226 3-9 4-74 4-64 CASEW CHMS 3-8 deferred mode, mode, 3-2 4-72 With CASEL CHMS operand, displacement addressing mode, indexed With List, Procedure 4-226 indexed register, 4-70 Call 65-41 addressing Byte Disable (CADR) , (CAER), 6-41 4-54 Byte register 4-226 on 2-17, 6-5 register Cache frame, CALLG CHME 4-54 - 4-63 4-227 BUGL, - 4-63 Subroutine Displacement, BUGW, - £i11, Displacement, to Bugcheck, BVS addressing, 2-17, 9-26 CASEB Displacement, Word CAER operand, - Branch - CALLS Byte BSBW Error General 3-4 Code, 9-26 Call Fault, 3-18 Branch code, 9-26 Not 3-8 8-2 Disable CADR Braces as condition Cache 4-54 4-54 Breakpoint Condition 9-26 4-54 Than, Less on Unsigned, BPT Less on Branch Carry mode, mode, 6-5 Cache, 4-54 Branch - - 3-14 indexed displacement Cache Less on Unsigned, BNEQ Than Unsigned, on displacement Byte C Branch indexed mode, 3-14 C - BLEQU Byte 4-16 4-61 BLEQ displacement 1-1 4-61 BLBS Index-3 4-17 User, 6-41 Index-4 Page 4-124 CLRD - Clear D floating, 4-124 CLRF - Clear F floating, 4-124 4-124 CLRG - Clear G _floating, CLRH - Clear H floating, CLRL - Clear Long, 4-17 CLRO - Clear Octa, 4-17 CLRQ - Clear Quad, 4-17 CLRW - Clear Word, 4-17 CMI Error register, 9-24 CMIERR - CMI Error register, 9-24 CMP - Compatibility Mode, CMPB - Compare Byte, 4-18 CMPC3 3 CMPCS5 5 - CMPD CMPF CMPG CMPH 6-5 - Compare Characters Operand, 4-148 - Compare Characters Operand, 4-148 Compare H floating, 4-125 CMPL - Compare Long, 4-18 CMPP3 - Compare Packed Operand, 4-184 4 Operand, 4-184 CMPV - Compare Field, 4-42 CMPW - Compare Word, 4-18 CMPZV - Compare Zero Extended 4-42 format, 2-2 10-6 register mapping, registers, 10-2 TRAP fault, 19-57 trap instrucions, 10-8 user environment, 10-2 10-60 unimplimented traps, Compatibility mode exception, 6-21 Condition Codes, 2-17, 6-5 Console Receive Control/Status register (RXCS), 9-8 register (RXDB), 9-8 Storage Console Receive Status register (CSRS), 9-25 Console Storage Device, 9-25 Console Storage Receive Data Buffer register , (CSRD) Console Storage Transmit Status register (CSTS), 9-25 Console Storage Transmit Data Buffer register (CSTD), 9-25 Console terminal registers, 9-8 Console Transmit Control/Status (TXDB), 9-9 Constraints on I/0 registers, 8-5 6-5, 6-34, 7-1 7-1 6-1, to 7-2 5-3, Context, system wide, 6- 1, 6-34 Control instructions, 4- 48 Control Store, instruction fault, VAX-11/7880, Conventions general, 1-2 in notation, Micro 9-17 4-6 10 10-53 | 10-5 > CRC - Calculate Cyclic Redundancy Check, 4-172 memory management, processor process , registers, PSW, 10-561 Context, process, 19-57 instructions, 10-7 interrupts, 10-57 10T fault, 10-57 leaving, 10-53 10-58 Context switching, 10-61 illegal T-bit, register Compatibility mode, 6-5 address modes, 10-2 addresses, 10-54 BPT fault, 10-57 EMT fault, 10-57 entering, 10-53 exceptions, 10-57 1/0, 10-6 synchronization, register (TXCS), 9-9 Console Transmit Data Buffer Compatibility as a goal, 1-1 Compatibility (PDP-11) longword data stack, 9-25 CMPP4 - Compare Packed Field, 10-57 instrucions, 10-38 instruction fault, Console Receive Data Buffer Compare D floating, 4-125 Compare F floating, 4-125 Compare G _floating, 4-125 3 reserved reserved 61 CSRD - Console Storage Receive Data Buffer register, 9-25 CSRS - Console Storage Receive CSS, Status register, 9-25 Reserved to, 1-3 CSTD - Console Storage Transmit Page Data CSTS - Buffer Console Transmit register, Status - Currency Current sign, Current Current - 6- 5 - Convert F floating, CVTBG - G Convert floating, CVTBH - Convert H floating, CVTBL to, Byte 4-126 Convert Byte to Word, - Convert D floating to D floating to D floating to - Convert - Convert Long, Word, - CVTFD - - Convert G floating, CVTFH - Convert H floating, CVTFL - Convert Long, CVTFW - Word, CVTGB - - Convert F _floating, CVTGH - Convert H floating, CVTGL - Convert Long, CVTGW - D _floating to to - Convert Long F floating, CVTLG - Convert F_floating to F floating Long Convert Long to:wOrd, - Convert Packed Packed Separate CVTPT - to CVTRHL F_floating to CVTSP G_floating to CVTTP Convert - - to 4-126 to to Long, Long, to Long, to Long, 4-126 Convert Leading Separate Numeric to Packed, 4-193 - Convert Tra111ng to Packed, 4-195 - Convert Word to - Convert Word to CVTWB CVTWD CVTWF - Convert F_floating, to 4-126 - D floating, to 4-126 Rounded 4-19 4-126 4-126 Rounded to Convert 4-191 Rounded Convert H_floating Numeric, Rounded Convert G_floating - Numeric, Convert F_floating Long, Packed Trailing D _floating 4-126 to Leading F floating G_floating - Packed, Convert CVTRGL G_floating to - to G floating Long to CVTRFL G _floating Convert 4-187 to 4-126 to 4-126 4-19 CVTRDL F floating Long 4-1856 to 4-126 to 4-126 - Convert H floating, to F floating to 4-126 G floating, - Byte, 4-1256 4-189 4-126 Convert Long CVTPS 4-126 CVTGF - Convert D floating, CVTPL to 4-126 Convert Byte, 4-126 Dfloating 4-126 Convert to to CVTLW 4-126 D floating, CVTFG 4-124h 4-126 Convert H floating Long CVTLP 4-126 Convert Byte, to 4-126 CVTLH 4-126 Convert H _floating Convert CVTLF to 4-126 CVTLD to - - H floating Convert - to 4-126 4-19 Long, CVTDW'- Convert CVTFB CVTLB to 4-126 Byte - to H floating Convert Word, to H floating, CVTDL CVTHW to 4-125% Byte - H floating 4-126 Convert Long, Byte F floating, CVTDH CVTHL Convert Byte, CVTDF 1-3 to 4-126 Byte 4-19 CVTDB Convert G_floating, - 4-19 CVTBW - to 4-1256 F floating, CVTHG - Reserved D floating, CVTBF Register, H _floating 4-126 - Convert D floating, CVTHF mode, Convert 4-126 Convert Byte, 5-5 4-205 Pointer Customers, CVTBD - CVTHD Mode, Frame 2-15 Word, CVTHB register, 9-25 CUR_MOD 9-25 Storage Index-5 CVTWG - Convert 4-126 Word to 4-126 Word to Numeric Byte, Page 4-125 G _floating, CVTWH - Convert Word to Hfloating, 4-126 CVTWL - Convert Word to Long, 4-19 4-171 Cyclic redundancy check, D floating, 2-4 Dfloating data type, operand, 3-2 Data sharing, 8-1 Displacement mode, 3-9 DIVR2 - Divide Byte 2 Operand, 4-21 DIVB3 - Divide Byte 3 Operand, 4-21 DIVD2 - Divide D floating 2 Operand, 4-130 DIVD3 - Divide D floating 3 Operand, 4-130 2 Operand, 4-130 3 Operand, 4-130 2 Operand, 4-130 3 Operand, 4-130 2 Operand, 4-130 Operand, 4-130 DIVF2 - Divide F _floating 8-1 Data synchronization, Data Index-56 type DIVF3 - Divide F_floating DIVG2 - Divide G_floating character string, 2-8 decimal string, 2-13 floating, 2-4 to 2-5 integer, 2-1 to 2-3 DIVG3 - Divide G _floating packed decimal string, 2-13 DIVH2 - Divide H floating variable length bit field, 2-6 DIVH3 - Divide H floating 2-13 2-8, string, Data type, operand, byte, 3-2 Dfloating, F floating, G floating, H floating, longword, octaword, quadword, word, 3-2 Data types, 3-2 3 3 33 4-21 DIVL3 - Divide Long 3 Operand, 4-21 3-2 33 DIVP - Divide Packed, 4-197 DIVW2 - Divide Word 2 Operand, 2-1 DIVW3 - Divide Word 3 Operand, 4-21 DEC, Reserved to, 1-3 DECB - Decrement Byte, 4-21 4-20 Decimal overflow, 2-18, 6-5 Decimal string packed, 2-13 zero trap, data type Decimal string divide by Decimal string 4-175 Decimal 6-15 instructions, string overflow trap, 5-15 DECL - Decrement Long, 4-20 DECW - Decrement Word, 4-20 Digits significant, 4-205 Dispatch CHMx, 6-42 Displacement addressing mode, 3-9 Displacement deferred indexed addressing mode, mode, 3 Divide by zero fault, 6-16 Divide by zero trap, 6-15 DIVL2 - Divide Long 2 Operand, 3-14 3-14 DV - Decimal Overflow Enable, 2-18, 6-5 Edit instruction, 4-205 EDITPC - Edit Packed to Character String, 4-206 EDIV - Extended Divide, 4-23 Efficiency, as a goal, bit 1-1 EMODD - Extended Multiply and Integerize D _floating, 4-132 EMODF - Extended Multiply and Integerize F floating, 4-132 EMODG - Extended Multiply and Integerize G _floating, 4-132 EMODH - Extended Multiply and Integerize H_floating, 4-132 EMUL - Extended Multiply, 4-24 Entry mask, 4-70 EOS$SADJUST INPUT - Adjust Input Length, 4-224 Page EOSBLANK ZERO - Blank Backwards Faults When Zero, 4-22¢ EO$CLEAR_SIGNIF - Clear Significance, EOSEND - End EOSEND_FLOAT arithmetic, FF 4-223 Edit, 4-225 - Floating End 4-219 EOSFILL - Store Fill, 4-215 EOSFLOAT - Float Sign, 4-217 EOSINSERT - Insert 4-213 EOSLOAD FILL - EOSLOAD MINUS - Load Load Sign EOSLOAD_SIGN - Load Sign Register If Register, Plus, 4-222 When Zero, 4-221 EO$SET_SIGNIF - Set EOSSTORE_SIGN 4-214 - Store 4-223 Errors, ESP - Significance, Exception, Exceptions 6-1 detected during reference, operation, of memory 5-10 as a goal, Extension, 3-9 to Extent, 6-20 access EXTV - EXTZV Extract Extract Field, 2-4 F_floating data 3-2 Fault, 3-13 6-1, memory Field, Zero 4-44 F_floating, - field part Floating, currency data Floating divide by zero fault, divide by zero trap, Floating fault, Floating 6-5 overflow fault, overflow trap, 4-44 operand, Floating 6-15 Floating Floating constant, 3-12 point instructions, sign, 4-205 underflow, Floating 2-18, underflow fault, Floating underflow trap, - Current Frame Register, 2-15 - First Frame Part FU - Pointer Done, 6-5 Current, Floating Underflow Enable, 6-5 G floating, 2-5 G_floating data Global type, 3-2 mode addressing, Registers, 7-4 page table -8 index 1-1 5-8 floating, HALT 6-16 6-15 Register, 2-18, H 6-5 Pointer 2-5 data operand, 5-23 6-16 6-15 Floating FP 4-205 2-4 point immediate H floating 6-3 symbol, type, 6-16 Gptx, management, 4-2¢5 done, 6-5 2-4 to 2-5 Floating Goals, type, addressing 4-4¢ Floating General General Extended 4-45 register, operand, 1-2 - Fill mode, specifier, 6-5 4-45 2-6 2-15 1-1 3-14, Set, FPD the Extensibility as First an instruction, Executive Find 6-18 6-14 occurring consequence - 4-115 Pointer, condition, the FFS 8-4 Exception Exceptions Clear, Floating 6-3 operand First Sign, Stack 7-4 Find Floating processor, Executive - First 4-222 EOSMOVE - Move Digits, 4-216 EOSREPLACE_SIGN - Replace Sign Enable, FFC Field instructions, 4-4¢ Fill, 4-205 Fill character, 4-2g5 4-222 - Fault notation, Sign PLUS 6-14 Floating FIELD Fill If Minus, - Field, 4-222 Register EOSLOAD Sign, Character, Load Register, Index-7 - Halt, type, 3-2 4-82 3-5 (gptx), Index-8 Page Halt, processor, 6-26, 6-28, 6-34, 6-38, 6-41, 6-43, 8-2, 9-18 VAX-11/7808, 6-29 9-13 ICR - Interval Count Register, 9-13 Immediate addressing mode, 3-6 constant floating point, 3-12 integer, 3-11 Immediate indexed addressing mode, 3-14 Immediate indexed mode, 3-14 INCL - Increment Long, INCW - Increment Word, INDEX - Compute Incdex, Index addressing mode, 4-25 4-25 4-25 4-83 3-13 Immediate mode, 3-6 INCB - Increment Byte, Index mode, 3-13 Index register, 2-15 Indivisible operation modify access, 3-19 Initialize UNIBUS 6-2, Interrupt process, 6-8 Interrupt stack, 6-5 9-27 interrupt, INSQHI - Insert Entry into Queue at Head, Interlocked, 4-99 INSQTI - Insert Entry into Queue at Tail, Interlocked, 4-102 INSQUE - Insert Entry in Queue, Instruction format, 2-19 7-8 8-4 Process Interrupts, Interrupts, Interval clock, 9-13 Interval Clock Control/Status register (ICCS), 9-13 9-13 IORESET - Initialize UNIBUS, 9-27 IPL - Interrupt Priority Level, 6-10 6-2, 6-5, 6-5, 6-35 2-18, 6-5 to 6-11 IS - Interrupt Stack in use, IV - Integer Overflow Enable, 4-65 Kernel memory access mode, Kernel stack not valid 6-26 LDPCTX - Load 7-9 LDPCTX -- Load immediate constant, 3-11 Integer data type, 2-1 to 2-3 Integer divide by zero trap, 4-7 Integer overflow, 2-18, 5-5 Integer overflow trap, 5 Interrupt, 6-1 to 6-3, 6-8 Interrupt AST Delivery, 7-8 Interrupt priority level, 6-5 Process Context, Leading separate sign, 4-189, 4-193 zero, 7-4 Process Context, 4-226 Integer 4-47 5-10 abort, KSP - Kernel Stack Pointer, Literal mode, Integer (ICR), Interval Count Register Leading instructions, Structure, 7-8 Instruction operand formats, A-1l INSV - Insert Field, 2-20 Process Scheduling, Interrupt, JSB - Jump To Subroutine, 4-66 6-37 4-105 6-26 Interrupt structure, JMP - Jump, (IORESET), Initiate exception or 6-15 (IPL), 6-11 Interrupt stack not valid halt, 1/0 instructions, A-18 1/0 structure, 2-20, 8-5 ICCS - Interval Clock Control/Status register, Immediate Interrupt Priority Level 4-175, 4-223 Literal addressing mode, 3-11 3-11 LOCC - Locate Character, 4-152 Logical instructions, 4-7 Longword, 2-2 PDP-11 compatibility, 2-2 Longword data type, operand, Longword displacement addressing mode, 3-8 3-2 Longword displacement deferred addressing mode, 3-9 indexed addressing mode, Page 3-14 indexed mode, mode, 3-9 Longword addressing M - bit, Map MATCHC - MBRK Micro - 1-2 MCESR - Machine Summary MCOMB - Move MCOMW - mode, Address F floating, - Move Address G floating, 9-25 Byte, Long, Word, 6-5 Memory Mapping Move From 5-5 5-23 9-5 Processor 4-226 Control Address 9-18 unsigned notation, instructions, 4-78 Mapping MNEGB Enable, - Move MNEGD Negated Byte, - Move Negated D Address Long, 4-38 Address Octa, 4-38 MOVAQ - Move Address MOVAW Quad, - 4-38 Move Address Word, 4-38 - Negated MOVC5 Move - F Byte, 4-28 Move Character 3 Operand, Move Character 5 Operand, MOVD - Move Dfloating, 4-135 MOVF - Move F _floating, 4-135 MOVG - Move MOVH G floating, - Move 4-135 H floating, 4-135 MOVL - Move Long, 4-28 MOVO - Move Octa, 4-28 MOVP - Move Packed, - Move - Move - PSL, Quad, Move 4-199 4-85 4-28 Translated Characters, 4-169 MOVTUC - Move Translated Until MOVZBL MOVZBW - Byte MOVZWL floating, - 4-163 Word, 4-28 Move Zero-Extended to Long, Move to to Move 4-29 Zero-Extended Long, To 4-29 Zero-Extended Word, - Move Word MTPR Character, Move Byte floating, Move Move Move 5-5 4-27 floating, - MOVW Memory H - MOVTC Breakpoint (MBRK), minimum - Address MOVAL MOVQ 9-17 Program 4-134 Move MOVAO MOVPSL Store VAX-11/780, MNEGF - 4-156 (MAPEN), - Move From Processor Register, 4-134 MOVAH B 4-156 faults, Miscellaneous o 4-38 MOVB management - MOVAG 4-38 floating, 4-38 5-10 Register, 3-19 5-6 Move Memory - bit, - exceptions, MME synchronization, MOVC3 Enable operand, 3-18 MOVAF 5-10, 5-5 type, 6-5 Error 5-10 6-17 5-18, Byte, Complemented access 4-6 access 6-41 access, D control, MINU memory 4-38 Move register Mode, 6-5 instructions, Address management Micro changing Address management Micro Mode Move Memory -- 4-27 Move Memory MFPR 4-27 Word, - Kernel, 5-1¢ Supervisor, 5-1¢ MFPR Long, Negated - Complemented Executive, User, Negated Move MOVAB 4-26 Memory Move - Modify ‘ - - 4-38 Check floating, MOVAD Complemented 4-26 H 9-18 4-26 MCOML Negated MNEGL 3-2, Breakpoint register, Move Move MNEGW Modify 6-26 Register, 5-5 Characters, 4-154 Program G floating, 5-140, 6-5 compatibility, Enable register, Negated Mode, 9-26 exception, Match Address MBZ, 3-8 Summary (MCESR), check - 3-14 mode, - Move 4-134 5-6 Error register MAPEN mode, displacement Check Machine MNEGH indexed 3-14 Modify Machine 4-134 displacement mode, Longword MNEGG 3-14 Index-9 4-29 Page Processor Register, MTPR 9-3 —-- Move To Processor Register, 4-226 MULB2 - Multiply Byte 2 Operand, 4-30 MULB3 - Multiply Byte 3 Operand, 4-30 MULD2 - Multiply D floating 2 Operand, 4-135 MULD3 - Multiply D floating 3 Operand, 4-135 MULF2 - Multiply F floating 2 Operand, 4-135 3 Operand, 4-136 MULF3 - Multiply F_floating MULG2 - Multiply G floating 2 Operand, 4-136 MULG3 - Multiply G_floating RIn], 2-15 REM - remainder, register, Rn, 2-15 Index-10 4-6 2-15 SEXT - sign extend, 7EXT - zero extend, 3-4, 3-4, 4- 6 4- 6 1-2 Numbering, OA - operand address notation, 3-4 Octaword, 2-3 Octaword data type, operand, 3-2 Opcode assignments, A-12 Opcode formats, 3-1 Opcode to customers reserved fault, 6-20 Opcode reserved to DIGITAL Fault, 6-20 Operand format summary, A-1 3 Operand, 4-136 2 Operand, 4-136 Operand specifier, 3-2 Operand specifier access type, 3 Operand, 4-136 Operand specifier conventions, MULH2 - Multiply H floating MULH3 - Multiply H floating MULL2 - Multiply Long 2 Operand, 4-30 MULL3 - Multiply Long 3 Operand, 4-30 MULP - Multiply Packed, 4-201 MULW2 - Multiply Word 2 Operand, 4-3¢ MULW3 - Multiply Word 3 Operand, 4-30 N - Negative Condition Code, 2-17, 6-5 N condition code, Next 2-17, Interval Count Register Nibble, (NICR), 6-5 9-13 2-13 NICR - Next Interval Count Register, 9-13 NOP - No Operation, 4-86 as a diagnostic scope point, 9-18 Notation () s 3-4 {}I 3-4 addressing modes, 3-2 3-18 Operand specifier data type, 3-2 Operand specifier notation, A-9 Operand specifier, base, 3-13 Operand, primary, 3-13 Py Base Register, 7-4 Orthogonality as a goal, 1-1 Overflow, 6-4 to 6-5, 6-14 to 6-16, 6-27 stack, 6-26 PP Base Register (PO2BR), 5-17 PP Length Register (POLR), 5-17 Pg Limit Register, Py Page Table P@ Region, P@ region, 7-4 (POPT), 5-17 5-17 5-4 PPBR - PO Base Register, 5-17, 7-4 PYULR - P@ Length Register, 5-17 PPLR - P@ Limit Register, 7-4 P@PT - PO Page Table, 5-17 Pl Base Register, 3-4 FIELD - field addressing, 4-40 MINU - minimum unsigned, 4-6 OA - operand address, 3-4 operand specifier, 4-3, A-9 operation description, 4-4 7-5 Pl Base Register (P1BR), 5-20 Pl Length Register (P1LR), 5-20 Pl Limit Register, 7-5 Pl Page Table (P1PT), 5-20 P1 Region, Pl region, 5-20 5-4 Page P1BR - Pl Base Register, 7-5 PILR - Pl Length PILR - Pl Limit P1PT - Pl Page Packed Table, decimal frame number Table Entry as a Part done, PC Program - Counter Register, context, Process - Control Process Base, Performance monitor Frame - POLYD - D enable, 7-5 field, Monitor Enable, Evaluation floating, 4-138 F floating, 4-138 Evaluation - Polynomial Evaluation G_floating, 4-138 - H Polynomial floating, Evaluation 4-138 POPR - Pop Registers, Power fail, 4-87 level, 6-5 accessibility, - Probe Counter Program status process Protection, context, 4-222 5-10¢ field, 5-6 - Previous PSL - Processor - Program process PSW - PTE - 6-3, Page 7-4 Status 6-5, Table Longword Word, 6-19 Entry, Address PUSHAD Byte, - Push Address D floating, - Push Address F floating, - Push Address G _floating, - Push Address H 4-39 PUSHAF - Push Address Long, - Push 4-39 Address Quad, Address 4-39 Word, 4-39 PUSHAW - Push accessibility, 5-26 - Push Long, PUSHR - Push Registers, Write Accessibility, 4-226 accessibility, 5-26 Procedure call 4-70 Procedure 4-70 instructions, calling interface, Quadword, 2-3 Quadword data context, Process 7-1 control Process block, scheduling, 7-1 4-88 operand, 3-2 4-9¢ Range a Range 7-2 4-31 type, instructions, Queue as Process floating, PUSHAL PUSHL Probe 4-39 PUSHAQ 4-226 - 5-8 Push Accessibility, PROBEW 5-6, - 4-39 Read Status 6-5 Longword, PUSHAB PUSHAH 5-28 Mode, Status context, Processor 2-17, 5-6 5-10 Code, PSL 2-15 7-4 field, Protection MOD 7-4 longword Protection PRV 2-17 Register, Protection 4-39 5-26, Word, (PSL), 9-7 context, Program - 9-6 Longword counter process PUSHAG 8-2 Priority PROBER type, 4-39 Previous mode, 6-5 Primary operand, 3-13 Probe Status Processor in POLYF - Polynomial POLYH Processor check, 5-4 Polynomial POLYG Status 5-10 6-5 Performance 7-5 7-2 Block Number 5-6 PME Block, Control Space, Page Processor PROT 7-2 Per-process - mode, Registers, in 7-4 Register 9-1 Processor in 6-5 process - 5-8 3-4 2-15 in 5-6 5-6, 8-4 Internal Processor Program notation, Errors, 6-5 field, Parentheses PFN 2-13 (PTE), Processor 5-4, 5-1% definition, 7-1 space, 5-2 Page PCB 5-20 string, Space, Processor 4-175 Page PCBB 5-20 7-5 decimal Packed Process Process, Register, Register, instructions, Page, 5-29, Index-11 Read goal, of access 3-18 1-2 values, type, 1-2 operand, 3-2, Page SBI Register £1i11, 4-205 sign, 4-205 9-18 3-6 deferred addressing mode, 3-5 addressing mode, 3-14 Register deferred 9-20 3-14 Register deferred mode, 3-5 Register mode, 3-5 to 3-6 Register usage, Registers VAX-11 Series, 9-6 REM - remainder notation, 4-6 - Remove Entry from Queue at Head, Interlocked, 4-107 REMQTI - Remove Entry from Queue at Tail, Interlocked, 4-1190 REMQUE - Remove Entry from Queue, RESERVED, 1-3 Reserved addressing mode fault, 6-18 Reserved operand exception, 6-18 Restartability, 8-3 RET - Return from Procedure, 4-76 Revision level, 9-7 ROTL - Rotate Long, 4-32 RSB - Return From Subroutine, 4-67 RXCS - Console Receive Control/Status register, 9-8 RXDB - Console Receive Data Buffer register, 9-8 saved PC, 6-3, 6-5, 6-14, 6-18, 6-22, 6-27 Saved PSL, 6-21 6-27 Saved TP, 6-27 to 6-28 6-3, to 6-23, to 6-28 6-5, 6-14, 6-25, 6-22 to 5-23, to 6-28 SBI Error register Silo (SBIQC), (SBIMT), 9-23 Comparator register (SBISC), 9-19 Silo Data Register (SBIS), 9-19 SBI Timeout Address register (SBITA), 9-22 SBIER - SBI Error register, 9-21 SBIFS - SBI Fault/Status register, SBIMT - SBI Maintenance register, or Interrupt, 6-39 -- Return from Exception or Interrupt, 4-226 4-113 Quad Clear SBI (SBIFS), 9-18 2-15 VAX-11/750 Specific, 9-24 VAX-11/78@ Specific, 9-15 REI - Return from Exception REMQHI SBI SBTI indexed Register deferred indexed mode, REI Fault/Status register SBI Maintenance register Register addressing mode, 3-5 to Register Index-12 9-20 SBIQC - SBI Quad Clear, 9-23 SBIS - SBI Silo Data Register, 9-19 SBISC - SBI Silo Comparator register, 9-19 SBITA - SBI Timeout Address SCBB - System Control Block Base, 6-29 Scheduling, process, 7-1 Self-relative queues, 4-95 Separate sign, leading, 4-175, 4-189, (SBIER), 9-21 4-193 Separation of procedure and data, 2-20 Serial number, 9-7 Serialization of notification of multiple events, 6-27 SEXT - sign extend notation, 3-4, 4-6 Sharing, 8-1 SID - System Identification, 9-7 Sign, 4-205 currency, 4-205 Sign character, 4-205 Sign register, 4-205 Significance, 4-205 4-205, Significance indicator, 4-223 Significant digits, SIRR 6-25, 9-22 register, SBR - System Base Register, 5-13 SBWC - Subtract With Carry, 4-33 SCANC - Scan Characters, 4-165 - Software Inte ) rup Request Register, 6-2, 6-10 to 6-11 SISR - Software Interrupt 6-8, Page Summary SKPC - SLR - Register, Skip System Length - Subtract Greater SOBGTR - Than One or Subtract Greater Software and Branch 4-68 6-10 Summary - Register (SISR), Stack Pointer 3-1¢, SPT - System SSP - Supervisor Page Stack alignment, Stack frame, Stack in 6-35 7-4 9-2 pointer images, Pointer Stack Register, residency, data character, packed String as 2-15 6-34 6-34, 6-37, 6-39 2-8 decimal, SUBB2 2-13 4-146 redundancy SUBD2 2 SUBD3 3 SUBF2 2 SUBF3 3 SUBG2 2 check, 4-175 4-171 2 Operand, - Subtract Byte 3 Operand, - Subtract D floating 4-143 - Subtract D floating Operand, 4-123 Subtract Operand, - floating 4-143 Subtract F floating Operand, - F Packed 4-203 range trap, - Subtract Word 2 Operand, - Subtract Word 3 Operand, Summary, 4-1243 Subtract G floating Operand, 4-113 6-16 1-1 Supervisor memory - Save -- access Process Save mode, Context, Process Context, Switching, context, 7-1 Synchronization, 8-1 modify access, 3-19 System Base Register (SBR) , Control Block (SID), Length System Page Region, System Space, Table - Trace Enable, - Trace Trap Data register TB Group Disable Check - TBDR TB - (TBDR), Data 9-28 9-26 Buffer 5-23 Register, 9-28 Group register, Translation Invalidate 5-23 2-18 (TBDATA), register, TB Disable TBIA 6-5 Translation TBDATA 5-13 5-13 Enable, TB - (SPT), 5-4, T register (SLR), 5-13 T - 5-13 (SCBB) 9-7 Register System TBCHK Base Identification 5-13 Byte - 4-2¢3 Subtract 4-34 System Subtract Operand, Packed register - 4-34 Subtract System 4-175 4-14s5, 4-34 SUBB3 - 6-29 character, decimal, Operand, System instructions cyclic 3 4-226 descriptor String Long SVPCTX type operand, Subtract 7-11 Stack String - SVPCTX context, switch, Operand, 5-10 pointer Stack, 2 4-34 5-13 floating Long Operand, SUBW3 Pointer, Stack H 4-143 Subtract Subscript 4-169 floating - - 6 SUBW2 4-7¢ process Subtract Operand, SUBP6 Table, Stack 7-4 4 6-1¢ 3-13 H 4-34 SUBP4 SPANC - Span Characters, Specifier extension, to SUBL3 Register, 2-15 3-9 SUBL2 floating 4-143 Operand, 4-34 (SIRR), interrupt, Subtract - 3 Branch Register 6-10 Software - G 4-143 Operand, SUBH3 4-69 Subtract Operand, SUBH2 Interrupt Request SP and - 3 2 Equal, One Than, SUBG3 4-167 Register, 5-13 SOBGEQ 6-10 Character, Index-13 All 9-26 Buffer Register, [4 Page TBIS - Translation Buffer Invalidate Single Register, 5-22 , (TODR) 9-11 TODR - Time-of-Year Register, 9-11 6-5 TP - Trace Pending, Trace, 6-5, 6-22 Trace pending, 6-5 4-175 instructions, string instructions, 4-191, 4-195 Translation buffer, 5-22 Translation Buffer Check register (TBCHK), 5-23 Translation Buffer Invalidate All Register (TBIA), 5-23 Single Register (TBIS), 5-22 Translation not valid fault, 6-17 Translation, address, 5-6 6-3 Traps arithmetic, 6-14 4-35 TSTL - Test Long, 4-35 4-145 4-145 4-145 4-145 TSTW - Test Word, 4-35 TXCS - Console Transmit Control/Status register, 9-9 TXDB ~ Console Transmit Data Buffer register, 9-9 Type, processor, 9-7 1-2 UNIBUS, 6-2, 6-9, 8-1 Unmapped system, 5-5 UNPREDICTABLE, 1-2 Unsigned integer, 2-1 to 2-2 User memory access mode, 5-10 USp - User Stack Pointer, 7-4 V - Overflow Condition Code, 2-17, 6-5 type, data 2-6 VAX-11/780 Accelerator, 9-15 VAX-11/78¢ Micro Control Store, Vector, 6-2, 6-20 to 6-21, 6-26 to 6-27, 6-29, 6-31, 6-34 to 6-35, 6-37, 6-42 interrupt, 6-8 Virtual address, 2-1 Virtual Address Space, 5-2 Virtual Page Number, 5-4 VPN - Virtual Page Number, 5-4 WCSA - Writable Control Store Address register, 9-17 WCSD - Writable Control Store Data register, 9-17 Word, 2-2 Word data type, operand, 3-2 Word displacement V - Valid bit, 3-8 Word displacement deferred - Test D floating, - Test F floating, - Test G floating, - Test H floating, UNDEFINED, instructions, 4-40 bytes referenced, 2-7 addressing mode, TSTR - Test Byte, TSTD TSTF TSTG TSTH 5-6 Validating address arguments, 9-17 Trace trap, 2-18 Trailing numeric 6-1, Valid bit, Variable length bit field Time-of-Year Register Trap, Vv condition code, 2-17, 6-5 5-25 Terminology general, 1-2 string Index-14 5-6 addressing mode, 3-9 indexed addressing mode, 3-14 indexed mode, 3-14 Word displacement deferred mode, 3-9 Word displacement indexed addressing mode, 3-14 Word displacement indexed mode, 3-14 Word displacement mode, 3-8 Writable Control Store Address register (WCSA), 9-17 Writable Control Store Data register (WCSD), 9-17 Write access type, operand, 3-2, 3-18 XFC - Extended Function Call, -89 XORB2 2 XORB3 3 - Exclusive OR Byte Operand, 4-36 - Exclusive OR Byte Operand, 4-36 Page XORL2 2 XORL3 3 XORW2 2 XORW3 3 Z - Exclusive Operand, - leading, 3-4, OR Long 4-36 Condition condition - Long - Exclusive OR Word Operand, 4-36 - Exclusive OR Word Operand, 4-36 Zero ZEXT OR 4-36 Exclusive Operand, Zero 6-5 Z - zero 4-5 code, Code, 2-17, 2-17, 6-5 4-223 extend notation, Index-15 VAX-11 ARCHITECTURE REFERENCE MANUAL REVISION 6.1 READER’S COMMENTS Your comments and suggestions will help us in our continuous effort to improve the quality and usefulness of our manuals. What is your general reaction to this manuail? (format, accuracy, completeness, organization, etc.) What features are most useful? Does the publication satisfy your needs? What errors have you found? Additional comments Name Title Company Dept. Address City State Zip . Do Not Tear - Fold Here and Staple ___ __ __ FoldHere - - - — — — — — — — i No Postage Necessary if Mailed in the United States BUSINESS REPLY MAIL FIRST CLASS PERMIT NO. 33 MAYNARD, MA POSTAGE WiLL BE PAID BY ADDRESSEE DIGITAL EQUIPMENT CORPORATION VAX ARCHITECTURE MANAGEMENT 1925 ANDOVER STREET TW/B05 TEWKSBURY, MA 01876 &)
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies