Digital PDFs
Documents
Guest
Register
Log In
DEC-9A-MAD0-D
2000
222 pages
Original
9.8MB
view
download
Document:
Advanced Software System Monitors
Order Number:
DEC-9A-MAD0-D
Revision:
Pages:
222
Original Filename:
http://bitsavers.org/pdf/dec/pdp9/DEC-9A-MAD0-D.pdf
OCR Text
Digital Equipment Corporation Maynard, Massachusetts mamaama ADVANCED SOFnNARE SYSTEM MON ITORS ADVANCED SOFnNARE SYSTEM MONITORS For additional copies order No. DEC-9A-MADO-D from Program library, Digital Equipment Corporation, Maynard, Massachusetts. DIGITAL EQUIPMENT CORPORATION 0 Printed in U.S.A. Price $5.00 MAYNARD. MASSACHUSETTS 1st Printing March 1967 2nd Printing Revised February 1968 3rd Printing Revised May 1968 4th Printing Revised January 1968 Copyright© 1968 by Digital Equipment Corporation Instruction times, operating speeds and the like are included in this manual for reference only; they are not to be taken as specifications. The following are registered trademarks of Digital Equipment Corporation, Maynard, Massachusetts: DEC FLIP CHIP DIGITAL PDP FOCAL COMPUTER LAB ii CONTENTS CHAPTER 1 PDP-9 ADVANCED SOFTWARE SYSTEM 1.1 Introduction 1-1 1.2 Hardware Requi rements 1-1 1.3 Monitor Systems 1-2 1. 3. 1 Input/Output Monitor 1-2 1.3.2 Keyboard Monitor 1-3 1.3.3 Background/Foreground Monitor 1-3 1.4 Input/Output Programming System (lOPS) 1-4 1.5 System Programs 1-4 1 .5. 1 FORTRAN IV Compiler 1-5 1.5.2 MAC RO -9 Assemb ler 1-5 1.5.3 Dynamic Debugging Technique (DDT) Program 1-6 1.5.4 Text Editor Program 1-6 1 .5.5 Peripheral Interchange Program (PIP) 1-7 1.5.6 Linking Loader 1-7 1.5.7 PDP-7 to MACRO-9 Assembly Language Converter 1-7 1 .5.8 System Generator 1-7 1.5.9 Dump Program 1-8 1.5.10 Library Update Program 1-8 1. 5. 11 System Patch Program 1-8 1.5.12 Chain Builder and Execute Programs 1-8 CHAPTER 2 THE PDP-9 MONITOR ENVIRONMENT 2. 1 2-1 Monitor Functions 2. 1 . 1 General I/O Communication 2-1 2.1.2 Command, Control, and Data Flow 2-2 2.2 Line Buffers 2-5 2.3 Data Modes 2-8 2.3.1 lOPS Modes 2-9 2.3.2 Image Modes 2-10 2.3.3 Dump Mode 2-10 2.3.4 Input/Output Data Mode Terminators 2-11 iii CONTENTS (cont) Page 2.4 2-12 System Tables 2.4. 1 Device Assignment Table {. DAT} 2-12 2.4.2 System Communication Table (.SCOM) 2-13 Specifying Devices Used To Linking Loader 2-14 2.5 CHAPTER 3 USER PROGRAM COMMANDS (SYSTEM MACROS) 3.1 I/O Monitor Commands (System Macros) 3-1 3. 1 . 1 · I NIT (Initi al i ze) 3-2 3. 1 .2 . READ 3-2 3. 1.3 . WRITE 3-3 3.1.4 . WAIT 3-4 3.1.5 .WAITR 3-4 3.1.6 .CLOSE 3-5 3. 1 .7 · TIMER 3-5 3. 1.8 · EXIT 3-6 3.2 Keyboard Monitor Commands {System Macros} 3-7 3.2. 1 .SEEK 3-7 3.2.2 · ENTER 3-8 3.2.3 • FSTAT 3-9 3.2.4 .RENAM 3-9 3.2.5 · DLETE 3-10 3.2.6 .TRAN 3-10 3.2.7 .CLEAR 3-11 3.2.8 .MTAPE 3-11 3.3 Background/Foreground Monitor Commands (System Macros) 3-12 3.3.1 .REALR 3-12 3.3.2 · REALW 3-13 3.3.3 .IDLE 3-15 3.3.4 .IDLEC 3-15 3.3.5 · TIMER 3-15 3.3.6 · RLXIT 3-16 iv CONTENTS (cont) Page CHAPTER 4 INPUT/OUTPUT MONITOR 4. 1 Input/Output Monitor Functions 4-1 4.2 Programming Example 4-1 4.3 Operating The I/O Monitor System 4-3 4.3. 1 Loading Program in the I/O Monitor Environment 4-3 4.3.2 Device Assignments 4-8 4.3.3 Error Detection and Handling 4-9 4.3.4 Control Character Commands in the I/O Monitor Environment 4-10 4.3.5 Modifying System Programs and Bui Iding Executable User Core Loads in the I/O Monitor Environment 4-10 CHAPTER 5 KEYBOARD MONITOR 5. 1 Keyboard Monitor Functions 5-1 5.2 Programming Example 5-1 5.3 Keyboard Commands 5-4 5.3.1 System Program Load Commands 5-4 5.3.2 Special Function Commands 5-5 5.3.3 Control Character Commands 5-12 5.4 Operating The Keyboard Monitor System 5-13 5.4.1 Loading the Keyboard Monitor 5-13 5.4.2 System Generation 5-14 5.4.3 Assigning Devices 5-19 5.4.4 Loading Programs in the Keyboard Monitor Environment 5-20 5.4.5 Error Detection and Handling 5-21 5.5 Batch Processing 5-26 5.6 DECtape File Organization 5-29 5.6. 1 Non-File-Oriented DECtape 5-29 5.6.2 File-Oriented DECtape 5-29 5.7 5-32 Interim Disk System 5.7. 1 The Disk as System Device 5-33 5.7.2 Disk File Organization 5-33 5.8 Disk System Operation 5-34 v CONTENTS (cont) Page 5.8.1 Paper Tape Load Procedure 5-35 5.8.2 Disk System Generation 5-37 5.8.3 Disk System Generation from DECtape 5-37 5.8.4 Disk System Save/Load from DECtape 5-38 Magnetic Tape Systems 5-39 5.9.1 File Organization 5-40 5.9.2 File Identification and Location 5-42 5.9 5.10 Magnetic Tape System Operation 5-44 5.10.1 System Fi Ie Structure 5.10.2 System Tape Organization 5-44 5-45 5.10.3 System Startup 5-45 5.10.4 Continuous Operation 5-46 5.11 5-47 Drum File Organization CHAPTER 6 BACKGROUND/FOREGROUND MONITOR 6.1 Background/Foreground Monitor Functions 6-1 6.1.1 Scheduling of Processing Time 6-2 6.1.2 Protection of FOREGROUND Job Core and I/O 6-4 6. 1.3 Sharing of Multi-Unit Device Handlers 6-4 6.1.4 Use of Software Priority Levels 6-5 6.1.5 Use of Real-Time Clock 6-5 6.1.6 Communication Between BACKGROUND and FOREGROUND Jobs 6-5 6.2 Hardware Requirements and Options 6-5 6.3 Keyboard Commands 6-7 6.3. 1 FILES 6-7 6.3.2 FCORE 6-7 6.3.3 FCONTROL 6-7 6.3.4 BCONTROL 6-8 6.4 Operating the Background/Foreground Monitor System 6-8 6.4.1 Loading the Background/Foreground Monitor 6-9 6.4.2 Assigning Devices 6-9 6.4.3 Loading User FOREGROUND Programs 6-9 6.4.4 Loading System or User BACKGROUND Programs 6-10 vi CONTENTS (cont) Page 6.4.5 End of Job 6-11 6.4.6 Error Detection and Handling 6-12 CHAPTER 7 I/O DEVICE HANDLERS 7. 1 Description of I/O Hardware and API Software Level Handlers 7-1 7.1.1 I/O Device Handlers 7-1 7.1.2 API Software Level Handlers 7-4 7.1.3 Standard API Channel/priority Assignments 7-6 7.2 Writing Special I/O Device Handlers 7-6 7.2.1 Discussion of Example A by Parts 7-8 7.2.2 Example A, Skeleton I/O Device Handler 7-9 7.2.3 Example B, Special I/O Handler for Type AF01 B A/D Converter 7-11 7.2.4 Incorporating Special, User-Program I/O Handler into Paper Tape System 7-14 7.3 I/O Handlers Acceptable to System Programs 7-15 7.4 Summary of Standard I/O Handler Features 7-21 APPENDIX A PDP-9 ASCII CHARACTER SET APPENDIX B PDP-9 ASCII/HOLLERITH CORRESPONDENCE APPENDIX C KEYBOARD AND BACKGROUND/FOREGROUND MONITOR ERRORS APPENDIX D LINKING LOADER AND SYSTEM LOADER ERRORS APPENDIX E lOPS ERRORS APPENDIX F SYSTEM PROGRAM DISK AND DECTAPE ADDRESSES APPENDIX G SUMMARY OF KEYBOARD COMMANDS FOR KEYBOARD AND BACKGROUND/FOREGROUND MONITORS vii CONTENTS (cont) ILLUSTRATIONS 2-1 General I/O Communication in Monitor Environment 2-2 2-2 Command, Control, and Data Flow in Monitor Environment 2-3 2-3 Monitor Commands and Function Codes 2-4 2-4 line Buffer Structure 2-6 2-5 Format of Header Word Pair 2-7 2-6 lOPS Mode Data on Paper Tape 2-9 2-7 5/7 ASCII Packing Scheme 2-10 2-8 Image Mode Data on Paper Tape 2-11 2-9 lOPS ASCII and Image Alphanumeric Data in line Buffers 2-11 4-1 I/O Mon i tor System Memory Maps 4-5 4-2 Device Assignment Table (.DAT) for I/O Monitor 4-8 4-3 Device Assignment Table (.DAT) for PIP 4-9 5-1 Function of • DAT Slots in Keyboard Monitor System 5-20 5-2 Keyboard Monitor System Memory Maps 5-22 5-3 Paper Tape Block Format 5-35 5-4 Block Format, Fi Ie-Structured Mode 5-41 5-5a. Format of the File Directory Data Block 5-43 5-5b. Format of Fi Ie-Structured Tape 5-43 5-6a. User-Fi Ie Header Label Format 5-44 5-6b. User-File Trailer label Format 5-7a. System Program (PIP) Header Label 5-7b. System Program (PIP) Trailer Label 5-44 5-45 5-45 6-1 Keyboard Communication in Background/Foreground Monitor System 6-2 6-2 Background/Foreground Monitor System Memory Maps 6-13 7-1 Structure of API Software Level Handler 7-5 7-2 lOPS Binary Input Card Format 7-36 TABLES 2-1 Maximum line Buffer Sizes 2-8 2-2 Input/Output Data Mode Terminators 2-12 2-3 System Communication Table (.SCOM) Entries 2-13 4-1 Control Character Commands 4-10 viii TABLES (cont) Page 5-1 5-12 Control Character Commands ix PREFACE This manual contains information required to prepare programs for operation under control of PDP-9 ADVANCED Software System Monitors. The manual is organized as follows: Chapter 1 PDP-9 ADVANCED Software System Chapter 2 The PDP-9 Monitor Environment Chapter 3 User Program Commands (System Macros) Chapter 4 Input/Output Monitor Chapter 5 Keyboard Monitor Chapter 6 Background/Foreground Monitor Chapter 7 I/O Device Handlers The I/O Monitor (Chapter 4) is used with paper tape systems; the more sophisticated Keyboard Mon itor (Chapter 5) is used with bulk storage systems; and the Background/ Foreground Monitor (Chapter 6) is used with time-shared and real-time systems. Up- ward compatibility exists between the monitor systems. The Keyboard Monitor contains all the features of the I/o Monitor and also provides for Teletype keyboard commands. The Background/Foreground Monitor is an extension of the Keyboard Monitor and provides for concurrent BACKGROUND and FOREGROUND processing. An I/O Monitor Guide and a Keyboard Monitor Guide, prepared especially for convenient use at the computer console, are now available (Order Numbers DEC9A-MIPA-D and DEC-9A-MKFA-D, respectively). These console manuals sum- marize the essential information required to operate the I/O and Keyboard Monitors, and include detailed operating procedures for each of the system programs. It should be noted that all material presented in this manual for the Background/ Foreground Monitor is preliminary and subject to change. CHAPTER 1 PDP-9 ADVANCED SOFTWARE SYSTEM 1.1 INTRODUCTION PDP-9 ADVANCED software provides a complete system for program preparation, compilation, assembly, debugging, and operation. It features total relocatability and can expand to take full advantage of any hardware configuration. Powerful system programs include FORTRAN IV, a sophisticated macro assembler, an on-line debugging system, an on-line editor, and a peripheral interchange program. A versatile and flexible input/output programming system frees the user from the need to create devicehandling subroutines and the concerns of device timing. Three monitor systems are available with PDP-9 ADVANCED software. The Input/Output Monitor operates on a basic PDP-9 with 8192 (or more) words of memory, high-speed paper tape reader and punch, and a console teleprinter. The I/O Monitor operates in a paper tape (or card) environment and provides for the calling and handling of all input and output functions. The more sophisticated Keyboard Monitor is available for systems with auxiliary bulk storage units. It allows for device-independent programming and automatic creation, calling, and loading of programs. Since upward compatibility exists between the Input/Output Monitor and the Keyboard Monitor, all programs prepared for the I/O Monitor can also be run using the Keyboard Monitor. The Background/Foreground Monitor is an extension of the Keyboard Monitor. It allows for the concurrent, time-shared use of a PDP-9 system by a protected FOREGROUND user program and an unprotected BACKGROUND system or user program. This provides the user with optimum utilization of system hardware and processing time. 1.2 HARDWARE REQUIREMENTS To operate the PDP-9 ADVANCED software system under control of the Input/Output Monitor, a basic PDP-9 is required with: a. 8192 words of core memory b. 300 character per second paper tape reader c. 50 character per second paper tape punch d. Console teleprinter (Teletype Model KSR 33 or KSR 35) For extra memory, the Type K E09A Extended Arithmeti c Element and the Type KF09A Automatic Priority Interrupt can also be used with this system. The Type CR02B Card Reader can be used for input in addition to the paper tape reader; a Type 647 Line Printer can be used for listings. 1-1 Some form of bulk storage must be added to the basic PDP-9 to use the Keyboard Monitor: a. Type TC02 DECtape Control and two Type TU55 DECtape Transports, or b. Type TC59 Magnetic Tape Control and two 7-channel or 9-channel Magnetic Tape Transports (Type TU20, Type TU20A, or equivalent), or c. Type RC09 Fixed-Head Disk System Input/output routines are provided for these devices as required. In addition, this system can take full advantage of extra memory, central processor options, and additional I/O options. The Background/Foreground Monitor requires all the options itemized for the Keyboard Monitor plus the following: a. Type LT09A** Multi-station Teletype Control, and one Type LT09B Line Unit for each external Teletype. 1.3 b. Type KSR 33 Teletype c. Type KX09A Memory Protection Option d. Type KG09A Memory Extension Control e. Type MM09A Memory Module (8K) MONITOR SYSTEMS PDP-9 monitor systems simplify the handling of input/output functions and facilitate the creation, debugging, and use of PDP-9 programs. They allow overlapped input/output and computation, simultaneous operation of a number of asynchronous peripheral devices, and (in the case of the Keyboard and Background/Foreground Monitors) device-independent programming, while freeing the user from the need to create device handling subroutines. The monitors, operating in conjunction with the Input/ Output Programming System (lOPS), provide a complete interface between the user's programs and the peripheral hardware. The Background/Foreground Monitor effectively provides the user with two systems; on-line data acquisition and control can be performed in the FOREGROUND while user program compilation, debugging, etc., can be accomplished in the BACKGROUND environment. 1 .3. 1 Input/Output Monitor The Input/Output Monitor accepts I/O commands from the system or user programs and super- vises their execution. By calling upon the device manipulation routines of lOPS, it provides for simultaneous I/O and computation. * Background/Foreground systems cannot use magneti c tape as a system devi ce. **If the API option is available, a Type LTl9A Teletype Control and a Type LTl9B Line Unit are required instead of the LT09A and LT09B. 1-2 The I/O Monitor contains: a. Routines for its own initialization and control. b. Tables to allow communication between the Monitor, system programs, user programs, and the Input/Output Program System. c. The CAL Handler, which is used to dispatch to the appropriate Monitor and I/O sub- d. Device handlers for the Teletype and clock. routines. The I/O Monitor resides in lower core and occupies about 960 10 locations. 1.3.2 Keyboard Monitor The Keyboard Monitor is designed to operate on a PDP-9 system with some form of auxiliary bulk storage (see Hardware Requirements, Section 1.2). It includes all of the facilities of the I/O Monitor plus routines to accept and act upon Teletype keyboard commands, the ability to dynamically modify I/O device assignments for a program, and the facilities for automatically storing, calling, loading, and executing system and user programs. With the ability to alter I/O assignments, the Keyboard Monitor brings true device independence to the user. Programs may be modified simply and quickly to operate on any configuration, and additions to (or deletions from) an existing system need not result in program reassembly or recompilation. The Keyboard Monitor also frees the user from the problems of tape or card handling. Programs can be created, stored, retrieved, loaded, debugged, and operated at the keyboard console. Both system and user programs can be called from the bulk storage device with a few simple keyboard commands. The Keyboard Monitor also has a batch processing capability that allows user commands to come from the paper tape reader (or card reader) instead of the Teletype, perm itti ng many programs to be run without operator intervention. 1.3.3 Background/Foreground Monitor The Background/Foreground Monitor is designed to control processing and I/O operations in a real-time or time-shared environment. FOREGROUND programs are defined as the higher priority, debugged programs that interface with the real-time environment. They normally operate under Program Interrupt (PI) or Automatic Priority Interrupt (API) control. At load time they have top priority in selection of core memory and I/O devices, and at execution time they have priority (according to the assigned priority levels) over processing time and use of shared I/O. BACKGROUND processing is essentially the same as processing normally performed under control of the Keyboard Monitor. That is, it could be an assembly, compilation, debugging run, 1-3 production run, editing task, etc. BACKGROUND programs may use any facilities (core, I/O, or processing time) that are available and not simultaneously required by the FOREGROUND job. 1.4 INPUT/OUTPUT PROGRAMMING SYSTEM (lOPS) The Input/Output Programming System (lOPS) consists of an I/O control routine and indivi- dual hardware device handling subroutines that process file and data level commands to the devices. These handlers exist for all standard PDP-9 peripherals (see Section 7.4). The I/O control routine accepts user program commands and transfers control to the appropriate device handlers. These device handlers are responsible for transferring data between the program and I/O devices, for initiating the reading or writing of files, for the opening and closing of files, and for the performance of all other functions peculiar to a given hardware device. They are also responsible for ignoring functions which they are incapable of handling (for example, trying to rewind a card reader, or skipping files on a non-file-oriented device). All device handlers operate either with or without the Automatic Priority Interrupt (API) option. 1.5 SYSTEM PROGRAMS PDP-9 ADVANCED software systems include either the Input/Output Mon itor, the Keyboard Monitor, or the Background/Foreground Monitor in addition to an Input/Output Programming System and the following system programs: FORTRAN IV Compiler, Object Time System, and Science Library MACRO-9 Assembler Dynamic Debugging Technique (DDT) Program Text Editor Program Peripheral Interchange Program Linking Loader PDP-7 to MACRO-9 Assembly Language Converter Chain Bui Ider Program Chain Execute Program System Generator With Keyboard and Background/Foreground Monitor systems only Dump Program Library Update Program System Patch Program The following special-purpose utility programs are also available: Disk/DECtape Save Disk/Paper Tape Save } for Disk users PUNCH9 - for paper tape systems 1-4 1.5.1 FORTRAN IV Compiler The PDP-9 FORTRAN IV compiler is a two-pass system that accepts statements written in the FORTRAN IV language and produces a relocatable object program capable of being loaded by the Linking Loader. It is completely compatible with USA FORTRAN IV, as defined in USA Standard X3.9-1966, with the exception of the following features which were modified to allow the compiler to operate in 8192 words of core storage: a. Complex arithmetic is not legal. b. Adjustable array dimensions are not allowed at source level, but may be implemented by call ing dimension-adjustment subroutines. c. Blank Common is treated as named Common except when object program is used in d. The implied DO feature is not included for the DATA statement. e. Specification statements must be strictly positioned and ordered. chaining. The FORTRAN IV compiler operates with the PDP-9 program interrupt or API facilities enabled. It generates programs that operate with the program interrupt or API enabled and can work in conjunction with assembly language programs that recognize and service real-time devices. Subroutines written in either FORTRAN IV or MACRO-9 assembly language can be loaded with and called by FORTRAN IV main programs. Comprehensive source language diagnostics are produced during compilation, and a symbol table is generated for use in on-line debugging with DDT. There are two versions of the FORTRAN IV compiler; F4 is the basic compiler, and F4A is an abbreviated version that allows for DECtape I/O in an 8K system. F4A does not provide for object code listing, symbol table listing, EQUIVALENCE statements, ASSIGN statements, assigned GOTO statements, or EXTERNAL statements. The PDP-9 FORTRAN IV Compiler, Object Time System, and Science Library are described fully in the FORTRAN IV Manual (DEC-9A-KFZA-D). 1.5.2 MACRO-9 Assembler The MACRO-9 Assembler provides PDP-9 users with highly sophisticated macro generating and calling facilities within the context of a symbolic assembler. MACRO-9 is described in detail in the MACRO-9 Assembler Manual (DEC-9A-AMZA-D). Some of the prominent features of MACRO-9 include: a. The abi lity to (1) define macros (2) define macros within macros (nesting) (3) re-define macros (in or out of macro definitions) 1-5 (4) call macros within macro definitions (5) have macros call themselves (recursion) b. Conditional assembly based on the computational results of symbols or expressions. c. Repeat functions. d. Boolean manipulation. e. Optional octal and symbolic listings. f. Two forms of radix control (octal, decimal) and two text modes (ASCII and 6-bit tri mmed ASCII). g. Global symbols for easy linking of separately assembled programs. h. Choice of output format: relocatable, absolute binary (check summed); or full binary capable of being loaded via the hardware READIN switch. i. Ability to call input/output system macros that expand into lOPS calling sequences. A shorter version of the assembler (MACRO A) is avai lable to enable users with 8K systems to use DECtape for input and output. Conditional pseudo-ops and .ABS, .FUll, .REPT, and .DEFIN are not allowed. 1.5.3 Dynamic Debugging Technique (DDT) Program DDT provides on-line debugging facilities within the PDP-9 ADVANCED software system, enabling the user to load and operate his program in a real-time environment while maintaining strict control over the running of each section. DDT allows the operator to insert and delete breakpoints, examine and change registers, patch programs, and search for specific constants or word formats. The DDT -9 breakpoint feature allows for the insertion and simultaneous use of up to four breakpoints, anyone (or all) of which may be removed with a single keyboard command. The search facility allows the operator to specify a search through any part or all of an object program with a printout of the locations of all registers that are equal (or unequal) to a specified constant. This search feature also work, for portions of words as modified by a mask. With DDT -9, registers may be examined and modified in either instruction format or octal code, and addresses may be specified in symbolic relative, octal relative, or octal absolute. Patches may be inserted in either source language or octal. DDT -9 is described more fully in the PDP-9 Utility Program Manual (DEC-9A-GUAB-D). 1.5.4 Text Edi tor Program The Text Editor of the PDP-9 ADVANCED software system provides the ability to read alpha- numeric text from any input device (paper tape reader, card reader, disk, DECtape, magnetic tape, etc.), to examine and correct it, and to write it on any output device. It can also be used to create new symbo Ii c programs. 1-6 The Editor operates on lines of symbolic text delimited by carriage return (CR) or ALT MODE characters. These lines can be read into a buffer, selectively examined, deleted or modified, and written out. New text may be substituted, inserted, or appended. For further details on the Text Editor, refer to the PDP-9 Utility Programs Manual (DEC9A-GUAB-D). 1.5.5 Peripheral Interchange Program (PIP) The primary function of PIP is to facili.tate the manipulation and transfer of data files from any input device to any output device. It can be used to refresh mass storage file directories, list file directory contents, delete, insert, segment, or combine files, perform code conversions, and copy tapes. Directions for the use of PIP-9 can be found in the PDP-9 Utility Programs Manual (DEC9A-GUAB-D). 1.5.6 Linking Loader The Linking Loader loads any PDP-9 FORTRAN IV or MACRO-9 object program which exists in relocatable format (or absolute format if pseudo-ops .ABS and .FULL are not used). Its tasks include loading and relocation of programs, loading of called subroutines, retrieval and loading of implied subroutines, and building and relocation of the necessary symbol tables. Its operation is discussed in the PDP-9 Utility Program Manual (DEC-9A-GUAB-D). 1.5.7 PDP-7 to MACRO-9 Assembly Language Converter This system program converts source programs written in PDP-7 or BASIC PDP-9 assembly language to a format acceptable to the MACRO-9 assembler. CONV is described more fully in the PDP-9 Utility Programs Manual (DEC-9A-GUAB-D). 1.5.8 System Generator The System Generator (SGEN) is a standard system program used to create new system tapes. With it, the user can tailor his system to his installation's needs and specify standard input and output devices, memory size, and special I/O and central processor options present. A more complete description of SGEN and details of its use, are given in the Keyboard Monitor Guide (DEC-9A-MKFA-D). 1-7 1.5.9 Dump Program This system program gives the user the ability to output on any listing device, specified core locations that have been preserved on a bulk storage file via the CTRL Q Keyboard Monitor dump command. A more complete description of the Dump program is given in the Keyboard Monitor Guide (DEC-9A-MKFA-D). 1.5.10 Library Update Program This system program gives the user the capability to examine and update the binary library files on file-oriented devices. A more complete description of the Library Update program is given in the Keyboard Monitor Guide (DEC-9A-MKFA-D). 1.5.11 System Patch Program The System Patch program is used to make corrections to the binary version of non-relocatable system programs on the system device. A more complete description of the System Patch program and details of its use, are given in the Keyboard Monitor Guide (DEC-9A-MKFA-D). 1.5.12 Chain Builder and Execute Programs The Chain Builder and Execute programs provide the user with a capability for program seg- mentation which allows for multiple core overlap of executable code and certain types of data areas. A more complete description of the Chain Builder and Execute programs is given in the Keyboard Monitor Guide (DEC-9A-MKFA-D). 1-8 CHAPTER 2 THE PDP-9 MONITOR ENVIRONMENT 2.1 MONITOR FUNCTIONS PDP-9 ADVANCED Software System Monitors greatly simplify the task of programming I/O functions by providing an interface between system or user programs and the external world of I/o devi ces. Upward compatibi lity exists between the Monitor systems; programs written to operate under contro I of the I/o Monitor wi II a Iso operate, without modi fi cati on, under contro I of the Keyboard and Background/Foreground Monitors. The Monitors, by means of the Input/Output Programming System (IOPS) and Program Interrupt (PI) or Automati c Priori ty Interrupt (API), allow si mu Itaneous operation of multi pie I/o devices a long with overlapping computati ons. Certain features such as the genera I monitor environment, data handling, and logi ca I/physi cal I/O device associations, are common to all three monitors. These features are discussed at length in this chapter. It is recommended that the reader become thorough Iy fami liar with the contents of this chapter before reading chapters that apply to each of the monitors. 2 .1 .1 General I/o Communication The general communication required to accomplish an I/o task is the same for all three monitor systems (see Figure 2-1). A system or user program initiates an I/o function by means of a monitor command (system macro), which is interpreted by a CAL handler within the monitor as a legitimate I/o call. (See the PDP-9 User Handbook for a description of the CAL instruction.) The I/o call includes a logical I/o device number as one of its arguments. The monitor establishes the logical/ physical I/O device association by means of its Device Assignment Table (.DAT). When this has been accomplished, the monitor passes control to the appropriate device handler subroutine to initiate the I/o functi on and return contro I to the system or user program. The system or user program retai ns control until an interrupt (PI or API) occurs, at which time it relinquishes control to the device handler to perform and/or complete the specified I/o function. Computations or other processing can be performed by the system or user program while waiting for an interrupt. This feature allows the programmer to make optimum use of avai lable time. 2-1 DATA ~ SYSTEM OR USER PROGRAM i CONTROL RETURN Figure 2-1 2.1 .2 ~ V I A CAL HANDLER VIA CAL I/O DEVICE HANDLER VIA PI OR API I/O DEVICE MON ITOR INITIATION \ INTERRUPT • • j General I/o Communication in Monitor Environment Command, Contro I, and Data Flow Figure 2-2 provides a more detai led representation of the monitor environment, with emphasis on command, control, and data flow. As shown, the user can initiate a command via the Teletype. In the I/o Monitor environment, this command can be interpreted only by a Command Processor within the system program (or user program if so designed). In the Keyboard and Background/Foreground Monitor environments, an expanded set of keyboard commands can a Iso be interpreted by a Keyboard Listener (.KUST) and acted upon by a Monitor Command Decoder (.MCD). This feature greatly extends the capabilities of the monitors and provides the user with a large repertoire of keyboard commands. The monitor shown in Figure 2-2 can represent anyone of the monitor systems, except that the I/o Monitor does not contain the .KUST and .MCD programs to interpret and act upon Teletype keyboard commands. The .KUST and .MCD programs are nonresident in the sense that they are overlaid by user and system programs. Each system or user program must internally set up line buffers (except when using Dump mode, discussed later) to be used in transmitting data to or from the external environment. Each line buffer of n words consists of a two-word header {referred to as a header word pair} and n -2 words of data. The system or user program can exercise control on output by modifying the header word pair, or it can verify on input by examining the header word pair. The use of line buffers is discussed in more detail later in this chapter. Monitor I/o commands {system macros} are written as part of the system or user program. In FORTRAN IV source programs, these commands are in the form of READ and WRITE statements {refer to the FORTRAN IV Manual, DEC-9A-AF4B-D}. These statements are translated by the compiler into the proper calling sequences for the FORTRAN Object Time System which provides the required monitor calls at execution time. In MACRO-9 source programs, monitor I/O commands are written as system 2-2 MONITOR ENVIRONMENT EXTERNAL ENVIRONMENT I ~ Y-;O A-;D -;::N';-B;;' I I MON ITOR SYSTEMS ONLY I KEYBOARD COMMANDS I COMMAND I ACKNQWL EDGE ME N TS ERROR COMMANDS USER MESSAGES TELETYPE COMMANDS II I I I W I ERRORS PROGRAM OUTPUT CONTROL I '" MONITOR MON I TOR ERROR DIAGNOSTIC LMED) • I I SYSTEM OR USER PROGRAM COMMAND PROCESSOR ACKNOWLEDGEMENTS IN PUT HEADER VERIFICAT ION i i MONITOR WORD PAIR I I I I DATA I I I I I I I I I I I L I ______ I I I I ERROR MESSAGES AND COMMAND ACKNOWLEDGEMENTS I I II M(O:I\~~ T C)OM~~~D I KEYBOARD LISTENER I DECODER I.MCDI I L_ - - - - _.J ERRORS DEVICE ASSIGNMENT] TABLE LOAl) COMMANDS (SYSTEM MACROS) CONTROL DATA LIN E CAL HANDLER BUFFER I NON I/O FUNCT IONS MON! TOR ~I CONTROL ROUTINE I 11/0 FUNCTIONS' - ERRORS MONITOR ,----- J - - - - - I/O CONTROL ROUTINE I I _________ -.---J - lOPS I/O DEvICE DATA AND CONTROL I I I I L INTERRUPT 4 : I I INITIALIZATION INITIATION .. ERRORS I/O DEVICE HANDLER - -) -, I I I I I I I I I I ---------------------------- ~ INPUT /OUTPUT PROGRAMMING SYSTEM (lOPS) Figure 2-2 Command, Control, and Data Flow in Monitor Environment macros withi n the system or user program. These system macros are expanded at assemb Iy ti me and inc lude a CAL initiated monitor call that contains the logical device number as one of the arguments. At execution time, monitor calls are processed by the CAL Handler within the monitor. Non-I/O functions are then further processed by the Monitor Control routine, and I/o functions are processed by the I/o Control routine (see Figures 2-2 and 2-3). A complete description of each of these commands is given in Chapter 3. If the original command involved is an I/o function, the I/o control routine checks the Device Assignment Table to associate the logical I/o device (specified by the system macro) to a physical I/o device. In the I/o Monitor environment, the logical/physical device associations can be modified only by reassembly. In the Keyboard and Background/Foreground Monitor environments, device associations can be modified at System Generation time, or by means of the ASSIG N keyboard command just pri or to loadi ng a system or user program. This capabi lity adds true device independence to the monitor systems. Function Code Command .INIT Functions processed by I/o control routine Functions processed by monitor control routine Figure 2-3 2 .DLETE, .RENAM, and .FSTAT 3 .SEEK 4 .ENTER 5 .CLEAR 6 .CLOSE 7 .MTAPE 10 • READ and .REALR 11 .WRITE and .REALW 12 .WAIT and .WAITR 13 .TRAN 14 • TIMER 15 • EXIT 16 .SETUP 17 .IDLE Monitor Commands and Function Codes 2-4 NOTE .INIT, .READ, .WRITE, .WAIT, .WAITR, .CLOSE, • TIMER, and .EXIT are recognized by all three monitors • •SEEK, .ENTER, .FSTAT, .RENAM, .DLETE, • TRAN, .CLEAR, and .MTAPE are recognized by the Keyboard and Background/Foreground Monitors (and are ignored by the I/O Monitor) • •SETUP is used by the Monitors in setting up the I/o skip chain and API channel registers (see Chapter 7) • •ID LE is recogni zed by the Background/Foreground Monitor only. When the logical/physical I/O device association has been established, the monitor passes control to the appropriate I/o device handler which initializes itself, initiates I/o, and returns control to the system or user program. As mentioned previously, the system or user program retains control unti I the specified device causes an interrupt (PI or API). At this point, it relinquishes control to the device handler to continue or complete the specified I/O operation. In either case, control is returned to the system or user program at the point where it was interrupted. The system or user program, by means of a . WAIT system macro (described in Chapter 3), can determi ne whether an input or output operati on has been completed. If the transfer of data from or to the system or user program line buffer has been completed, program execution continues; if the transfer has not been completed, control is returned to the •WAIT macro. Additional buffering is provided by the individual device handlers as required. All device handlers are non-resident in the sense that only those handlers required by the system or user program are loaded into core. 2.2 LINE BUFFERS As menti oned in the preceedi ng genera I descri pti on of the moni tor envi ronment, each system or user program must internally set up line buffers to be used in transmitting data to or from the external environment. An exception to this rule is when data is transmitted in the Dump mode (described in Section 2.3.3). Each line buffer ofn words (always even) should be set up to consist ofa two-word header (termed a header word pair) followed by n-2 words of data as shown in Figure 2-4. 2-5 Word 0 First Word of Line Buffer Header Word 1 Second Word of Li ne Buffer Header Word 2 First Word of Data Area ! Last Word of Data Area l Word n-1 FiglJ"e 2-4 Li ne Buffer Structure A system or user program should contain at least one line buffer for each device that is to be used. This buffer is used to set up output lines before transmittal to an output device, or to receive input lines from the associated input device. The monitor accepts commands (system macros) from system or user programs to initiate input to the line buffers and to write out the contents of line buffers. Complete descriptions of these commands are given in Chapter 3. Line buffers are internal to, and must be defined by, each system or user program. The header word pair within a line buffer is detai led in Figure 2-5. The .BLOCK pseudo operation may be used to reserve space for a line buffer. A tag is required to allow referencing by indivdual .READ and .WRITE macros. For example: .DEC LINEIN .BLOCK 52 UNOUT .BLOCK 52 /creates 52-word line /buffer named UNEIN. /creates 52-word line /buffer named UNOUT. Before output, the user must set the appropriate word pair count in bits 1 through 8 of word zero in the line buffer if they have not a Iready been set by a device handler on input. This count overrides the word count passed to lOPS by the. WRITE macro. (The word count must still be specified in the .WRITE macro for each data mode; however, it only has meaning in Dump mode since there is no header word pair.) In lOPS binary mode (discussed in Paragraph 2.3.1 .2), bits 9 through 11 should be set to 101 if the output wi II ultimately be on cards. The checksum word, the second word in the header, need not be set by the user since checksums are computed by lOPS. Before input, the user should not be concerned with the header word pair since they wi II be set by lOPS to enable the user to determine what has happened after input has terminated. On input, the word count specified in the .READ macro is used by lOPS to determine the maximum number of locations to be occupied by the data being read. If the word count is exceeded before input is terminated, or if there is a parity or checksum error, lOPS sets the appropriate va lidity bits in header word 0 to i ndi cate the error. 2-6 o COUNT 1- IGNORE CHECK SUM ON BINARY INPUT 9--11 ~~B I 1 0 1 12 I , 13 V 1 14 17 lID MODE I ~ r FOR lOPS BINARY ONLY } (CORRESPONDS TO 7-9 PUNCH ON BINARY CARDS) 1 ~~~~~~~~~~~~~~---' VALIDITY BITS. 00 = DATA CORRECT 01 PARITY ERROR = 10 CHECK SUM ERROR } 11 = SHORT LINE . (BUFFER OVERFLOW) = ~~~~~~~~---' lID MODE. 0000 = lOPS BINARY 0001 = IMAGE BINARY 0010= lOPS ASCII 001 1 • IMAGE ALPHANUMERIC = = 0100 DUMP 0101 EOF (LOGICAL! 011 0 = EOM (PHYSICAL! * *} ~~~~~~~~~~---' 011 1 = TAPE LABEL" * lOPS AND IMAGE MODES ONLY 0~~~~~~~~~~~~~~~~~~~~~~~~~---17 HEADER, WORDI ~----------'----y~--~~--------~ CHECK SUM: TWO'S COMPLEMENT OF HEADER WORD 0 PLUS WORDS (0= CHECK SUM NOT COMPUTED) Figure 2-5 DATA - - - - - - - ' Format of Header Word Pair After input, the user should check the validity bits in word 0 of the line buffer header to determine if the data was read without error. If multiple errors are detected, priority is given to a parity error over a checksum error. lOPS ignores checksum errors on binary input if bit 0 of word 0 of the line buffer header is set to 1. lOPS sets the I/O mode bits (bits 14 through 17 of word 0 of the line buffer header) to: 6 (0110 2 ) if it senses a physical end-of-medium (such as end-of-tape in the paper-tape reader), or 5(0101 2 ) if it senses a logical end-of-file during an lOPS binary read. When choosing a word count (that is, the maximum line buffer size) to specify in system macros, both the set of possible devices and the mode of data transmission must be considered. The maximum line buffer sizes (including 2-word header) for standard peripheral devices, along with applicable data modes, are listed in Table 2-1. 2-7 Table 2-1 Maximum Line Buffer Sizes Maximum Line Data Modes* Buffer Size Device PR (paper tape reader) 52 10 All 34 10 sufficient if A mode only, Heaaers accepted for B; generated for A, I, H PP (paper tape punch) 52 10 All 3410 sufficient if A mode only, Headers output for B on Iy , TT (Teletype) 34 10 A,H only A Ilows for 80 10 characters, Headers generated on input, Headers not output on output, CD (card reader) 52 10 All 52 for B mode; 82 10 for I, H mo es, Headers accepted for B; generated for A, I, H, LP (I i ne pri nter) 52 10 A only Allows for 125 10 characters, No headers output, DTO-7 (DECtape) 255 10 All MTO-7(magnetic tape) 255 10 All OK (disk) 255 10 All DR (drum) 255 10 All * Data Modes are: 2,3 Notes 1R lOPS and image modes allow for severa I Ii ne buffers (I og ica I records) per physica I block, A = lOPS ASCII B = lOPS Binary 0= Dump Mode I = I mage Bi nary H = Image Alphanumeric DATA MODES The Input/Output Programming System allows data transmission to or from a system or user program in five different modes, Mode lOPS Binary I mage Bi nary lOPS ASCII Image Alphanumeric Dump Code * o 1 2 3 4 2-8 * Bits 14 through 17 of Header Word 0, specified by system macro and set by lOPS, 2.3.1 lOPS Modes The two lOPS data modes include lOPS ASCII and lOPS binary as shown in Figure 2-6 on paper tape, and described in the following paragraphs. TAPE CHANNEL 87654 321 FEED DIRECTION) OF TAPE MOVEMENT 00000 0 00000 0 0 000 0 0 000 00000 a 000 0 000 0 0 i~ t'-___ I L ._ _ _ _ _ _ _ 7-BIT ASCII CODE PARITY BIT IEVEN PARITY) lOPS ASCII TAPE CHANNEL 8765432 FEED DIRECTION) OF TAPE MOVEMENT I - .0000 0000 • 0 0 0 0 0 • 0 0 0 0 .0000 1st 6-BlTBYTE 0 0 0 2 nd 6-81 T BYTE 0 0 0 0 3 rd 6-81T BYTE 0 000 '--y-----J t ~ 6-BITS OF BINARY WORD PARITY BIT 1000 PARITY) MUST ALWAYS BE PUNCHED lOPS BINARY Figure 2-6 2.3.1.1 lOPS Mode Data on Paper Tape lOPS ASCII - 7-bit ASCII is used by lOPS to accommodate the entire 128-character revised ASCII set (Appendix A). All alphanumeric data, whatever its original form on input (ASCII, Hollerith, etc.) or fi na I form on output, is converted i nterna Ily and stored as 5/7 ASCII. "5/7 ASCII" refers to the internal packing and storage scheme. Five 7-bit ASCII characters are packed in two contiguous locations as shown in Figure 2-7 and can be stored as binary data on any bulk storage device. Input requests involving lOPS ASCII should be made with an even word count to accommodate the paired input. ASCII data is input to or output from lOPS ordinarily, via the Teletype or paper tape, although it may exist in 5/7 ASCII form on any mass storage device. lOPS ASCII is defined as a 7-bit ASCII character with even parity in the eighth (high order) bit, in keeping with USA standards. lOPS performs a parity check on input of lOPS ASCII data prior to the 5/7 packing. On output, lOPS generates the correct pari ty . 2-9 o .....f - - - - - - - -... 6 7 ......f - - - - - - -__•• 13 14 ...- -... 17 1ST CHARACTER 2ND CHARACTER 3RD CHARACTER 1-4 WORD 0 0_2 WORD 1 3" .9 5TH CHARACTER 4TH CHARACTER Figure 2-7 ~ 10" 16 17 47- UNUSED 5/7 ASCII Packing Scheme Non-parity lOPS ASCII occurs in data originating at a Model 33, 35, or 37 Teletype, without the parity option. This data always appears with the eighth (high order) bit set to 1. Apart from parity checking, the lOPS routines handle lOPS ASCII and non-parity lOPS ASCII data identically. An alphanumeric line consists of an initial form control character (line feed, vertical tab, or form feed), the body of the line, and a carriage return (CR) or ALT MODE. CR (or ALT MODE) is a required line terminator in lOPS ASCII mode. Control character scanning is performed by some device handlers for editing or control purposes (see Section 7.4 for effects of control characters on specific devices). 2.3.1.2 lOPS Binary - lOPS Binary data is blocked in an even number of words, with each block preceded by a two-word header. On paper tape (see Figure 2-6), lOPS binary uses six bits per frame, with the eighth channel always set to 1, and the seventh channel containing the parity bit (odd parity) for channels 1 through 6 and channel 8. The parity feature supplements the checksumming as a data validity provision in paper tape lOPS binary. 2.3.2 Image Modes Image Mode data is read, written, and stored in the bi nary or a Iphanumeri c form of the source or terminal device, one character per word, as shown in Figures 2-8 and 2-9. No conversion, checking, or packing is permitted, and character scanning is generally omitted. 2.3.3 Dump Mode Dump Mode data is a Iways binary. Dump mode is used to output from or load directly into any core memory area, bypassing the use of line buffers. Each dump mode statement has arguments defi ni ng the core memory area to be dumped. Dump mode is norma Ily used wi th bu Ik storage devi ces, although it is also possible to use it with paper tape output and input. 2-10 TAPE CHANNEL 87654 321 FEED 00000 0 000 000000000 DIRECTION) OF TAPE MOVEMENT 00000 0 0 00000 0 000 0 0 ~---y~--- L ALL EIGHT CHANNELS USED I MAGE ALPHANUMERIC TAPE CHANNEL 87654 321 FEED DIRECTION) OF TAPE MOVEMENT .0000 0 000 .0000 0 000 .00000000 .0000 0 000 6-BIT BINARY CODE (3 FRAMES/WORD) IGNORED MUST ALWAYS BE PUNCHED IMAGE BINARY Figure 2-8 Image Mode Data on Paper Tape ra 0 I A C I 17 I 2 I " rsI I WORD COUNT IC J I 0 17 3 HEADER WORD PAIR B WORD COUNT 0 .1-< A ABC; INS/7ASCII B C .J IMAGE ALPHANUMERIC lOPS ASCII 2.3.4 ABC" FO UR 8-B I T CHARACTERS >- (RIGHT JUSTIFIED) ; Figure 2-9 HEADER WORD PAIR lOPS ASCII and Image Alphanumeric Data in line Buffers Input/Output Data Mode Terminators Input/output terminators for each of the data modes are summarized in Table 2-2. 2-11 Table 2-2 Input/Output Data Mode Terminators I N P U T lOPS ASCII lOPS Binary Image Alphanumeric Image Binary Dump Carriage Return Word Pair Count Word Count Word Count Word Count ALT MODE End of Medium End of Medium End of Medium End of Medium Word Pair Count** Word Count* End of File** End of Fi le~* End of Fi le** End of Medium End of File** Word Count* End of Fi le** 0 U T P U T Carriage Return ALT MODE Word Count Word Pair Count Word Pair Count*** (except on Teletype) Word Pair Count Word Pair Count ,- *A short Line Indicator will be placed by lOPS into the validity bits (12 and 13) of Header Word 0 if the maximum size of the line buffer is reached before an End-of-File. **Bulk storage only. ***If the word pair count is not greater than 1, the output line is ignored. If the word pair count is greater than 1, it has no effect and a carriage return or ALT MODE are the only legal line terminators. 2.4 SYSTEM TABLES System tables used by each of the monitor systems include the Device Assignment Table (.DAT), and the System Communication Table (.SCOM). These tables are discussed in the following paragraphs. 2.4.1 Device Assignment Table (.DA T) Both FORTRAN IV and MACRO-9 coded user programs, as well as the system programs, specify I/o operations with commands to logica I I/o devices. One of the monitor's functions is to relate these logical units to physical devices. To do this, each of the monitors contains a Device Assignment Table (.DAT) which has "slot" numbers that correspond directly to logical I/o device numbers. Each .DAT slot contains the physical device unit number (if applicable) along with a pointer to the appropriate device handler. All I/o communication in the monitor environment is accomplished by the logical/physical device associations provided by the Device Assignment Table. The use of the Device Assignment Table differs for each of the monitor systems, and is discussed separately for each of the monitors (Chapters 4, 5, and 6). 2-12 2.4.2 System Communication Table (.SCOM) The System Communication Table (. SCOM) provides a list of registers that can be referenced by the monitor, lOPS, and system programs. A complete list of . SCOM entries, and the purpose of each, is given in Table 2-3. The System Communication Table begins at location 1008 . Table 2-3 System Communication Table (.SCOM) Entries Word Purpose .SCOM First free register below resident portion of System Bootstrap (constant) .SCOM + 1 First free register above resident KM-9 (constant) .SCOM + 2 First free reg ister .SCOM + 3 Last free register .SCOM + 4 Hardware options available: Bit 0 Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 1 = API 1 = EAE 1 = TTY is 35/37 1 = Non-resident KM-9 in core 1 = VC38 Character Table 1 = 339 Pushdown Table 1 = 9-channel, 0 = 7-channel Magnetic tape Bits 15-17 Drum Size: 1 = 32K (RM09 A) 2 = 65K (RM09B) 3 = 131K (RM09C) 4 = 262K (RM09D) 5 = 524K (RM09E) .SCOM + 5 System program starting location .SCOM + 6 User starting location (bits 3 through 17), and: Bit 0 Bit 1 Bit 2 1 = DDT Load 1 = G Load 1 = No-symbol-table Load .SCOM + 7-11 8 Device numbers of Linking Loader1s devices. These are used to avoid loading user handlers already in core for the Loader itself. . SCOM + 12-158 Transfer vectors associated with API software level channel registers 40 through 43 8 . . SCOM + 16 Conta i ns PC on keyboard interrupts • . SCOM + 17 Conta i ns AC on keyboard interrupts . 2-13 2.5 SPECIFYING DEVICES USED TO LINKING LOADER When writing a MACRO-9 program that uses monitor commands {system macros}, it is necessary to use the .IODEV pseudo operation somewhere in the program to specify to the Linking Loader which .DAT slots are to be used. The .IODEV pseudo-op causes a code to be generated that is recognized by the Linking Loader and used to load device handlers associated with specified .DAT slots. FORTRAN IV programs cause the compi ler to generate this code based on the units specified in READ and WRITE statements. {If a variable is used in a FORTRAN program to specify an I/o unit, handlers will be loaded for all positive .DAT slots that have handlers assigned.} The .IODEV pseudoop has the following form .IODEV 3, 5, 6 where the MACRO-9 program containing this statement can use .DAT slots 3, 5, and 6. An error message is generated if a slot called for by a program is unassigned. 2-14 CHAPTER 3 USER PROGRAM COMMANDS (SYSTEM MACROS) All user program commands or system macros are described in this chapter for convenient reference. All commands that apply to the I/o Monitor are presented first and are followed by de- scriptions of the additional commands that apply to the Keyboard and Background/Foreground Monitors, respectively. Because of the upward compatibility of monitor systems, all I/o Monitor commands (sys- tem macros) are also used in the Keyboard and Background/Foreground Monitor environments. All Key- board Monitor commands (system macros) are also used in the Background/Foreground Monitor environment. Note that all information presented in this manual for the Background/Foreground Monitor is preliminary and subject to change. NOTE When executing a system macro, the monitor makes no attempt to save the user's accumulator and link bit. 3.1 I/o MONITOR COMMANDS (SYSTEM MACROS) The following commands are available for use in programs that are to operate in the I/o Monitor environment. Each command is described in detail in the paragraphs that follow. Name Purpose . INIT Initializes the device and device handler . . READ Transfers data from the device to the line buffer . • WRITE Transfers data from the line buffer to the device . . WAIT Checks availability of the user's line buffer and waits if busy. .WAITR Checks availability of the user's line buffer, and provides transfer address for busy return. . CLOSE Terminates use of a file • . TIMER Calls and uses real-time clock . . EXIT Returns control to the Monitor . 3-1 3. 1 . 1 .INIT {Initialize} FORM: .INIT a, F, R VARIABLES: a = Device Assignment Table (. DAT) slot number (in octal radix) F= File Type: { 0= Input File 1 = Output File R = User Restart Address* (should be in every .INIT statement) EXPANSION: LaC CAL + F7 - 8 + a 9 - 17 LaC + 1 1 LaC + 2 R LaC + 3 n /The CAL handler will place the unit number (if /applicable) associated with. DAT slot a into bits /0 through 2 of this word. ** /Maximum size of line buffer associated with. DAT /slot ~, for example, 255 10 for DECtape. *** DESCRIPTION: The macro .INIT causes the device and device handler associated with. DAT slot a to be initialized •• INIT must be given prior to any I/O commands referencing .DAT slot~; a separate .INIT command must be given for each .DAT slot referenced by the program. Each initialized .DAT slot constitutes an open file to the device handler and must be .CLOSEd. Since a • DAT slot may refer to only one type of file (input or output), only one file type specification (0 or 1) may be made in an .INIT statement. If a . DAT slot first references an input file, then an output file (or vice versa), a second .INIT command must be executed to change the transfer direction prior to the actual data transfer command. 3.1.2 .READ FORM: .READ a, M, L, W VARIABLES: a = • DAT slot number (octal radix) o = lOPS Binary M = Data mode 1 = Image Binary 2 = lOPS ASCII 3 = Image Alphanumeric 4 = Dump Mode *Has meaning only for .INIT commands referencing slots used by Teletype (the last .INIT command encountered for any slot referencing the keyboard or teleprinter takes precedence). When the user types tP, control is transferred to R. For example, the Linking Loader takes advantage of this feature to restart the system when a new medium has been placed in the input device. **Has no direct effect upon the user's program, but should be noted so that no attempt will be made to use LaC + 1 as a constant. ***Size is returned by the handler so that the program, in a device-independent environment, can use it to properly set up line buffers. 3-2 L = Line Buffer address W = Line buffer word count (decimal radix), including the two-word header EXPANSION: LaC CAL + M6 - 8 + 9-17 LaC + 1 10 LOC + 2 L . DEC LOC + 3 /CAL Handler will place unit number (if applicable) /into bits through 2. a /Decimal radix -W DESCRIPTION: The . READ command is used to transfer the next I ine of data from the device assigned to. DAT slot ~ to the line buffer in the user's program. In the operation, M defines the mode of the data to be transferred; L is the address of the line buffer; and W is the number of words in the line buffer (including the two-word header). Since I/O operations and internal data transfers may proceed asynchronously with computat ion, a . WAIT command must be used after a • READ command before the user attempts to use the data in the line buffer or to read another line into it. When a . READ (non-dump mode) has been completed, the program should interrogate bits 12 through 13 of the first word of the line buffer header to ascertain that the line was read without error. Bits 14 through 17 should be checked for end-of-medium and end-of-file conditions. 3.1.3 .WRITE FORM: .WRITE a, M, L, W VARIABLES: a = . DAT slot number (octal radix) a = lOPS Binary M = Data mode 1 = Image Binary 2 = lOPS ASCII;-';' 3 = Image Alphanumeric 4 = Dump Mode L = Li ne buffer address W = Line buffer word count (decimal radix), including the two-word header EXPANSION: LaC CAL + M6 - 8 to a9_ 17 LaC + 1 10 LaC + 2 L . DEC LaC + 3 /CAL Handler will place the unit number (if appli/cable) associated with. DAT slot a into bits /0 through 2. /Decimal radix -W 3-3 DESCRIPTION: .WRITE is used to transfer a line of data from the user's line buffer to the device associated with. DAT slot E1, • •WAIT must be used after a .WRITE command, before the line buffer is used again, to insure that the transfer to the device has been completed. On non-bulk storage devices, headers are output along with the data in lOPS binary mode only (bit 9 and 11 of header word 0 should be set to 1). On bulk storage devices, headers are output along with the data in all modes except dump mode. In image modes, the header space cannot be used for data, even though the headers are not written out. The word pair count in the header takes precedence over maximum size (or word count) in all modes and must be inserted by the user. For both .READ and .WRITE macros, dump mode causes the transfer of the specified core area to or from one record on magnetic or paper tape. One or more blocks on DECtape or disk may be occupied by a single dump command. A subsequent .WRITE in dump mode will utilize the unfilled portion of the last block • 3.1.4 •WAIT FORM: .WAIT a VARIABLES: a = • DAT slof number (octal radix) EXPANSION: LOC CAL + a9-17 LOC + 1 12 /The CAL Handler will place the unit number (if /applicable) associated with. DAT slot a into bits /0 through 2. DESCRIPTION: .WAIT is used to detect the availability of the user's line buffer (being filled by .READ or emptied by .WRITE). If the line buffer is available, control is returned to the user immediately after the. WAIT macro expansion (LOC + 2). If the transfer of data has not been completed, control is returned to the • WAIT macro. 3.1.5 . WAIT must a Iso be used after the . TRAN command • •WAITR FORM: •WAITR a, ADDR VARIABLES: a = • DAT slot number (octal radix) ADDR = Address to which control is passed if line buffer is not available for use. EXPANSION: LOC CAL + 10008 + a9-17 LOC + 1 12 LOC +2 ADDR /The CAL Handler will place the unit number (if /applicable) associated with. DAT slot a into bits / 0 through 2. 3-4 DESCRIPTION: .WAITR is also used to detect the availability of the user's line buffer. If the buffer is avai lable, control is returned to the user immediately after the • WAITR macro expansion (LOC + 3). If the transfer of the data has not been completed however, control is given to the instruction at ADDR. It is the user's responsibility to return to the .WAITR to again check the availability of the buffer • 3. 1 .6 • CLOSE FORM: .CLOSE a VARIABLES: a = . DAT slot number (octal radix) EXPANSION: LOC CAL + a9-17 LOC + 1 6 /The CAL Handler will place the unit (if applicable) /associated with. DAT slot ~ into bits 0 through 2. DESCRIPTION: When action has been initiated (.INIT or . SEEK or • ENTER) on a file (whether the device is file-oriented or not) this action must be terminated by a .CLOSE command. On input, it is assumed that the user is finished with the file when the .CLOSE macro is used, so the file is closed. On output, all associated output is allowed to finish and then an EOF (endof-file) line is output before the file is finally closed. If ~ refers to a file-oriented device, any earlier fi Ie of the same name and extension, as currently referenced, is deleted from its directory after the new fi Ie is written. 3.1.7 . TIMER n,C FORM: • TIMER VARIABLES: n = Number of clock increments (decimal radix) C = Address of subroutine to handle interrupt at end of interval EXPANSION: LOC CAL LOC + 1 14 LOC + 2 C . DEC LOC + 3 /Decimal radix -n DESCRIPTION: • TIMER is used to set the real-time clock to n increments and to start it. Each clock increment represents 1/60s for 60 Hz systems and 1/50s for 50 Hz systems. C + 1 is the location to which control is given when the Monitor services the clock interrupt. The coding at C should be in subroutine form; for example, 3-5 C o /C + 1 is reached via JMS DAC SAVEAC : } Must not contain any Monitor CALs • in I/O or Keyboard Systems. LAC C /Restore Link RAL LAC SAVEAC XIT /Restore AC JMP* C so that control will return to the originally-interrupted sequence when the interval-handling routine has been completed. The Monitor automatically reenables the interrupt system before transferring control to C + 1. If the user wishes to initiate another interval at the completion of the previous interval in the subroutine specified to • TIMER, he may do so as follows: LAC (desired interval in 2's complement) DAC* (7 /Restore Li nk LAC C RAL LAC SAVEAC /Restore AC CLON /Turn on clock JMP* C 3.1.8 . EXIT FORM: • EXIT EXPANSION: LOC CAL LOC + 1 15 DESCRIPTION: • EXIT provides the standard method for returning to the Monitor after completion of a system or user program. In the I/O Monitor environment, it causes a program halt; in the Keyboard Monitor environment, it causes the non-resident monitor to be reloaded. When the reloading process has been completed, the Monitor types MONITOR $ on the teleprinter, indicating that it is ready to accept the next command. In the Background/Foreground Monitor environment, the effect of the. EXIT depends upon whether it occurs in a BACKGROUND or a FOREGROUND job (see Section 6.4.5). 3-6 3.2 KEYBOARD MONITOR COMMANDS (SYSTEM MACROS) The commands listed below are available for use in programs that are to operate in the Key- board Monitor environment. Each command is described in detail in the following paragraphs. Refer to Chapter 5 for a complete description of bulk storage file organization. Name Purpose .SEEK Locates file on file-oriented device and begins data input. · ENTER Primes file-oriented device for output. · FSTAT Checks presence of fi Ie on fi Ie-oriented device. • RENAM Renames fi Ie on fi Ie-oriented device • • DLETE Deletes fi Ie from fi Ie-oriented device. .TRAN Reads or records user-specified block on bulk storage devices, providing the user with the capability to determine the structure of the fi les on the device. . Cl EAR Initializes file structure on file-oriented device • • MTAPE Provides special commands for IBM-compatible magnetic tape • The first se~en of the eiQht macros Iisted above apply to the fi Ie-oriented devices - DECtape (DT), disk (DK), drum (DR) and magnetic tape (MT); they are ignored by nonfile-oriented devices, depending upon the device handler used. The eighth macro, .MTAPE, handles the nonfile-oriented functions of magnetic tape (REWIND, BACKSPACE, etc.). If these nonfile-oriented commands are given to file-oriented devices, they are ignored by the device handling routines. To the the .MTAPE commands, however, (REWIND TO LOAD POINT, BACKSPACE RECORD), may be used with disk drum or DECtape; when so used, they preclude the use of .SEEK or • ENTER (see Section 5.6). 3.2.1 .SEEK FORM .SEEK a ,D VARIABLES: a == .DAT slot number (octal radix) D == Address of user directory entry block EXPANSION: DESCRIPTION: LOC CAL + a 9- 17 LOC + 1 3 LOC + 2 D /The CAL Handler will place unit number (if appli/cable) into bits 0 through 2. .SEEK is used to search the directory of file-oriented device ~ for a desired file and to begin input for subsequent .READ commands. D is a pointer to (that is, the address of) a three-word entry in the user's program containing the file name and extension information. The device IS file directory block is searched for a matching entry and if found, input of the file into the handler's internal 3-7 buffer begins. If no matching entry is found, control is transferred to an error-handling routine in the Monitor, an error message is printed on the teleprinter and the Monitor resumes control. Execution of the • FSTAT command allows the user to check the directory for a named file and to retain control if not found. The entry format in the user's file directory entry block (in core) is as follows: 5 6 0 11 12 17 D N A M D+1 E 0 0 D+2 E X T File Name: up to six 6-bit trimmed ASCII characters, padded, if necessary, with nulls (0). Fi Ie Name Extension: Up to three 6bit trimmed ASCII characters, padded with nulls. (The symbol @ produces a zero when using SIXBT.) The fi Ie name is essentially nine characters (six of fi Ie name and three of fi Ie name extension); the file-searching of the .SEEK command takes into account all nine characters. System programs use predetermined fi lename extensions in their operation. For example, if FORTRAN IV or MACRO-9 wishes to • SEEK program ABCDEF as source input, it searches for ABCDEF SRC (ABCDEF, Source). The binary output produced would be named ABCDEF BIN (ABCDEF, Relocatable Binary), while the listings produced would be named ABCDEF LST (ABCDEF, Listing). The Linking Loader, if told to load ABCDEF, would. SEEK ABCDEF BIN. 3.2.2 • ENTER FORM: . ENTER a, D VARIABLES: a = .DAT slot number (octal radix) D = Address of user directory entry block EXPANSION: LOC CAL + a9-17 LOC + 1 4 LaC + 2 D /The CAL Handler will place the unit number (if /applicable) associated with. DAT slot a into /bits 0 through 2. DESCRIPTION: . ENTER is used to examine the directory of the device referenced by • DAT slot ~ to find a free four-word directory entry block in which to place the three-word block at D and one word of retrieval information when. CLOSE is later issued. Deletion of any earl ier fi Ie with the same name and extension is performed by the .CLOSE macro. Control is transferred to the error handling routine in the Monitor to output an appropriate error message if there is no avai lable space in the fi Ie directory at the time when • ENTER is executed. 3-8 3.2.3 • FSTAT FORM: .FSTAT a, D VARIABLES: a = . DAT slot number (octal radix) D = Starting address of three-word block of storage in user area containing the file name and extension of the file whose presence on the device associated with. DAT slot a is to be examined. EXPANSION: LOC CAL + 3000 + a9-17 LOC + 1 2 LOC + 2 D* /The CAL Handler will place the unit number /associated with. DAT slot a into bits 0 through 2 /of LOC + 1. - DESCRIPTION: . FSTAT checks the status of the file specified by the file entry block at D on the device associated with. DAT slot a. On return, the AC will contain the first block number of the file if found. The contents of the AC wi II be zero on return, if the specified fi Ie is not on the device. It is recommended that. FST AT be used prior to . SE EK, if the user prefers to retain program control when a fi Ie is not found in the directory. Otherwise, control is returned to the Monitor error routine to out-. put an lOPS 13 error code on the Teletype. 3.2.4 .RENAM FORM: .RENAM a,D VARIABLES: a = . DAT slot number (octal radix) D = Starting address of two 3-word blocks of storage in user area containing the fi Ie names and extensions of the fi Ie to be renamed and the new name, respectively. EXPANSION: LOC CAL + 2000 + a9-17 LOC + 1 2 LOC + 2 D /The CAL Handler will place the unit number /associated with. DAT slot a into bits 0 through 2 /of LOC + 1. - *Bits 0 through 2 of LOC + 2 must be set to zero prior to the execution of the CAL at LOC. On return, bits 0 through 2 of LOC + 2 will contain a code indicating the type of device associated with. DAT slot a. 0= Non-fi Ie-oriented devices 1 = DECtape (2 through 7 to be specified) If the contents of the AC are 0 on return from . FSTAT (indicating that the file was not found), bits 0 through 2 of LOC + 2 should be checked because if they are still 0, the device was non-file-oriented. 3-9 DESCRIPTION: . RENAM renames the file specified by the file entry block at D with the name in the file entry block at D + 3 on the device associated with. DAT slot~. The contents of the AC will be zero on return, if the file specified at D cannot be found. 3.2.5 • DLETE FORM: • DLETE VARIABLES: a = • DAT slot number {octal radix} a, D D = Starting address of three-word block of storage in user area containing the file name and extension of the file to be deleted from the device associated with .DAT slot a. EXPANSION: LOC CAL + 1000 + a9-17 LOC + 1 2 LOC + 2 D /The CAL Handler will place the unit number /associated with. DAT slot a into bits 0 through 2 /of LOC + 1. - DESCRIPTION: • DLETE deletes the file specified by the file entry block at D from the device associated with. DAT slot ~ and retrieves the storage blocks released by that file. The contents of the AC will be o on return if the specified file cannot be found • 3.2.6 • TRAN FORM: .TRAN a, D, B, L, W VARIABLES: a = • DAT slot number (octal radix) D = Transfer direction Input Forward =:(Q) Output Forward = 1 *Input Reverse ~. , *Output Reverse =~,,) B = Device address for example, block number (octal radix) for DECtape L = Core starting address W = Word count (decimal radix) EXPANSION: LOC CAL + D7-8 + a9-17 LOC + 1 13 LOC + 2 B /The CAL Handler will place the unit number (if /applicable) associated with. DAT slot a into bits /0 through 2. - *DECtape only. 3-10 LaC + 3 L .DEC LaC + 4 /Decimal radix -W DESCRIPTION: • TRAN is employed when the user desires total freedom in data structuring of bulk storage devices. It provides the facility to read or record user-specified areas on the device •• TRAN should be followed by a • WAIT macro to ensure that the transfer has been completed. 3.2.7 .CLEAR FORM: .CLEAR a VARIABLES: a = • DAT slot number (octal radix) EXPANSION: LaC CAL + a9-17 LaC + 1 5 /rhe CAL Handler will place the unit number (if /applicable) associated with. DAT slot a into bits /0 through 2. - DESCRIPTION: .CLEAR is used to initiate the lOPS file structuring of the device referenced by • DAT slot ~ by initial izing its existing directory. The directory area and fi Ie bit map blocks on the filestructured device are set to 0 (except for those bits in the directory bit map referring to the directory itself and the file bit maps). In order to avoid clearing a directory when its files are still in use, the directory is checked for open files. If there are no open files, the directory is cleared; otherwise, control is transferred to the monitor error handling routine to output an lOPS 10 error code (file still active). 3.2.8 .MTAPE a ,(x'X) FORM: • MT APE VARIABLES: a = • DAT slot number (octal radix) ~., XX = Number of magnetic tape function or configuration: 00 = Rewind to load point 02 = Backspace record 03 = Backspace fi Ie 04 = Write end-of-fi Ie 05 = Skip record 06 = Skip fi Ie 07 = Skip to logical end-of-tape 10 = 7-channel, even parity, 200 bpi 11 = 7-channel, even parity, 556 bpi 12 = 7-channel, even parity, 800 bpi 13 = 9-channel, even parity, 800 bpi 14 = 7-channel, odd parity, 200 bpi 15 = 7-channel, odd parity, 556 bpi 16 = 7-channel, odd parity, 800 bpi 17 = 9-channel, odd parity, 800 bpi 3-11 EXPANSION: LOC CAL + X?<S-8 + a9-17 LOC + 1 /The CAL Handler will place the unit number (if /applicable) associated with. DAT slot a into bits /0 through 2. - DESCRIPTION: .MTAPE is used to perform functions unique to non-file-oriented bulk storage devices. In general, these functions are intended for magnetic tape; however, two of the functions, REWIND TO LOAD POINT and BACKSPACE RECORD may be used with any bulk storage device that is to be employed in a non-file-oriented manner. For example, the DECtape Handler is directed to work in a file-oriented mode for a particular .DAT slot if it encounters a .SEEK or . ENTER as the next command after the .INIT command for that .DAT slot. If it encounters .MTAPE REWIND or BACKSPACE as the first command after. INIT, it sets up to work in non-file-oriented modes and interprets subsequent .READ and • WRITE commands appropriately. After the mode is establ ished, commands in the other mode must not be executed. 3.3 BACKGROUND/FOREGROUND MONITOR COMMANDS (SYSTEM MACROS) The following commands are available for use in programs that are to operate in the Back- ground/Foreground Monitor environment. Each command is described in detail in the paragraphs that follow. It should be noted that this information is preliminary and subject to change. Purpose Name 3.3. 1 · REALR Real time transfer of data from device to line buffer. . REALW Real time transfer of data from line buffer to device • .IDLE Allows FOREGROUND job to indicate that control can be given to lower levels of the FOREGROUND job or to the BACKGROUND job. .IDLEC Allows FOREGROUND Mainstream to give control to BACKGROUND job and subsequently continue processing after the. I DLEC. • TIMER Calls and uses real-time clock and allows priority level to be established. .RLXIT Accomplishes the exit from all real-time subroutines that were entered via. REALR, • REALW or • TIMER requests. • REALR FORM: .REALR a, M, L, W, ADDR,p VARIABLES: a = • DAT s lot number (octa I radix) M = Data mode 0= lOPS binary 1 = Image binary 2 = lOPS ASCII 3 = Image Alphanumeric 4 = Dump Mode L = Li ne buffer address 3-12 W = Line buffer word count {decimal radix}, including the two-word header AD DR = lS-bit address of closed subroutine that is given control when the request made by the • REALR is completed. p = API priority level at which to go, to ADDR P Priority Level o Mainstream Level of • REALR API software level S API software level 6 API slftware level 7 4 S 6 7 EXPANSION: LaC CAL + 10000 + M6- 8 + a9-17 LaC + 1 10 LaC + 2 L .DEC LaC + 3 -W .OCT LaC +4 /Decimal radix /Octal radix AD DR + pOOOOO DESCRIPTION: The .REALR command is used to transfer the next line of data from the device assigned to • OAT slot ~ to the line buffer in the user's program. In this operation, M defines the mode of the data to be transferred, L is the address of the line buffer, W is the number of words in the line buffer {including the two-word header}, and ADDR is the address of a closed subroutine which should be constructed as shown in the following example. ADDR 0 DAC } 3.3.2 FORM: SAVEAC /Save AC Any system macro may be issued at this point. LAC SAVEAC /Restore AC .RLXIT ADDR /Return to interrupted point via monitor CAL ** .REALW .REALW a, M, L, W, ADDR, p *The subroutine specified by a .REALR should not be used at more than one priority level. The subroutine is entered via a JMS and thus cannot be protected against re-entry. ** .RLXIT is described in Section 3.3.6. 3-13 VARIABLES: a = • OAT slot number (octal radix) 0= lOPS binary 1 = Image binary 2 = lOPS ASCII 3 = Image Alphanumeric 4 = Dump Mode M = Data mode L = Li ne buffer address W = Line buffer word count (decimal radix), including the two-word header ADDR = 15-bit address closed subroutine that is given control when the request made by the .REALW is completed. p = API priority level at which to go to AD DR P Priority Level o Mainstream Level of • REALW API software level 5 API software Ieve I 6 API software level 7 4 5 6 7 EXPANSION: LOC CAL + 10000 + M6-8 + a9-17 LOC + 1 11 LOC + 2 L .DEC LOC+ 3 -W .OCT LOC+4 IDecimal radix 10ctai radix ADDR + pOOOOO DESCRIPTION: The .REALW command is used to transfer the next line of data from the line buffer in the user's program to the device assigned to .DAT slot~. In this operation, M defines the mode of the data to be transferred, L is the address of the line buffer, W is the count of the number of words in the line buffer (including the two-word header), and ADDR is the address of a closed subroutine which should be constructed as shown in the following example. EXAMPLE: ADDR 0 DAC } SAVEAC lSove AC Any system macro may be issued at this point. LAC SAVEAC /Restore AC .RLXlT ADDR /Return to interrupted point via Monitor CAL ** *The subroutine specified by a .REALW should not be used at more than one priority level. The subroutine is entered via a JMS and thus cannot be protected against re-entry. ** .RLXIT is described in Section 3.3.6. 3-14 3.3.3 .IDLE FORM: .IDLE EXPANSION: LOC CAL LOC + 17 DESCRIPTION: The FOREGROUND job in a Background/Foreground environment can indicate that wishes to relinquish control to lower levels of the FOREGROUND job or to the BACKGROUND job by executing this command. This is useful when the FOREGROUND job is waiting for the completion of real-time I/o from anyone of a number of I/o requests that it has initiated or when it is waiting for completion of •TIMER requests. The .IDLE is the logical end of the current level IS processing; that is, control never returns LOC + 2. If the .IDLE is issued at a FOREGROUND API software level, it effects a DBR from the handler at that level. Other routines in the APIQ for that level are deferred until a hardware interrupt is requested for that level again. If the .IDLE is issued at FOREGROUND mainstream, it effects an I/o BUSY situation (except that no BUSY flag is set) and control goes to the BACKGROUND JOB. If the .IDLE is issued at BACKGROUND mainstream level, it effects an I/o BUSY situation and control is returned to the .IDLE CAL. 3.3.4 .IDLEC FORM: .IDLEC EXPANSION: LOC LOC CAL+1000 + 1 17 DESCRIPTION: Identical to .IDLE except when issued at FOREGROUND mainstream level. In this case, control goes to the BACKGROUND job, and LOC + 2 is saved as the FOREGROUND mainstream return pointer. The next time control returns to FOREGROUND (at any priority level), FOREGROUND mainstream processing will CONTINUE at LOC + 2 when mainstream becomes the highest active FOREGROUND level. 3.3.5 . TIMER FORM: .TIMER n, C, p VARIABLES: n = Number of clock increments (decimal radix)* C = Address of subroutine to handle interrupt at end of interval ** p = API priority level at which to go to C *To transfer control to subroutine C at priority level p immediately, n should be set equal to zero. **The subroutine specified should not be used at more than one priority level. The subroutine is entered via a JMS and thus cannot be protected against re-entry. 3-15 P Prioritl Level 0 Mainstream Level of • TIMER API software level 5 API software level 6 API software level 7 4 5 6 7 EXPANSION: LaC CAL LaC + 1 14 LaC +2 C + pOOOOO .DEC LaC + 3 /Decimal radix -n DESCRIPTION: • TIMER is used to set the real-time clock to n increments and to start it. Each clock increment represents l/60s for 60 Hz systems and 1/50s for 50 Hz systems. When the monitor services the clock interrupt, it passes control to location C + 1 with the priority level set to p. The coding at C should be in subroutine form, for example, C 0 DAC SAVEAC /C + 1 is reached via JMS The restriction that applies to non B/F monitors does not apply here. Any system macro (including. TIMER) may be issued at this point. LAC SAVEAC /Restore AC .RLXIT C /Return to interrupted point via monitor CAL so that control will return to the originally interrupted sequence when the interval-handling routine has been completed. The Monitor automatically reenables the interrupt system before transferring control to C + 1 • 3.3.6 • RLXIT FORM: .RLXIT VARIABLES: ADDR = entry point address of real-time subroutine that is to be exited. EXPANSION: LaC CAL LaC + 1 20 ADDR ADDR DESCRIPTION: .RLXIT is used to exit from all real-time subroutines toot were entered via. REALR, • REALW or • TIMER requests. The instruction just preceding the. RLXIT call should restore the AC with the value of the AC on entrance to this subroutine •• RLXIT will restore the link from bit 0 of ADDR. 3-16 .RLXIT protects against re-entrance to BACKGROUND or FOREGROUND mainstream real-time subroutines. When the contents of ADDR is non-zero, the subroutine is assumed active; • RLXIT sets the contents of ADDR to 0 thus making it available again. NOTE: Real-time subroutines should initially have their entry point register set to O. 3-17 CHAPTER 4 INPUT/OUTPUT MONITOR 4.1 INPUT/OUTPUT MONITOR FUNCTIONS The I/O Monitor of the PDP-9 ADVANCED Software System simplifies the programming of input and output functions in the basic paper-tape environment. It serves as an interface between the system and user programs and the external world of device hardware, relying upon the routines and capabilities of the Input/Output Programming System (lOPS) to relieve the programmer of writing his own device and data handling subroutines. The I/o Monitor allows simultaneous operation of many I/o peripherals and overlapped computation. Since upward compatibility exists between the monitor systems, user programs that are written to operate under control of the I/O Monitor will also operate without modification, under control of the Keyboard and Background/Foreground Monitors. The Input/Output Monitor is designed to take advantage of the Automatic Priority Interrupt (API) if it is present on the system. Both the I/O skip chain for the Program Interrupt Control (PIC) and the API channels are set up to handle all devices which have been requested by the user. All unused channels are tied to an error routine to detect spurious interrupts. The reader is referred to Chapter 2 for a general discussion of the monitor environment, and to Chapter 3 for detailed descriptions of user program commands {system macros} available in the I/o Monitor environment. 4.2 PROGRAMMING EXAMPLE The following example illustrates the use of system macros with MACRO-9 programs in the I/o Monitor environment. The example inputs a line of data from the Teletype keyboard, and outputs the same line of data to the Teletype. The arguments used by the system macros are given symbolic names (via MACRO-9 direct assignment statements) to faci litate recall for the programmer, and to change the arguments easily, if desired. Note the use of the pseudo ops .TITLE, .IODEV, .BLOCK, and .END, in addition to the system macros. The assembly listing that follows the example shows how the system macros are expanded at assembly time. (The reader may wish to compare these expansions with the system macro descriptions in Chapter 3.) • T iTl...t: ECHO TIl =2 TTO=41f?l OlJT=l I N= 0 IOPS=2 4-1 START BEGI~ RESTRT BUFFER • IODEV • I NI T • I NI T .READ • 'alA IT .WRITE • 'alAI T JMP .ClOSE .CLOSE JMP .BlOCK .END 2,4 TTO,OU:-,RESTRT TTl, IN, RESTRT TTI,IOPS,BUFFER,34 TTl TTO,IOPS,BUFFER,34 TTO BEGIN TTl TTO START 42 START IINITIALIZE TELETYPE OUTPUT lAND IN?UT IINPUT lOPS ASCII FROM TELETYPE IWAIT UNTIL INPUT COMPLETE 10UTPUT SAME DATA ON TELETYPE IWAIT UNTIL OUTPUT COMPLETE IlOOP TO INPUT AGAIN ITERMINATE INPUT ITERMINATE OUTPUT IRETURN TO REINITIAlIZE ISET UP TElETYP~ BUFFER (34 DEC) lEND OF ECHO PR01RAM ASSEMBLY LISTING: PAGE ECHO • TITLE 000007 000010 000001 000000 000002 00000 00000 00001 00002 00003 R R R R R 00004 00005 00006 00007 00010 00010 00011 00012 A A A A A A-GEN* A GEN* R GEN* A GEN* R R R R R R R R 000007 000001 000025 000000 A GEN* A GEN* R GEN* A GEN* 00013 R 777736 A GEN* A GEN* R GEN* GEN* A GEN* 00014 00015 R R 000007 000012 A GEN* A GEN* 00016 00017 00020 R R R 002010 000011 000032 00021 R 777736 A GEN* A GEN* R GEN* GEN* A GEN* 00022 00023 R 000010 000012 A GEN* A GEN* R .IODEV 2 .. 4 .INIT TTO,OUT,RESTRT CAL+OUT*1000 TTO&777 1 RESTRT 0 .INIT TTI,IN,RESTRT CAL+IN*1000 TTI&777 1 RESTRT START 001010 000001 000025 000000 0 TTI,IOPS,BUFFER,34 .READ CAL+IOPS*1000 TTI&777 10 BUFFER .DEC -34 .WAIT TTl CAL TTl&777 12 TTO,IOPS,BUFFER,34 • WR ITE CAL+IOPS*1000 TTO&777 11 BUFFER .DEC -34 TTO • WAIT CAL TTO&777 12 BEGIN 002007 000010 000032 ECHO TTI=2 TTO=4 OUT=1 IN=0 IOPS=2 4-2 00024 00025 00025 00026 R R R R 00027 00030 00031 00032 R R R R 600010 RESTRT 000007 000006 A GEN* A GEN* 000010 000006 600000 A GEN* A GEN* R A BUFFER R 000000 4.3 R JMP BEGIN .CLOSE TTl CAL TTl&777 6 ·CLOSE TTO CAL TTO&777 6 JMP START .BLOCK 42 .END START NO ERROR LINES OPERATING THE I/O MONITOR SYSTEM The reader is referred to the I/o Monitor Guide (DEC-9A-MIFA-D) for detailed operating procedures for system programs in the I/O Monitor environment. The following PDP-9 ADVANCED Software System manuals contain additional detailed information on system programs. Manual Document Number Ut iii ty Programs DEC-9 A-GUAB- D MACRO-9 Assembler DEC-9A-AMZA-D FORTRAN IV DEC-9A-KFZA-D This section contains descriptions of loading programs, device assignments, and error detection and handling. 4.3. 1 Loading Programs in the I/o Monitor Environment In the paper tape system, each system program accompanied by the necessary I/O device handlers and an appropriate version of the I/O Monitor, is punched on a separate paper tape in absolute format. Each PDP-9 core configuration (8, 16, 24 and 32K) requires a separate set of paper tape system programs. The ten system tapes supplied are: FORTRAN IV MACRO-9 PIP-9 Text Editor Linking Loader DDT (without Patch File capabilities) DDT (with Patch File capabilities) 7 to 9 CONVERTER (CONV) CHAIN EXECUTE 4-3 In addition, the utility program PUNCH 9, which provides the ability to dump an executable core load and .ABS loader onto paper tape, is provided with all paper tape systems. See Figure 4-1 for memory maps of I/O Monitor System. At the beginning of each tape is a Bootstrap Loader in hardware READIN mode. By setting the starting address of the Loader* on the console address switches, depressing I/O RESET, and then depressing the READIN switch, these system tapes may be loaded. Since the tapes also contain appropriate versions of the I/o Monitor and the necessary I/o device handlers, the system programs (FORTRAN IV, MACRO-9, Text Editor, CONV, PIP, CHAIN, and EXECUT) can be loaded, ready for operation, in a single step. Once the system program (FORTRAN IV, MACRO-9, Text Editor, CONV, PIP, CHAIN, EXECUT or Linking Loader/DDT) has been loaded and takes control, the individual system program operating procedures come into use. (See I/o Monitor Guide, oEC-9A-MIPA-D .) User programs, however, normally exist in relocatable form, as output from FORTRAN IV or MACRO-9; these tapes do not contain copies of the I/o Monitor. To load these programs, a copy of the Linking Loader or DDT should be loaded first. The user should then initiate loading of his main program followed by all required subprograms. By loading subprograms in order of size (largest first, smallest last), the user has a better chance of satisfying core requirements for his program in systems with extended core memory. The version of the I/O Monitor (including the device handlers) contained on the Linking Loader or DDT tape may be used with user programs, and the Linking Loader or DDT can be used to load the necessary device handlers as well as the user's object programs. *17720 for 8192 word systems, 37720 for 16,384 words, 57720 for 24,576 words, and m20 for 32,768 words. 4-4 MEMORY MAP A 8K or 16K or 24K or 32K SYSTEM PROGRAMS: BOOTSTRAP LOADER IN HRM FORMAT m: MEMORY MAP B-LINKING LOADER, CHAIN FORTRAN MACRO-9 EDITOR PIP-9 7-9 CONVERTER BK or 16K or 24K or 32K • SCOM BOOTSTRAP LOADER IN HRM FORMAT I • SCOM AND. SCOM + 3 USER PROGRAMS + SYSTEM PROGRAM • SCOM +3 • SYSTEM PROGRAM TABLE SPACE GLOBAL SYMBOL TAjLE • seOM +2 LINKING LOADER OR CHAIN SYSTEM PROGRAM DEVICE HANDLER • SCOM + 2 PAPER TAPE READER HANDLER SYSTEM PROGRAM DEVIC E HANDLER • SCOM + I • SCOM +1 1/0 MONITOR WITH TELETYPE -IN AND TELETYPE-OUT DEVICE HANDLERS 1/0 MONITOR WITH TELETYPE-IN AND TELETYPE-OUT DEVICE HANDLERS o o Refer to Section 7.4 for sizes for device handlers. Figure 4-1 NOTE: IN THE CASE OF CHAIN THE PAPER TAPE PUNCH HANDLER IS ALSO RESIDENT IN CORE. Refer to Memory Map D for resu Its of Link ing Loader. I/o Monitor System Memory Maps 4-5 MEMORY MAP C-DDT TAPE MEMORY MAP D-USER PROGRAM READY TO BE EXECUTED 8K or 16K or 24K or 32K 8K or 16K or 24K or 32K BOOTSTRAP LOADER IN HRM FORMAT BOOTSTRAP • SCOM • SCOM DOT USER PROGRAMIS) • SCOM+3 USER DEVICE HANDLER U;ER PROGRAMS • USER DEVICE HANDLER USER DEVICE HANDLER • • SCOM +3 GLOBAL AND DDT SYMBOL ITABLES • SCOM+Z LINKING LOADER ------- lb.) LINKING LOADER DEVICE HANDLER PAPER TAPE PUNCH HANDLER ------LINKING LOADER DEVICE HANDLER PAPER TAPE READER HANDLER • SCOM +1 10.) I/O MONITOR WITH TELETYPE-IN AND TELETYPE-OUT DEVICE HANDLERS I/O MONITOR (INCLUDING TELETYPE HANDLER) o o Refer to Memory Map E for results of Link Loading in DDT mode. Refer to Section 7.4 for sizes of device handlers. Paper Tape Punch Handler is only present in DDT versions with patch file capabilities. . SCOM+l and. SCOM+2 both point to one of two places and non-BLOCK DATA COMMON (FORTRAN IV or MACRO-9) output may make use of core as low as they point. a. If the user program did not have any device handlers in common with the Linking Loader. b. If the user program did have at least one device handler in common with the Linking Loader. Figure 4-1 I/o Monitor System Memory Maps (Cont) 4-6 MEMORY MAP F (EXECUTE) MEMORY MAP E 8K or 16K or 8K or 16K or 24K or 32K 24K or 32K BOOTSTRAP 4810 DDT EXECUTE 352 10 USER PROGRAM (SI USER PROGRAM(S) USER/DDT DEVICE HANDLER LI BRARY PROGRAM(S) BOOTSTRAP 50 10 • • SCOM SCOM USER/DDT DEVICE HANDLER USER DEVICE HANDLER(S) • SCOM + 3 I NAMED COMMON • SCOM+ 3 DDT CREATED SYMBOLS AND PATCH SPACE • SCOM +2 • SCOM + I DDT SYMBOL TABLE IIIIIIIIIIIIIIII LINKING LOADER DEVICE HANDLER L LINKING LOADER DEVICE HANDLER I/O MON IT OR (INCLUDING TELETYPE HANDLER I BLANK COMMON • LINKING LOADER BLOCK TRANSFER ROUTINE SCOM+ 2 EXECUTE'S DEVICE HANDLER I/O MONITOR ( INCLUDING TELETYPE HANDLE R ) 775 10 880 10 o o Refer to Section 7.4 for sizes for device handlers. Non BLOCK DATA COMMON (FORTRAN IV of MACRO-9 output) may make use of core as low as the DDT symbol table. However, trouble will occur if the user requests DDT to create symbols or make patches that cause overlaying of the COMMON area. The Linking Loader device handlers would have been used to satisfy user device requests. When the user types in the name of the XCT File to be run, • EXECUTE brings in the first chain from paper tape. FORTRAN programs pass on data in blank common starting at • SCOM + 2. Macro programs pass on data between .SCOM + 2 and .SCOM + 3. A call from the running chain to bring in another chain is effected by transferring control back to Execute. Figure 4-1 I/O Monitor System Memory Maps (Cont) 4-7 4.3.2 Device Assignments The device assignment table used by the I/O Monitor is fixed in length and in the assign- ments it contains. It is composed of two sections; the upper section is for use by all system programs except PIP, the lower section is referenced by all user programs and PIP, The upper portion of the . OAT contains 13 slots, referenced as -1 through -15S ' The lower section has S slots numbered 1 through lOS' The standard assignments for the device assignment table for user programs and system programs other than PIP are shown in Figure 4-2, Figure 4-3 illustrates PIP assignments, which include the Card Reader (CR01E, CR02B) and Line Printer as standard devices, .DAT Slot .DATBG .DAT Device Handler* -15 Paper Tape Punch (PPA.) Editor and Converter Output -14 Paper Tape Reader (PRA.) Editor and Converter Input -13 Paper Tape Punch (PPB. ) MACRO-9, FORTRAN IV Output -12 TTY Printer (TTA.) MACRO-9, FORTRAN IV and Converter Listing -11 Paper Tape Reader (PRB.) MACRO-9 FORTRAN IV Input -10 Paper Tape Reader (PRA.) DDT -9 Input and Editor, MACRO-9 Secondary Input -7 0 -6 Paper Tape Punch -5 0 -4 Paper Tape Reader (PRA.) System Input (Linking Loader) -3 TTY Printer (TTA.) Teleprinter Output -2 TTY Keyboard (TTA.) Keyboard Input -1 Paper Tape Reader (PRA. ) System Device (Linking Loader) TTY Printer (TTA.) Teleprinter Output 2 TTY Keyboard (TTA.) Keyboard Input 3 Paper Tape Reader (PRA.) Input 4 TTY Printer (TTA.) Listing 5 Paper Tape Punch (PPA.) Output 6 Paper Tape Reader (PRA.) Scratch 7 Paper Tape Punch (PPA.) Scratch 10 Paper Tape Reader (PRA.) Scratch Use Not Used (PPA.) DDT -9 Output Not Used .DAT .DATND =, Figure 4-2 Device Assignment Table (.DAT) for I/o Monitor *See Section 7.4 for a description of the handlers. 4-S The negative • OAT slot assignments for use by system programs may be changed by DEC. For example, • OAT slot -10 might be associated with a card reader, while .DAT slot -12 could be assigned to a line printer. Provision for changing positive • OAT slot assignments for use by relocatable user programs is included in the PUNCH9 utility program (see section 4.3.5). For example, a magnetic tape handler (MTF) or one of the drum handlers (ORA, ORB, DRC, ORO) could be added. Handler Use Teletype (TTA.) Input/Output 2 Teletype (TTA. ) Input/Output 3 Paper Tape Reader (PRA. ) Input 4 Line Printer (LPA. ) Output 5 Paper Tape Punch (PPA. ) Output 6 Card Reader (COB.) Input 7 Paper Tape Punch (PPA. ) Output 10 Paper Tape Reader (PRA. ) Input . OAT Slot Device Figure 4-3 4.3.3 Device Assignment Table (.DAT) for PIP Error Detection and Handling Comprehensive error checking is provided by the Linking Loader and the Input/Output Programming System. Detailed lists of errors that may occur are given in Appendix 0 and E, respectively. The other system programs also provide comprehensive error checking. Refer to the appropriate PDP-9 ADVANCED Software System manual (listed at the beginning of this section) for detailed information on these errors. 4-9 4.3.4 Control Character Commands in the I/o Monitor Environment All control character commands recognized by the I/o Monitor are summarized in Table 4-1. These commands (except RUBOUT) are formed by holding down the CTRL key while striking a letter key. The character or characters echoed on the Teletype and the resulting action is given in the table for each command. Table 4-1 Control Character Commands Action Command Echo CTRL S t S Starts user program after Linking Loader has brought it into core via a LOAD command. CTRL T t T CTRL T is applicable only when using DDT and forces control back to DDT which types DDT > to indicate its readiness for another DDT command. All previous DDT conditions remain intact (breakbpoints, register modifications, etc.) . CTRL R t R Allows the user to continue when an lOPS 4 (device not ready) error occurs. The user must first ready the device, and then type CTRL R. CTRL P t P Forces control to last address specified in the .INIT command referencing Teletype. Used by system programs to reinitialize or restart. CTRL U @ Cancels current line on Teletype (input or output). RUBOUT \ Cancels last character input from Teletype (not applicable with DDT). 4.3.5 Modifying System Programs and Building Executable User Core Loads in the I/o Monitor Environment The capability of modifying or patching system programs in the I/o Monitor environment is provided by the utility program PUNCH9. PUNCH9 allows for producing an executable core load on paper tape in .ABS format with the standard .ABS loader (HRM 17720 of the highest available core bank) on the front of the tape. This is particularly useful when the core load consists of a relocatable main program, subroutines and library routines, the repetitive loading of which tends to be time consuming. It is further possible to specify the number of .ABS tapes to be output (1-9) for convenience of tape hand ling. 4-10 The areas of memory output by PUNCH9 are 0 up to .SCOM + 2 (the first free cell) and .SCOM + 3 (last free cell) up to the .ABS loader (17720 module SK). PUNCH9 is loaded (I/O RESET and REAOIN) at 17720 of the highest core bank available. It loads and relocates part II of itself in free core, i.e., from the cell in • SCaM + 2 and up. When loaded it types the following message on Teletype: P,TorS?J > The user is expected to type t P or tT or t S to define the starting location of the program to be punched followed by carriage return (1 tape) or a number (1-9) specifying the total number of tapes into which binary output is to be divided. tT should be used if DDT is part of the core load. tp should be used for all other system programs and user programs which have already initialized (.INIT) the Teletype with a RESTART address at the time PUNCH9 was executed. t S should be used only if the core load was output by PUNCH9 after Linking Loader operation at the moment when the loader itself was expecting the ts command. All tapes output by PUNCH9 are loaded by hitting I/O RESET and the REAOIN key with ADDRESS switches set to 17720 of the highest core bank. 4.3.5.1 Modifying User. OAT Slots in the I/O Monitor Environment - Although it is not possible to reassign negative • OAT slots at load time in the I/O Monitor environment for system programs (reassembly is required), PUNCH9 provides this capability for the user or positive. OAT slots. For example, Figure 4-2 lists the standard .OAT slot assignments. A relocatable user program wanting to use drum (handlers ORA., ORB., ORC. or ORO.) or magnetic tape (MTF.) or card reader (COB.) or line printer (LPA.) whose handlers are included in the paper tape library has no way of doing so unless he can modify the positive. OAT table. The modifications procedure is as follows: 1. Load the Linking Loader (or DDT) tape into core (HRM 17720 modulo SK). 2. Stop the computer and modify the appropriate . OAT slot cell (.OAT = 135) according to the Loader - I/O correspondence table below. For example, if • OAT slot 7 is to be assigned to drum unit 1 using handler ORO., cell 144 should be changed to 100013. * 3. Load PUNCH9 into core (HRM 17720 modulo SK). 4. Type tp in response to the query from PUNCH: lip, Tor S?" 5. Load the resultant punched tape into core (HRM 17720 modulo SK). *Note: The unit number is stored in bits 0-2. 4-11 6. The Loader will restart, ready for acceptance of typed program names to be loaded. If . OAT slot 7 is referenced by the user program (e.g., IOOEV 7), ORO. for drum unit 1 will be loaded from the I/O Library. Loader - I/O Correspondence Handler .OAT Slot Value 1 TTA. PRA. PRB. PPA. PPB. PPC. 2 3 4 5 6 7 LPA. COB. MTF. 11 13** 14** 15** 16** 17** ORA. DRB. DRC. ORO. ** With unit number in bits 0-2. 4-12 CHAPTER 5 KEYBOARD MONITOR 5.1 KEYBOARD MONITOR FUNCTIONS The Keyboard Monitor is designed to operate with a PDP-9 that has some form of bulk storage (see Hardware Requirements, Section 1.2). It includes all elements of the Input/Output Monitor in addition to routines that accept and interpret Teletype keyboard commands, change device assignments, and automatically load and initiate system and user programs. The reader is referred to Chapter 2 for a general discussion of the monitor environment, and to Chapter 3 for a detailed description of user program commands (system macros) available in the Keyboard Monitor environment. The Keyboard Monitor Guide (DEC-9A-MKFA-D) contains detai led operating procedures for system programs mentioned in this chapter and a good example (Appendix J) of an actual keyboard session using system software. 5.2 PROGRAMMING EXAMPLE The following example illustrates the use of system macros with MACRO-9 programs in the Keyboard Monitor Environment. The example inputs a Iine of data from the Teletype keyboard, writes it on DECtape, reads it back from DECtape, and outputs it on the Teletype. Before subsequent keyboard inputs, the program pri nts the messages: FILE ALREADY PRESENT! ! DO YOU WISH TO KEEP IT? (Y OR N) AND CR. By typing Yon the keyboard, the file is saved and a new file is created for the next line of input from the keyboard. By typing N on the keyboard, the next line of data input from the keyboard is written on DECtape with the same fi Ie name given to the previous line. The name of the file is initially ECHO TST. The file name for each new file (providing that the previous file was not deleted) is obtained by incrementing location NAME+l. This produces a series of files, ECHO TST, ECHO A TST, ECHO B TST, ECHO C TST, ••• etc., (since the alphabet in .SIXBIT begins 01 8 , 02 8 , 03 8 , etc). The arguments used by the system macros are given symbolic names by means of MACRO-9 direct assignment statements at the beginning of the program to faci litate recall for the programmer, and to change the arguments readily. The partial assembly listing that follows the example shows how the first several system macros are expanded at assembly time. expansions with the system macro descriptions in Chapter 3.) 5-1 (The reader may wish to compare these Example: DECTAPE=7 TT!=S TTO=5 IN=0 OUT=l IOPS=2 START READKB II/RITE REA DDT RESTRT UPDATE .TITLE DTECHO • IODEI) • I NIT • I NIT • I NIT .l<'STAT SZA JMP .READ • ',A/AIT LAC SZA JMP .ENTER • II/RITE .'A/AIT .CLOSE • PH T .SEEK .READ • 'I/A IT .'A/RITE .'A/ .UT .CLOSE .CLOSE .CLOSE JMP .'A/RITE .'4~IT • 'I/RITE .'4AIT .READ • "JAIT LAC A"JD SAD JMP DZM JMP YES NEWJ<I L MSGI MSG2 5,6,7 DECTAPE,OUT,RESTRT TTI,IN,Rl:!...;,TRT TTO,OUT,RESKT DECTAP,NAME IINITIALIZE DECTAPE OUTPUT, ITELETY. E I ~PUT , lAND TELETYE OUTPUT lIS FILE PRESENT? INO, I~PUT KEYBOARD UPDATE IYES, OUTPUT MSGI AND MSG2 TT1,IOPS,BUFFER,34 IINPUT lOPS ASCII FROM KEYBOARD TII IWAIT UNTIL I~PUT COMPLETE UDSI4 ITEST UPDATE SWITCH I~ R~. L~CE INPUT FILE NEWFIL I-I=SAVE INPUTI CREATE NEW OUTPT DECTAP,NAME ILOCATE FREE DECTAPE FILE DECTAP,IOPS,BUFFER,34 10UTPUT DATA ON DECTAP DECTAP I~AIT UNTIL OUTPUT COMPLETED DECTAP ICLOSE FILE DECTAP,IN,RESTRT II~IrIALIZE DECTAPE INPUT DECTAP,~~ME ILOCATE FILE "NAME" DECTAP,IOPS,9UFFER,34 IREAD INTO SUFFER DECTAP IWAIT UNTIL READ COMPLETE TTO,IOPS,9UFFER,34 IOUTPUT TO TELETYPE TTO IWAIT UNTIL OUTPUT COMP~ETE TTO ITERMINATE TELEfYPE OUTPUT, TTl ITELETyPE INPUT, DECTAP lAND DECTAPE INPUT/OUTPUT START ILOOP FOR UPDATE OPTION TTO,IOPS,MSSl,34 10UTPUT MSGI TTO lAND MS32 TTO,IOPS,MSG2,34 10~ TTO ITELETYPE TTI,IOPS,COM,g IREAD RESPONSE TTl IWAIT UNrI~ READ COMPLETE COM+2 IGET FIRST WORD (774000 ISAVE FIRST SEVEN BITS ~544000 lIS CHA~ A Y? YES IYES UDSW INO, SET TO REPLACE INPUT FIL~ READKB ILOOP TO READ KEYBOARD CLC DAC UDSla/ JMP READKB ISZ NAME+I JMP '~RI TE MSG2-MSGl/2*1000 ISET UPDATE S~. TO SAVE IINPUT, CREATE NE~ OUTPUT ILOOP TO READ KEYBOARD ICHAN3E FILE NAME ITO CREATE NEW OUTPUT IWPC FOR HEADER WORD 0 .ASCII "FILE ALREADY" .ASCII "PRESENT!!"cI5> COM-MSG2/2*1000 IWPC FOR HEADER WORD 0 o o 5-2 COM BUFFER NAME UDSIaI .ASCII "DO yOU WISH TO KEEP IT?" .I\SCII "CY OR N) AND CR."<15> IRESPONSE BUFFER 10 .BLOCK IDATA BUFFER C34 DECIMAL> 42 .BLOCK IF! LE NAME • SIXBIT "ECHO@@TST" IUPDATE SWITCH o START .END ASSEMBLY LISTING: DTECHO PAGE • TITLE 000007 000006 000005 000000 000001 000002 A A A A A A 00000 00000 00001 00002 00003 R R R R R 001007 000001 000070 000000 A GEN* A GEN* R GEN* A GEN* 00004 00005 00006 00007 R R R R 000006 000001 000070 000000 A GEN* A GEN* R GEN* A GEN* 00010 00011 00012 00013 R R R R 001005 000001 000070 000000 A GEN* A GEN* R GEN* A GEN* 00014 00015 00016 00017 00020 00021 00021 00022 00023 R R R R R R R R R 003007 000002 000246 740200 600077 A GEN* A GEN* R GEN* A R 002006 000010 000204 00024 R 777736 A GEN* A GEN* R GEN* GEN* A GEN* 00025 00026 00027 00030 00031 00032 00032 00033 1710034 R R R R R R R R 000006 000012 200251 740200 600132 A GEN* A GEN* R A R 000007 000004 A GEN* DTECHO DECTAP=7 TTI=6 TTO=5 IN=0 OUT=1 lOP S =2 5,6,7 .IODEV DECTAP,OUT,RESTRT • INIT CAL+OUT*1000 DECTAP&777 1 RESTRT 0 TTI,IN,RESTRT • INIT CAL+IN*1000 TTI&777 1 RESTRT 0 .INIT TTO,OUT,RESTRT CAL+OUT*1000 TTO&777 1 RESTRT 0 .FSTAT DECTAP,NAME CAL+3000 DECTAP&777 2 NAME SZA JMP UPDATE .READ TTI,IOPS,BUFFER,34 CAL+IOPS*1000 TTI&777 10 BUFFER .DEC -34 .WAIT TTl CAL TTI&777 12 LAC UDSW SZA JMP NEWFIL DECTAP,NAME .ENTER CAL DECTAP&777 START READKB WRITE P 5-3 5.3 KEYBOARD COMMANDS The Keyboard Monitor provides three advantages over the Input/Output Monitor: a. The ability to request system information and directions for system operation. b. I/O device independence, through the ability to dynamically change I/o device assignments before loading a program. c. The ability to call, load, and execute system and user programs via simple keyboard commands. When the Keyboard Monitor initially gets control it outputs MONITOR $ to the teleprinter to indicate readiness to accept a keyboard command. Subsequently, it outputs only the dollar sign ($) to indicate readiness. In both cases, the keyboard command should be typed on the same line as the dollar sign ($). Keyboard Monitor commands fall into three categories: a. ALT MODE). b. Commands that load system programs (terminated with a carriage return (J) or Commands to perform special functions. c. Control character commands, formed by holding down the CTRL key while striking a letter key. These commands are used during the running of system or user programs. (System programs echo contro I character commands by typing an up arrow (t) fo IIowed by the assoc iated character.) 5.3. 1 System Program Load Commands Loading commands instruct the Keyboard Monitor to bring in the System Loader which is used to load all system programs from the system device. The commands which follow are available to the user for loading systems programs via the Keyboard Monitor. System Program Loaded Command F4 FORTRAN IV Compi ler F4A Abbreviated FORTRAN IV Compiler MACRO MACRO-9 Assembler MACROA Abbreviated MACRO-9 Assembler PIP Peripheral Interchange Program EDIT Symbolic Text Editor CONV 7 -to-9 Converter LOAD Li nk i ng Loader GLOAD Linking Loader (set to load and go) 5-4 System Program Loaded Command DDT Dynamic Debugging Technique program DDTNS DDT program with no user symbol table UPDATE Library Fi Ie Update program DUMP Program to dump saved area (see CTRL Q and QDUMP commands) PATCH System tape Patch program CHAIN Modified version of Linking Loader (allows for chaining) EXECUTE{E) Control program to load and execute chained programs SGEN System Generation program All commands should be terminated by a carriage return (CR) or ALT MODE (ESC). When the requested program has been loaded and is waiting for keyboard input ,an indication is given on the Teletype with an appropriate message; such as LOADER > or FORTRAN 4 > or EDITOR > etc. 5.3.2 Special Function Commands The special-function keyboard commands available in the Keyboard Monitor environment are described in the following paragraphs. 5.3.2.1 LOG (or L) - The LOG command is used to make hard copy records of user comments on the Teletype. When the LOG command is encountered, the Monitor ignores all typing up to and including the next ALT MODE. Example: $LOG THIS IS AN EXAMPLE. (ALT MODE) 5.3.2.2 SCOM (or S) - The SCOM command causes typeout of system configuration information, in- cluding available device handlers, the skip chain order, and manual restart and dump procedures. 5-5 Example: $SCOM SYSTEM INFORMATION - V4B 9/30/68 17646 - BOOTSTRAP RESTART ADDRESS 17636 - 1ST FREE LOCATION BELOW BOOTSTRAP 1635 - 1ST FREE LOCATION ABOVE RESIDENT MONITOR 135 - ADDRESS OF .DAT 536 - tQ ADDRESS FOR MANUAL DUMP 101 - START BLOCK FOR tQ DUMP AREA 2~0 - KM9 START WITH RESTART ADDRESS IN LOCATION 0 DEVICE HANDLERS AVAILABLE: TTA TELETYPE: INPUT/OUTPUTI ASCII MODESI ALL FUNCTIONS PRA PAPER TAPE READER: INPUTI ALL MODESI ALL FUNCTIONS PRB PAPER TAPE READER: INPUTI lOPS ASCII MODEl ALL FUNCTIONS PPA PAPER TAPE PUNCH: OUTPUT I ALL MODES I ALL FUNCTIONS PPB PAPER TAPE PUNCH: OUTPUTI ALL MODES LESS lOPS ASCIII ALL FUNCTIONS PPC PAPER TAPE PUNCH: OUTPUTI lOPS BINARY MODEl ALL FUNCTIONS DTA DECTAPE: 3 FILESI INPUT/OUTPUTI ALL MODES I ALL FUNCTIONS DTB DECTAPE: 2 FILESI INPUT/OUTPUTI lOPS MODESI LIMITED FUNCTIONS DTC DECTAPE: FILEI INPUTI lOPS MODESI LIMITED FUNCTIONS DTD DECTAPE: 1 FILEI INPUT/OUTPUTI ALL MODESI ALL FUNCTIONS LPA LINE PRINTER: OUTPUTI lOPS ASCII MODEl ALL FUNCTIONS CDB CARD READER: INPUTI lOPS ASCII MODEl ALL FUNCTIONS SKIP CHAIN ORDER SPFAL DTDF RCSF CLSF LSDF RCSD RSF PSF KSF TSF DTEF SPE MPSNE MPSK 5.3.2.3 API ON/OFF - This command controls the status of the Automatic Priority Interrupt if avail- able in the system. API ON enables the API; API OFF disables the API. Example: $APIOFF 5.3.2.4 QDUMP (or tQ)* - In the event of an unrecoverable error, this command conditions the monitor to dump memory on the "save area" of the system tape (or other unit at the system device if used). *The QDUMP and HALT commands are mutually exclusive and have no effect if a DDT load. 5-6 QDUMP forces automatic execution of the CTRL Q command (described later) on all non-recoverable error calls to the Monitor Error Diagnostic (.MED) program. It must be issued prior to the LOAD, GLOAD, DDT, or DDTNS command used to load the user program. (QDUMP issued prior to a GET, has no effect after the GET since the Monitor at CTRL Q time overlays the monitor primed by QDUMP.) Note that the WRITE switch on the system device should be enabled in case of error; otherwise, an lOPS 4 (not ready) error will follow the initial error. 5.3.2.5 HALT (or H)* - This command conditions the Monitor to print an error message and halt in the event of an unrecoverable lOPS error. Depressing the CONTINUE button reloads the Monitor. HALT must be issued prior to the LOAD, GLOAD, DDT, or DDTNS command. (HALT is issued prior to a GET, has no effect after the GET since the Monitor at CTRL Q time overlays the Monitor primed by the HALT command.) 5.3.26 INSTRUCT (or I) - The INSTRUCT command can be used in two ways: INSTRUCT alone causes a summary of Monitor commands to be printed on the Teletype; INSTRUCT ERRORS causes a summary of system error messages to be pri nted. Example: $INSTRUCT MONITOR: INFORMATION AND MODIFICATION COMMANDS LOG(L): USER COMMENTS TERMINATED BY ALTMODE SCOM(S): SYSTEMS INFORMATION INSTRUCT(I): LIST OF MONITOR COMMANDS INSTRUCT(I) ERRORS: DESCRIPTION OF ERROR CODES REQUEST(R), REQUEST(R) PRGNAM: .DAT SLOT USAGE REQUEST(R) USER: POSITIVE .DAT SLOT USAGE ASSIGN(A) DEVN A,B, ••• /ETC.: .DAT SLOT MODIFICATIONS DIRECT(D), DIRECT(D) M: DIRECTORY OF UNIT 0 OR M OF SYSTEM DEVICE NEWDIR(N) M: CLEAR DIRECTORY OF UNIT M OF SYSTEM DEVICE QDUMP(Q): SET TO SAVE CORE (tQ) ON .IOPS ERROR HALT(H): SET TO HALT ON .IOPS ERROR rQN: SAVE CORE ON UNIT N GET(G) N: RESTORE CORE FROM UNIT N AND RESTART GET(G) N X: RESTORE CORE FROM UNIT N AND START AT X GET(G) N HALT(H):RESTORE CORE FROM UNIT N AND HALT API ON/OFF: CHANGE STATE OF API tC: RESTORE MONITOR tP: USER RESTART *The QDUMP and HALT commands are mutually exclusive and have no effect if a DDT load. 5-7 MONITOR: PROGRAM LOADING COMMANDS AND PRGNAM FOR REQUEST COMMAND LOAD: LINK LOADER AND STOP GLOAD: LINK LOADER AND GO DOT: LINK LOADER WITH SYMBOLS AND GO TO DOT DDTNS: LINK LOADER WITHOUT SYMBOLS AND GO TO DOT MACRO: SYMBOLIC MACRO ASSEMBLER MACROA: ABBREVIATED SYMBOLIC MACRO ASSEMBLER F4: FORTRAN IV COMPILER F4A: ABBREVIATED FORTRAN IV COMPILER EDIT: SYMBOLIC CONTEXT EDITOR PIP: PERIPHERAL INTERCHANGE PROGRAM SGEN: SYSTEM GENERATOR DUMP: BULK STORAGE DEVICE DUMP UPDATE: LIBRARY FILE UPDATE CONV: 7-TO-9 CONVERTER PATCH: SYSTEM TAPE PATCH ROUTINE EXECUTE(E) FILE: LOAD AND RUN FILE XCT CHAIN: XCT CHAIN BUILDER MONITOR: BATCH PROCESSOR BATCH(B) DV: ENTER BATCH MODE WITH DV AS BATCH DEVICE DV: PR = PAPER TAPE READER CO = CARD READER $JOB: CONTROL COMMAND WHICH SEPARATES JOBS $DATA: BEGINNING OF DATA - NOT ECHOED ON TELETYPE $END: END OF DATA $EXIT: LEAVE BATCH MODE TT: SKIP TO NEXT JOB TC: LEAVE BATCH MODE 5.3.2.7 REQUEST (or R) - The REQUEST command allows examination of the. OAT slots associated with various programs.* The command takes the following form: xxxxxx REQUEST where XXXXXX is the system program name (that is I the system program load command), or USER for all positive • OAT slots, or blank for an entire • OAT table printout. Examples: $REQUEST .DAT DEVICE USE -15 -14 -13 -12 - 11 -10 -7 DTA2 DTAI PPC0 TTA0 DTCI TTA0 DTC0 NONE OUTPUT INPUT OUTPUT LISTING INPUT INPUT SYSTEM DEVICE FOR .SYSLD OUTPUT -6 *See Section 7.3 for. OAT slots used by system programs, their uses, and acceptable I/o handlers. 5-8 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 11Z1 NONE PRAIZI TTAIZI TTAIZI DTCIZI DTAIZI DTA1 DTA2 TTAIZI PRAIZI PPAIZI DTA1 DTA2 EXTERNAL LIBRARY FOR .LOAD SYSTEM INPUT TELEPRINTER OUTPUT KEYBOARD INPUT SYSTEM DEVICE FOR .LOAD USER USER USER USER USER USER USER USER $REQUEST MACRO .DAT DEVICE USE -13 -12 - 11 -11Z1 -3 -2 PPCIZI TTAIZI DTC1 TTAIZI TTAIZI TTAIZI OUTPUT LISTING INPUT SECONDARY INPUT CONTROL AND ERROR MESSAGES COMMAND STRING 5.3.2.8 ASSIGN (or A) - The ASSIGN command allows reassignment of • OAT slots to devices other than those set at system generation time. The change of assignment is only effective for the current job, since the permanent assignments are restored when control is returned to the Monitor. The command takes the following form: ASSIGN DEVn a, b, etc/DEVm x, y, etc. where DEV is the device handler name (the list of legal handlers for a particular system may be requested via the SCOM command*). If the third letter of a handler name is omitted, the letter A is assumed. n, m are unit numbers (if none specified, 0 is assumed) a, b, x, y, etc., are • OAT slot numbers Examples: $ASSIGN DTAO -10, -6/PRA -5 (An equivalent command would be $ASSIGN DT -10, -6/PR -5) $ASSIG N PPB -6/DTB2 3/DTB3 5 $ASSIGN DTAl 6, 7, 10 *See Section 7.3 for. OAT slots used by system programs, their uses, and acceptable I/O handlers. Many of the devices, DECtape for example, have more than one I/O handler associated with them. It is imperative that only one version of a device handler be present during a particular run since confusion occurs because of the lack of communication between the two interrupt handlers. 5-9 DEVn can be replaced by NONE or NON to clear. DAT slots. $ASSIGN NONE 4, 5, 10 . DAT slots -2 and -3 are permanent and should not be modified . . DAT slot -7 should be modified only at system generation time. 5.3.2.9 DIRECT (or D) - The DIRECT command allows printout of the directory associated with any unit on the system device control (that is, eight units, 0 through 7, on DECtape control). The command takes the following form: DIRECT N where N is the unit number (unit 0 is the default assumption). Example: $DIRECT DIRECTORY LISTING .LIBR BIN 1 LJ 1 DDT9 BIN 1 LJ2 .LOAD BIN 1 LJ3 CHAIN BIN ILJLJ INTEGE EAE ILJ5 INTEGE NON 152 REAL EAE 16LJ REAL NON 215 KM9 SYS 0 .SGEN2 SYS 36 SKPBLK SYS LJLJ UPDATE SYS LJ5 .SYSLD SYS 56 EXECUT SYS 67 rQAREA SYS 101 PATCH SYS 652 EDIT SYS 657 PIP SYS 671 FLJ 711 SYS MACRO SYS 7 LJ2 FLJA SYS 771 MACROA SYS 1020 DUMP 10LJLJ SYS ·SGENI SYS 1050 CONV SYS 106LJ 70 FREE BLOC KS 5.3.2.10 NEWDIR (or N) n - This command refreshes the directory on the specified unit (n) of the system device control (unit 0 illegal). 5-10 5.3.2.11 GET (or G) - This command has three forms as follows: GET n, GET n xxxxx, or GET n HALT. The letter n is the number (0 through 7) of a unit on system device control that contains the tQ area to be retrieved, and xxxxx is a program starting address. GET retrieves the core image (including the Monitor) stored on unit n on the system device control by CTRL Q commands, and restores it to memory. Control is transferred to xxxxx, if specified; execution halts if HALT was specified. To start in this case, the extended memory switch should be raised if the machine is greater than 8K, and the starting address should be placed in the ADDRESS switches and the START button depressed (PIC and API are enabled). If neither xxxxx not HALT are specified, the job is restored in memory and the resident Monitor waits in a Teletype loop with API and/or PIon for one of the following commands to be typed: tP (restart any system program and user programs whi ch have issued an . I N IT to the Tel etype wi th a restart address. or n (restarts DDT) or ts (starts a relocatable user program - used only if tQ had been executed at the completion of a link load when the loader was waiting for tQ to by typed.) 5.3.2.12 CHANNEL (or C) 7/9 - This command causes the default operation bit (.SCOM + 4, bit 6) to be cleared or set. If this bit is 0, then 7 channel operation is assumed by the MAGtape handler. If it is 1, the 9 channel is assumed. This default condition can also be set at system generation time by answering yes or no to the question "SHOULD DEFAULT ASSUMPTION BE 7 CHANNEL MAGTAPE?" 5.3.2.13 339 (or 3) ON/OFF - This command tells the monitor that a 339 handler is to be loaded. A 30 8 register block is reserved for the push-down list. If a 339 display handler is loaded and the push-down list has not been reserved, an .IOPS 24 error will occur on the first .INIT to that handler. The default condition of the 339 ON/OFF bit (.SCOM+4, Bit 5) can be set at system generation time by answering YES to the question, "SHOULD DEFAULT ASSUMPTION BE A 339 LOAD?" 5.3.2.14 VC38 (or V) ON/OFF - This command causes the character display table for the VC38 option to be set up prior to loading of any system or user programs. If this table is not set up and the user does not specify a character table in the first. INIT to the handler, the display handler wi II assume the presence of a VC38 for text manipulation. The default condition of the VC38 ON/OFF bit (.SCOM+4, bit 4) can be set at system generation time by answering YES to the question, "SHOULD VC 38 CHARACTER TABLE BE LOADED?" 5-11 NOTE If 339 is ON (bit 5 of • SCOM+4=l), then the address of the push-down I ist is initially set to zero. However, if VC38 is ON (bit 4 of . SCOM+4=l) , then the first register of the push-down list points to the starting address of the VC 38 table. 5.3.3 Control Character Commands All control character commands recognized by the Monitor are summarized in Table 5-1. These commands (except RUBOUT) are formed by holding down the CTRL key while striking a letter key. The character or characters echoed on the Teletype and the resulting action is given in the table for each command. Table 5-1 Control Character Commands Action Command Echo CTRL S ts Starts user program after Linking Loader has brought it into core via a LOAD command. CTRL C tc Forces control back to Monitor which types MONITOR $ to indicate that it is awaiting a keyboard command. If the nonresident section of the Monitor was in core, the Monitor is not reinitialized; thus, previous conditions, such as .DAT slot assignments, remain as they were prior to CTRL C. If the nonresident section of the Monitor was not in core, it is brought in and all conditions revert to the standard. CTRL T tT CTRL T is applicable only when using DDT or when operating in the BATCH mode. If DDT is being used, CTRL T forces control back to DDT which types DDT > to indicate its readiness for another DDT command. All previous DDT conditions remain intact (for example, breakpoints, register modifications, etc.). When operating in BATCH mode, CTRL T causes a skip to the next job. CTRL R tR Allows the user to continue when an lOPS 4 (device not ready) error occurs. The user must first ready the device, and then type CTRL R. 5-12 Table 5-1 (Cont) Control Character Commands CTRL P tP Forces control to address specified in the last .INIT command referencing Teletype. Used by system programs to reinitialize or restart. CTRL Q n tQ Dumps the current job, in core image, onto prespecified blocks of unit n on the system device control {the WRITE switch on this unit must be enabled}. For example, when the system device is DECtape unit 0, CTRL Q requests can be made to DECtape only. The core image may be retrieved and reloaded by the GET command or examined by using the DUMP command to load the system Dump program. CTRL Q is honored whenever typed. CTRL U @ Cancels current line on Teletype {input or output}. RUBOUT \ Cancels last character input from Teletype {not applicable with DDT}. 5.4 OPERATING THE KEYBOARD MONITOR SYSTEM The reader is referred to the Keyboard Monitor Guide {DEC-9A-MKFA-D} for detailed operating procedures for system programs in the Keyboard Monitor environment. The following PDP-9 ADVANCED Software System manuals contain additional detailed information on system programs. Manual Document Number Uti I ity Programs DEC-9A-GUAB-D MACRO-9 Assembler DEC-9A-AMZA-D FORTRAN IV DEC-9A-KFZA-D This section contains descriptions of loading the Keyboard Monitor, system generation, assigning devices, loading programs, and error detection and handling. 5.4.1 Loading the Keyboard Monitor Each installation employing the DECtape version of the Keyboard Monitor must reserve tape unit 0 as the system device. This unit will contain the system tape, which includes the Monitor, the Input/Output Programming System, and all system and library programs needed by the user. A System Bootstrap is supplied on paper tape in hardware READIN format. By setting the starting load address of the bootstrap (17637 of the highest memory bank available) on the console address switches, depressing I/O RESET and then the READIN switch, the bootstrap is loaded into upper core. It clears the flags, turns on EXTEND MODE, disables the program interrupt {and the automatic priority interrupt, if avai lable}, loads the Keyboard Monitor from the system device into lower core, and transfers control to it. The Monitor types MONITOR $ when it is ready to accept commands from the user. 5-13 The System Bootstrap may be restarted without reloading the paper tape, if it has not been destroyed, by setting the ADDRESS switches to 17646 of the highest memory bank, depressing I/O RESET and then START. Ease of operation in an 8K DECtape environment will be enhanced by noting the following system characteristics, all of which are concerned with a judicious choice of I/o handlers (see Section 7.3 and 7.4) for system program operations: a. .DAT slots -11 and -13 have been standardly assigned to handler DTB. to facilitate use of MACROA and FORTRAN IV A with DECtape input and DECtape output. Consequently, a reassignment of .DAT slots -11 and/or -13 is required in order to use MACRO or FORTRAN 4. If this reassignment is not performed the user may expect a . SYSLD 1 (core overflow) error. b. .DAT slot 6 has been assigned to PPB (the punch handler for all data modes except lOPS ASCII) in order to facilitate loading PIP with the optimum combination of I/O handlers. Since paper tape reproduction of any paper tape may be accomplished using the I data mode, the user is seldom inconvenienced. If, however, PPA. is sometimes desired, the other positive .DAT slots will have to be examined for appropriate reassignment. 5.4.2 System Generation PDP-9 installations with Disk but not DECtape receive PDP-9 ADVANCED software as a set of paper tapes which can be used to create a system tape. Installations that have DECtape will receive a system tape on 0 ECtape • System Generator (.SGEN) is a standard system program (bulk storage systems only) used to create new system tapes. Upon receiving a PDP-9 bulk-storage system, the user should immediately create a standard system tape for his installation. This is done by loading the System Bootstrap, which calls the system into core, and using the Keyboard Monitor to call the System Generator. . SGEN will output the new system tape on the device associated with .DAT slot -15; the ASSIGN command should be used prior to calling. SGEN to assign a bulk storage device to slot -15 and the old system device to slots -10 and -14, that is, $ASSIGN DTAO -14, -10/OTA2 -15 (or DKD2 -15*) J $SGEN J Once loaded, . SGEN communicates with the user in a conversational mode via the Teletype to obtain information needed to create a system tape. Among the items of information it needs to know are: *It is imperative that the Disk "0" handler be used when generating from DECtape to Disk to avoid core overflow. Conversely, generating from Disk to DECtape requires: $ASSIGN DKAO -14, -10/OTD2 -15 J 5-14 a. On which device the system tape will operate, so that 1. The system device slots in the device assignment table (. DAT) can be set. 2. The PIC skip chain and API channels can be set up for the system device. b. All device skips present in the PIC skip chain and their order. Non-basic devices can be added to the skip chain at this time, by supplying the device mnemonic and the skip IOT(s}. c. Total core capacity (8, 16, 24, or 32K) of the installation. d. Special options present at the installation (API, EAE, etc.) e. be assigned. The structure of • DAT. All system slots (-1 through -15) and slots 1 through 10 shou Id When .SGEN has received all of the information necessary, it creates a new system tape, then returns control to the Monitor. New system tapes can be created whenever a significant change in the installation configuration occurs. A good example of a complete system generation session is given in the Keyboard Monitor Guide (DEC-9A-MKFA-D). The following paragraphs are intended to assist Keyboard Monitor users in their initial efforts at "tailor making" a system for their installation. The first and foremost rule before system generation is attempted involves getting a .SCOM printout ($S J to the Monitor) and a .DAT slot printout ($RJ to the Monitor) in order to assist in determining two basic elements in the system; (1) skip chain content and order; and (2) • DAT slot assignments. 5.4.2.1 DECtape or DECtape/Disk Systems An 8K, non-EAE, non-API, KSR33 DECtape system is sent to all DECtape or DECtape/Disk customers. Each customer with a core configuration of greater than 8K or who has either EAE or API or a KSR35 Teletype will want to go through system generation in order to tailor his installation for maximum efficient use. All customers who, upon examining the .SCOM printout, discover devices or options listed that are not present in their system may want to eliminate the irrelevant skips from the chain. Those with non-standard devices (A/D, for example) will want to expand the chain. Listed below is the skip chain as it appears in the standard 8K DECtape system: SPFAL DTDF DSSF DRSF MTSF LSDF RCSF RCSD CLSF Power Fail DECtape Done Disk Done Drum Done Magneti c Tape Done on Error Line Printer Done Card Column Ready Card Done Clock Done 5-15 RSF PSF KSF TSF DTEF MPSNE MPSK SPE *DRNEF Ready Done Punch Done Keyboard Done Teleprinter Done DECtape Error Non-Existent Memory Reference Memory Protect Violation Memory Pari ty Error Drum No Error It is important that the above order remain intact even if deletions or additions are to be made. For example, given a PDP-9 without the Power Fail, Parity or Memory Protect options and having either card reader, line printer or magnetic tape, the skip chain should be generated as follows: DTDF DSSF CLSF RSF PSF KSF TSF DTEF The position of a skip to be added to the chain varies with the nature of the device. example, high data rate devices might best be placed at the top of the chain. For Listed below are the. DAT slot assignments as they appear in the standard 8K DECtape system: .DAT DEVICE USE -15 -14 -13 DTA2 DTA1 DTB2 HAO DTBl HAO DTCO NONE NONE DTC2 HAO HAO DTCO OUTPUT INPUT OUTPUT LISTING INPUT INPUT SYSTEM DEVICE FOR. SYSLD OUTPUT EXTERNAL LIBRARY FOR • LOAD SYSTEM INPUT TELEPRINTER OUTPUT KEYBOARD INPUT SYSTEM DEVICE FOR. LOAD -12 -11 -10 -7 -6 -5 -4 -3 -2 -1 *DRNEF, Skip on drum error flag not raised, is a good example of a negative skip, i.e., a skip on a flag not being raised. When specifying such a skip to • SGEN, a minus sign must precede the skip. It sh~d be carefully noted that negative skips should only be included when the device is physically present in the PDP-9 system since the skip lOT otherwise becomes an effective NOP causing execution of the next instruction which is a JMP to the Monitor error routine (lOPS 3). 5-16 1 2 3 4 5 6 7 10 DTAO DTAl DTA2 TTAO PRAO PPBO DTAl DTA2 USER USER USER USER USER USER USER USER The following examples are variations on • DAT slot assignments* as a function of either core size or different peripherals. a. Given an 8K system with line printer and card reader: LPA should be assigned to . DAT slot -12 and one of the positive slots, for example, 3, 7, or 10. CDB should be assigned to one of the positive slots. b. be as follows: -15 -14 -13 -12 -11 -10 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 10 Given a 16K (or greater) Disk/DECtape system, a suggested list of assignments might DKA6 DKA4 DKA5 TTA DKA4 PRA DKCO DKA5 NONE DKAS TTA TTA DKAO DKA4 DKAS DKA6 TTA PRA PPA DTAl DTA2 c. Given a 16K (or greater) DECtape system with magnetic tape, a suggested list of assignments might be as follows: -15 -14 -13 -12 -11 DTA2 DTAl DTA2 TTA DTAl * All installations with 16K or more core should assign the ~ versions of handlers to all .DAT slots. 5-17 -10 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 10 5.4.2.2 PRA DTCO DTA2 NONE DTA2 HA HA DTAO DTAO DTAl DTA2 HA PRA PPA MTFl MTF2 Paper Tape/Disk Systems Three trays of paper tapes {24} representing an SK, non-EAE, non-API, KSR33 Disk system are sent to all disk customers who do not have DECtape. Installations with greater than 8K, API, EAE, KSR35 or non-standard options will want to generate a system after the initial loading of their 8K system. The discussion about skip chain order appearing in Section 5.4.2.1 {DECtape/Disk system} applies and should be read carefully. Usted below are the. DAT slot assignments as they appear in the standard 8K Paper Tape/ Disk system: .DAT DEVICE USE -15 -14 -13 -12 DKA6 DKA4 DKB5 HAO DKB4 HAO DKCO NONE NONE DKC5 HAO HAO DKCO DKA4 DKA5 DKA6 HAO PRAO PPAO DKAl DKA2 OUTPUT INPUT OUTPUT LISTING INPUT INPUT SYSTEM DEVICE FOR. SYSLD OUTPUT EXTERNAL LIBRARY FOR. LOAD SYSTEM INPUT TELEPRINTER OUTPUT KEYBOARD INPUT SYSTEM DEVICE FOR. LOAD USER USER USER USER USER USER USER USER -11 -10 -7 -6 -5 -4 -3 -2 1 1 2 3 4 5 6 7 10 5-1S The following example is a variation of • OAT slot assignments* as a function of both increased core size and additional peripherals: Given a 16K system with line printer, card reader and magnetic tape, a suggested list of assignments follows: -15 -14 -13 -12 DKA6 DKA4 DKA5 LPA DKA4 PRA DKCO DKA5 NONE DKA5 TTA TTA DKAO DKA4 DKA5 DKA6 TTA PRA PPA CDB MTF1 -11 -10 -7 -6 -5 -4 -3 -2 -1 1 2 3 4 5 6 7 10 5.4.3 Assigning Devices Before calling a system or user program, the user should make all device assignments necessary to the program(s) to be run. The ASSIG N command (see Section 5.3.2.8) is used to attach hardware devices to the slots of the device assignment table. Figure 5-1 shows the normal setup of . OAT. Only system slots -2, -3, and -7 cannot be modified by the ASSIGN command, since these must be used by the Monitor. System programs use the negative .DAT slots while user programs should use the positive .DAT slots. PIP-9 (Peripheral Interchange Program) is an exception to this rule in that it uses all the positive .DAT slots (1 through 10) and system slot -2, -3 for Teletype I/O. .DAT Slot .DATBG Device Handler* -15 DTA -14 DTA -13 DTB Unit Use 2 Output (EDITOR, UPDATE, CONVERTER, SYSGEN) Input (EDITOR, UPDATE, CONVERTER, SYSGEN, DUMP) 2 Output (MACRO-9, FORTRAN IV) *AII installations with 16K or more core should assign the A version of handlers to all • OAT slots. 5-19 .DAT -12 TTA Listing {MACRO-9, FORTRAN IV, UPDATE, DUMP, CONVERTER} -11 DTB Input {MACRO-9, FORTRAN IV} -10 PRA Input {DDT} Secondary Input {EDITOR, UPDATE, MACRO-9, SYSGEN} -7 DTC -6 PPC Output (DDT) -5 NONE External Library {Linking Loader} -4 DTC -3 TTA Tel epr inter Output -2 TTA Keyboard Input -1 DTC 0 2 0 System Device {System Loader} Input (Linking Loader) } All system programs System Library {Linking Loader} .DAT 1 2 DTAO DTAl DTA2 TTA PRA PPB DTAl DTA2 3 4 5 6 7 10 User and PIP-9 .DAT slots .DATND=. Figure 5-1 5.4.4 Function of .DAT Slots in Keyboard Monitor System Loading Programs in the Keyboard Monitor Environment In the Keyboard Monitor environment, all system programs are called by unique keyboard commands {F4, MACRO, etc.}. User programs are called by loading the Linking Loader or DDT {via LOAD, GLOAD, DDTNS, or DDT commands} and requesting it to load the desired program. In loading user programs, the main program is loaded first, followed by all required subprograms. By loading subprograms in the order of size {largest first, smallest last}, the user has a better chance of satisfying core requirements for his programs in systems with extended core memory. {See Figure 5-2 for memory maps of programs loaded in the Keyboard Monitor system.} When a keyboard command requests a new system program, the Keyboard Monitor loads the System Loader and the system device handler into core. The System Loader is basically the Linking Loader in absolute form and always requires the same device handler to acquire input from the system device. The Linking Loader, on the other hand, is relocatable and device independent. *See Section 7.4 for a description of the handlers. 5-20 The System Loader is used to bring in all system programs, including the linking Loader, and their associated device handlers. Once loaded, the linking Loader is used to bring in user programs, their subroutines and device handlers. The System Loader can print the same error messages as the linking Loader (see Appendix D), except that it precedes the error code with the symbol. SYSLD. It returns control to the System Bootstrap to re-initialize the Keyboard Monitor if an error occurs. Once a system program is loaded by the System Loader, the loaded program assumes control. At this stage, it is ready to accept an input command string from the keyboard telling it how to proceed. Detailed operating procedures for each system program are given in the Keyboard Monitor Guide (DEC-9A-MKFA-D) • 5.4.5 Error Detection and Handl ing Comprehensive error checking is provided by the Keyboard Monitor, the loaders, and the Input/Output Programming System. Detailed lists of errors that may occur are given in Appendices C, D, and E, respectively. After error messages are output, the user may optionally restart the system or user program, dump core, or return control to the System Bootstrap for re-initialization of the Keyboard Monitor (see Section 5.3.2.11). If QDUMP has been issued prior to execution of this program, an automatic CTRL Q (dump the current job, in core image, onto prespecified blocks of the system device) takes place before control is returned to the System Bootstrap. The number of the unit to be used as the dump device must be typed by the user after the error typeout. This dumped file can be selectively I is ted by the system Dump program. If HALT has been typed prior to program execution, the program stops after error message typeout allowing manual memory cell examination, manual restart or core dump. 5-21 MEMORY MAP B MEMORY MAP A BK or 16K or 8K or 16K or 24K or 32K 24K or 32K RESIDENT SYSTEM BOOTSTRAP RESIDENT SYSTEM BOOTSTRAP • SCOM AND eSCOM+3 f - - - - - - - I e SeOM NON-RESIDENT KEYBOARD MONITOR: INITIALIZATION AND KEYBOARD COMMAND DECODER • SCOM +1 AND. SCOM +2 RESIDENT KEYBOARD MONITOR (INCLUDING TELETYPE HANDLER) 9 o o The System Bootstrap loads {DUMP mode} the Keyboard Monitor {resident and nonresident} from the system device. The System Bootstrap is loaded via the paper tape reader in HRM mode. Figure 5-2 Keyboard Monitor System Memory Maps 5-22 MEMORY MAP C MEMORY MAP D (SYSTEM PROGRAM IS NOT LINK ING LOADER) 8K or 16K or 8K or 16K or 24K or 32K 24K or 32K RESIDENT SYSTEM BOOTSTRAP R£SIDENT SYSTEM BOOTSTRAP 9 • SCOM • SCOM SYSTEM PROGRAM SYSTEM LOADER 1-------SYSTEM DEVI CE HANDLER l • • SCOM+3 SCOM+3 SYSTE M PROGRAM TABLE SPACE ie: MACRO-9 AND FORTRAN IV SYMBOL TABLES. t • SCOM+2 SYSTEM PROGRAM DEVICE HANDLER i SYSTEM PROGRAM DEVICE HANDLER • SCOM+I a • SCOM+2 • SCOM+I RESIDENT KM-9 (INCLUDI NG TELETYPE HANDLER) RESIDENT KM-9 (INCLUDING TELETYPE HANDLER) o 960 10 o The Keyboard Monitor loads (DUMP mode) the System Loader and the system device handler from the system device The System Loader, during loading of a system program from the system devi ce , builds the loader (GLOBAL) symbol table down from • SCOM+3 and the programs up from. SCOM+2. The System Loader learns which I/o handlers are required by the requested system program from its table of .IODEV info for system programs, loads the handlers relocatably just above the resident KM-9 and then modifies the System Bootstrap to bring in the system program in Dump mode just below the Bootstrap. • EXIT from the system program takes the process back to Memory Map B where the system bootstrap reinitializes the Keyboard Monitor. Refer to Section 7.4 for the sizes of the device handlers that may be associated with the. DAT slots used by the System program. Figure 5-2 Keyboard Monitor System Memory Maps (Cont) 5-23 MEMORY MAP 8K or 16K or MEMORY MAP F (NOT DDT OR DDTNS) E (SYSTEM PROGRAM IS LINKING LOADER) LOAD GLOAD BK or 16K or 241< or 32K OOT 24K or 32K DDTNS CHAIN RESIDENT SYSTEM BOOTSTRAP • SCOM B l RESIDENT SYSTEM BOOTSTRAP • • SCOM+3 SCOM USER PROGRAM(S) USER DEVICE HANDLER USER DEVICE HANDLER USER DEVICE HANDLER • SCOM +3 i • SCOM+2 LINKING LOADER OR CHAIN ------- LINKING LOADER DEVICE HANDLER { LINKING LOADER DEVICE HANDLER (bl LINKING LOADER DEVICE HANDLER REFER TO SECTION 4.6 FOR DEVICE HANDLER SIZES. ------LINKING LOADER DEVICE HANDLER (0.) • SCOM+l RESIDENT KM-9 IINCWDING TELETYPE HANDLER) RESIDENT KM-9 IINCLUDING TELETYPE HANDLER) o o The System Loader learns which I/O handlers are required by the Linking Loader, loads them relocatably and then loads the Linking Loader relocatably. • EXIT from user program takes the process back to Memory Map B where the system bootstrap re-initial izes the Keyboard Monitor. Refer to Section 7.4 for sizes of device handlers. If a DDT load, the Linking Loader just prior to giving control to DDT moves the DDT symbol tab Ie down in core so that it overl ays a II of the Linking Loader except for the small routine that makes the· block transfer. The Linking Loader, during loading of user programs down from .SCOM+2, builds the loader (GLOBAL) and DDT (if DDT) symbol tables up from .SCOM+2. DDT symbol table will not be built if a LOAD, GLOAD, or DDTNS load. .SCOM+l and .SCOM+2 both point to one of two places and non-BLOCK DATA COMMON (FORTRAM IV or MACRO-9) output may make use of core as low as they point. a. If the user program did not have any device handlers in common with the Linking Loader. b. If the user program did have at least one device handler in common with the Linking Loader. Figure 5-2 Keyboard Monitor System Memory Maps (Cont) 5-24 MEMORY MAP H (EXECUTE) MEMORY MAP G (DDT OR DDTNS) 8K or 16Kor 8K or 16K or 24Kor32K 24K or 32K RESIDENT SYSTEM BOOTSTRAP RESIDENT SYSTEM BOOTSTRAP • SCOM • SCOM EXECUTE (600\0 DDT USER PROGRAM( S) USER PROGRAM(S) USER/DDT DEVICE HANDLER LIBRARY PROG R AM(S) USER/DDT DEVICE HANDLER USER DEVICE HANDLER(S) • 46(0 SCOM+ 3 NAMED COMMON I • SCOM+3 DDT CREATED SYMBOLS AND PATCH SPACE • SCOM + 2 DDT (USER) SYMBOL TABLE '/////1///1//1/, LINKING LOADER DEVICE HANDLER LINKING LOADER DEVICE HANDLER B LANK COMMON • SCOM +( ~ • SCOM+2 LINKING LOADER BLOCK TRANSFER ROUTINE EXECUTE'S DE V ICE HANDLER RESIDENT KM-9 (INCLUDING TELETYPE HANDLER) RESIDENT KM- 9 (INCLUDING TELETYPE HANDLER) o o . EXIT from the user program takes the process back The System Loader loads the I/O handler needed by EXECUTE above the resident portion of the Monitor. to Memory Map B where the system bootstrap reIt then modifies the System Bootstrap to bring in initializes the Keyboard Monitor. EXECUTE in dump mode just below the Bootstrap. Refer to Section 7.4 for sizes of device handlers. When the user typed in the name oftheXCTfile to be run, Non-BLOCK DATA COMMON (FORTRAN IV) the non-resident portion of the Monitor stored the fi Ie or MACRO-9 output) may make use of core as name in .SCOM + 7, 10 and 11. . EXECUTE now low as the DDT symbol table *. However, locates this file and brings in the first chain. trouble will occur if the user requests DDT to create symbols or make patches that cause overFORTRAN programs pass on data in blank common starting at . SCaM + 2. Macro programs pass on laying of the COMMON area. data between . SCO M + 2 and . SCO M + 3. The Linking Loader device handlers would have A call from the running chain to bring in another chain been used to satisfy user device requests. is effected by transferring control back to Execute. *There is no DDT symbol table if a DDTNS load. . EXIT from the user chain takes the process back to PHASE 2 where the System Bootstrap re-initializes the Keyboard Monitor. Figure 5-2 Keyboard Monitor System Memory Maps (Cont) 5.5 BATCH PROCESSING The Batch Processor portion of the Monitor allows user commands to come from the paper tape reader or card reader instead of the Teletype, allowing many programs to be run without operator intervention. All Monitor commands read on the batch device are echoed on the Teletype. Monitor commands that are peculiar to the Batch Processor include the following: Function Command BATCH (B) dv Enter Batch mode with dv as batch device; dv can be typed as PR, for paper tape reader, or CD, for card reader NOTE The following special characters can be keypunched using the indicated card codes. Back arrow (-) = 0-5-8 punch ALT MODE (ESC) = 12-1-8 punch $JOB Used to separate jobs (the loading of any system or user program constitutes a single job). $ DATA Beginning of data - all inputs up to $END are not echoed on the Teletype. $END End of data. $ EXIT Leave Batch mode. NOTE The following commands are illegal when operating in Batch mode: QDUMP, HALT, GET (all forms), BATCH, LOAD, DDT, and DDTNS. Special Batch Processor control characters include the following: CTRL T (echos tT) Skip to next job. CTRL C (echos tC) Leave Batch mode. To use the Batch Processor, proceed as fo I lows • a. Load the batch tape or deck into the batch device. b. Type BATCH (or B) dv on the keyboard, where dv is PR or CD. When operating in Batch mode, the Keyboard Monitor has the following operational changes. a. Any ASSIGN command that references the batch device (any handler) will be assigned to the batch device handler. 5-26 b. Any REQUEST command will print the batch device handler PR* or CD* (whichever applies) . c. When the non-resident Monitor is reloaded, it interprets batch communication bits in the top register of core (177777, 377777, 577777, or 777777): Bit 0 Bit 1 1 = Batch mode o = Non-Batch mode 1 = $JOB command in 0= Search for $JOB Bit 2 1 = CD is batch device 0= PR is batch device When an error occurs in a job, the non-resident Monitor is reloaded and the Batch Processor skips to the next $JOB command on the batch device. The following example was produced under control of the Batch Processor. Underlined commands are on paper tape. ALT MODE termination is indicated with a 0. $tC M·Jf'-J I TOR VLj8 $BATCrl PR This command causes all subsequent commands to come from the paper tape reader. MOl\! I TOR VLtB $$JOB TEST BATCH $PIP PIP V7A >N DKLt >T DKLt TEST SRC (A) $DATA $!<..ND ~ PR The entire program to be compiled below appears on the paper tape between $DATA and $END. MONITOR \jLjB S) $JOB s)ASSIGN TT -12 s)R FLt • W1T DEVICE USE - 13 DXAS TTA0 DKALt TTA0 PR*0 OUTPUT LI STIi\! G INPUT CONTROL AND ERRDR MESSi1GES COMMAND STRII\!G -12 - 11 -3 -2 SiFLt 5-27 FO RT R:';,\) 4 'v 4A > S~ L~ B<-TEST® E,\) 0 PASS 1 C C TEST OF BATCrl PRJCESSO~ FORTRAN program to I ist numbers from 1 through 10. C DO 1 I = 1 ~ 10 1 ~~ITE 100 FO~ivJiH (4~100) (6X~I3) STO? 12345 E,\)O TEST •1 I • F '.~ • 100 • FE .FF · ST Fe> 17777 00012 00043 00036 00021 00037 00040 00041 00042 * * * * * · . Mel.\) I TOR VLJB S$JJ3 $ GLO.40 L,)ADER 'v3A >TEST ® TEST 37573 BCOID 34600 STOP 34565 SPMSG 34472 FIOPS 33736 OTSER 33642 REAL 32654 Program execution begins here. 2 3 4 5 6 7 8 9 10 5-28 STOP 012345 MOI\JITOR VLJ8 $$JOB $$EXIT MONITOR V48 5.6 Control is returned to Teletype at this po int. DECTAPE FILE ORGANIZATION DECtape can be treated either as a non file-oriented medium or as a fi Ie-oriented medium, as described in the following paragraphs. 5.6. 1 Non-File-Oriented DECtape A DECtape is said to be non-file-oriented when it is treated as magnetic tape by issuing the MTAPE commands: REWIND, BACKSPACE, followed by .READ or .WRITE. No directory of identifying information of any kind is recorded on the tape. A block of data (255 10 word maximum), exactly as presented by the user program, is transferred into the handler buffer and recorded at each. WRITE command, where the final (256 th) word is the data link to the next DECtape block of data. A .CLOSE terminates recording with a simulated end-of-file consisting of two words: 001005, 776773. The data link of this EOF DECtape block is calculated in case another file is to be recorded. Note that the simulated end-of-file is identical whether executing a .CLOSE in a file-oriented or non-file-oriented environment. Because braking on DECtape allows for tape roll, staggered recording of blocks is employed in the PDP-9 ADVANCED Software System to avoid constant turnaround or time-consuming back and forth motion of sequential block recording. When recorded as a non-fi Ie-oriented DECtape, block 0 is the first block recorded in the forward direction. Thereafter, every fifth block is recorded until the end of the tape is reached, at which time recording, also staggered, begins in the reverse direction. Five passes over the tape are required to record 576 10 blocks (0-10778 ), 5.6.2 Fi Ie-Oriented DECtape Just as a REWIND command declares a DECtape to be non-fi Ie-oriented, a • SEEK or • ENTER implies that a DECtape is to be considered file oriented. The term file-oriented means simply that a directory containing file information exists on the DECtape. A directory listing of any DECtape so recorded is available via the (L}ist command in PIP or the (D)irect command in the Keyboard Monitor. A fresh directory may be recorded via the (N)ewdir command in the Keyboard Monitor or PIP or by the 5-29 N or S switch in PIP. The directory of all DECtapes except system tapes occupies all 4008 cells of block 1008 , It is divided into two sections: (1) a 408 word Directory Bit Map and (2) a 3408 word Directory Entry Section. The Directory Bit Map defines block availability. One bit is allocated for each DECtape block (576 10 bits = 3210 words). When set to 1, the bit indicates that the DECtape block is occupied and may not be used to record new information. The Directory Entry Section provides for a maximum of 56 10 files on a DECtape (24 10 on a system tape). A four-word entry exists for each file on DECtape, where each entry includes the 6-bit trimmed ASCII file name (6 characters maximum), and file name extension (3 characters maximum), a pointer to the first DECtape block of the file, and a file active or present bit. On a system tape on Iy the first 2008 words are used as a 24 fi Ie directory. Cells 0-378 constitute the System Tape Directory Bit Map and cells 40-1778 contain 24 fi Ie Directory Entry Section. The second 2008 words of DECtape block 1008 contain basic system directory information (blocks occupied by system programs), used by KM-9, PIP-9 and SGEN-9. DECTAPE DIRECTORY Block 0 ooEE;--- Directory Block 1077 Entry _ 0_ """---- _ _ _ Bit Map _ _ _ ooEE;-_ _ Directory Entry Section '------------Entry 55 10 377 A DIRECTORY ENTRY o 5 6 11 12 File Wd. 0 Name 2 3 Fi Ie Name Extension 1 I Data Li nk (Next Fi Ie Block) Sign Bit: 1 = Fi Ie Active 5-30 17 Note: Nulls (0) fi II in short fi Ie names. A fj Ie name extension is not absolutely necessary. Additional file information is stored in blocks 71 through 77 of every file-oriented DECtape (blocks 71 through 73 of a system tape). These are the File Bit Map Blocks. For each file in the directory, a 408 word File Bit Map is reserved in block 71 through 77 as a function of file name position in the Directory Entry Section of block 100. Each block is divided into eight File Bit Map Blocks. A File Bit Map specifies the blocks occupied by that particular file and provides a rapid, convenient method to perform DECtape storage retrieval for deleted or replaced files. Note that a file is ~ deleted until the new one of the same name is completely recorded, that is, on the .CLOSE of the new file. Fi Ie Bit Map Blocks Block 71 File Bit Map for File 0 File 7 Block 72 Fi Ie 15 10 Block 77 File 48 10 File 55 10 When a fresh directory is written on DECtape, blocks 71 through 100 are always indicated as occupied in the Directory Bit Map. Staggered recording (at least every fifth block) is used on file-oriented DECtapes, where the first block to be recorded is determined by examination of the Directory Bit Map for a free block. The first block is always recorded in the forward direction; thereafter, free blocks are chosen which are at least five beyond the last one recorded. When turnaround is necessary, recording proceeds in the same 5-31 manner in the opposite direction. When reading, turnaround is determined by examining the data link. If reading has been in the forward direction, and the data link is smaller than the last block read, turnaround is required. If reverse, a block number greater than the last block read implies turnaround. A simulated end-of-file terminates every file and consists of a two word header (1005, 776773) as the last line recorded. The data link of this final block is 777777. Section 2.3.1 of this manual discusses lOPS data modes. Data organization for each I/O medium is a function of these data modes. On file-oriented DECtape there are two forms in which data is recorded: (1) packed lines - lOPS ASCII, lOPS binary, Image ASCII and Image binary and (2) dump mode data - Data Mode. In lOPS or image modes, each line (including header) is packed into the DECtape buffer. A 2'5 complement checksum is computed and stored for each line of information. When a line is encountered which will exceed the remaining buffer capacity, the buffer is output, after which the new line is placed in the empty buffer. No line may exceed 254 10 words, including header, because of the data link and even word requirement of the header word pair count. An end-of-file is recorded on a .CLOSE. It is packed in the same manner as any other line, that is, if the buffer will not contain it, the line goes into the next free block chosen. In dump mode, the word count is a Iways taken from the I/o macro. If a word count is specified which is greater than 255 10 (note that space for the data link must be allowed for again), the DECtape handler will transfer 255 10 word increments into the DECtape buffer and from there to DECtape. If some number of words less than 255 10 remain as the final element of the dump mode .WRITE, they will be stored in the DECtape buffer, which will then be filled on the next .WRITE, or with an EOF if the next command is .CLOSE. DECtape storage use is thus optimized in dump mode since data is stored back to back without headers. 5.7 INTERIM DISK SYSTEM The PDP-9 Interim Disk System (Storage Unit RB09 and Disk Control RC09) is an adaptation of the PDP-9 ADVANCED Software System for DECtape and includes the Keyboard Monitor, all PDP-9 ADVANCED Software System programs, a disk system bootstrap, disk handlers DKA, DKB, DKD, and DKC, and either DSKSAV or DSKPTR, utility programs to save and restore disk data to/from DECtape or paper tape, respect i ve Iy • In the interim system, the disk is treated as six logical units (0,1,2,4,5,6), each conta i n i ng 576 10 b locks of 256 10 words per block. Si nce each of the RB09 di sk tracks conta i ns 80 sectors of 64 10 words, a track is equivalent to 20 logical DECtape blocks. The table below lists unit-track correspondence: 5-32 Track, Sector (Inclusive) Disk Unit DKO 0,0-28,63 DK1 30,0-58,63 DK2 60,0-88,63 DK4 100,0-128,63 DK5 130,0-158,63 DK6 160,0-188,63 The minimum hardware configuration required for the PDP-9 Disk System is a basic PDP-9 (8K, Teletype, high-speed reader/punch), RB09 Disk Unit with Disk Control RC09, and Direct Memory Access Channel Multiplexer Adapter, Type DM09A. 5.7.1 The Disk as System Device The PDP-9 ADVANCED Software System resides on tracks ° through 28 (Disk Unit 0) with the Keyboard Monitor starting at tracks 0, sector 0. All absolute system programs, directory and File Bit Map information occupy the same logical block positions on disk as they occupy on DECtape. Blocks on tracks ° through 28 not used for system storage are avai lable for user fi les provided that the disk protec- tion switches have not been activated. It is recommended however, that once the disk system is loaded, the protection switches be activated for tracks ° through 29. Much of the description on DECtape file organization (Section 5.4.1), applies to the Interim Disk System as well, since the four disk handlers (DKA, DKB, DKD, and DKC) are modified versions of DECtape handlers DTA, DTB, DTD, and DTC. 5.7.2 Disk File Organization In the interim system the PDP-9 Disk is divided into 6 units (each equivalent to a DEC tape in length) therefore, each unit has its own directory of files. Each unit, each directory and the file therein is treated as distinct within the system. Disk files may be recorded in anyone of the five standard PDP-9 ADVANCED Software System data modes. MTAPE .READS, .WRITES may be considered as creating a sixth data mode as far as data organization of MTAPE files on Disk is concerned. Disk file data organization may take one of three forms: a. Packed lines: lOPS ASCII, lOPS Binary, Image Alphanumeric, Image Binary b. Packed dump areas: Dump Mode c. MTAPE transfers 5-33 In lOPS or Image modes, lines, including headers, are packed back to back on a logical words or 4 disk sectors). A 2 1s complement checksum is computed by the disk handler 10 and stored in the header of each line. When a line is encountered which will exceed the current block disk block (256 capacity, that line is placed in the next free logical disk block. A data link to the new block is stored in the final word of the filled block. Unused space in any file block is equal to zero. The final line of the file, whatever the data mode, is an EOF header of two words: 1005, 776773. The data link of the last block of any fi Ie except a • MT APE transfer is 777777. In Dump Mode, the transfer word count is a Iways taken from the I/o Macro. If a word count greater than 255 10 is specified (again the last word of a logical block must contain a data link), the disk handler will transfer 255 10 word increments onto the disk in linked logical blocks. If some number of words less than 255 10 remain as the final element of the Dump Mode. WRITE, they will be stored on the next logical disk block which will then be filled on the next .WRITE or with an EOF if the next command is .CLOSE. Disk storage is optimized in Dump Mode since data is packed and no headers are used. An MTAPE • WRITE causes transfer of a 255 10 word logical disk block starting at logical block 0 of the specified disk unit. A disk unit used for MTAPE transfers contains no directory information. No packing is performed by the disk handler, it is the user1s responsibility to format the record in whatever way he chooses. When a .CLOSE is issued, the usual EOF line is recorded as the last block of an MTAPE file. The data link is computed in case another MTAPE file is to be written and is stored in the EOF (or last) block of the present file. 5.S DISK SYSTEM OPERATION Operation of the PDP-9 Disk System is essentially the same as operation of the DECtape sys- tem. To begin disk system operation, the paper tape Disk Bootstrap (.DKSBT) is loaded into core memory (HRM: 17637) and automatically loads the Keyboard Monitor into core from disk track O. (The bootstrap restart address is 17646.) PDP-9 ADVANCED Software for the disk is distributed as an SK system in one of two forms: a. 1 DECtape . b. 3 trays (24 10 ) of paper tapes } SK, non-API, non-EAE, KSR33 systems DSKPTR is the utility program for loading the disk system from paper tape, a 30 minute operation. It is additionally capable of loading or punching any logical disk unit or 6K elements thereof as a function of ACS settings on the PDP-9 console. The data format of tapes generated or loaded via DSKPTR is shown in Figure 5-3. Each tape consists of 6K or 24 logical 256 10 word sequential disk blocks. Each data block on paper tape is preceded by six blank frames to aid visual identification. 5-34 FRAME 0-2 BLOCK # \0-1077) BLOCK N FRAME 3- 5 . BLOCK CHECKSUM" BLANK BLOCK N+I - ~ A 256 BINARY DATA WORDS "BLOCK CHECKSUM ~ 2'S COMPLEMENT CHECKSUM OF BLOCK J!'+DATA WORDS Figure 5-3 5.8. 1 Paper Tape Block Format Paper Tape Load Procedure a. Place the paper tape of DSKPTR in reader with address switches set to 17720. b. Press I/o RESET and READI N. c. on teletype. When the program is loaded, it wi II display its title, DSKPTR and skeleta I directions SET: d. *ACSO=O ACS15-17 = Unit # Paper tape to disk 0,1,2,4,5,6 Place the first disk system tape in reader and press CONTINUE. e. IIHIT CONTINUE FOR NEXT TAPE II will be typed on the teletype when the tape has been read correctly. Load the remaining 23 tapes in a similar fashion. Note, any number of tapes up to the fu II 24 may be loaded in any order. The following errors may be displayed on the teletype during loading: 1. Unit Error: ACS15-17 = 3 or 7. Action: 2. Reset ACS15-17 = 0, 1,2,4,5,6 b. Press CONTINUE Reload Tape: Reader end-of-tape condition at illegal point. Action: 3. a. a. Reload tape b. Press CONTINUE Input Checksum Error: Block checksum incorrect. Action: a. Reload tape from beginning, OR position tape to the front of block in error, or leave tape in current position.* *ACS 0-17 = 0 for full system load onto disk. 5-35 b. Press CONTINUE f. When the disk system is loaded, set the write protect switches for tracks 0 through 29. g. Load the Disk Bootstrap into the reader with address switches set to 17637. h. Press I/o RESET and READIN. The PDP-9 Keyboard Monitor will be loaded from the disk and will type: $ MONITOR The system is now ready for operation. Refreshing all user disk unit directories is imperative at this point. This is done with the KM-9 Newdir (N) command, for example, $ N 1J refreshes disk unit 1. This command should be issued for units 1, 2, 4, 5, and 6 before further operation. DSKPTR may also be used to punch out 6K areas of the disk. To do so, follow steps a. and b. above under loading procedure. c. ACSO=l ACS15-17 = Unit # **ACS5-14 = Logical Block # 0, 30, 60 .••• 10508 d. Press CONTINUE e. See step e. above. The following errors may be displayed on Teletype during disk to punch output: 1. Unit Error: (See loading procedure) 2. Reload Tape: Punch out of tape Action: 3. a. Reload punch b. Press CONTINUE c. Splice Tape Disk Error: Probably parity error. AC will contain disk status. Look at disk control panel for AC bit meaning. Action: Since OSKPTR will have tried 8 times to read disk a. Reset at 16000 or b. Press CONTINUE to accept data. *Oata block in error will be accepted as is. **ACS5-14 = 0 causes punching of all 2410 tapes for disk unit (ACS15-17). ACS5-14 = NON 0 causes punching of one 6K paper tape starting at the logical block specified. Note, this feature is particularly useful when PATCH is used for system program modification and a single back up paper tape of the associated disk area is desired. See Appendix F for program location on disk. 5-36 5.B.2 Disk System Generation Once the Disk System is loaded and disk un its have been refreshed, it may be necessary to generate a system more appropriate to the needs of the installation. For example, since the released system is an BK system, all 16, 24 and 32K installations will want to generate a system for the appropriate core size. Operation of SGEN (PDP-9 System Generator Program) is described in Section 5.4.2 of this manual and in the Keyboard Monitor Guide (DEC-9A-MKFA-D). Disk unit 0 should be assigned to • DAT slot -10 and -14. The output device (presently disk unit 6) appears in .DAT slot -15. When system generation has been completed, PIP-9 should be called into memory to copy disk unit 6 onto disk unit 0 from which the new system may now be operated. The PIP command to be used is C DKO (H) +- DK6J DSKPTR may be used to produce a backup of the system on paper tape. 5.B.3 Disk System Generation from DECtape The PDP-9 installations with both disk and DECtape receive the standard Keyboard Monitor system on DECtape. It is an BK system which when loaded from DECtape, unit 0 with the DECtape bootstrap (I/O RESET followed by READIN with the address switches set to 17637) allows a disk system to be generated. Once the Monitor is in from DECtape and has typed: MONITOR $ the REQUEST and SCOM commands should be issued to the Monitor for system information and the following I/o handler assignments should be made: $A DTAO-10 ,-14/DKDO-15 ~ System Generator shou Id then be ca II ed: $SGEN J Once disk system generation is complete, the write protect switches for tracks 0 through 29 shou Id be activated. The Monitor system may now be loaded from disk unit 0 using the Disk Bootstrap (HRM: 17637). When the Monitor is in core, it is imperative to refresh all user disk unit directories. This is done with the Keyboard Monitor Newdir (N) command, for example, $N q refreshes disk unit 1. This command should be issued for units 1, 2, 4, 5, and 6, before further operation. 5-37 5.8.4 Disk System Save/Load from DECtape Once a disk system has been generated, it is valuable to produce a backup system for DEC- tape for rapid disk system restoration when necessary. DSKSAV is the utility program for saving or loading the PDP-9 ADVANCED Software Disk System to/from DECtape. System loading or saving with DSKSAV is a 55 second operation. It is additionally capable of loading or saving on DECtape, any other logical disk unit as a function of ACS settings on the PDP-9 console. The save/load procedure is as follows: a. Place paper tape of DSKSAV in reader with address switches set to 17720. (Restart = 16000) b. Press I/o RESET and READIN. c. When the program is loaded, it will type its title, DSKSAV, and brief directions on the console Teletype. The program is stopped to allow ACS settings. Set: * ACSCFO ACSO=l ACS15-17=Unit# d. CONTINUE. DECtape to Disk (LOAD) Disk to DECT APE (SAVE) 0,1,2,4,5,6 Be sure the DECtape unit selection is identical to ACS 15 through 17 and press The following errors may be displayed on the Teletype during loading: 1. Unit Error: ACS15-17=30r7. Action: 2. Disk Error: a. Reset ACS 15-17 = 0, 1, 2, 4, 5, 6 b. Press CONTINUE Probably illegal disk address (for example, attempt to load disk with write protect switch enabled). AC contains disk status. Examine disk control panel for AC bit meaning. 3. Action: Correct disk problem if possible and press CONTINUE. DECtape Error: Probably end zone error. AC contains DECtape status. amine DECtape control panel for AC bit meaning. Action: a. If DECtape is in the forward end zone, press CONTINUE. b. If DECtape is in the far end zone (beyond block 1077), position tape out of end zone and press CONTINUE. c. If parity or mark track error**, press CONTINUE to restart transfer from the beginning, or set ACSO through 17 = a and press CONTINUE to retry read one more time. Ex- DSKSAV may also be used to save or load other logical units of the disk. This has proved to be very useful since it provides rapid DECtape backup of any or all disk data files. To do so, follow steps (a) and (b) above under loading procedure. * ACSO- 17= a for fu II system load onto di sk. * * DS KAV w ill have tr i ed to read four times before the message. 5-38 5.9 a. ACSO = 1 ACS15-17 = Unit # b. Press CONTINUE c. See step e. under load procedure. MAGNETIC TAPE SYSTEMS PDP-9 ADVANCED Software provides for IBM-compatible magnetic tape as a file-structured medium and as a full-scale system device. The magnetic tape handlers communicate with a single TC-59 Tape Control Unit (TCU). Up to eight magnetic tape transports may be associated with one TCU; these may include any combination of transports TU-20 and TU-20A. * At least two transports are required for full system operation. There are a number of major differences between magnetic tape and other bulk-storage devices (for example, DECtape or Disk); these differences affect the operation of the device handlers. Magnetic tape is well-suited for handling data records of variable length; such records, however, must be treated in serial fashion. The physical position of any record may be defined only in relation to the preceding record. Block-addressable devices are most economically used in transferring records having fixed lengths that are hardware-constrained. Using such devices, the absolute physical location of any record is program-specifiable. Because of the serial character of data blocks as they are recorded on magnetic tape and because of the presence of blocks of unknown length, three techniques available in I/o operations to block-addressable devices are not honored by the magnetic tape handlers: a. The user cannot specify physical block numbers for transfer. In processing I/o requests that have block numbers in their argument lists (. TRAN, for example), the handler ignores the blocknumber specification. b. The only area open for output transfers in the file-structured environment is that following the current logical end of tape. The exception to this rule is in the recording of the File Directory as explained below. c. Only a single file may be open for transfers (either input or output) at any time on a single physical unit. *A detai led description of the TCU is contained in the TC-59 Instruction Manual (DEC-9A-I3BA-D) and in the PDP-9 User Handbook (F-95). 5-39 5.9. 1 Fi Ie Organization The discussion below applies particularly to MTA, the most general and the largest of the magnetic tape handlers. Response to data-mode specification is identical for handlers MTB., MTC., and MTD., except for the modes that are illegal in these more limited handlers. MTA. is a full device handler that will read and write tape in both the file-structured and non-file-structured fashion. It will honor all CAL functions and requests for transfer in all data modes. The characteristics of data recorded on tape are dependent upon a decision as to the file structuring. This decision, in MTA., is based upon much the same criteria as in other bu Ik-storage handlers. If the first I/o request after an .INIT is .READ, .WRITE, or any .MTAPE command, the referenced unit is presumed to be non-filestructured. If the first request after an .INIT is .SEEK, .ENTER, .CLEAR, or .OPER, then the referenced unit is treated as a file-structured device. 5.9. 1 .1 Non-Fi Ie-Structured Data Recordi ng - The treatment of data to be recorded or read in non- file-structured fashion has two primary objectives. It is intended to satisfy the requirements of the FORTRAN programmer whi Ie sti II providing the assembly language programmer maximum freedom in the design of his tape format. Magnetic tape data, written in the non-fi Ie-oriented environment, differs in two important respects from data recorded by means of fi Ie-oriented I/o requests. In the first place, no handlersupplied supplementary information is written on the tape. No reference is made, for example, to a file directory, and block-control data (see below) is never written. Secondly, no blocking (or packing) of lines is performed by the handler. Each .WRlTE (or .READ) request causes direct data transfer between the user's line buffer and the TCU. No buffering or editing of any kind is done (in lOPS and Image modes) by MTA. Each .WRITE (or .READ) issued results, in general, in the transfer of exactly one physical record to (or from) tape.* 5.9.1.2 File-Structured Data Recording - The programmer can make the fullest possible use of those features peculiar to magnetic tape by employing non-file-oriented transfer techniques. On the other hand, he has little recourse to the powerful file-manipulation facilities available in the system. Filestructured I/o brings to bear the whole body of file-system software, gives true device independence to the magnetic-tape user, and allows extensive use of the storage medium with a minimum of effort. *An exception to this rule is the Dump Mode transfer. The handler will pack output data into, and extract input data from, an internal buffer in this mode. 5-40 5.9.1.3 Block Format - Every block recorded by MTA. (with the exception of end-of-file markers, which are hardware-recorded) in file-structured mode includes a two-word Block Control Pair and not more than 255 10 words of data. The Block Control Pair serves three functions: it specifies the character of the block (label, data, etc.), provides a word count for the block, and gives an lS-bit block checksum. The Block Control Pair has the following format: Word 1: Bits 0 through 5: Block Identifier (BI). This 6-bit byte specifies the block type. Values of BI may range from 0 to 77 S ' Current Legal values of BI, for all user files, are as follows: BI Value Block Type Specified o User-File Header Label User-File Trailer Label 2 User-File Data Block Bits 6 through 17: Block Word Count (BWC). This 12-bit byte holds the 2's complement of the total number of words in the block (including the Block Control Pair). Legal values of BWC range from -3 to -40 lS . Word 2: Bits 0 through 17: Block Checksum. The Block Checksum is the full-word, unsigned, 2's complement sum of all the data words in the block and word 1 of the Block Control Pair. o 17 5 6 N TOTAL WORDS IN BLOCK N- 2 DATA WORDS [ Figure 5-4 Block Format, Fi Ie-Structured Mode 5-41 5.9.2 Fi Ie Identification and Location One of the main file-manipulation functions of the handler is that of identifying and locating referenced fi les. This is carried out by two means: first, names of fi les recorded are stored in a fi Ie directory at the beginning of the tape; and second, labels integral to the file are recorded with the file itself. 5.9.2.1 Magnetic Tape File Directory - The directory, a single-block file (and the only unlabeled fi Ie on any fi Ie-structured tape), consists of the first recorded data block on the tape. It is a fixedlength block with a constant size of 257 10 words and the following characters: a. Block Control Pair (words 1 and 2) Word 1: Block Identifier = 748 = File Directory Data Block. Block Word Count = 4018 = 73778. Word 2: Block Checksum: As described. b. Active File Count (Word 3, Bits 9 through 17) 9-bit one's complement count of the active file names present in the Fi Ie Name Entry Section (described below). c. Total File Count (Word 3, Bits 0 through 8) 9-bit one's complement count of all files recorded on the tape, including both active and inactive files, but exclusive of the file directory block. d. File Accessibility Map (Words 4 through 17): The File Accessibility Map is an array of 25210 contiguous bits beginning at bit 0 of word 4 and ending as bit 17 of word 17. Each of the bits in the Accessibility Map refers to a single file recorded on tape. The bits are assigned relative to the zeroth fi Ie recorded; that is, bit 0 of word 4 refers to the first fi Ie recorded; bit 1, word 4, to the second file recorded; bit 0, word 6, to the 3710 file recorded; and so on, for a possible total of 25210 files physically present. A file is only accessible for reading if its bit in the Accessibi lity Map is set to one. A file is made inaccessible for reading (corresponding bit = 0) by a . DLETE of the file, by a .CLOSE (output) of another file of the same name, or by a .CLEAR. A file is made accessible for reading (corresponding bit = 1) by a .CLOSE (output) of that file. Operations other than those specified above have no effect on the File Accessibility Map. e. File Name Entry Section (Words 18 through 257): The File Name Entry Section, beginning at word 18 of the directory block, includes successive 3-word file name entries for a possible maximum of 80 entries. Each accessible file on the tape has an entry in this section. Entries consist of the current name of the referenced file in standard DEB format: file name proper in the first two words, extension in the third word; 6-bit trimmed ASCII characters, left-adjusted and, if necessary, zero-fi II ed • The position of a file name entry relative to the beginning of the section reflects the position of its accessibility bit in the map. That bit, in turn, defines the position of the referenced file on tape with respect to other (active or inactive) files physically present. Only active file names appear in the entry section, and accessibility bits for all inactive files on the tape are always set to zero; accessibility bits for all active files are set to one. To locate a file on the tape having a name that occupies the second entry group in the Fi Ie Name Entry Section, the handler must (a) scan the Accessibi lity Map for the second appearance of a 1-bit, then (b) determine that bit's location relative to the start of the map. That location speci- 5-42 fies the position of the referenced file relative to the beginning of the tape. The interaction of the File Name Entry Section and the Accessibility Map is shown in Figure 5-5. BIT POSITION 0 BCP { WO,,, 3 WORO 2 FILE COUNTS T 6 9 12 7 15 17 7 BEGINNING OF TAPE BLOCK CHECKSUM WORD 3 FILE D I RECTORY WORD 4 FILE ACCESSIBILITY MAP FILE #1 1I NACTIVEl WORD 16 WORD 17 FILE ",2 (ACTIVEl WORD 18 WORD 2 I FILE #3 (lNACTIVEl FILE NAME ENTRY SECTION WORD 24 FILE #4 (ACTIVEl FILE #5 (ACTIVEl WORD 257 END OF TAPE Figure 5-5a. Format of the File Directory Data Block, showing relationship of active and inactive files to file name entries and to Accessibility Map. 5.9.2.2 Figure 5-5b. Format of file-structured tape, showing directory block and data files. User-File Labels - Associated with each file on tape are two identifying labels. The first is a header label and precedes the first data block of the fi Ie; the second, a trai ler label, follows the final recorded data block of the file. Each label is 27 10 words in length. Label format is shown in Figure 5-6. Note that the trailer label differs from the header label only in the contents of the BI field and in that the former includes an indication rNord 4) of the total blocks recorded in the file. The total includes the two labels themselves. 5-43 o WORD' 5 6 00 o '7 I 7745 WORD 2 CHECKSUM WORD 3 777 XXX WORD 4 000000 0' F== '7 I 7745 CHECKSUM 777 XXX FILE NAME FILE NAME +NBLOCKS WORD 5 -- l WORD27'O~ L-______________________l WORD 26'0 5 6 -- RESERVED - ~--- RESERVED ~ Figure 5-6a. User-Fi Ie Header Label Format 5.9.2.3 Figure 5-6b. User-File Trailer Label Format File Names in Labels - The handler will supply the contents of the file-name fields (Word 3) in labels. These are used only for control purposes during the execution of • SEEK's. The name consists simply of the two's complement of the position of the recorded file's bit in the Accessibility Map: the "name" of the first file on tape is 777777; that of the third file is 777775; and so on. A unique name is thus provided for each file physically present on the tape. Since there may be a maximum of 252 10 files present, legal file-name values lie in the range 777777 to 777404. 5.10 MAGNETIC TAPE SYSTEM OPERATION 5.10.1 System Fi Ie Structure In general, the system tape differs only incidentally from the user tapes described previously. Directories, labels, and data blocks have like formats and perform identical functions on both user and system tapes. Some identifying information however, is different in order to accommodate those cases in which the tape is bootstrap-accessed (for example, in loading the System Loader). 5.10.1.1 System File Labels - Labels on the system tape serve the same purpose as user-file labels; that is, the identification of the file which follows. They differ only in the contents of the Block Identifier field and of the file name indicator. For header labels, BI = 368 ; for trailer labels, BI = 378 , The file-name words in both labels contain the block number which begins the file in block-addressable bulk-storage system. In all other respects, the labels are identical to those which appear on user tapes. Typical system tape label format (for PIP) is shown below. 5-44 o 5 6 WORD I 36 I WORD 2 310636 WORD 3 000671 WORD 4 000000 11 I P'P"F'LE NAME" - a" E?oooooo =l WORD 27,0 _ 0 0 0 0 0 0 5 6 37 1745 CHECKSUM * i--- ~ '0"' o 17 7745 000671 P'P "FILE NAME" +N BLOCKS TOTAL BLOCKS IN PIP - RESERVED (ZEROES) RESERVED (ZEROES) _ * 400636 +C (WORD 4) Figure 5-7a. System Program (PIP) Header Label. Figure 5-7b. System Program (PIP) Trailer Label. All absolute system programs are labeled in the manner described. 5.10.1.2 System File Data Blocks - The Block Control Pair for an absolute system program block serves a purpose somewhat different from that for a user-fi Ie data block. The format of the Block Control Pair is as follows: a. Block Identifier \Word 1, bits 0 through 5): 778 = System program data block. b. Word Count \Word 1, bits 6 through 17): Two's complement count of data words in the block, including the Block Control Pair. c. 5.10.2 Word 2: 15-bit load address-l for this block. System Tape Organization The system tape is organized in the usual fashion, that is, the File Directory data block is recorded first and is followed by labeled data files. The single requirement is that two system files the Monitor and the System Loader - appear immediately following the Directory. Other system fi les are recorded following the System Loader. 5.10.3 System Startup The system tape must be mounted on unit 0 and the transport must be on line and ready. The bootstrap program is loaded via the paper tape reader; the bootstrap will bring the Monitor into core from the system tape and give control to it. The user may then proceed as described in Section 5.4. 5-45 5.10.4 Continuous Operation* Under certain circumstances, it is possible to perform successive I/o transfers without in- curring the shut-down delay that normally takes place between blocks. The handler stacks transfer requests, and thus ensures continued tape motion, under the following conditions: a. The I/o request must be received by the CAL handler before a previously-initiated I/o transfer has been completed. b. The unit number must be identical to that of the previously-initiated I/o transfer. c. The previously-requested transfer must be completed without error. In general, successive error-free READS (WRITES) to the same transport wi" achieve non-stop operation. The examples given below illustrate the principle. Example 1: Successive Continued Operation. SLOT = 1 INPUT = 0 BLOKNO = 0 READ 1 READ2 RETURN . TRAN SLOT, INPUT, BLOKNO, BUFF1, 257 .TRAN SLOT, INPUT, BLOKNO, BUFF2, 257 JMP READ1 The program segment in Example 1 will most probably keep the referenced transport (.DAT slot 1) up to speed. The probab i Iity decreases as more ti me e lapses between READ 1 and READ2 I and between READ2 and RETURN. Example 2: Unsuccessful Continued Operation. SLOT = 1 INPUT = 0 BLOKNO = 0 READ STOP RETURN . TRAN SLOT, INPUT, BLOKNO, BUFF, 257 .WAIT SLOT JMP READ The program segment in 'Example 2 will not keep the tape moving because the explicit .WAIT at location STOP prevents control from returning to location READ until the transfer first initiated at READ has been completed. Example 3: Unsuccessful Continued Operation SLOTl = 1 SLOT2 = 2 INPUT = 0 BLOKNO = 0 *Control and transport requirements for successful continuous operation are outlined in the TC-59 Instruction Manual (DEC-9A-I3BA-D) and in the PDP-9 User Manual (F-95). 5-46 READ1 READ2 RETURN • TRAN SLOTl, INPUT, BLOKNO, BUFF1, 257 . TRAN SLOT2, INPUT, BLOKNO, BUFF2, 257 JMP READ1 This program segment will not provide non-stop operation because of the differing unit specification at READ 1 and READ2. 5.11 DRUM FILE ORGANIZATION Drum handlers DRA, DRB, DRC, and DRD are now available in version V4B of the Keyboard Monitor System. The Drum handlers are modified versions of DECtape handlers DTA, DTB, DIC, and DTD, (see Section 7.4) and permit data transfer to/from the RM09 Drum by both user and system programs. It should be clearly noted, however, that availability of Drum handlers does not imply use of the Drum as a system device; that capabi lity does not presently exist. The PDP-9 Advanced Software Drum handlers may be used with anyone of the five RM09 drum options available. Storage capacity is defined in the following table in terms of DECtape storage capacity. Drum Size Number of Units Number of Blocks (256 10) 1 32K 1/4 128 2 65K 1/2 256 3 131K 1 512 4 256K 2 1024 5 524K 4 2048 A Drum unit is defined as 512 10 sectors or blocks of 256 10 words each (i .e., 64 blocks less than the capacity ofa single PDP-9 DECtape). The 32,65 or 131K Drums are referenced as unit 0; the 262K drum, as units Oand 1; the 524K drum, as units 0,1,2, and 3. Referencing a unit number greater than that permitted for a given drum results in an lOPS 26 error. Listed below are the sector limits for each unit of each Drum. 5-47 Unit Sector Limits ~ Drum 0 1 2 3 32K o - 177 --- --- --- 65K 0-377 --- --- --- 131K 0-777 --- --- --- 262K 0-777 1000 - 1777 --- --- 527K 0-777 1000 - 1777 2000 2777 3000 3777 The drum size of a system must be set up in .SCOM+4, bits 15-17. A value of 1-5 is used where 1 = 32K; 2 = 65K, etc. lOPS 35 results if . SCOM+4 is not properly set for drum size. Although the Drum control is designed to perform full block (256 10) transfers rather than variable word count transfers, code has been included in both DRA and DRD to allow variable word count transfers via the . TRAN command (i.e., . TRAN works for Drum as it does for the PDP-9 Disk and DECtape). Furthermore, division of the Drum into logical units does not prevent. TRAN's or . MT APE READS/WRITES from referencing any and all Drum sectors provided drum unit 0 is used. More simply, if drum units 1-3 are referenced, a check is made such that ~ transfer is a IIowed to exceed the sector limits of a unit. If sector size exceeds 7778 , an lOPS 25 error message results. However, if Drum unit 0 is assigned, any sector may be referenced in . TRAN or . MTAPE READ/WRITE commands, provided the physical drum size is not exeeded. Drum file data organization is basically the same as that for DECtape (see Section 5.6). As mentioned earlier, the file capacity is limited by a unit size of 512 10 rather than 576 10 . Sector 100 (1100 for unit 1, etc .), contains the Drum unit directory; sectors 71-77 (1071 - 1077 for unit 1, etc.), contain fi Ie bit map information. Unit size is reflected in a directory listing via PIP. For example, when the N (NEWDIR) command is issued, the listing appears as follows: 32K Drum: DIRECTORY LISTING o USER FILES 710 SYSTEM BLKS 170 FREE BLKS 5-48 65K Drum: DIRECTORY LISTING o USER FILES 510 SYSTEM BLKS 370 FREE BLKS 131, 262 or 524K Drum: (each unit) DIRECTORY LISTING USER FILES 110 SYSTEM BLKS 770 FREE BLKS o Because the Drum is not used as a system device, it should be noted that t Q to the Drum cannot be executed. Consequently, the S switch in PIP is inoperative to the Drum and results in execution of the N (NEWDIR) command instead. Users of Monitor V4B (9-30-68) system tapes wi II find the Drum handlers included in their I/o library and the skip chain set up accordingly. To adopt the system for the installation Drum size, however, .SCOM+4 (absolute location 104), bits 15-17, must be set (1-5) by use of the system program, PATCH. Drum users with Monitor tapes earlier than V4B must perform the following sequence: 1. Use SGEN to generate a new system tape being sure to: a. Answer "yes" when asked about the presence of new handlers (DRA, DRB, DRC and DRD.) b. Answer DRSF, 706101 and DRNEF, 706201 to the new skip lOT question. c. Position DRSF high in the skip chain (after DTDF - DECtape or DSSF - Disk). d. Position - DRNEF as the very last skip in the chain. Note: DRNEF is a reverse skip (SKIP ON NOT ERROR) and must be preceded by a minus (-) sign. 2. Use UPDATE to incorporate the new Drum handlers into the library of the newly generated tape. 3. Use PATCH to set .SCOM+4, bits 15-17 (absolute cell 104) in KM9 to the appropriate drum size (1-5) for the installation. 5-49 CHAPTER 6 BACKGROUND/FOREGROUND MONITOR 6.1 BACKGROUND/FOREGROUND MONITOR FUNCTIONS The Background/Foreground Monitor is designed to control processing and I/O operations in a real-time or time-shared environment. It is essentially an extension of the Keyboard Monitor (described in Chapter 5) and allows for time-shared use of a PDP-9 by a protected, priority, user FOREGROUND program and an unprotected system or user BACKGROUND program. The Background/Foreground Monitor greatly expands the capabilities of PDP-9 ADVANCED Software and makes optimum use of all available hardware. It allows for recovery of the free time (or dead time) that occurs between input/output operations, and promotes 100% utilization of central processor time. The reader is referred to Chapter 2 for a general discussion of the Monitor environment, and to Chapter 3 for a detailed description of user program commands (system macros) available in the Background/Foreground Monitor environment. It should be noted that all material presented in this manual for the Background/Foreground Monitor is preliminary and subject to change. FOREGROUND programs are defined as the higher-priority, debugged user programs that interface with the real-time environment. They normally operate under Program Interrupt (PI) or Automatic Priority Interrupt (API) control, and are memory protected. At load time they have top priority in selection of core memory and I/O devices, and at execution time they have priority (according to the assigned priority levels) over processing time. Depending upon system requirements, the user IS FOREGROUND program could be an Executive capable of handling many real-time programs or subprograms at four levels of priority (with API present). BACKGROUND processing is essentially the same as the processing normally accomplished under control of the Keyboard Monitor. That is, it could be an assembly, compilation, debugging run, production run, editing task, etc. BACKGROUND programs may use any facilities (for example, core, I/O, and processing time) that are available and not simultaneously required by the FOREGROUND job. Using the Monitorls Batch processing capability optimizes the processing of BACKGROUND jobs under control of the Background/Foreground Monitor. The Background/Foreground Monitor system is externally a keyboard-oriented system; that is, all FOREGROUND and BACKGROUND requests for systems information, core, I/O devices, programs to be run, etc., are made via the Teletype keyboards (see Figure 6-1). At run time, the Monitor internally controls scheduling and processing of I/O requests, while protecting the two resident users. 6-1 FOREGROUND JOB CONTROL UNIT MULTI STATION L - - - - - - l T~~~~~7L ~g~~~S~L OR LTl9A/ LTt9B(S) PDP-9 MULTI-UNIT TE LE TYPE HANDLER (WHICH IS PART OF THE RESIDENT MON I TORI BACKGROUND JOB CONTROL UNIT Figure 6-1 Keyboard Communication in Background/Foreground Monitor System The Background/Foreground Monitor performs the following functions as it controls the timeshared use of the PDP-9 central processor by two co-resident programs: a. Schedules processing time. b. Protects the FOREGROUND job's core and I/O devices. c. Provides for the sharing of multi-unit device handlers, such as DECtape, by both FOREGROUND and BACKGROUND jobs. d. Allows convenient use of API software levels by FOREGROUND jobs. e. Provides for convenient and shared use of the system Real Time Clock. f. Allows communication between the BACKGROUND and FOREGROUND jobs via coreto-core transfers. 6. 1• 1 Scheduling of Processing Time At run time, the FOREGROUND job retains control except when it is I/O bound; that is, when completion of an I/O request is required before it can proceed any further, as in the following example. 6-2 .READ 3,O,LNBUF,48 /READ TO • DA T SLOT 3 • WAIT 3 /NAIT ON .DAT SLOT 3 If the .WAIT is reached before the input requested by the . READ has been completed, control is transferred to a lower priority FOREGROUND segment or to the BACKGROUND job unti I the input for the FOREGROUND job is completed. Since multi-unit device handlers can be shared by FOREGROUND and BACKGROUND programs, there is a mechanism by which a FOREGROUND I/o request will cause a BACKGROUND I/o operation to be stopped immediately so that the FOREGROUND operation can be honored. On completion of the FOREGROUND I/o, the BACKGROUND I/o will be restarted with no adverse effects on the BACKGROUND job. The FOREGROUND program can also indicate that it is I/O bound by means of the .IDLE command (Section 3.3.3). This is useful when the FOREGROUND job is waiting for real-time input from anyone of a number of input devices, as in the following example (see Section 3.3. 1 for description of real-time read. REALR command). .REALR 1,O,LNBUF1, 32, CTRLl, N /REAL • REALR 2,2, LN BUF2, 42, CTRL2, N /TIME . .REALR 3,3, LNBUF3, 36, CTRL3, N /READS • IDLE If the .IDLE is reached before any of the input requests have been satisfied, control is transferred to a lower priority FOREGROUND segment or to the BACKGROUND job, which retains control until one of the FOREGROUND input requests is satisfied. Control is then returned to the FOREGROUND job by executing the subroutine at the specified completion address (CTRLl, CTRL2, CTRL3) and at the priority level specified by N, which may be o = Mainstream (lowest level) 4 = Current level 5 = Software level 5 6 = Software leve I 6 7 = Software level 7 6-3 NOTE If real-time reads (.REALR), real-time writes (REALW), or interval timer requests (. TIMER) are employed in the BACKGROUND, N may be set to 0,4,5,6, or 7, but will be converted to 0 since the BACKGROUND job can run only on the mainstream level. This allows you to set up N as you want it to be in cases where a BACKGROUND program is to be subsequently run in the FOREGROUND. 6. 1.2 Protection of FOREGROUND Job Core and I/O The FOREGROUND jobls core is protected by means of the Memory Protection Option (Type KX09A). The BACKGROUND job runs with memory protect enabled; the FOREGROUND job runs with memory protect disabled to allow for execution of lOT's. Protection of the FOREGROUND jobls I/O devices is accomplished with the hardware by means of the memory protect option, which prohibits lOT and Halt instructions in the BACKGROUND area; and with the software by means of the Monitor and lOPS, which screen all I/O requests made by Monitor CALIs. Also, the Linking Loader prevents the BACKGROUND job I/O from conflicting with that of the FOREGROUND job (for example, it would not honor a BACKGROUND request for a paper tape handler being used by the FOREGROUND job). 6.1.3 Sharing of Multi-Unit Device Handlers The Background/Foreground Monitor allows sharing of multi-unit, mass-storage device handlers (such as DECtape, Magnetic Tape, and Disk) between BACKGROUND and FOREGROUND jobs to reduce core memory requirements for the system. Using these multi-unit handlers, n files can be open simultaneously, where n equals the number of .DAT slots associated with the particular bulk storage device. When this count is not true (because of the .DAT slots not being used simultaneously), the keyboard command FILES (Section 6.3.1) can be used to remedy the situation. Both the FORE- GROUND and BACKGROUND jobs can indicate their file requirements by means of the FILES keyboard command. The multi-unit handlers are capable of stacking one BACKGROUND I/o request. Thus, control is returned to the BACKGROUND job to allow non-I/O related processing when the handler is preoccupied with an I/O request from the FOREGROUND job. For example, if the FOREGROUND job has requested DECtape I/O with a .READ, and is waiting for its completion on a .WAIT, control is returned to the BACKGROUND job. If the BACKGROUND job requests DECtape I/o with a . READ, the 6-4 handler wi II stack the request and return control to the BACKGROUND job following the . READ. The BACKGROUND job can then continue with non-I/O related processing as though the. READ were being honored. 6.1.4 Use of Software Priority Levels The Background/Foreground Monitor allows convenient use of software priority levels of the API by the FOREGROUND job. The BACKGROUND job can use only the mainstream level. 6.1.5 Use of Real-Time Clock The Background/Foreground Monitor provides for convenient and shared use of the system real-time clock. It will effectively handle an unlimited number of intervals at the same time, thus the real-time clock can be used simultaneously by both BACKGROUND and FOREGROUND jobs. 6.1.6 Communication Between BACKGROUND and FOREGROUND Jobs The Background/Foreground Monitor allows communication between BACKGROUND and FOREGROUND jobs via core-to-core transfers. This is accomplished by means of a special "I/O device" handler within lOPS. Complementing I/O requests are required for a core-to-core transfer to be effected; for example, a FOREGROUND .READ (.REAlR) from core must be matched with a BACKGROUND .WRITE (.REALW) to core. Two possible uses of this feature are: a. The BACKGROUND job could be related to the FOREGROUND job, and as a result of its processing, pass on information that would affect FOREGROUND processing. b. The BACKGROUND job could be a future FOREGROUND job, and the current FOREGROUND job, being its predecessor, could pass on real-time data to create a true test environment. 6.2 HARDWARE REQUIREMENTS AND OPTIONS The following hardware is required to operate the Background/Foreground Monitor System. a. Basic PDP-9 with Teletype, b. Memory Extension Control, Type KG09A, c. Additional 8192-Word Core Memory Module, Type MM09A, d. Memory Protection Option, Type KX09A, 6-5 e. External Teletype System, including at least*; (1) One Teletype Control, Type LT09A, (2) One Teletype Line Unit, Type LT09B, (3) One Teletype, Model KSR33 or equivalent, f. Bulk Storage System, comprising either; (1) One DECtape Control, Type TC02, and two DECtape Transports, Type TU55, or (2) One Di sk System, Type RB09, or (3) One Disk System, Type RF09/RS09 The following options may be added to improve system performance (as noted); Effect Options Additional 8192 Word Core Memory Modules, Type MM09B and MM09C Increase the maximum size of both BACKGROUND and FOREGROUND programs that can be handled by the system. Automatic Priority Interrupt, Type KF09A Allows for quicker recognition of requests for service by FOREGROUND devices. Extended Arithmetic Element, Type KE09A Increases speed of arithmetic calculations Additional DECtape Transports, Type TU55, or IBM-compatible Magnetic Tape Transports, Type TU20 or TU20A Allows greater bulk storage capability, simultaneous use of storage media by more programs. Since only one file may be open at a time on IBM-compatible magnetic tape transports, more then two Type TU20 or TU20A transports may be desirable for some applications. Automatic Line Printer, Type 647 Provides greater listing capabilities. 200 CPM Card Reader, Type CR03B Allows card input and control cards for BACKGROUND Batch processing. Additional Teletype Line Units, Type LT09B, (or LTl9B) and Teletypes, Type KSR33 or equivalent Provides additional output devices if multiple FOREGROUND jobs may require simultaneous output or BACKGROUND jobs wish to use multiple devices. *The basic system Teletype is assigned to the BACKGROUND environment. One Teletype of the external Teletype system must be reserved for the FOREGROUND job(s); additional Teletypes may be assigned to either BACKGROUND or FOREGROUND functions. If the API option is avai lable, a Type LTl9A Teletype Control and a Type LT19B Line Unit are required. 6-6 6.3 KEYBOARD COMMANDS In addition to the keyboard commands available in the Keyboard Monitor environment (see Section 5.3), the Background/Foreground Monitor recognizes and accepts the following commands: FILES, FCORE, FCONTROL, and BCONTROL. Each of these commands is described in the following paragraphs. 6.3. 1 FILES This command is used to conserve core space by indicating the number of bulk storage files that will be open simultaneously. It is normally typed prior to requesting the loading of user programs so that the system or linking loader can allocate sufficient buffer space. The command is typed after the Monitor's dollar sign request. Example: $FILES DT3 In this case, the DECtape handler will be able to accommodate three files open simultaneously. 6.3.2 FCORE This command is used to define additional core required by the FOREGROUND job, exclu- sive of the Monitor, the system device handler, the teletype handler and the FOREGROUND user programs. The command is normally typed following the Monitor's dollar sign request and is only applicable before loading the FOREGROUND job. It is followed by a space and some octal number n, which represents the total number of 1K octal increments of core memory required by the FOREGROUND job (area between .SCOM+2 and .SCOM+3). If FCORE is not used, core will be allocated dynamically at load time and there will be no free core available to the FOREGROUND job. Example: $FCORE 6.3.3 3 FCONTROL This command allows the user to change the Teletype assigned to the FOREGROUND job while the Monitor is operating in the FOREGROUND mode. Initially, keyboard commands are accepted from external Teletype Unit 1. The user could assign external Teletype Unit 2 (if available) to the FOREGROUND job by typing "FCONTROL 2" after the Monitor's dollar sign request. The Monitor would respond by typing CONTROL RELINQUISHED on external Teletype Unit 1, typing MONITOR $ 6-7 on external Teletype Unit 2, and accepting subsequent keyboard commands in the FOREGROUND mode from external Teletype Unit 2. Control would then remain with Teletype Unit 2 until another FCONTROL is given. 6.3.4 BCONTROL This command allows the user to change the Teletype assigned to the BACKGROUND job while the monitor is operating in the BACKGROUND mode. When control is first transferred to the BACKGROUND mode, keyboard commands are accepted from Teletype Unit 0 (basic system teletype). The user can assign an external Teletype to the BACKGROUND job, provided that an external Teletype not currently assigned to the FOREGROUND job is available. For example, if external Teletype Unit 2 is available and not assigned to the FOREGROUND program, the user could assign it to the BACKGROUND job by typing "BCONTROL 2" after the Monitor's dollar sign request. The Monitor would respond by typing CONTROL RELINQUISHED on Teletype Unit 0, typing MONITOR $ on Teletype Unit 2, and accepting subsequent keyboard commands in the BACKGROUND mode from external Teletype Unit 2. Control would then remain with Teletype Unit 2 until another BCONTROL is given. 6.4 OPERATING THE BACKGROUND/FOREGROUND MONITOR SYSTEM The reader is referred to the Keyboard Monitor Guide {DEC-9A-MKFA-D} for detailed operating procedures for system programs, which can be used in BACKGROUND processing. The following PDP-9 ADVANCED Software System manuals contain additional detailed information on system programs. Manual Document No. Uti I ity Programs DEC-9A-GUAB-D MACRO-9 Assembler DEC-9A-AMZA-D FORTRAN IV DEC-9A-KFZA-D This section contains descriptions of loading the Background/Foreground Monitor, assigning devices, loading user FOREGROUND programs, loading system or user BACKGROUND programs, and error detection and handling. Figure 6-2 contains complete memory maps and a summary of all loading procedures. 6-8 6.4.1 Loading the Background/Foreground Monitor The procedure for loading the Background/Foreground Monitor is similar to that for loading the Keyboard Monitor. That is, the System Bootstrap (in hardware READIN format) is loaded at the top of core using the paper tape reader. This is accomplished by placing the tape in the reader, momentarily pressing the tape feed button, setting the Address switches to the lowest address of the bootstrap (37637 for 16K systems), and depressing the I/O RESET and READIN switches. The System Bootstrap automatically loads the resident portion of the Monitor from the system device into lower core. It then transfers control to the Monitor via the .EXIT command, with the FOREGROUND flag set to simulate a FOREGROUND. EXIT. (This will cause subsequent keyboard commands to be accepted from Teletype Unit 1 and interpreted as FOREGROUND requests.) The resident Monitor loads the non-resident Monitor from the system device into upper memory, overlaying the System Bootstrap. It then types MONITOR $ on external Teletype Unit 1 and transfers control to the Keyboard Listener portion of the non-resident Monitor to await keyboard commands from Teletype Unit 1. Initially, since the FOREGROUND flag was set, these commands are interpreted as FOREGROUND commands. While operating in the FOREGROUND mode, the FOREGROUND control Teletype can be changed from external Teletype Unit 1 to any other external Teletype available by means of the FCONTROL keyboard command (see Section 6.3.3). 6.4.2 Assigning Devices Before loading a user FOREGROUND program or a system or user BACKGROUND program, the user should make all device assignments required for the program to be run. There are two Device Assignment Tables (.DAT) in the Bockground/Foreground Monitor system: one used by BACKGROUND jobs, and one used by FOREGROUND jobs. The Monitor determines which table is intended or required according to its current operating mode. The. DAT slot assignment for BACKGROUND jobs are the same as normal Keyboard Monitor. DAT slot assignments (see Section 5.4.3). Since only user programs operate in the FOREGROUND mode, all .DAT slots can be used by the FOREGROUND job, except .DAT slots -1, -4, -5 and -7. 6.4.3 Loading User FOREGROUND Programs When a keyboard command that requests loading of a user FOREGROUND program is en- countered, the non-resident Monitor brings in the System Loader, overlaying itself. This is done via 6-9 the resident system device handler. For FOREGROUND loads, the System Loader is the Linking Loader. It first loads any other I/O handlers required for loading, and then loads the user program along with its required I/O handlers. It then allocates buffer space to accommodate the n\:lmber of bulk-storage files either a. specified by the keyboard command FILES that was typed prior to the load request, or b. determined from the number of • OAT slots associated with bulk storage devices. The System Loader sets the memory protect bound above the FOREGROUND system. It then places the address of a routine to perform a .EXIT into the BACKGROUND program counter register (control will go there when the FOREGROUND job becomes I/O bound), and gives control to the FOREGROUND job with memory protect disabled. When the FOREGROUND job becomes I/O bound, control is transferred to the routine which performs a • EXIT. The Monitor recognizes this as a BACKGROUND .EXIT and loads the non-resident Monitor (via the resident system device handler) into upper memory. It then gives control to the Keyboard Listener which types MONITOR $ on the system Teletype Unit 0 and then waits for BACKGROUND keyboard commands from the system Teletype (Unit 0). While operating in the BACKGROUND mode, the control Teletype can be changed from Unit 0 to any other Teletype available, not currently being used by the FOREGROUND job, by means of the BCONTROL command (see Section 6.3.4). 6.4.4 Loading System or User BACKGROUND Programs When a keyboard command that requests loading of a system or user BACKGROUND program is encountered, the non-resident Monitor brings in the System Loader, overlaying itself. This is done via the resident system device handler. If the BACKGROUND program is a system program, the System Loader loads the system program I/O handlers up from the top of the FOREGROUND system*, allocates buffer space to accommodate all • OAT slots associated with bulk storage devices, and then loads the system program into the top of memory. It then sets the memory protect bound above the allocated buffer space and transfers control to the system program. *The System Loader loads I/O handlers required by either a system program or the Linking Loader just above the FOREGROUND job. This is done to make use of any space resulting from the fact that the smallest unit of memory protection is 1K (decimal). Also, multi-unit handlers (such as DECtape) which are already in core for the FOREGROUND job are shared, rather than loaded again. 6-10 If the BACKGROUND program is a user program, the System Loader loads the Linking Loader I/O handlers up from the top of the FOREGROUND system, allocates the required buffer space, and then loads the relocatable Linking Loader where the memory protect bound can be set just below it. The Linking Loader is used to load the user's BACKGROUND program down from the top of core (see Keyboard Monitor Guide, DEC-9A-MKFA-D). The user's I/O handlers are loaded last (relocated to run from the area just above the Loaders I/O handlers). User program handlers that are identical to Loader or FOREGROUND handlers already in core are not loaded. The necessary buffer space is allocated just above the area where the user's handlers are to be relocated. An • EXIT from the Linking Loader causes the user program I/O handlers to be block transferred to their running position, the memory protect bound to be set just above the buffer area, and control to be transferred to the user program. 6.4.5 End of Job When an .EXIT is encountered in a job, • EXIT is output on the associated control Teletype and additional action is taken depending upon whether the job is a BACKG ROUND or a FOREGROUN D. If the job is a BACKGROUND, and the FOREGROUND job has not been completed, the non-resident Monitor is loaded into upper core and outputs MONITOR $ to the current BACKGROUND control Teletype to indicate its readiness to receive BACKGROUND commands. If the job is a BACKGROUND, and the FOREGROUND job has been completed, the MONITOR $ is output on the current FOREGROUND control Teletype to indicate readiness to accept FOREGROUND commands. If the job is a FOREGROUND, the FOREGROUND completion flag is set and control is retumed to the BACKGROUND job. The BACKGROUND job may be aborted at this time by typing CTRL C on the FOREGROUND control Teletype. This will cause ABORT to be typed on the current BACKGROUND control Teletype, the non-resident monitor to be loaded into upper core, and MONITOR $ to be typed on the FOREGROUND control Teletype indicating readiness to accept FOREGROUND command. 6-11 6.4.6 Error Detection and Handling Comprehensive error checking is provided by the Background/Foreground Monitor, the loaders, and the Input/Output Programming System. Detailed lists of errors that may occur are given in Appendices C, D, and E, respectively. After error messages are output, the non-resident Monitor is brought into core to allow initialization of the next job. The system programs that operate in the BACKGROUND mode also provide comprehensive error checking. Refer to the appropriate PDP-9 ADVANCED Software System Manual (listed at the beginning of this section) for detailed information on these errors. 6-12 MEMORY MAP A MEMORY MAP B 16K r----S-Y-ST-E-M----~ 16K BOOTSTRAP BK~----------~ SYSTEM BOOTSTRAP • SCOM • SCOM +1 AND. SCOM +2 BK "RESIDENT MON ITOR o '--------------' o *INCLUDING MULTI-UNIT TELETYPE HANDLER AND SYSTEM DEVICE HANDLER. The System Bootstrap is loaded at the top of core via the paper tape reader in HRM format. Figure 6-2 The System Bootstrap automati ca lIy loads the resident Monitor from the system device into lower core. Background/Foreground Monitor System Memory Maps 6-13 MEMORY MAP C MEMORY MAP D • 16K 16K . . . . . - - - - - - - , SCOM NON-RESIDENT MONITOR • SCOM SYSTEM LOADER • SCOM +3 8K 1 - - - - - - - - 1 8K • SCOM+I AND. SCOM+2 • SCOM + 2 AND. SCOM + I RESIDENT MONITOR RESIDENT MONITOR o '---------' o The resident Monitor loads the non-resident Monitor (via the resident system device handler) into upper core, overlaying the System Bootstrap Figure 6-2 To load a user FOREGROUND program, the nonresident Monitor brings in the System Loader, overlaying itself. For FOREGROUND loading, the System Loader is the linking Loader. Background/Foreground Monitor System Memory Maps (Cont) 6-14 MEMORY MAP E 16K . MEMORY MAP F • SCOM 16K SCOM NON-RESIDENT MONITOR SYSTEM LOADER • SCOM+3 ADDITIONAL LOADER I/O HANDLERS AND BU FFER (IF NECESSARY! 8K 8K PROTECT BOUND. '(f////////////// I-- MEMORY (THE AREA BETWEEN THE BUFFER BUFFER SPACE USER PROGRAM I/O HANDLERS '/11IIIIIIULLIL SPACE AND THE MEMORY PROTECT BOUND IS DUE TO THE FACT THAT THE 'SMALLEST UN IT OF MEMORY PROTECTION IS IK DECIMAL.! • SCOM +1,. SCOM+2 AND. SCOM + 25 FOREGROUND SYSTEM FOREGROUND SYSTEM USER PROGRAM (S! RESIDENT MONITOR RES IDENT MONITOR o o The System loader first loads any additional I/O handlers required for loading. It then loads the user program and the I/O handlers that it requires, and allocates buffer space. Memory protect bound. (The area between the buffer space and the memory protect bound is due to the fact that the smallest unit of memory protection is 1K decimal. However, this area can be used for dynamic data storage via a software protect feature.) Figure 6-2 When the FOREGROUND job becomes I/O bound, control is transferred to the BACKGROUND job. The resident Monitor loads the non-resident Monitor (via the resident system device handler) into upper core. It then gives control to the Keyboard listener (within the non-resident Monitor) to await a BACKGROUND keyboard command. Background/Foreground Monitor System Memory Maps (Cont) 6-15 MEMORY MAP H MEMORY MAP G 16K 16K • SCOM • SCOM SYSTEM LOADER SYSTEM PROGRAM • SCDM+3 • SCOM+3 MEMORY PROTECT BOUND --. fllllllll/llllll. • SCOM +2 BUFFER SPA CE BK BK '11/1/11/1/11/11. } • SCOM +1,. SCOM +2 AND. SCOM +25 BACKGROUND I/O HANDLERS • SCOM +1 AND. SCOM+25 FOREGROUND SYSTEM FOREGROUND SYSTEM RESIDENT MONITOR RESIDENT MONITOR o 0 When a keyboard command requests loading of a BACKGROUND system or user program, the non-resident Monitor brings in the System Loader, overlaying itself. Figure 6-2 If the BACKGROUND program is a system program, the System Loader loads the system program I/O handlers up from the top of the FOREGROUND system, allocates buffer space, and loads the system program at the top of core. It then sets the memory protect bound above the buffer space and gives control to the system program. Background;1=oreground Monitor System Memory Maps (Cont) 6-16 MEMORY MAP I MEMORY MAP "J 16K 16K o SCOM AND 0 SCOM +3 SYSTEM . o SCOM AND 0 SCOM +3 USER PROGRAM(S) LOADER USER PROGRAM I/O HANDLERS o SCOM+2 o SCOM+2 LINKING LOADER LINKING LOADER MEMORY PROTECT BOUND MEMORY PROTECT BOUND '11111111111, "////////////, BUFFER BUFFER SPACE BK SPACE o SCOM +1 BK oSCOM+1 LINKING LOADER rio HANDLERS BACKGROUND I/O HANDLERS o SCOM+25 o SCOM+25 FOREGROUND SYSTEM FOREGROUND SYSTEM RE S IDENT MONITOR RESIDENT MONITOR 0 0 If the BACKGROUND program isa user program, the System Loader loads the Linking Loader I/O handlers up from the top of the FOREGROUND system, allocates buffer space, and loads the Linking Loader such that the memory protect bound can be set just below it. Figure 6-2 The user's program, followed by its I/O handlers, are loaded down from the top of core. The I/O handlers are relocated to run just above the Linking Loader I/O handlers so that the memory protect bound can be set above them. Background/Foreground Monitor System Memory Maps (Cont) 6-17 MEMORY MAP K 16K • SCOM USER PROGRAM( S) • SCOM+3 MEMORY PROTECT BOUND ---. '1/////////////, • SCOM+l AND. SCOM+2 BUFFER SPACE • USER PROGRAM I/O HANDL E RS BK LINKING LOADER I/O HANDLERS • SCOM +25 FOREGROUND SYSTEM RESIDENT MON ITOR 0 The. EXIT from the Linking Loader causes the user program I/O handlers to be block transferred to their running position, the memory protect bound to be set i ust above the buffer space, and control given to the user program. Figure 6-2 Background/Foreground Monitor System Memory Maps (Cont) 6-18 CHAPTER 7 I/O DEVICE HAN DLERS This chapter contains information that is essential for a good understanding and proper use of I/O device handlers for the I/o and Keyboard Monitor systems. Included is a general description of I/O hardware and API software level handlers, a complete section on writing special I/O device handlers, a summary of I/O handlers acceptable to system programs, and a summary of standard I/O handler features. It is assumed that the reader is familiar with all related material in the PDP-9 User Handbook (F-95), especially Chapter 9, Input/Output Considerations. It is also assumed that the reader is familiar with the PDP-9 Monitor environment and other pertinent information contained in this manual. 7.1 DESCRIPTION OF I/o HARDWARE AND API SOFTWARE LEVEL HANDLERS This section applies to I/o and Keyboard Monitor environments only. 7.1.1 I/O Device Handlers All communications between user programs and I/o device handlers are made via CAL in- structions (see Chapter 3) followed by argument lists. The CAL Handler in the Monitor performs preliminary setups, checks on the CAL calling sequence, and transfers control via a JMP instruction to the entry point of the device handler. When the control transfer occurs, the AC contains the address of the CAL in bits 3 through 17 and bits 0, 1, and 2 indicate the status of the Link, extend mode and memory protect, respectively, at the time of the CAL. Note that the content of the AC at the time of the CAL is not preserved. Or:! machines that have an API, the execution of a CAL instruction automatically raises the priority to the highest software level (level 4). Control passes to the handler while it is still at level 4, allowing the handler to complete its re-entrant procedures before debreaking (DBK) from level 4. This permits the handler to receive re-entrant calls from software levels higher than the priority of the program that contained this call. If a device handler does not contain re-entrant procedures, system failure caused by inadvertent re-entries can be prevented by remaining at level 4 until control is returned to the user. If the non-reentrant method is used, the debreak and restore (DBR) instruction should be executed just prior to the JMP* which returns control to the user, allowing debreak from level 4 and restoring the conditions of the Link, extend mode, and memory protect. Any lOTs issued at the CAL level (level 4 if API present, mainstream if no API) should be executed immediately before the 7-1 DBR XCT JMP* .+1 exit sequence to ensure that the exit takes place before the interrupt from the issued lOT occurs. (The XCT is necessary to ensure that the 3 cycles requested by the API on a debreak operation occur in the instruction after the DBR.) The CAL instruction must not be used at any hardware priority level (API or PIC), since interrupts to these levels are not closed out by the execution of a CAL and recovery is not possible from such sequences of events as a. An I/o flag coming up during a CAL at level 7, b. Control going to the I/O device hand ler at level 3, c. The handler at level 3 CALing and thus destroying the content of location 00020 for the previous CAL. The highest API software level {level 4} is also used for processing CALs and care must be taken when executing CALs at this level. For example, a routine that is CAL'd from level 4 must know that if a debreak (DBR or DBK) is issued, control will return to the calling program at a level lower than 4. The calling routine will also debreak; however, this second debreak will not be from level 4 but from the next highest active level. 7.1.1.1 Setting Up the Skip Chain and API (Hardware) Channel Registers - When the Monitor is loaded, the Program Interrupt Control (PIC) skip chain and the Automatic Priority Interrupt (API) channels are set up to handle the Teletype keyboard, teleprinter and clock interrupts, only. The skip chain contains the other skip lOT instructions, but indirect jumps to an error routine result if a skip occurs, as follows: SKP DTA SKP JMP*INTl SKP LPT SKP JMP*INT2 SKP TTl SKP JMP TELINT /Skip if DECtape flag. /INTl contains error address. /Skip if line printer flag. /INT2 contains error address. /Skip if Teletype flag. /To Teletype interrupt handler. All unused API channels also contain JMPs to the error address. When a device handler is called for the first time via an .INIT user program command, it must call a Monitor routine (.SETUP) to set up its skip chain entry or entries and API channel, prior to performing any I/o functions. The calling sequence is as follows. 7-2 CAL N /N = API channel register 40 through 77 (see section /7 .1.3 for standard channel assignments), 0 if de/vice not connected to API. /. SETUP function code. /Skip lOT for this device. /Address of interrupt handler. 16 SKP lOT DEVINT (normal return) DEVINT exists in the device handler in the following format. DAC LAC* DAC LAC JMP DEVINT JMP DAC LAC DAC 10RS SMA!CLA LAW TAD DVSTON DAC DEVCF DEVION ION DEVAC DEVPIC /SAVE AC. AD--"-""", < ( DEVOUT \ """"--"""-; DEVION DVSTON DEVPIC DEVAC DEVINT DEVOUT ", /SAVE PC, LINK, EX.MODE, MEM.PROT. /FORCE ION AT DISMISSAL. '", /PIC ENTRY. /API ENTRY, SAVE AC. /SAVE PC, LINK, EX.MODE, MEM.PROT. /CHECK STATUS OF PIC /FOR RESTORATION AT DISMISSAL. /PIC OFF, BUILD 10F lOT. /PIC ON, BUILD ION lOT. 17740 DEVION DVSWCH /CLEAR DEVICE DONE FLAG /ENABLE PIC SO THAT OTHER DEVICES /AREN'T SHUT OUT. 10F DEVIOT /DISMISS ROUTINE LAC DAC LAC DVSWCH ION DBR JMP* /DISABLE PIC TO INSURE /DISMISSAL BEFORE INTERRUPT /FROM THIS lOT OCCURS (JMP DEVPIC DEVINT DEVAC /RESTORE DEVINT IN /CASE API DISABLED. /RESTORE AC /ION OR 10F /DEBREAK AND RESTORE CONDITIONS /OF LINK, EX.MODE AND MEM.PROT. DEVOUT Since the auto-index registers and EAE registers are not used by the standard I/o device handlers, it is not necessary to save and restore them. The Monitor routine (.SETUP) checks the skip chain for the instruction which matches SKP lOT; if there is a match it places the address, DEVINT, in the appropriate transfer vector (INTn) and places JMS* INTn in the corresponding API channel register. If a match cannot be found, lOPS outputs the following error message, • lOPS 05 XXXXXX indicating that the skip lOT in the CAL calling sequence at location XXXXXX was not in the skip chain. 7-3 Refer to the operating procedures of the System Generator for the method of incorporating new handlers and associated skip chain entries into the Monitor. 7.1.2 API Software Level Handlers (This section assumes complete fami I iarity with Chapter 9 of the PDP-9 User Handbook.) 7.1.2.1 Setting Up API Software Level Channel Registers - When the Monitor is loaded, the API software-level channel registers (40 through 43) are initial ized to .SCOM+ 12 .SCOM+13 .SCOM+14 .SCOM+15 JMS* JMS* JMS* JMS* /LEVEL 4 /LEVEL 5 /LEVEL 6 /LEVEL 7 where the .SCOM registers are at absolute locations 00112 through 00115 and contain the address of an error routine. Therefore, prior to requesting any interrupts at these software priority levels, the user must modify the contents of the .SCOM registers so that they point to the entry point of the user's software leve I hand lers. Example: .SCOM = 100 LAC DAC* (LV5INT (.SCOM+13 LV5INT exists in the user's area in the following format: LV5INT 0 DAC SAV5AC /SAVE AUTO INDEX REGISTERS /IF LEVEL 5 ROUTINES fUSE THEM AND LOWER LEVEL /ROUTINES ALSO USE THEM /SAVE MQ AND STEP COUNTER /IF SYSTEM HAS EAE AND IT /IS USED AT DIFFERENT LEVELS • fpC, LINK, EX.MODE, MEM.PROT. /SAVE AC . /RESTORE SAVED REGISTERS. DBR XCT .+ 1 JMP* LV5INT 7.1.2.2 /DEBREAK FROM LEVEL 5 /AND RESTORE L, EX.MODE, MEM.PROT. Queueing - High priority/high data rate/short access routines cannot perform complex cal- culations based on unusual conditions without holding off further data inputs. To perform the calculations, the high priority program segment must initiate a lower priority (interruptable) segment to perform 7-4 the calculations. Since, in general, many data handling routines will be requesting calculations, there wi II exist a queue of calculation jobs waiting to be performed at the software level. Each data handling routine must add its job request to the appropriate queue (taking care to raise the API priority level as high as the highest level that manipulates the queue before adding the request) and issue an interrupt request (ISA) at the corresponding software priority level. The general flow chart, Figure 7-1 depicts the structure of a software level handler involved with queued requests. LV5INT SAVE PC,LlNK,AC, AUTO-INDEX REGS, MO, STEP COUNTER AND CONDITIONS OF E~TEND MODE AND MEMORY PROTECT Figure 7-1 Structure of API Software Level Handler Care must be taken about which routines are called when a software level request is honored; that is, if a caJ led routine is "open" {started but not completed} at a lower level, it must be reentrant or errors will result. NOTE The standard hardware I/O device handlers do not contain reentrant procedures and must not be reentered from higher software levels. New resident handlers for Power Fail, Memory Parity, nonexistent memory violation, and Memory Protect violation have been incorporated into the system and effect an lOPS error message if the conditon is detected (see Appendix E for lOPS errors). The user can, via a .SETUP, tie his own handler to these skip lOT or API channel resisters. 7-5 Standard API Channel/Priority Assignments 7.1 .3 Priority Channel Register Software priority 4 40 1 Software priority 5 41 2 Software priority 6 42 3 Software priority 7 43 4 DECtape TC02 44 5 MAGtape TC59 45 6 Drum RM09 46 7 Disk 8 Paper Tape Reader 2 50 9 Clock overflow 3 51 10 Power fail KP09 0 52 11 Parity MP09 0 53 12 Display (L P flag) 34H 2 54 13 Card readers CR01E CR02B 2 2 55 14 Line Printer 647 2 56 15 A/D 138/139 0 57 16 DB99A/DB98A DB09A 3 60 17 360 Data Li nk 3 61 Channel Device 0 Option Number 47 Channels 18 through 31 still unassigned. 7.2 WRITING SPECIAL I/o DEVICE HANDLERS This section contains information prepared specifically to aid those users who plan to write their own special I/o device handlers for the I/O or Keyboard Monitor systems. (Information on special handlers for the Background/Foreground Monitor system will be available at a later date.) The PDP-9 Keyboard Monitor system is designed to enable users to incorporate their own device handlers; however, precautions should be taken when writing the handler to ensure compatibility with the Monitor. Special handlers cannot be incorporated into the I/O Monitor system, but can be designed to run with user programs in the I/O Monitor environment (see Section 7.2.4). In an I/O Monitor system, if a user wishes to incorporate a special handler into a systems program (for example, a card punch handler for MAC RO-9), he must purchase the source tape and assembly listings, modify them symbolically, and reassemble using at least a 16K machine. 7-6 It is assumed that the user is familiar with Section 7.1 of this chapter. To summarize, the handler is entered via a JMP from the Monitor as a result of a CAL instruction. The contents of the AC contain the address of the CAL in bits 3 through 17. Bit 0 contains the Link, bit 1 contains the extend mode status, and bit 2 contains the memory protect status. The previous contents of the AC and Link are lost. To show the steps required in writing an I/o device handler, a complete handler (Example B) was developed with the aid of a skeleton handler (Example A). This handler is a non-reentrant type (discussed briefly at the beginning of this chapter) and uses the Debreak and Restore instruction (DBR) to leave the handler at software priority level 4 (if API), and restore the status of the Link, extend mode, and memory protect. Example A is referenced by part numbers to illustrate the development of Example B, a finished Analog to Digital Converter (ADC) I/o Handler. The ADC handler shown in Example B, was written for the Type AF01B Analog to Digital Converter, discussed on pages 4-26 and 4-27 of the PDP-9 User Handbook. This handler is used to read data from the ADC and store it in the user's line buffer. The handler shown in Example B is for instructional purposes only; it has not been thoroughly tested. The reader, while looking at the skeleton of a specialized handler as shown in Example A, should make the following decisions about his own handler. (The decisions made in this case are in reference to developing the ADC handler): a. Services that are required of the handler (flags, receiving or sending of data, etc.). By looking at the ADC lOT's shown in Chapter 4 of the Users Handbook, it can be seen that there are three lOT instructions to be implemented. These instructions are: Skip if Converter Flag Set; Select and Convert; and Read Converter Buffer. The only service the ADC handler performs is that of receiving data and storing it in user specified areas. This handler will have a standard 256-word buffer. b. Data Modes used (for example, lOPS ASCII, etc.). As there is only one format of input from the Type ~FOl B ADC, mode specification is unnecessary in Example C. c. Which I/O macros are needed for the handler's specific use, that is, .INIT, .CLOSE, .READ, etc. These are fully described in Chapter 3 of this manual. For an ADC, the user would be concerned with three of the macros • • INIT would be used to set up the associated API channel register and the interrupt skip lOT sequence in the Program Interrupt (PIC) skip chain. This is done by a CAL (N) as shown in Part III of Example A, where (N) is the channel address. The standard device/API channel associations can be found on Pages 12 and 13 of the Users Handbook • • READ is used to transfer data from the ADC. When the • READ macro is issued, the ADC handler will initiate reading of the specified number of data words and then return control to the user. The analog input data received is in its raw form; it is up to the programmer to convert the data to a usable format • •WAIT detects the availability of the user's buffer area and ensures that the I/o transfer is completed. It would be used to ensure a complete transfer before processing the requested data. 7-7 d. Implementation of the API or PIC interrupt service routine. Example A shows an API or PIC interrupt service routine that handles interrupts, processes the data and initiates new data requests to fully satisfy the .READ macro request. Note that the routines in Example A will operate with or without API. Example B used the routines exactly as they are shown in Example A. During the actual writing of Example B, consideration was given to the implementation of the I/O Macros in the new handler in one of the following ways: 1. Execute the function in a manner appropriate to the given device as discussed in (c) •• INIT, .READ, .WAIT were implemented into the ADC handler (Example B) under the subroutine names ADINIT, ADREAD, ADWAIT. Wait for completion of previous I/O. (Example B shows the setting of the ADUND switch in the ADREAD subroutine to indicate I/O underway.) 2. Ignore the function if meaningless to the device. See Example B (.FSTAT results in JMP ADIGN2) in the dispatch table DSPCH. For ignored macros, the return address must be incremented depending upon the argument string after the CAL. The number of arguments for each macro is shown in Chapter 3. 3. Issue an error message in the case where it is not possible to perform the I/o function. (An example would be trying to execute an .ENTER on the paper tape reader.) In Example B the handler jumps to DVERR6 which returns to the Monitor with a standard error code in the AC. After the handler has been written and assembled, users who have a mass storage device must rebuild the Monitor system using the System Generator (SGEN), conveying to it the following information: a. Answer "yes" for, "Are any other device handlers present?" b. Give the total number of additional handlers. c• Type hand ler names. d. Type number of skip lOT's. e. Type skip lOT's f. Type skip chain, in the desired order of priority (usually with high speed devices first). An example of System Generation is shown in the SGEN section of the Keyboard Monitor Guide (DEC-9A-NGBA-D). When the system has been generated on a mass storage device, the system program UPDATE must be used to add the new handler to the library. At this time, the user is ready to use his specialized device handler in the PDP-9 system. For the I/O Monitor (paper tape systems), the user must assemble the handler and spl ice it to the lOPS Library Tape (Number 1). This procedure is described following Example B. 7.2.1 Discussion of Example A by Parts Part 1 Stores CAL pointer and argument pointer; also picks up function code from argument string. Part 2 By getting proper function code in Part 1 and adding a JMP DSPCH, the CAL function is dispatched to the proper routine. 7-8 7.2.2 t o Q.. N t o Q.. Part 3 This is the .SETUP CAL used to set up the API channel register and PIC skip chains. Section 7.1.3 of this manual shows the standard device/API associations. Part 4 Shows the API and PIC handlers. It is suggested these be used as shown. Part 5 This area reserved for processing interrupt and performing any additional I/O. Part 6 Interrupt dismiss routine. Part 7 Increments argument pointer in bypassing arguments of ignored macro CALis. Example A, Skeleton Vo Device Handler ISPECIALIZED 1/0 HANDLER ICAL ENTRY ROUTINE .GLOBL DEV. • MED=3 DAC DEV. DVCALP DAC DVARGP ISZ DVARGP DVARGP LAC* (77777 AND DIJARGP ISZ TAD (JMP DSPCH) DAC DSPCH DSPCH XX JMP DVI NIT JMP DVFSAT DVSEEK JMP DVENTR JMP JMP DVCLER JMP DVCLOS JMP DVI'IITAP JMP DVREAD D'JI.~RTE JMP DVI~AIT JMP DVTRAN JMP IMUST BE OF FORM AAA • I.MED (MONITOR ERROR DIAGNOSTIC) ISAVE CAL POINTER lAND ARGUMENT POINTER IPOINTS TO FUNCTION CODE IGET CODE IREMOVE UNIT # IF APPLICABLE IPOINTS TO CAL + 2 IDISPATCH WITH IMODIFIED JUMP II = IINIT 12 = .FSTAT, .DELET, .RENAM 13 = .SEEK 14 = .ENTER 15 - • CLEAR = . CLOSE = .MTAPE 110 = .READ 111 - .WRITE 112 = .WAIT 113 = .TRAN /6 17 IILLEGAL FUNCTIONS IN ABOVE TABLE CODED AS: JMP DVERR6 I IFUNCTION CODE ERROR DVERR6 LAW 6 JMP* ( MED+ 1 ) IERROR CODE 6 ITO MONITOR IDATA MODE ERROR DVERR7 LAlli 7 JMP* (.MED+1) IERROR COD: 7 ITO MON ITOR IDEVICE NOT READY DVERR4 LAC (RETlJRiiJ) IRETURN (ADDRESS IN HANDLER) ITO RETURN IS W~~N NOT READY ICONDITION HAS BEEN REMOVED) ( • MED) IERROR CODE 4 ITO MONITOR (.MED+1 ) 7-9 11/0 UNDERWAY LOOP DBR DVBUSY JMP* IBREAK FROM LEVEL 4 ILOOP ON CAL DVCALP INORMAL RETURN FROM CAL DVCK DBR DVARGP JMP* IBREAK FROM LEVEL 4 IRETURN AFTER CAL AND IARGUMENT STRING. ITHE DVINIT ROUTINE MUST INCLUDE IA. SETUP FOR lEACH FLAG CONNECTED TO PIC (AT BUILD TIME) lONE OF THESE MAY ALSO BE THE API SETUP CALL. ITHE SETUP CALLING SEQUENCE IS: DVINIT CAL IN = API CHANNEL REGISTER N 1(40-77); 0 IF NOT ICONNECTED TO API IIOPS FUNCTION COvE ISKIP lOT TO TEST THE FLAG IADDRESS OF INTERRUPT IHANDLER (API OR PIC) 16' SKP lOT DBVINT ITHIS SPACE CAN BE USED FOR 1/0 SUBROUTINES IINTERRUPT HANDLER FOR API OR PIC DEVAC DEVPIC DAC (0) LAC* DEVOUT DAC DEVION LAC DVSTON JMP DEVPIC DEVINT JMP DEVAC DAC DEVINT LI\C DEVOUT DAC IORS SMA!CLA LAI" DVSTON DEVION { TAD DAC DEVCF ION IS,WE AC ISACE PC, LINK, EX. MODE, IMEM. PROT. IFORCE ION AT DISMISSAL IPIC ENTHY IAPI ENTRY, SAVE AC IS AVE PC, LINK, EX. MODE, IMEM. PROT. ICHECK STATUS OF PIC IFOR RESTORATION AT IDISMISSAL. 1 7740 DEVION DVS1vCH ICLEAR FLAG IENABLE PIC ITHIS IS THE AREA DEVOTED TO PROCESSING INTERRUPT AND IPERFORMING ANY ADDITIONAL 1/0 DESIRED. IOF DEVIOT IDISABLE PIC TC INSURE IDISMISSAL BEFORE IINTERRUPT FROM THIS IIOT OCCURS IINTERRUPT HANDLER DISMISS RTE (JMP DEVPIC) DVDISM LAC DEVINT DAC DEVAC LAC DVS\I/r:H ION DBR DEVOUT JMP* IRESTORE PIC ENTRY IRESTORE AC lION OR lOr IDEBREAK AND RESTORE IlINK, EX. MODE, MEM. PROT. 7-10 IIF THE HANDLER USES THE AUTO-INDEX lOR IEAE REGISTERS, THEIR CONTENTS ISHOULD BE ISAVED AND RESTORED. IFU~CTIONS POSSIBLY IGNORED SHOULD ICONTAIN PROPER INDEXING TO BYPASS IARGUMENT STRING. ~:( DVIGN2 ~ 7.2.3 ISZ JMP DVARGP DVCK /BYP~SS tILE POINTER Example a, Special I/o Handler for Type AFOla AID Converter IADC lOT'S ADSF=701301 ADSC=701304 ADRB=701312 IADSF=SKIP IF CONVERTER FLAG IS SET IADSC=SELECT AND CONVERT(ADC FLAG IS CLE4RED lAND A CONVERSION IS INITIALITED) IADRB=READ CONVERTER BUFFER(PUTS CONTENTS IN !\ C) ICAL ENTRY ROUTINE IADC. IS GLOBAL NAME FOR HANDLER .GLOBL ADC. IMED(MONITOR ERROR DIAGNOSTIC) .MED=3 ISAVE CAL POINTER DAC ADCALP ADC. lAND ARGUMENT POI~TER DAC 4DARGP IPOINTS TO FUNCTION CODE ISZ ADARGP IGET CODE LAC* ADARGP IPOINTS TO CAL + 2 ISZ ADARGP TAD (JMP DSPCH) IDISPATCH WITH DAC DSPCH IMODIFIED JUMP XX OSPCH JMP ADINIT II = .INIT JMP ADIGN2 12 = .FSTST, • DELET, • RENAM JMP ADIGN2 13 = .SEEK JMP ADFRR6 14 - .ENTER ~MP ADFRR6 15 = .CLEAR JMP ADOK 16 = .CLOSE JMP ADOK 17 = .MTAPE JMP ADREAD 110 = .READ JMP ADERR6 III = .WRITE JMP ADWAIT 112 = .WAIT JMP ADERR6 113 = .TRAN IILLEGAL FUNCTIONS IN ABOVE TABLE CODED AS: I JMP ADERR6 IFUNCTION CODE ERROR AOERR6 LAW 6 IERROR CODE 6 ITO MONITOR JMP* (.MED+1) IOATA MODE ERROR AOERR7 LAW 7 IERROR CODE 7 JMP* (.MED+!) ITO MONITOR 7-11 ITHE ADINT ROUTINE MUST INCLUDE A I. SETUP FOR lEACH FLAG ASSOCIATED WITH THE IDEVICE ITHE .SETUP CALLING SEQUENCE IS: ADINIT ISZ ADARGP .DEC LAC (256 .OCT DAC* ADARGP ISZ ADARGP CAL 57 IIDX TO RET STNDRD BUFF SIZE ISTANDARD BUFFER SIZE (DECI~AL) IPUT BACK STANDARb BUFFER SIZE 157=API CAHNNEL RF-GISTER 1(40-77); 0 IF NOT ICONNECTED TO API I.SETUP lOPS FUNCTION CODE ADSF IADC SKIP lOT TEST THE FLAG ADCINT IADDRESS OF INTERRUPT IHANDLER (API OR PIC) ADUND LAC .+2 IERASES CALL FU~CTION IN CASE ADI,IRC DAC .-5 10F FURTHER .INIT'S THEY WILL BE ADWPCT JMP ADS TOP IIGNORED By THIS JMP TO ADSTOP IWHERE THE 1/0 UNDERWAY SWITCH lIS CLEARED AND ALL 1/0 IS ITERMINATED ITHE PREVIOUS SIX TAGS IN THE CAL AREA ARE USED FOR TEMP ISTORAGE DURING THE ACTUAL .READ FUNCTION IADCKSM IS FOR STORING THE CHECKSUM IADDRP IS THE CURRENT BUFFER POINTER IADLRHP IS THE LINE BUFFER HEADER POINTER IADUND IS FOR DEVICE UNDERWAY SWITCH IADRWC IS USED AS A -WORD COUNT REGISTER IADRWCT IS USED TO STORE CURRENT WORD PAIR COUNT ISTOP ADC ROUTINE CLEARS 1/0 UNDER WAY SWITCH ADSTOP DZM ADUND IADC WAIT LAC ADUND SNA JMP ADaK 11/0 UNDERWAY LOOP ADBUSY DBR JMP* ADCALP ADCKSM ADCBP ADLBHP 16 ADREAD LAC ADUND SZA!CMA JMP ADBUSY DAC ADUND LAC* ADARGP DAC ADDBP DAC ADLBHP ISZ ADARGP LAC* ADRAGP DAC ADRWC ISZ ADARGP DZM ADWPCT DZM ADCKSM ISZ ADDBP ISZ ADDBP ICHECK TO SEE IF 1/0 IS UNDERWAY IIF NOT SET IT WITH -1 lIT WAS SET, GO BACK TO CAL ISET IT IGET LI~E BUFFER HEADER POINTER ISTORE IT IALSO STORE IT FOR LATER HEADER IINCREMENT ARG. POINTER IGET -L~B.W.C.(2'S CaMP) ISTORE IT IN WORD COUNT REGISTER IINCREMENT FOR EXIT FROM .READ IZERO WORD PAIR COUNT REG. IZERO CHECKSUM REG. IGET PAST HEADER PAIR INOW POINTING AT BEGINNING OF IBUFFER 1ST ART UP DEVICE ADSC INORMAL RETURN FROM CAL ADOK DBR JMP* ADARGP IBREAK FROM LEVEL 4 IRETRUN AFTER CAL 7-12 IINTERRUPT HANDLER FOR API OR PIC ADCPIC DAC ADCAC LAC* (0) DAC ADCOUT LAC ADCION JMP ADSTON ADCINT JMP ADCPIC DAC ADCAC LAC ADCINT DAC ADCOUT LAC (JMP ADAPIC) DAC ADCINT IORS SMA!CLA LAW 11140 TAD ADCION ADSTON DAC ADSWCH ADRB ADCION ION DAC* ADDBP ISZ ADDBP ISZ ADWPCT TAD ADCKSM DAC ADCKSM ISZ ADRWC JMP ADCONT LAC ADWPCT TAD <1 RTL RTL RTL RTL AND (311000 DAC* ADLBHP IS~ ADLBHP TAD ADCKSM DAC* ADLBHP DZM ADUND JMP ADDISM IOF ADCONT ADSC ISAVE AC ISAVE PC, LINK, EX. MODE IMEM. PROT. IFORCE ION AT DISMISSAL IPIC ENTRY. IAPI ENTRY, SAVE AC ISAVE PC,LINK,EX. MODE, IMEM. PROT. IRESTORE PIC ENTRY BECAUSE PIC IA JMS CALL NOT A JUMP ICHECK STATUS OF PIC IFOR RESTORATION AT IDISMISSAL IREAD CONVERTER BUFFER IENABLE PIC FOR OTHER DEVICES ISTORE DATA IN USER BUFFER IINC. BUFFER POINTER IINC. WORD PAIR COUNTER IADD CHECKSUM ISTORE IT lIS 1/0 COMPLETE INO KEEP GOING IYES,COMPUTE WORD COUNT PAIR IADD ONE MAY BE ODD IDIVIDE By TWO, AT SAME TIME ADS IIT,FOR HEADER IALL SET ISTOHE IN HEADER #1 IINC. TO STORE CKSUM IADD WORD PAIR COUNT ISTORE IN HEADER #2 ICLEAR DEVICE UNDERWAY IEXIT IDISABLE PIC TO INSURE IDISMISSAL BEFORE IINTERRUPT FROM THIS IIOT OCCURS IINTERRUPT HANDLER DISMISS RTE ADDISM LAC ADCAC ADSWCH ION DBR JMP* ADCOUT ADCAIP 0 ~DARGP 0 ADCOUT PJ ADCAC 0 IRESTORE AC lION OR IOF IDE9REAK AND RESTORE ILINK,EX.MODE,MEM. PROT. IADC CAL POINTER IADC ARGUEMENT POINTER IPC,L,FM,MP lAC SAVED HERE IIF THE HANDLER USES THE AUTO-INDEX lOR IEAE REGISTERS, THEIR CONTENTS ISHOULD BE ISAVED AND RESTORE. 7-13 /FUNCTIONS POSSIBLY IGNORED SHOULD /CONTAIN PROPER INDEXING TO BYPASS /ARGUMENT STRING. ADIGN2 ISZ ADARGP JMP ADO'X .END 7.2.4 /BYPASS FILE POINTER Incorporating Special, User-Program I/O Handler into Paper Tape System Proceed as follows to incorporate a nonstandard device handler into a user program in the I/O Monitor environment. a. Assemble the new. handler in relocatable binary form. After removing the end-of-file block {with the W switch in PIP}, attach it to the I/O tape {No.1} of the library. b. Write a main program in which the new handler is declared as an external global: .GLOBL NUHDLR Perform the following sequence of instructions prior to the execution of any monitor calls to the .DAT slot(s} to which this handler is to be attached: LAC DAC* DAC* NUHDLR (140 /.OAT SLOT *3 /.DAT SLOT *4 {141 c. Do not put these • DAT slot numbers in a .IODEV psuedo-op. d. On the first .INIT to this handler, the handler should: 1. Place the skip lOT in the skip chain in place of an unused skip lOT (avoid DRNEF) PAPER TAPE SYSTEM SKIP CHAIN LOC SKP lOT 1511 1514 1517 1522 1525 1530 1533 1536 1541 1544 1547 1552 1555 1560 1563 SPFAL DRSF MTSF CLSF RCSF RCSD LSDF RSF PSF KSF TSF MPSNE MPSK SPE DRNEF DEVICE POWER FAIL DRUM DONE MAGTAPE DONE CLOCK OVERFLOW CARD COLUMN READY CARD DONE LINE PRINTER DONE PAPER TAPE READER DONE PAPER TAPE PUNCH DONE KEYBOARD READY TELEPRINTER DONE NON-EXISTENT MEMORY MEMORY PROTECT VIOLATION MEMORY PARITY ERROR NOT DRUM ERROR An example is: LAC DAC* (skip lOT) (IE33) 7-14 /REPLACE LINE /PRINTER SKIP lOT 2. Call .SETUP CAL 16 SKIP lOT DEVINT AD IADDRESS OF API REGISTER SETUP FUNCTION CODE I. I ADDRESS OF INTERRUPT SERVICE Where AD is the address of the associated API channel register; it is 0 if this device is not attached to the API. e. The setup for communication with this nonstandard handler via .DAT slots 3 and 4 is complete. NOTE This procedure refers to the current Paper Tape System being distributed where .DAT slot Number 1 is at absolute register 136j:l' A more modular verision is to be distributed in the tUture. 7.3 1/0 HANDLERS ACCEPTABLE TO SYSTEM PROGRAMS This section lists the .DAT slot requirements of system programs, the uses made of the .DAT slots, and the I/O handlers that may be assigned to each. It is imperative that one and only one I/o handler for a device be in core at the same time; that is, DTA. and DTB. should not be brought in together since there is no communication between the two interrupt handlers. IFORTRAN IV .DAT Slot Use -11 Input Handler TTA PRA PRB (recommended) DTA, DKA, ORA, or MTA (required if 3 files open) DTB, DKB, ORB, or MTB (recommended if 2 files open) DTC, DKC, DRC, or MTC (recommended if input only) DTD, DKD, ORO, or MTD MTF (non-file-oriented) CDA COB CDC -12 Listing TTA LPA PPA DTA, DKA, ORA, or MTA (required if 3 files open) 7-15 .DAT Slot Use Handler DTB, DKB, DRB, or MTB {recommended if 2 files open} DTD, DKD, DRD, or MTD {recommended if listing output only} MTF {non-fi le-ori ented} -13 Output PPA PPB PPC {recommended} DTA, DKA, DRA, or MTA (required if 3 fi les open) DTB, DKB, DRB, or MTB {recommended if 2 files open} DTD, DKD, DRD, or MTD (recommended if listing output only) MTF (non-file-oriented) IMACRO-9 Identical to FORTRAN IV, with two exceptions (a) if .ABS binary output is requested on .DATslot-13, PPC. and DTB. cannot be used. (b) .DATslot-10 is the secondary input device (P option in command string) and should be attached to a non-bulk-storage handler: TTA PRA PRB CDA CDB CDC IEDIT-9 .DAT Slot Use -10 Secondary Input Handler TTA PRA PRB (recommended) CDA CDB CDC 7-16 .DAT Slot -14 Use Input Handler TTA PRA PRB (recommended) DTA, DKA, ORA, or MTA (required if input and output) DTD, DKD, ORO, or MTD (input only) CDA COB CDC -15 Output LPA TTA PPA DT A, DKA, ORA, or MTA (required if input and output) DTD, DKD, ORO, or MTD (output only) Linking Loader and DDT .DAT Slot -1 Use System Library Handler PRA DTA, DKA, or MTA DTB, DKB, or MTB DTC, DKC, or MTC (recommended if no user I/O) DTD, DKD, or MTD CDA COB CDC -4 Input Same as for . OAT slot -1 plus ORA -5 External User Library ORB DRC ORO NOTE Since Linking Loader handlers can be used by the user program, choice of the bulk-storage handler should be a function of user requirements. 7-17 PIP uses all the positive . OAT slots (1 through 10) plus . OAT slot -3 for Teletype I/O. Prior to PIP use, any non-standard peripheral device assignments should be made via the ASSIGN command to the PDP-9 Keyboard or Background/Foreground Monitor. If several PIP functions are to be used with a variety of peripherals, assignment of all these peripherals to Device Assignment Table (OAT) slots (1 through 10) will avoid returning to the Monitor for reassignment of OAT slots and reloading PIP and its new lOPS routines into memory. The following should be carefully noted in using the ASSIGN command to set up OAT slots for PIP. Since the PDP-9 ADVANCED Software System includes more than one device handler for certain peripherals, those used with PIP should normally be the ones with the fullest capabilities, for example, PRA, PPA and DTA. If both input and output are to occur to the same type device (for example, DECtape), separate slots must be assigned. Both, however, must be assigned to the same handler, that is, erroneous results will occur if DT A is assigned to one slot and DTB to another, since there is no communication between the interrupt service routines. The user must be certain to clear (ASSIGN NONE A, B, C,J , where A, B, and C are the OAT slots to be cleared), undesirable assignments. ISystem Generator • OAT Slot Use Handler -14, -10 Input DTA, DKA, or MTA -15 Output DTA, DKA, or MTA PTD, DKD, or MTD IDUMP -12 listing LPA TTA PPA -14 Input OTA, DKA, ORA, or MTA DTD, DKD, ORO, or MTD (recommended) 7-18 17-TO-9 CONVERTER I Handler .OAT Slot Use -12 Listing TTA LPA PPA OTA, OKA, ORA, or MTA (required if 3 files open) OTB, OKB, ORB, or MTB (recommended if 2 files open) OTO, OKO, ORO, or MTO (recommended if 1 file open) -14 Input TTA PRA PRB (recommended) OTA, OKA, ORA, or MTA (required if 3 files open) OTB, OKB, ORB or MTB (recommended if 2 fi les open) OTC, OKC, ORC, or MTC (recommended if input only) OTO, OKO, ORO, or MTO COA COB CDC -15 Output LPA TTA PPA OTA, OKA, ORA, or MTA (required if 3 files open) OTB, OKB, ORB, or MTB (recommended if 2 files open) OTO, OKO, ORO, or MTO (recommended if output only) I Libary Update I -10 Secondary Input PRA OTA, OKA, ORA, or MTA COA -12 Listing LPA TTA PPA OTA, OKA, ORA, or MTA COA 7-19 .DAT Slot Use Handler -14 Input PRA DTA, DKA, ORA, or MTA -15 Output PPA PPB PPC DTA, DKA, ORA, or MTA NOTE The A version of bulk-storage handlers (DTA, DKA, etc.) can handle only three files simultaneously; any one of them should never be assigned to all four Library Update • OAT slots. ISystem Patch .DAT Slot Use -14 System Device I/O DTA, DKA, MTA DTD, DKD, MTD -10 Secondary Input PRA Handler NOTE PATCH uses • OAT slot -3 for teletype output and • OAT slot -2 for input from the keyboard of batch input device. The user should never modify .DAT slots -3 or -2. I Chain Bui Ider I .DAT Slot Use -6 Output 7-20 Handler PPA PPB PPC DTA, DKA, ORA, or MTA DTB, DKB, ORB, or MTB (recommended) DTD, DKD, ORO, or MTD (only if no other DT, OK, etc., in -4, -5, and -1) Handler .DAT Slot -5 External Library -4 User Programs -1 System Library PRA CDA DTA, DKA, ORA, or MTA DTB, DKB, ORB, or MTB (recommended) DTC, DKC, DRC, or MTC (only if no other DT, OK, etc. in -6) DTD, DKD, DKD, or MTD (only if no other DT, OK, etc. in -6) (Same as for • OAT -5) NOTE Use smallest handlers possible since they are not recoverable as user handlers. I Chain Execute -4 Chain Input I PRA CDA DTA, DKA, ORA, or MTA DTB, DKB, ORB, or MTB DTC, DKC, DRC, or MTC DTD, DKD, ORO, or MTD NOTE Use smallest "input-only" handler since user program may not use this handler. 7.4 SUMMARY OF STANDARD I/O HANDLER FEATURES This section applies to I/O and Keyboard Monitor environments only. ILPA.(647 LINE PRINTER) A. I Function 1. .INIT (a) Return standard line buffer size (52 10) (b) .SETUP --- API channel register 56 8 (c) Clear line printer buffer (d) Form feed 7-21 2. .DLETE .RENAM • FSTAT Ignore 3. .SEEK Illegal function 4. .ENTER Ignore 5. .CLEAR Ignore 6. .CLOSE (a) Allow previous output to terminate (b) Form feed (c) Allow form feed to terminate 7. .MTAPE Ignore 10. .READ Illegal function 1l. .WRITE (a) Allow previous output to terminate (b) B. 12. •WAIT Allow previous output to terminate 13. .TRAN Illegal function Lega I Data Modes l. C. D. Output line lOPS ASCII Vertical Control Characters (when first character of line) 12 21 Pri nt every line 22 Print every third line 13 Print every sixth line 23 Print every tenth line 24 Print every twentieth line 20 Overprint 14 Form feed Print every second line Horizontal Control Characters (anywhere in line) 11 Horizontal tab -- converted to N spaces, where N is the number necessary to have the next character in column 11,21,31,41, •.• E. Recoverable Errors 1. Device not ready Monitor error message, .IOPS 4. Make device ready, then type tR to continue. 7-22 F. Unrecoverable Errors 1. 2. Illegal function Illegal data mode Monitor error message, • lOPS 06 XXXXXX, where XXXXXX is address of error CAL. (a) .SEEK (b) .READ (c) • TRAN Monitor error message, .IOPS 07 XXXXXX, where XXXXXX is address of error CAL. Any mode other than lOPS ASCII. I. Program Size 297 (decimaO registers. ITT A- (TELETYPE) I A. Functions - All function descriptions (except READ and WRITE) refer to action taken when either the teleprinter or the keyboard is addressed. 1. .INIT (a) Return standard buffer size (34 10). (b) Assign return addresses for certain control characters from contents of CAL ADDRESS + 2. Bits 0 through 1 in CAL + 2 address are set to designate caller: BO, 1 = 01 BO,1=10 BO, 1 = 00 caller = KM9 caller = DDT caller = any other user (c) Set I/O UNDERWAY indicator. (d) Print CR/LF. 2. .DLETE .RENAM • FSTAT Ignore 3. .SEEK Ignore 4. .ENTER Ignore 5. .CLEAR Ignore 6. .CLOSE (a) Set VA UNDERWAY indicator. (b) Print CR/LF. (c) Wait on .CLOSE for completion of 7. .MTAPE 10. .READ ve. Ignore (a) Set VA UNDERWAY indicator. (b) Set up to accept characters from keyboard. 7-23 11. .WRITE (a) Set VO UNDERWAY indicator. (b) B• C. Print line. 12. •WAIT Allow input or output to finish • 13. •TRAN Illegal function • Lega I Data Modes 1. lOPS ASCII 2. IMAGE ASCII Vertical Carriage Control Characters 1. Output (a) Line feed (12a) (1) lOPS ASCII: Ignore all leading line feeds; otherwise output (2) IMAGE: Output (b) Others (vertical tab, form feed) output 2. D. Inserted in buffer Input Horizontal Carriage Control Characters Tab (l1a) in or out 1. lOPS ASCII (a) Model 33 - output sufficient number of spaces to place the next typed character in column 11, •.• , 71 . Insert only 11a in buffer on input. (b) Model 35 - input, insert 11 R in buffer. Output, print tab. 2. E. IMAGE Input, insert 11a in buffer. Output, print tab. Program Control Characters-IN 1• Stop current Vo to Teletype. 2. Decode character (a) tC transfers control to the address specified as return in the • IN IT performed by KM9. and echo on Te leprinter. * (b) tP transfers control to the address specified as return in the .INIT performed by the user (other than KM9 or DDT). (c) tT transfers control to the address specified as return in the .INIT performed by DDT. (d) fS transfers control to the address specified in .SCOM + 6. (e) fQ transfers control to KM9SAV. *Character will be ignored {not echoed} in cases (a), (b), and (c), if respective •• INIT has not been performed. 7-24 F. Data Control Characters-IN 1. IMAGE Mode All characters inserted in buffer as 7-bit characters. 2. lOPS ASCII Mode (a) Rubout. Delete previous character typed. Type out reverse slash (\). (b) tU delete entire line typed so far. Type out commercial at (@). If output is UNDERWAY, printing is terminated and a CR/LF is output. G. Data Control Characters-OUT (both modes) Ignore rubout (177 8 ) and null (00). In image alpha mode, a rubout should be used to fill the last word pair when an odd number of characters is to be output. H. I. Errors (no program-initiated recovery) 1• IIlega I data mode Error code 7 2. Illegal function Error code 6 Program Size 469 10 registers (this is included in resident MONITOR). J. Teletype I/o - Can be requested only from mainstream in API systems, since the Teletype is not connected to the API. Ipp (PAPER TAPE PUNCH) I A. Functions l. 2. .INIT (a) Return standard buffer size (52 10), (b) .SETUP - no API. (c) Punch two fanfolds of leader. .DLETE .RENAM .FSTAT Ignore 3. • SEEK Illegal function • 4. .ENTER Ignore 5. .CLEAR Ignore 7-25 6. .CLOSE (a) Allow previous output to terminate. (b) Punch EOF if lOPS Binary (c) Punch two fanfolds of trai ler (d) Allow trailer punching to terminate 7. .MTAPE Ignore 10. • READ Illegal function 11. .WRITE (a) Allow previous output to terminate. (b) Output buffer B. 12. •WAIT Allow previous output to terminate • 13. .TRAN Illegal function Lega I Data Modes 1. lOPS Binary 2. IMAGE Binary 3. lOPS ASCII 4. IMAGE ASCII 5. Dump C. Vertical Control Characters (lOPS ASCII only) May appear only as first character of line, if elsewhere in line will be ignored; if no vertical control character at beginning of line, a line feed (012) will be used. D. 1. 012 Line feed 2. 013 Vertical tab, followed by four deletes (177) 3. 014 Form feed, followed by 408 nulls (000) Horizontal Control Characters (lOPS ASCII only) 1. E. 011 Horizontal tab, followed by one delete (177) Recoverable Errors 1. No tape in punch Monitor error code 4 (a) Put tape in punch (b) Type tR 7-26 F. Unrecoverable Errors 1. 2. Illegal function Illegal data mode Monitor error code 6 (a) .SEEK (b) .READ (c) • TRAN Monitor error code 7 I. Program Size PPA. (all data modes) PPB. (a II except lOPS ASCII) PPC. (lOPS binary only) j. In API systems, the paper tape punch can be called only from mainstream, since the punch is not 397 decimal registers 270 decimal registers 210 decimal registers connected to the AP I. I A. PR (PAPER TAPE READER) I Functions 1. 2. . IN IT (a) Return standard line buffer size (52 10) (b) .SETUP API channel register 50S (c) Clear I/O UNDERWAY indicator • DLETE .RENAM .FSTAT Ignore 3. .SEEK Ignore 4. .ENTER Illegal function (error code 6) 5. .CLEAR Illegal function (error code 6) 6. .CLOSE Allow previous input to finish and then clear I/O UNDERWAY indicator • 7. • MTAPE Ignore 10. .READ (a) Allow previous input to be completed. (b) Input line or block of data (see modes below). 11. .WRITE Illegal function (error code 6). 12. • WAIT Allow previous input to be completed before allowing user program to continue • 13. • TRAN Illegal function. 7-27 B• Lega I Data Modes (A 11 ) 1. lOPS ASCII (a) Constructs line buffer header, computing: (1) Word pair count (2) Data mode (3) Data validity bits (b) Packs characters into the line buffer in 5/7 ASCII, checking parity (eighth bit, even) on each character. (c) Allows vertical form control characters. (FF, LF, VT) only in character position 1 of the I ine buffer. Otherwise, ignored. (d) Terminates reading on CR or line buffer overflow. In the latter case, tape is moved past the next CR to be encountered. 2. lOPS BINARY (a) Reads binary data in alphanumeric mode, checking parity (seventh hole, odd) on each frame. (b) Accepts line buffer header at head of input data, modifying data validity bits if parity or checksum errors (or short line) have occurred. (c) Terminates reading on overflow of word pair count in line buffer header or word count in .READ macro, whichever is smaller, moving tape to end of line or block if necessary. 3. IMAGE ASCII (a) Constructs line buffer header, computing: (1) Word pair count (2) Data mode (b) Stores characters, without editing, or parity checking in the I ine buffer, one per register. (c) Terminates reading as a function of .READ macro word count. 4. IMAGE BINARY Same as 3 (a), (b), (c) above; however, a binary read is issued to the PTR. 5. DUMP Same as 3 (b), (c) above. A binary read is issued to the PTR. No header is constructed; loading begins at the core address specified in the .READ macro. NOTE An end of tape condition causes the PTR interrupt service routine to terminate the input line, turning off the I/O UNDERWAY program indicator and marking the header (data mode bits) as an EOM (end of medium) for all modes except DUMP. 7-28 C. Unrecoverable Errors 1. 2. I. Illegal Function Monitor error code 6 (a) .ENTER (b) .CLEAR (c) .WRITE (d) .TRAN I II ega I Data Mode Monitor error code 7 Program Size PRA. (all data modes) PRB. (lOPS ASCII only) 436 decimal registers 287 decimal registers IDT (DECT APE) A. Function 1. .INIT (a) Return standard line buffer size (255 10) (b) .SETUP - API channel register 448 (c) Set direction switch (input or output). NOTE In order to change transfer direction when operating in a file oriented environment, a new .INIT must first be executed. 2. .OPER (.DLETE) (.RENAM) (.FSTAT) (a) • DLETE (1) Examines specified Directory for presence of desired fi Ie name. If not found, AC = 0 upon return to user. (2) Deletes file name (clears to 0) from the Directory of the specified unit. (3) Clears file bit map corresponding to deleted entry. (4) Clears corresponding occupancy bits in Directory bit map. (5) Records modified Directory and file bit map b lock on specified unit. 7-29 (b) .RENAM (1) Examines specified Directory for presence of desired file name. If not found, AC = 0 upon return to user. (2) Changes file name in Directory to new one specified by user program (no change is made to first block pointers). (3) (c) Records modified Directory on specified unit. • FSTAT (1) Examines specified Directory for presence of desired fi Ie name. If not found, AC = 0 upon return to user. If found, AC = first block number of file. Also, bits 0- 2 of CAL ADDRESS + 2 = 1 = DECtape Directory type. (d) Other .OPER codes are illegal. 3. .SEEK (a) Loads into core the Directory of the unit specified if the Directory is not already in core. (b) Checks for presence of named file. (Error return to Monitor if not found.) 4. .ENTER (c) Begins transfer of first block of file into handler buffer area, overlaying Directory Entry Section but not Directory Bit Map. (d) Declares unit to be file oriented. (a) Loads into core the Directory of the unit specified if the Directory is not already in core. (b) Checks for presence of named fi Ie. If present, po inter to that entry is saved for update at .CLOSE time. If not present, empty slot is found for file name insertion at .CLOSE time. (c) Examine Directory Bit Map for free block and saves that block number for first transfer out and for insertion in Directory Entry Section at .CLOSE time. (d) 5. .CLEAR (a) Zero's out Fi Ie Bit Map blocks 71 through 77 on specified DECtape unit. (b) 6. CLOSE Dec lares unit to be fi Ie oriented. Initializes DECtape Directory block 100 to indicate that eight blocks (71 through 100) are occupied. (a) On input, clears internal program switches. On output, writes 2-cell EOF line as last line in output buffer (lOPS ASCII and binary only) and outputs last data buffer with the data link = 777777. (b) Loads into core the file bit map corresponding to the Directory Entry in order to clear the Directory Bit Map of bits for blocks formerly occupied by this fi Ie. 7-30 (c) Records newly constructed fi Ie bit map. (d) Loads Directory into memory, enters new entry and records Directory again with new entry and updated Directory Bit Map. (e) Clears internal program switches. 7. MTAPE (REWIND) (BACKSPACE) (a) REWIND (1) Sets internal switches such that data transfer will begin at block 0 in the forward direction. (2) Declares the unit as non-file-oriented, that is, data will be recorded (starting at block 0) every fifth block. At EOT, recording continues in the reverse direction, etc. Five passes will record all 1100a blocks of a DECtape. (b) BACKSPACE (1) Decrements the internal pointer to the next block to be transferred. (c) Other .MTAPE functions - ignored. 10. .READ (a) Input line from DECtape handler buffer or block of data to user area. (See B be low for data modes.) (b) Initiate input of next DECtape block when preceding block has been emptied. 11. •WRITE (a) Transfers line or block of data from user area to DECtape handler buffer. (b) Outputs buffer when full, examining Directory Bit Map for free block number to store as Data Link (word 377a) of current block output. 12. •WAIT 13.· •TRAN B• Allow previous transfer to be completed before allowing user program to continue. Transfer (in or out) the number of words specified by the user's word count to/from the core area indicated in the. TRAN macro to/from the specific block(s) desired by the user. Data will be transferred to/from contiguous DECtape blocks in the forward or reverse direction (also declared by the user). On input, transfer stops on word count overflow. On output, transfer also stops on word count overflow; however, if the word count is not equivalent to an integral number of DECtape blocks, the remainder of the last block wi II be filled with zeros. Lega I Data Modes 1. lOPS ASCII 2. lOPS Binary 3. Image Alphanumeric 7-31 C. 4. Image Binary 5. Dump Recoverable Errors 1. Monitor Error Code 4 Se lect Error* (a) Ready the desired DECtape unit (b) Type tR on the Teletype. D. Unrecoverable Errors 1. Monitor Error Code 6 Illegal Function (a) See E below for illegal functions 2. Monitor Error Code 7 Illegal Data Mode (a) .SEEK with .INIT for output (b) .ENTER with .INIT for input. (c) See E below for .READ, .WRITE illegal data modes. 3. Fi Ie Sti II Active Monitor Error Code 10 (a) 4. Monitor Error Code 11 .SEEK, .ENTER Not Executed (a) 5. .SEEK, .ENTER, .CLEAR or .OPER when last file has not been closed. DECtape Error .READ or .WRITE executed prior to .SEEK or .ENTER (or .MTAPE - REWIND) Monitor Error Code 12 (a) Mark Track Error (b) 6. Fi Ie Not Found EaT during read or write Monitor Error Code 13 (a) File name not found in Directory on a .SEEK. 7. Monitor Error Code 14 DECtape Directory Full (a) Directory Entry Section found full on an .ENTER. 8. DECtape Full Monitor Error Code 15 (a) All DECtape blocks occupied on a •WRITE 9. Output Buffer Overflow Monitor Error Code 16 (a) Output line (lOPS ASCII or Binary) greater than 255 10 cells (including header). *A "Select" error is equivalent to a hardware not ready condition. See the PDP-9 Users Handbook, F95, 5-12, for a detailed description. 7-32 (b) 10. 11. 12. E. Monitor Error Code 17 Excessive Number of Files Referenced Two output files on same unit Illegal word pair count tyVPC) Output block (Image Binary or Image Alphanumeric) greater than 255 10 cells (excluding header). See Section E for file reference limitations. Monitor Error Code 22 (a) Two output files open simultaneously on the same unit. Monitor Error Code 23 (a) WPC = 0, or greater than 177. Subprogram Description and Size 1. DTA (which requires 2321 10 locations) DTA is the most general DECtape handler issued with the PDP-9 ADVANCED Software System. DTA has a simultaneous 3-file capacity, either input or output. Files may be referenced on the same or different DECtape un its, except that two or more output fi les may not be on the same unit. All data modes are handled as well as all lOPS functions except .MTAPE. Three 256 10-word data buffers, three 32 10-word Directory Bit Maps and three 32 10-word File Bit Maps are included in the body of the handler. 2. DTB (which requires 1552 10 locations) DTB has a simultaneous 2-file capacity, either input or output. Both files may be on the same or different units. DTB transfers data only in lOPS ASCII or lOPS binary data modes. Included in the handler is space for two 256 10-word data buffers, two 32 10word Directory Bit Maps and two 32 10-word File Bit Maps. Functions included are: .INIT .SEEK 3. .ENTER .CLOSE .READ .WRITE .WAIT DTC (which requires 680 10 locations) DTC is the most limited (and conservative in terms of core allocation) DECtape handler in the PDP-9 ADVANCED Software System. DTC is a READ ONLY handler with a 1-file capacity requiring no space for bit maps and only one 256 10-word DECtape data buffer to handle either lOPS ASCII or lOPS binary input (and no other). Functions included are: .INIT .SEEK .CLOSE .READ 7-33 .WAIT 4. DTD (which requires 1569 10 locations) DTD has full lOPS function capabilities including .MTAPE commands; however, it allows for one and only one file reference, either input or output, at any given time. Sequential fi Ie references are permitted. All data modes are acceptable to DTD. One 256 10-word data buffer, one 32 10-word Directory Bit Map and one 32 10-word File Bit Map are included. ICD (Card Readers CROl E and CR02B) I A. Functions l. (a) Return standard buffer size (52 10 ) (b) Call .SETUP to update skip chain with PIC servicer addresses for column ready and card done flags and to place API servicer address in location 55 S (API channel 13). .DLETE .RENAM .FSTAT Ignored 3. .SEEK Ignored 4. .ENTER Illegal function 5. .CLEAR Illegal function 6. • CLOSE Allow previously requested input to terminate . 7. .MTAPE Ignored 10. .READ 2. B. .INIT (a) Allow previously requested input to terminate. (b) Ensure that device is ready. (c) Initiate input of next card. 1l. .WRITE Illegal function 12 . • WAIT Allow previously requested input to terminate. 13 . • TRAN Illegal function LEGAL Data Modes 1. Alphanumeric Input Modes a. lOPS ASCII (Mode 2) (36 10 locations required to store an SO-column card) Eighty card columns are read and interpreted as Hollerith (029) data, mapped into the corresponding 64-graphic subset of ASCII, and stored in the user's line buffer in 5/7 format. Compression of internal blanks to tabs and truncation of trailing blanks is not 7-34 performed; all SO characters appearing on the card are delivered to the caller's line buffer. In addition, a carriage return (015 S) character is appended to the input line; a total of Sl ASCII characters are thus returned by the handler in lOPS ASCII mode. All illegal punch configurations (that is, those not appearing in the 029 Hollerith set) are represented in the user's line buffer area as null (OO) characters. In addition, the parity error bit is set in the line buffer header to indicate the illegal punch condition. There is no possibility of confusion between those nulls representing illegal punch. combinations and nulls to pad a word-pair containing fewer than five characters. The reason for this lies in the fact that padding nulls are used only in the last pair of the line, and these are always (in lOPS ASCII mode) preceded by a carriage return. Thus any nulls which appear before the handler-supplied carriage return must be considered to represent i lIega I punches. The single addition to the Hollerith set, one made necessary by the constraints of system programs, is the provision for the internal generation of the ALT MODE terminator. The appearance of a 12-1-S punch (multiple-punched A/S) on the card is mapped into the standard PDP-9 ALT MODE character (175 S) in the user's line. When card processing is complete, word 1 of the header is constructed and stored in the caller's line buffer area. Word 2 of the header, the checksum location, is never disturbed by the card reader handler in lOPS ASCII mode. Attention is called to Appendix B (PDP-9 ASCII-Hollerith Correspondence) for a delineation of legal Hollerith codes and their corresponding ASCII graphics. b. Image Alphanumeric (Mode 3) (S2 1O locations required to store an SO-column card) Eighty card columns are read and interpreted as Hollerith data, mapped into the corresponding 64-graphic subset of ASCII, and stored in the user's line buffer area as SO right-adjusted 7-bit characters, one per word, with leading zero bits. No editing takes place (except in the case of illegal punch combinations), and no terminator is added to the input line. When an illegal (non-Hollerith) punch combination is encountered on the card being read, the corresponding position in the caller's line buffer is set to contain a null (OO) character. In addition, the parity-error bit in the I ine buffer header is raised to indicate the condition. 2. Binary Input Modes a. Image Binary (Mode 1) (S2 10 locations required to store an SO-column card) Eighty card columns are read as 12-bit binary numbers and stored one per word in the caller's line buffer. The column data appears right-adjusted with leading zero bits. 7-35 b. lOPS Binary (Mode 0) (52 10 locations required to store 78 data columns) Seventy-eight card columns (columns 1 through 78) are read as 12-bit bytes and stored, 3 bytes in each 2-word group, in the caller's I ine buffer area. Punches appearing in columns 79 and 80 are ignored in this mode. Data punched on the card are taken to represent full 18-bit words, each divided into one 6-bit segment and one 12-bit segment. The high-order (leftmost) bit in each column appears in the 12-row of that column; the low-order bit is punched in the 9-row. The organization of words on the card is represented schematically in Figure 7-2. 123456789 12 0 ;;; "0 - -'" ... N '" u; 76 77 78 o N a> N ... <D a> ... 0 80 '" '" '" ;;; is ~ :: '" 4 79 N a> o N (1) 0 N a> 0 ;;; ;;; 6 N :; '" '" u; ;;; <D '" '" u; '" '" u; 8 a ... a, a ... ;;; 9 :: ()O ~ :: 0 ... ~ ~~~'~ HEADER PAIR Figure 7-2 DATA PAIR #1 DATA PAIR #2 DATA IGNORED PAIR#25 lOPS Binary Input Card Format The line header pair, punched in columns 1,2, and 3 of the card, consists of a header word (word 1) and a checksum word (word 2). Header word 1 (column 1; column 2, rows 12-3) includes the following data fields: Bit 0 (column 1, row 12): Ignore checksum indicator; may be punched. Bits 1 through 8 (column 1, rows 11 through 6): Word Pair Count; must be punched. The handler will halt data transfer upon fulfillment of (1) the word count in the .READ sequence, (2) the word pair count in the card, or (3) 52 10 words transferred, whichever occurs first. Bits 9 through 11 (column 1, rows 7 through 9): Rows 7 and 9 must be punched. 7-36 Bits 12 through 13 (column 2, rows 12-11): Validity Code. This field is ignored by the handler (except for checksum computation) and the punches appearing in it are not passed on to the caller. The handler sets this field in the user's line buffer as dictated by conditions resulting from the read request. Bits 14 through 17 (column 2, rows 0-3): Mode; this field may contain either no punches or punches in rows 0 and 3 to indicate logical end-of-file. If rows 0 and 3 are punched, columns 4 through 80 are ignored. Header word 2 (column 2, rows 4-9; column 3) includes only, in bits 0 through 17, the checksum word for the card. The checksum must be the 2's complement of the 18-b it unsigned, arithmetic sum of all the data word (columns 4 through 78) on the card and word 1 of the header. c. Dump (Mode 4) (52 10 locations required to store 78 data columns) Identical to lOPS Binary (2 .b) I except that no header pair appears on the card. C. Recoverable Errors 1. Reader Not Ready (Monitor Error Code 4) a. Hopper Empty b. Stacker Fu II c. Feed Check (may be hardware failure) d. Read Check (may be hardware failure) e. Reader not ready: (1) Stop button depressed. (2) Start button not depressed. (3) Validity check with validity button on. D. Unrecoverable Errors 1. Illegal Function (Monitor Error Code 6) a. .ENTER b. .CLEAR c. • WRITE d. • TRAN 7-37 2• III ega I Data Mode (Mon itor Error Code 7) a. CDA.: Not applicable; all modes are legal for this version. b. COB, CDC.: lOPS ASCII only is legal for these versions. A request for data trans- fer in any other mode results in an error return to the Monitor. E. Program Size 1. CDA. (All modes): Approximately 450 10 locations 2. COB. (lOPS ASCII only}: 411 10 locations. CDC. (lOPS ASCII only): Approximately 270 10 locations. 3. F. Program Descriptions Both CDA. and COB. utilize 80-word internal buffers for the temporary storage of column data as it is encountered; remapping in these two handlers is performed after all 80 columns have been read. This scheme guarantees protection against data loss resulting from the service requirements of other active I/o devices. CDC., on the other hand, remaps each column as it appears, thus doing away with the need for 80 words of temporary storage. There is some, though sl ight, possibil ity of data loss in the process, since the column data is presented at fixed time intervals which cannot be programspecified. If data loss does occur during reading, the checksum error indicator is set in the val idity fie Id of the header for the Iine in wh ich loss was detected. CDC. is designed for use with programs which have large core requirements but relatively low I/o rates (for example, FORTRAN 4, MACRO). Determination of the end of a card deck is performed as follows by CDA, CDB and CDC: on both the CR01E and CR02B, the presence of an EOF card (all l's in column 1) signals the handler that an EOM (End-of-Medium) condition exists. The handler appropriately returns an EOM header (1006 in word O) to the ca II i ng program. An alternative method exists on the CR02B. The EOF button, if depressed with the hopper empty, is interpreted as an EOM condition. Typically, as the end of a card deck is reached, assuming no EOF card, an lOPS 4 message is output to the Teletype. Depressing the EOF button on the card reader and striking tR on the Teletype signal the end of the card deck. 10K (DISK) A. Functions 1• • IN IT (a) Return standard line buffer size (255 10) (b) .SETUP - API channel register 478 7-38 (c) Set direction switch (input or output). NOTE In order to change transfer direction when operating in a file oriented environment, a new. IN IT must first be executed • 2. • OPER (.DLETE) (.RENAM) (.FSTAT) (a) • DLETE (1) Examines specified Directory for presence of desired file name. If not found, AC = 0 upon return to user. (2) Deletes file name (clears to 0) from the Directory of the specified un it. (3) Clears file bit map corresponding to deleted entry. (b) (4) Clears corresponding occupancy bits in Directory bit map. (5) Records modified Directory and file bit map block on specified unit. .RENAM (1) Examines specified Directory for presence of desired file name. If not found, AC = 0 upon return to user. (2) Changes file name in Directory to new one specified by user program (no change is made to first block pointers) • (3) (c) Records modified Directory on specified unit. .FSTAT (1) Examines specified Directory for presence of desired file name. If not found, AC = 0 upon return to user. If found, AC = first b lock number of fi Ie. Also, bits 0- 2 of CAL ADDRESS + 2 = 1 = Disk Directory type. (d) Other • OPE R codes are illega I • 3. .SEEK (a) Loads into core the Directory of the unit specified if the Directory is not already in core. (b) Checks for presence of named file. (Error return to Monitor if not found.) (c) Begins transfer of first block of file into handler buffer area, overlaying Directory Entry Section but not Directory Bit Map. (d) Declares unit to be file oriented. 7-39 4. .ENTER (a) Loads into core the Directory of the unit specified if the Directory is not already in core. (b) Checks for presence of named file. If present I pointer to that entry is saved for update at ~C LOSE time. If not present I empty slot is found for file name insertion at .CLOSE time. (c) Examine Directory Bit Map for free block and saves that block number for first transfer out and for insertion in Directory Entry Section at .CLOSE time. (d) 5. .CLEAR Dec lares unit to be fi Ie oriented. (a) Zero's out Fi Ie Bit Map blocks (71 through 77) on specified DISK unit. (b) Initializes DISK Directory block 100 to indicate that eight blocks (71 though 100) are occupied. 6. CLOSE (a) On input I clears internal program switches. On output I writes 2-cell EOF line as last line in output buffer (lOPS ASCII and binary only) and outputs last data buffer with the datd link = 777777. (b) Loads into core the file bit map corresponding to the Directory Entry in order to clear the Directory Bit Map of bits for blocks formerly occupied by this file. (c) Records newly constructed file bit map. (d) Loads Directory into memory I enters new entry and records Directory again with new entry and updated Directory Bit Map. (e) Clears internal program switches. 7. MT APE (REWIND) (BACKSPACE) (a) REWIND (1) Sets internal switches such that data transfer will begin at block O. (2) Declares the unit as non-file-oriented I i.e. I data will be recorded (starting at block 0) every fifth block. Five passes will record all 1100a blocks of a DISK unit. (b) BACKSPACE (1) Decrements the internal pointer to the next block to be transferred. (c) Other .MTAPE functions - ignored. 10. .READ (a) Input line from DISK handler buffer or block of data to user area. (See B below for data modes.) (b) Initiate input of next DiSK block when preceding block has been emptied. 7-40 11. .WRITE (a) Transfers line or block of data from user area to DISK handler buffer. (b) Outputs buffer when full, examining Directory Bit Map for free block number to store as Data link (word 3778 ) of current block output. B. C. 12. .WAIT Allow previous transfer to be completed before allowing user program to continue. 13. .TRAN Transfer (in or out) the number of words specified by the user's word count to/from the core area indicated in the. TRAN macro to/from the specific block{s) desired by the user. Data will be transferred to/from contiguous DISK blocks in the forward or reverse direction (also declared by the user). On input, transfer stops on word count overflow. On output, transfer also stops on word count overflow; however, if the word count is not equivalent to an integral number of DISK blocks, the remainder of the last block will be filled with zeros. Lega I Data Modes l. lOPS ASCII 2. lOPS Binary 3. Image Alphanumeric 4. Image Binary 5. Dump Unrecoverable Errors 1. Illegal Function Monitor Error Code 6 (a) See D below for illegal functions. 2. Illegal Data Mode Monitor Error Code 7 (a) .SEEK with .INIT for output (b) .ENTER with .INIT for input (c) See D be Iow for • READ, •WRITE i lIega I data modes. 3. File Still Active Monitor Error Code 10 (a) 4. 5. .SEEK, .ENTER Not Executed File Not Found .SEEK, .ENTER, .CLEAR or .OPER when last file has not been closed. Monitor Error Code 11 (a) .READ or .WRITE executed prior to .SEEK or .ENTER (or .MTAPE - REWIND). Monitor Error Code 13 (a) File name not found in Directory on a .SEEK. 7-41 6. 7. DISK Directory Full Monitor Error Code 14 (a) Directory Entry Section found full on an .ENTER Monitor Error Code 15 DISK Unit full (a) All DISK unit blocks occupied on a .WRITE 8. Output Buffer Overflow Monitor Error Code 16 (a) Output line (lOPS ASCII or Binary) greater than 255 '0 cells (inc luding header). (b) Output block (Image Binary or Image Alphanumeric greater than 255 '0 cells (excluding header). 9. 10. Excessive Number of Files Referenced Monitor Error Code 17 Disk Failure Monitor Error Code 20 See Section 0 for file reference limitations. (a) Disk hardware malfunction 1l. Illegal Disk Address Monitor Error Code 21 (a) Reference to protected track (b) Reference to nonexistent track 12. 13. 14. Two Output Files on Same Unit Illegal Word Pair Count (WPC) Monitor Error Code 22 (a) Two output files open simultaneously on the same unit. Monitor Error Code 23 (a) WPC = 0, or greater than 177 Illegal Disk Unit Monitor Error Code 27 (a) Attempt to reference disk unit 3 or 7 D. Subprogram Description and Size 1. DKA (which requires 2272 ,0 locations) DKA is the most general DISK handler issued with the PDP-9 ADVANCED Software System. DKA has a simultaneous 3-file capacity, either input or output. Files may be referenced on the same or different DISK units except that 2 or more output files may not be on the same unit. All data modes are handled as well as all lOPS functions (except .MTAPE). Three 256 ,0-word data buffers, three 32 ,0-word Directory Bit Maps and three 32 ,0-word File Bit Maps are included in the body of the handler. 2. DKB (which requires 1533 10 locations) DKB has a simultaneous 2-file capacity: one input; one output. Both files may be on the same or different units. DKB transfers data only in lOPS ASCII or lOPS binary data modes. Included in the handler is space for two 256 ,0-word data buffers, one 32 10word Directory Bit Map and one 32 1O-word File Bit Map. Functions included are: 7-42 .ENTER .CLOSE .INIT .SEEK 3. .READ .WRITE . WAIT DKC (which requires 645 10 locations) DKC is the most limited (and conservative in terms of core allocation) DISK handler in the PDP-9 ADVANCED Software System. DKC is a READ ONLY handler with a 1-file capacity requiring no space for bit maps and only one 256 10-word DISK data buffer to handle either lOPS ASCII or lOPS binary input (and no other). Functions included are .INIT .SEEK 4. .CLOSE .READ .WAIT DKD (which requires 1533 10 locations) DKD has full lOPS function capabilities; however, it allows for one and only one fi Ie reference, either input or output, at any given time. Sequential file references are permitted. All data modes are acceptable to DKD. One 256 10-word data buffer, one 32 10 -word Directory Bit Map and one 32 10 -word File Bit Map are included. DKD. is the only DISK handler which allows .MTAPE transfers. DR (DRUM) I A. Functions 1. .INIT (a) Return standard line buffer size (255 10). (b) .SETUP - API channel register 468 . (c) Set direction switch (input or output). NOTE In order to change transfer direction when operating in a file-oriented environment, a new .INIT must first be executed. 2. .OPER (. DLETE) (.RENAM) (.FSTAT) (a) .DLETE (1) Examines specified Directory for presence of desired fi Ie name. If not found, AC = 0 upon return to user. (2) Deletes file name (clears to 0) from the Directory of the specified unit. (3) Clears file bit map corresponding to deleted entry. (4) Clears corresponding occupancy bits in Directory bit map. 7-43 (5) Records modified Directory and file bit map block on specified unit. (b) .RENAM (1) Examines specified Directory for presence of desired file name. If not found, AC = 0 upon return to user. (2) Changes file name in Directory to new one specified by user program (no change is made to first block pointers) . (3) Records modified Directory on specified unit. (c) .FSTAT (1 ) Exami nes spec ifi ed Directory for presence of desi red file name. If not found, AC = 0 upon return to user. If found, AC = first block number of fi Ie. Also, bits o - 2 of CAL ADDRESS + 2 = 1 = Drum Directory type. (d) Other .OPER codes are illegal. 3. .SEEK (a) Loads into core the Directory of the unit specified if the Directory is not already in core. (b) Checks for presence of named file. (Error return to Monitor if not found.) (c) Begins transfer of first block of file into handler buffer area overlaying Directory Entry Section but not Directory Bit Map. (d) Declares unit to be file-oriented. 4. .ENTER (a) Loads into core the Directory of the unit specified if the Directory is not already in core. (b) Checks for presence of named file. If present, pointer to that entry is saved for update at .CLOSE time. If not present, empty slot is found for file name insertion at .CLOSE time. (c) Examines Directory Bit Map for free block and saves that block number for first transfer out and for insertion in Directory Entry Section at .CLOSE time. (d) Declares unit to be file oriented. 5. .CLEAR (a) Zero's out File Bit Map blocks (71 - 77) on specified Drum unit. (b) Initializes Drum Directory block 100 to indicate that eight blocks (71 - 100) are occupied. 6. CLOSE (a) On input, clears internal program switches. On output, writes 2-cell EOF line as last line in output buffer (lOPS ASCII and binary only) and outputs last data buffer with the data Ii nk = 777777 • 7-44 (b) Loads into core the file bit map corresponding to the Directory Entry in order to clear the Directory Bit Map of bits for blocks formerly occupied by this file. (c) Records newly constructed fi Ie bit map. (d) Loads Directory into memory, enters new entry and records Directory again with new entry and updated Directory Bit Map. (e) Clears internal program switches. 7. MTAPE (REWIND) (BACKSPACE) (a) REWIND (1) Sets internal switches such that data transfer will begin at block O. (2) (b) Declares the unit as non-fi Ie-oriented, i.e., data will be recorded (starting at block 0) every fifth block. Five passes will record all 11008 blocks of a Drum unit. BACKSPACE (1) Decrements the internal pointer to the next block to be transferred. (c) Other. MTAPE functions are ignored. 10. .READ (a) Input line from Drum handler buffer or block of data to user area. (See B below for data modes.) (b) Initiate input of next Drum block when preceding block has been emptied. 11. . WRITE (a) Transfers line or block of data from user area to Drum handler buffer. (b) Outputs buffer when full, examining Directory Bit Map for free block number to store as Data Link (word 3778) of current block output. 12. .WAIT Allow previous transfer to be completed before allowing user program to continue. 13. . TRAN Transfer (in or out) the number of words specified by the user's word count to/from the core area indicated in the •TRAN macro to/from the specifi c block(s) desired by the user. Data wi II be transferred to/from contiguous Drum blocks in the forward or reverse direction (also declared by the user). On input, transfer stops on word count overflow. On output, transfer also stops on word count overflow; however, if the word count is not equivalent to an integral number of Drum blocks, the remainder of the last block wi II be fi lied with Os. 7-45 B. Legal Data Modes 1. lOPS ASCII 2. lOPS Binary 3. Image Alphanumeric 4. Image Binary 5. Dump C. Unrecoverable Errors 1. Monitor Error Code 6 I"egal Function (a) See D below for i"egal functions 2• I" ega I Data Mode Monitor Error Code 7 (a) .SEEK with .INIT for output (b) .ENTER with .INIT for input (c) See D below for .READ, .WRITE i"egal data modes. 3. Monitor Error Code 10 File Still Active (a) 4. 5. .SEEK, .ENTER Not Executed File Not Found .SEEK, .ENTER, .CLEAR or .OPER when last file has not been closed. Monitor Error Code 11 (a) .READ or .WRITE executed prior to .SEEK or .ENTER (or .MTAPE - REWIND). Monitor Error Code 13 (a) File name not found in Directory on a .SEEK 6. 7. Drum Directory Fu" Drum Unit Fu" Monitor Error Code 14 (a) Directory Entry Section found full on an • ENTER Monitor Error Code 15 (a) A" Drum unit blocks occupied on a •WRITE 8• Output Buffer Overflow Monitor Error Code 16 (a) Output line (lOPS ASCII or Binary) greater than 255 10 cells (including header). (b) Output block (Image Binary or Image Alphanumeric greater than 255 10 cells (excluding header). 9. 10. Excessive Number of Files Referenced Illegal Drum Sector Address Monitor Error Code 17 See Section D for file reference limitations. Monitor Error Code 25 (a) Sector address greater than physi cal drum size. (b) For unit 1 or greater, sector address greater than 7778 11. Illegal Drum Size Monitor Error Code 35 7-46 (a) 12. 13. 14. Two Output Files on Same Unit Illegal Word Pair Count (WPC) Illegal Drum Unit .SCOM + 4, Bits 15 - 17, not set up (1-5) Monitor Error Code 22 (a) Two output files open simultaneously on the same unit. Monitor Error Code 23 (a) WPC = 0, or greater than 177 Mon i tor Error Code 26 (a) 32, 65 or 131K Drum: Unit #> 0 (b) 262K Drum: Unit #> 1 (c) 524K Drum: Unit #> 3 D. Subprogram Description and Size 1. DRA (which requires 2288 10 locations) DRA is the most general Drum handler issued with the PDP-9 ADVANCED Software System. DRA has a simultaneous 3-file capacity, either input or output. Files may be referenced on the same or different Drum units except that 2 or more output files may not be on the same unit. All data modes are handled as well as all lOPS functions (except .MTAPE). Three 256 10-word data buffers, three 32 10 -word Directory Bit Maps and three 32 1O-word File Bit Maps are included in the body of the handler. 2. DRB (which requires 1473 10 locations) DRB has a simultaneous 2-file capacity: one input, one output. Both files may be on the same or different units. DRB transfers data only in lOPS ASCII or lOPS binary data modes. Included in the handler is space for two 256 1O-word data buffers, one 32 10 word Directory Bit Map and one 32 10 -word File Bit Map. Functions included are .INIT .SEEK 3. .ENTER .CLOSE .READ •WRITE .WAIT DRC (which requires 601 10 locations) DRC is the most limited (and conservative in terms of core allocation) Drum handler in the PDP-9 ADVANCED Software System. DRC is a READ ONLY handler with a 1-file capacity requiring no space for bit maps and only one 256 1O-word Drum data buffer to handle either lOPS ASCII or lOPS binary input (and no other). Functions included are: .INIT .SEEK 4. .CLOSE .READ .WAIT DRD (which requires 1478 10 locations) DRD has full lOPS function capabilities; however, it allows for only one file-reference, either input or output I at any given time. Sequential file references are permitted. 7-47 All data modes are acceptable to DRD. One 256 10-word data buffer, one 32 1O-word Directory Bit Map and one 32 10-word File Bit Map are included. DRD. is the only Drum handler which allows .MTAPE transfers. IMT (MAGNETIC TAPE)/ A. Functions 1. .INIT (a) Return standard buffer size (255 10). (b) Call .SETUP - API Channel Register 458 • (c) Ensure that the referenced transport is not currently open for output transfers in the fi Ie-structured environment. If the drive is not open for writing or is non-file-structured, continue. If the drive is open for output and is fi Ie-structured, overlay the first block (header label) with a logical end-of-tape indicator. (d) Set transfer direction (input or output). (e) Indicate that the decision with respect to file-structuring has not been made. (f) If first .INIT to this unit, assign default parity, density, and track-count settings for this unit. Parity is odd, density is 800 BPI, and track-count is specified by bit 6 of .SCOM + 4 (0 = 7-channel, 1 = 9-channel). (g) Indi cate that the referenced drive is open for I/o transfers. 2. .OPER (.DLETE) (.RENAM) (.FSTAT) (a) .DLETE (1) Examine the directory on the referenced unit for a file of the name provided. If no file is found, return to the user with the AC = O. (2) If fi Ie is found, remove the name found from the Directory, zero the applicable accessibility bit, decrement the active fi Ie count, and re-record the Directory. (3) Return with the AC 10. (b) .RENAM (1) Search the Directory for an active file of the name given. If no fi Ie is found, return to the user with the AC = O. (2) If file is found, replace the Directory file name entry with the new fi Ie name and re-record the Directory. (3) Return with the AC 10. 7-48 (c) .FSTAT (1) Set bits 0 through 2 of CAL + 2 = 4. (2) Search Directory for a fi Ie of the name given. If no file is found, return with the AC = O. (3) If a file is found, return with the AC = relative position of the file on tape (1 through 3748 ). 3. .SEEK (a) Determine if the referenced unit is file-structured. If it is not, take error return (lOPS 7). If no decision has been made, declare the unit file-structured. (b) Ensure that no fil e is open on the referenced unit. Take error return (lOPS 10) if so. (c) Ensure that the referenced unit has been .INIT'ed for input. Take error return (lOPS 7) if not. (d) Search directory for a fi Ie of the name given. If no file is found, error return (lOPS 13) to Monitor. (e) Physically position the tape to read the first data block on the file. The handler-calculated file name must match the file name in the header label (lOPS 40 if not). (f) 4. .ENTER Indicate a file open for reading on the referenced unit. (a) Determine if the referenced unit is fi Ie-structured. If it is not, take error return (lOPS 7). If no decision has been made, declare the unit to be file-structured. (b) Ensure that no file is open on the referenced unit. Take error return (lOPS 10) if so. (c) Ensure that the referenced unit has been declared an output unit. Error return (lOPS 7) if not. (d) Ensure that space is available in the File Name Entry Section of the Directory for this file name. Take error return (lOPS 14) if not. (e) Ensure that space is available in the Accessibility Map for this file. Take error return (lOPS 42) if not. (f) 5. .CLEAR Indicate that a file is open for writing on the unit referenced. (a) Determine if the referenced unit is file-structured. If not, take error return (lOPS 7). If no decision has been made, declare the unit file-structured. (b) Rewind and write an empty File Directory at the front of the tape, along with a Logical End-of-Tape indicator. 6. .CLOSE (a) Input: Indicate that the referenced unit is no longer available for I/o transfers; return to caller. (b) Output: (1) Non-File-Structured Tape: Write two end-of-file markers, 7-49 then backspace one to position the recording head between the two EOF markers written. Indicate that unit is no longer open for I/o transfers, and return to caller. (2) File-Structured Tape 7. a. Write the partial data buffer, if one is present. b. Write trailer label and logical end-of-tape indicator. c. Search the File Directory for a name identical to that of the file being closed. If one is found, remove it from the directory and set its accessibility bit to zero. d. Add the new fi Ie name at the bottom of the Directory • e. Update total and active fi Ie counts. f. Re-record the Directory. g. Indicate that unit is no longer open for I/o transfers, and return to call er. .MTAPE (a) Determine whether unit if fi Ie-structured; if so, take error return (lOPS 7). If no decision has been made, declare unit non-fi Ie-structured. (b) Honor subfunction specification as follows: 00 Rewind: Issue rewind to drive specified. 01 Undefined: Error Return (lOPS 6). 02 Backspace Record: Issue a single backspace to the drive specified. 03 Backspace File: Backspace until two EOF markers have been passed in reverse, then space forward one record. 04 Write EOF: Write one EOF marker. 05 Space Forward Record: Issue a single space forward to the drive specified. 06 Space Forward File: Space forward until a single EOF marker is passed. 07 Space to Logical EOT: Space forward until two consecutive EOF markers are passed, then backspace one record. 10 through 17 Describe Tape Configuration: Update the tape format descriptor bits for the drive specified. Subsequent I/O transfers (including space) will be performed in the density, parity, and channel-count given in .MTAPE 1017, thus: 7-50 8. Subfunction Channel Count Parity Density 10 7 Even 200 BPI 11 7 Even 556 BPI 12 7 Even 800 BPI 13 7 Odd 200 BPI 14 7 Odd 556 BPI 15 7 Odd 800 BPI 16 9 Even 800 BPI 17 9 Odd 800 BPI .READ (a) Ensure that referenced unit is input. lOPS 7 if not. (b) Ensure that a file is open for reading or unit is non-filestructured. lOPS 11 if not. (c) Initiate data transfer as described in Section 5.9.4. (d) Read Errors (1) Parity/Checksum Errors - As described in Section 5.9.4. (2) EOF Encountered. a. File-Structured Environment. Modes 0 - 4: An EOF pseudo-line is constructed and stored in the user's Iine buffer area. The format of the 2-word line is as follows: Header word 0: 001005 Header word 1: 776773 Mode 5: Illegal in file-structured environment. b. Non-Fi Ie-Structured Envi ronment. Modes 0 - 3: An EOF pseudo-line is constructed and stored in the user's line buffer area. The format of the line is as follows: Header word 0: 001005 Header word 1: 776773 Data word 0: 000000 Data word 1: Unchanged Modes 4 - 5: No indication of End-of-File is currently provided. (3) EOT Encountered a. File-Structured Environment. Modes 0 - 4: An EOM pseudo-line is constructed and stored in the user's Iine buffer area. The format of the 2-word line is as follows: 7-51 Header word 0: 001006 Header word 1: 776772 Mode 5: Illegal in file-structured environment. b. Non-File-Structured Environment. Modes 0 - 3: Exactly as described for file-structured environment (3a above). Modes 4 - 5: Error return (lOPS 43). 9. .WRlTE (a) Ensure that referenced unit is output. lOPS 7 if not. (b) Ensure that a file is open for writing or that unit is non-filestructured. lOPS 11 if not. (c) Initiate data transfer as described in Section 5.9.4. (d) EaT: When physical End-of-Tape is encountered during writing, an error return (lOPS 15) is made to the Monitor. Before control is given to the Monitor, the fi Ie being written is added to the directory with the final two characters of the extension as "XX". (e) Write Errors: Continued attempts are made to rewrite the record in error. The process terminates when EaT is encountered. 10. .WAIT, .WAITR (a) Check I/o underway. 11. (1) Busy: Return to CAL (.WAIT) or to address in CAL+2 (.WAITR). (2) Non-Busy: Return to CAL+2 (.WAIT) or to CAL+3 (.WAITR). .TRAN Honor subfunction indicator as follows: o Input Forward: Transfer next physical block on tape directly to user's buffer area. Output Forward: Transfer directly from user's buffer to the next physi cal block on tape. 2, 3 B. Illegal; Take error return (lOPS 6) to Monitor. Lega I Data Modes Mode 0 lOPS Binary Mode 1 Image Binary Mode 2 lOPS ASCII Mode 3 Image Alphanumeric 7-52 Mode 4 Dump Mode 5 9-Channel Dump (Legal for 9-channel transports only) 1. lOPS Binary (Mode 0) (a) Output (1) File-Structured Tape An attempt is made to pack the binary line into a 2571O-word buffer internal to MTA. If the line will not fit, the current contents of the buffer are written and the line transmitted begins a new buffer. The line checksum is computed and stored in the second word of the Iine as it appears in MTA. 's buffer; the user's line-buffer checksum word is undisturbed. The buffer checksum (BCP word 2) is updated. Bits 12-13 in the user's line (in MTA.'s buffer) are set to 00. The maximum length of the line buffer, including the header pair, is 25410 words. The first word of the header is checked to ensure that the word-pair count is less than or equal to 1778 and greater than O. A word-pair count equal to zero or greater than 1778 results in an error return (lOPS 23) to the Monitor. (2) Non-File-Structured Tape A check is made to ensure that the word-pair count is greater than zero. A o count results in an immediate error return (lOPS 23) to the Monitor. No check is made on the upper limit of the word-pair count; anything from 13778 is legal. The checksum is computed and stored in the second word of the line in the user's line buffer area. Bits 12 - 13 of this first header word are set to zero. The count of words to write is taken from the word-pair count in the header and transfer from the user's area is initiated. (b) Input (1) File-Structured Tape The line ca II ed for is unpacked from a 257 1O -word buffer i nterna I to MT A. If the buffer was emptied by a previous .READ, or if this .READ is the first one, the buffer is refilled from the next physical block on tape. The line is stored in the user's line buffer area. Transmission from MTA. 's buffer stops when (a) the word-pair count in the input line or (b) the word count in the CAL sequence is satisfied, whichever occurs first. In either case, the next-line poi nter i ndi cates the true subsequent line. In case of buffer overflow, bits 12 and 13 of the first header word are raised. (If buffer overflow does occur, the untransmitted portion of the line is no longer available to the caller.) Whether buffer overflow occurs or not, the validity bits (12 - 13) of the first header word are modified as follows and in the order indi cated. First, the checksum for the line is calculated; if it is different from the transmitted checksum, bits 12 - 13 are set to 10. Next, a check is made for successful transfer of the entire block. In this context, "Successful Transfer" means (a) the block was read without hardware-detected error and (b) the block checksum (BCP Word 2) is correct. If transfer was unsuccessful, bits 12 - 13 are set to 01. 7-53 (2) Non-File-Structured Tape The count of words to transfer is taken from CAL sequence, and input is initiated from the next physical block on tape directly to the user's line-buffer area. When the read is complete, the line validity bits are modified under the following conditions and in the order indicated. First, bits 12 - 13 of header word 0 are set if buffer overflow occurred. Next, a checksum is calculated (only if buffer overflow did not occur) and compared with the checksum read. If the two checksums differ, bits 12 - 13 are set to 10. Finally, a check is made to ensure that the line was transferred without hardware-detected error. If an error occurred, bits 12 - 13 are set to 01. If no errors of the types described are encountered, bits 12 - 13 are unchanged. 2. Image Binary (Mode 1) - Handler activity is exactly as described for lOPS binary, above. Headers and data are transferred in both file-structured and non-file-structured modes. Modifications are limited to the checksum word and the validity field as outlined above. 3. lOPS ASCII (Mode 2) - Handler activity is exactly as described for lOPS Binary, above. 4. Image Alphanumeric (Mode 3) (a) File-Structured Tape Handler activity is exactly as described for lOPS binary, above. In the filestructured environment, headers and data are transferred and modifications, when applicable, are carried out only on the checksum word and validity field. (b) Non-File-Structured Tape Image Alphanumeric Mode in the non-fi Ie-structured environment is intended to provide the user with a facility for reading and writing on tape, the alphanumeric character codes of his choice. The Mode 3 line appears in core following a .READ and prior to a •WRITE as two header words and a number of data words as reflected by the word pair count. Only the data portion of the line is transmitted to or from the TCU, however. On output, the header pair is discarded before transfer begins; on input, the header pair is constructed when the read is complete. The method of transfer depends upon the characteristi cs of the tape unit referenced. If the unit is 7-channel, then full 18-bit words are transferred. Each of the three 6-bit bytes in the PDP-9 register occupies a single 7-bit frame on the tape. If the unit is 9-channel, then each of two 8-bit bytes (bits 2 - 9 and 10 - 17) occupies a single 9-bit frame. Only two frames (a total of 16 bits) are transferred to or from 9-channel tape. (1) Output The count of words (including the header pair) in the line to be written is taken from the first header word. Transfer is initiated directly from the user's line buffer, beginning at the first data word. 7-54 (2) Input The input block is read directly into the user's line buffer area, beginning at the address which is two greater than that given in the CAL sequence. The count given in the CAL sequence is interpreted as the maximum number, less two, of data words to read. When the transfer is complete, a header is constructed and stored in the line buffer. Possible errors include only buffer overflow (validity bits = 11) or parity error (validity bits = 01). 5. Dump (Mode 4) - Dump mode is used to read into or write from specified areas of core, under count control, without the need for line buffers. The action taken by MTA. in honoring dump-mode .READ's and .WRITE's is identical in both file-structured and nonfi Ie-structured environments. (a) Output Data are taken from the core area specified in the CAL sequence and stored starting in the next available place in MTA.'s buffer. When the buffer is filled, it is written out and transmission to the new buffer continues until the count in the CAL sequence is fulfilled. The partly-filled buffer, if one remains, is not written at the completion of the operation. Data are transferred in 255 1O -word increments. The dump mode buffer as written includes the BCP for a total block length on tape of 257 10 words. (b) Input Data are taken from the handler buffer and stored sequentially starting at the core location given in the CAL argument list. Transmission continues until the word count in the CAL sequence is satisfied. If the handler buffer is emptied in the process, it is refilled from the next physical block on tape. (c) Read/Write Errors There is presently no facility for indicating I/o errors to the caller while dump mode is being used. 6. 9-Channel Dump (Mode 5) - This mode, device-dependent for 9-channel magnetic tape, is designed to make use of all 8 data bits in each frame of tape, whereas all other modes except 9-channel Image Alphanumeric require three frames for each data word written. Transfers in Mode 5 require only two frames for each word stored. Only 16 bits of each PDP-9 word, however, are read from or written on tape. Word format for Mode 5 is shown below. Bit Position: Contents: o1 2 9 10 17 IIIII I III IIIII I P1 P2 7-55 DO Dl Parity Bits (PO, P1): Bits 0 and 1 of the PDP-9 word are used as parity bits for the two 8-bit data bytes (DO and D1), respectively, in the low-order portion of the register. During an output (write) transfer, these bits are ignored. The hardware generates the proper parity for each data frame. During an input (read) transfer, these bits are set to the actual parity values for the two data frames as read from tape. Data Bytes (DO, D1): Bits 2 - 9 and 10 - 17 hold values of two adjacent 8-bit frames. During reads and writes, DO is the first frame transferred. If a record containing an odd number of frames is read, the final frame is stored in DO; D 1 is set to binary Os. An even number of frames is always written during an output operation. Mode 5 transfers may be performed only in the non-fi Ie-structured environment on 9-channel tape. An attempt to read or write a file-structured 9-channel tape or any 7 -channe I tape causes an error return (IO PS 7) to the Mon i tor. Data are transferred directly between the user's buffer area and the control. No buffering or editing of any kind is performed by MTA. On output, the exact count of words to write is taken from the CAL sequence. On input, the count is interpreted as the maximum number of words to read. Each. WRITE results in exactly one physical block on tape; each. READ results in the input of one record (or as much of that record as wi II fit). There is presently no facility for indicating I/O errors to the caller while Mode 5 is being used. C. Recoverab Ie Errors 1. Transport not ready. lOPS 4 Resu Its From: (a) Write request with write lock. (b) Transport off line or not dialed up. (c) 9-Channel I/O request to 7-channel transport, and vice-versa. Remedy: (a) Ready the requested magnetic tape unit. (b) Type CONTROL R on the Teletype. D. Unrecoverable Errors 1. Illegal Function. lOPS 6 (a) Any file-structured request to a non-fi Ie-structured transport. (b) Any non-fi Ie-structured request to a file-structured transport. 7-56 (c) Input request to output unit; output request to input unit. (d) . TRAN with reverse direction specified. (e) Additional restrictions outlined below. 2. Illegal Data Mode lOPS 7 (a) Mode 5 transfer request to fi Ie-structured transport. (b) Additional restrictions outlined below. 3. File Still Active lOPS 10 .SEEK, .ENTER, .CLEAR, OR .OPER requested while a file is still open on the specified unit. 4. .SEEK/.ENTER Not Executed lOPS 11 Before a .SEEK/.ENTER is executed, a .READ/.WRITE is requested to a transport which has been declared file-structured. 5. EOT Encountered on Read lOPS 12 Physical End-of-Tape encountered during an input operation. 6. Fi Ie Not Found lOPS 13 During processing of .SEEK, the requested file name is absent from the File Name Entry Section of the specified Directory. 7. Directory Overflow lOPS 14 During processing of .ENTER, the File Name Entry Section of the Directory is discovered to be fu II . 8. EOT Encountered on Write lOPS 15 Physical End-of-Tape encountered during an output operation. 9. Output Buffer Overflow lOPS 16 lOPS ASCII or lOPS Binary line exceed 255 10 words (including header). 10. Too Many Files lOPS 17 An excessive number of fi les are concurrently referenced 11. Word Pair Count Error lOPS 23 During a transfer in lOPS ASCII or lOPS Binary data mode, the Word Pair Count is found to be Iess than 1 or greater than 1778 . 12. Header Label Error lOPS 40 During the processing of .SEEK, the handler-calculated file name is discovered to be different from that present in the file header label. 13. Accessibi Iity Map Overflow lOPS 42 During the processing of .ENTER, the Accessibility Map is found to be full. 7-57 14. Directory Recording Error lOPS 43 A write error is encountered during Directory recording. E. Handler Description 1. MTA. The most general of the magnetic tape handlers, MTA. allows concurrent reference to a maximum of three files, either input or output. All functions and data modes are honored. 2. MTB. MTB. is an input-output handler which allows concurrent reference to two files •• Transfers are honored only in lOPS ASCII and lOPS Binary data modes, and only the following functions are allowed: .INIT .SEEK .ENTER 3. •WAIT .WAITR .CLOSE .READ . WRITE MTC. Designed for input operations, MTC. is a read-only handler with the capacity for operating on a single file. Sequential file references are allowed. Transfers are honored only in lOPS ASCII and lOPS Binary data modes. Legal functions are limited to the following: .INIT .SEEK 4. . WAIT .WAITR .CLOSE .READ MTD. MTD. honors all lOPS functions and data modes. Only a single file however, may be open for transfers at any time. Sequential file references are permitted. 5. MTF. Designed for the user operating in the FORTRAN environment, MTF. offers functions and data modes limited to those required by the FORTRAN Object Time system. Data modes include only lOPS ASCII and lOPS Binary. The device is always considered non-file-structured. Functions honored include: .INIT .CLOSE .READ . WRITE .WAIT .WAITR .MTAPE Rewind • MT APE Backspace MTF. allows a maximum of eight concurrently-open transports. 7-58 APPENDIX A PDP-9 ASCII CHARACTER SET Listed below are the ASCII characters interpreted by the PDP-9 Keyboard Monitor and system programs as meaningful data input or as control characters. 00-37 40-77 100-137 140-177 ASCII CHAR. ASCII CHAR. ASCII CHAR. ASCII CHAR. 0 1 2 3 4 5 6 7 10 NUL SOH (tA) SP ETX (tC) # 11 HT LF VT FF CR + SI (t 0) DLE (t P) / 0 P DC2 (tR) DC3 (t S) DC4 (tT) NACK (t U) 0 1 2 3 4 5 6 7 CNCL (t X) 8 X 9 Y : Z 12 13 14 15 16 17 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 \ ! " S % & SS (t Z) ESC 0 1 2 3 4 5 6 7 10 A B C D E F I G ( ) * H I 11 J K L M N , - Q R S T U V W ESC ; < ESC = RS (t) > /\ or t ? +- delete (RO) 12 13 14 15 16 17 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 *Codes 33, 176, 175 are interpreted as ESC (ALT Mode) and are converted on input to code 175 by lOPS handlers. A-l APPENDIX B PDP-9 ASCII/HOLLERITH CORRESPONDENCE 44-77 *00-37 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 ASCII CHAR. ASCII CHAR. NUL SOH STX ETX EOT ENQ ACK BELL BS HT LF VT FF CR SO SI DLE DCl DC2 DC3 DC4 NACK SYNC ETB CNCL EM SS ESC FS CS RS US SP ! II # $ % & I ( ) * + , / 0 1 2 3 4 5 6 7 8 9 : ; < == > ? 100-137 HOLLERITH CHAR. ASCII CHAR. \ 11-2-8 7-8 3-8 11-3-8 0-4-8 12 5-8 12-5-8 11-5-8 11-4-8 12-6-8 0-3-8 11 12-3-8 0-1 0 1 2 3 4 5 6 7 8 9 2-8 11-6-8 12-4-8 6-8 0-6-8 0-7-8 A B C D E F G H I J K L M N 0 P Q R S T U V W X Y Z [ ~ ] /\ (under score) HOLLERITH CHAR. @ 4-8 12-1 12-2 12-3 12-4 12-5 12-6 12-7 12-8 12-9 11-1 11-2 11-3 11-4 11-5 11-6 11-7 11-8 11-9 0-2 0-3 0-4 0-5 0-6 0-7 0-8 0-9 c 12-2-8 11-7-8 t 0-2-8 12-7-8 0-5-8 *ASCII code 0-37 and 140-177 have no corresponding codes in the Hollerith set. B-1 140-177 ASCII CHAR. @ a b c d e f 9 h i i k I m n 0 p q r s t u v w x y z { ----, } I delete 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 20 21 22 23 24 25 26 27 30 31 32 33 34 35 36 37 APPENDIX C KEYBOARD AND BACKGROUND/FOREGROUND MONITOR ERRORS Explanation Errors WHAT? Unrecognizable command BAD DEV - IGNORED FROM ERR Illegal device reference, for example: A PRA 5 ,6/PPW7/DT A-5 where the command is processed and effective up to the PPW and the remainder of the command is ignored. BAD. OAT SLOT - IGNORED FROM ERR Illegal. OAT slot reference, for example: A PRA 5,6/PPA G where the command is processed and effective through A PRA 5,6 but ignored from there on. BAD PRGNAM Non-existent program name. Command ignored. PERMANENT. OAT SLOT - IGNORED FROM ERR Command attempted to assign a device handler to one of the permanent • OAT slots (-2, -3, or -7). BAD UNIT- IGNORED FROM ERR Illegal unit reference (e.g., DTAX) BAD START LOC Illegal address given in "GET n address" command. SYS DEV ERR - CHECK UNIT & TRY AGAIN Last command typed caused error condition on system device control. BAD COMMAND IN BATCH MODE Illegal Batch Processor commands: QDUMP, HALT, GET (all forms), BATCH, LOAD, DDT, or DDTNS. BAD BATCH DEV Batch devi ce was not designated properly. Should be: CD - for card reader PR - for paper tape reader $JOB command not terminated by space, carriage return, or ALT MODE. BAD $JOB COMMAND C-l APPENDIX D LINKING LOADER AND SYSTEM LOADER ERRORS The following error codes are output by the Linking Loader and by the System Loader. When output by the Linking Loader, the errors are identified as shown below. When output by the System Loader, the errors are identified as ".SYSLD n" instead of ".LOAD n." Error Meaning • LOAD 1 Memory overflow - the Loader's symbol table and the user IS program have overlapped. At this point the Loader memory map will show the addresses of all programs loaded successfully before the overflow. Increased use of COMMON storage may allow the program to be loaded as COMMON can overlay the Loader and its symbol table, since it is not loaded into until run time. • LOAD 2 Input data error - parity error, checksum error, illegal data code, or buffer overflow (input line bigger than Loader's buffer). · LOAD 3 Unresolved Globals - any programs or subroutines required but not found, whether called explicitly or implicitly, are indicated in the memory map with an address of 00000. If any of the entries in the memory map have a 00000 address, loading was not successful; the cause of trouble should be remedied and the procedure repeated. · LOAD 4 Illegal. DAT slot request - the. DAT slot requested was: a. Out of range of Iega I . DAT slot numbers, b. Zero, c. Unassigned, that is, was not set up at System Generation Time or (in the case of the Keyboard and Background/ Foreground Monitors) was not set up by an ASSIGN command. d. Or, in the Background/Foreground system, the BACKGROUND program requested a • DAT slot which called for an I/o handler and device number which conflicted with the FOREGROUND job's I/O. D-l APPENDIX E lOPS ERRORS Error Code Error Error Data Comments 0 Illegal Function CAL CAL address The address points to a CAL which did not have a legal function code (1 to 16) in bits 3 to 17 of the word after the CAL. CAL * illegal CAL address The instruction CAL * (Indirect) is an illegal Monitor CAL. 2 . DAT slot error CAL address l. The .DAT slot number in Bits 9 to 17 of the CAL was 0 I greater than 10, or less than -15. 2. The . DAT slot did not contain a handler address (no .IODEV was given for this .DAT slot) . 3 Illegal interrupt I/o status An interrupt occurred which did not have an active device handler associated with it. The contents of the 10RS word at the time of the interrupt is printed out. 4 Dev ice not ready (type control R when ready) 5 Illegal . SETUP CAL CAL address Use of .SETUP when appropriate skip not placed in skip chain at system generation time. 6 Illegal handler function CAL address A function (.READ,.WRITE, etc.) was issued to a handler which is incapable of performing that function (. READ to paper tape punch, . WRITE to C version of handler (Read only». 7 Illegal data mode CAL address l. Illegal data mode for this version of the handler used. 2. Use of input commands after device has been •I NITed for output. 10 File still active CAL address Failure to close a file before another seek or enter on the same . DAT slot. 11 SEEK/ENTER not executed CAL address A read or write was issued without a prior SEEK, ENTER, or MTAP command. 12 Unrecoverab Ie DECtape error DECtape status register Band Unit Number DECtape error with status register B in bits 0 to 11 and the unit # in bits 15 to 17. This error can occur whenever any not ready condition occurs. l. DECtape or MAGtape - unit not selected or not write enabled. 2. Punch - out paper tape 3. Li ne pri nter - off line 4. Card reader - off line, out of cards, stacks full, or card jam 5. Disk - massive failure 6. Drum - attempt to write on locked out area or non-existent track, timing errors. E-l Error Error Data 13 File not found CAL address The file name specified by the directory entry section {pointer to entry is in CAL address plus 2} was not found. 14 Directory full CAL address The directory entry section of the current device in use is fu II . 15 DECtape full CAL address All blocks available for file storage are currently full . 16 Output buffer overflow CAL address The word pair count on the current . WRITE is greater than 1778 , 17 Too many fi Ies for handler CAL address Too many files are currently open on the handler referenced by this CAL {e.g., 4 files on DTA will cause error while 2 files on DTD would cause same error}. 20 Disk failure Disk status register Disk failure with status register printed out. 21 Illegal disk address CAL address The CAL pointed to caused the disk control to reference an illegal or write protected address. 22 Two output files on one unit CAL address Two concurrent output files have been opened on one unit. 23 Illegal Word Pair Count Sector address The word pair count on the current input or output I ine equals zero or greater than 1778 , 24 339 Handler called without push down I ist set up CAL address An attempt was made to use the 339 handler without reserving an area for the push down list. 25 Illegal sector address CAL address The current read or write CAL caused an illegal drum sector address to be used. 26 Illegal Drum unit CAL address The unit number in bits 0 to 2 of the word following the CAL is illegal for the drum size specified in bits 15 to 77 of .SCOM + 4. 27 Illegal disk unit CAL address The unit number in bits 0 to 2 of the word after the CAL is 3 or 7 which are both non-existent on the Disk. 30 API software level error API status register An API break occurred to a software level which did not have the appropriate transfer vector set up in .SCOM + 12 to .SCOM + 15. 31 Non-existent memory reference Program counter Non-existent memory reference with protect mode on without a user defined violation routine. 32 Memory protect violation Program Counter Reference to a location below the memory protect boundary without a user defined violation routine. 33 Memory parity error Program counter Memory parity error without a user defined parity error routine. Error Code Comments E-2 Error Code Error Comments Error Data 34 Power fail with no skip setup Program counter Power low flag came up but a user defined routine to save appropriate registers not in core. 35 Illegal drum size CAL address of first .INIT Drum size in .SCOM + 4 (bits 15 to 17) is not 1 through 5. 40 Header label errors CAL address The internal header label for the currently opened file is incorrect. 42 Accessibility map overflow CAL address Too many fi les recorded on the current MAGtape. Copy the tape to retrieve storage occupied by unwanted fi les. 43 Directory recording error CAL address Directory cannot be recorded at the beginning of the tape - use the utility program to re-make the tape. E-3 APPENDIX F SYSTEM PROGRAM DISK AND DEC TAPE ADDRESSES Program Logical Block (8) ** Disk Track, Sector Number of Logical Blocks (8) KM-9 0 0,0 36 SGEN2 36 1,40 6 KM-9 SKIP BLOCK 44 1,64 UPDATE 45 1,68 KM-9 I/o BLOCK 55 2,20 SYSLD 56 2,24 11 EXECUTE 67 2,60 2 FI LE BIT MAPS 71 2,68 7 DIRECTORY 100 3,16 tQAREA 101 3,20 40-200* PATCH 652 21,24 5 EDIT 657 21,44 12 PIP 671 22,04 20 F4 711 22,68 31 MACRO 742 24,08 27 F4A 771 25,20 27 MACROA 1020 26,32 23 DUMP 1044 27,32 4 SGEN1 1050 27,48 14 CONY 1064 28,16 14 *Depends upon installation core size (8-32K). ** Appl ies to both DECtape and Disk. F-1 10 APPENDIX G SUMMARY OF KEYBOARD COMMANDS FOR KEYBOARD AND BACKGROUND/FOREGROUND MONITORS KEYBOARD MONITOR COMMANDS System Program Load Commands Command System Program Loaded F4 FORTRAN IV Compiler F4A Abbreviated FORTRAN IV Compiler MACRO MACRO-9 Assembler MACROA Abbreviated MACRO-9 Assembler PIP Peripheral Interchange Program EDIT Symbolic Text Editor CONV 7 -to-9 Converter LOAD Li nk i ng Loader GLOAD Linking Loader {set to load and go} DDT Dynamic Debugging Technique program DDTNS DDT program with no user symbol table UPDATE Library File Update program DUMP Program to dump saved area {see CTRL Q and QDUMP commands} PATCH System tape Patch program CHAIN Modified version of Linking Loader -- allows for chaining EXECUTE {E} Control program to load and execute chained programs SGEN System Generation program Special Function Commands Command Action LOG {or L} Can be followed by any comment and terminated by ALT MODE. SCOM {or S} Causes typeout of system configuration information, including available device handlers. API OFF Disables API. API ON Enables API. QDUMP {or Q} Conditions Monitor to dump memory on the "save area" of the system tape {or other system device medium if available} in the event of an unrecoverable lOPS error. G-l Action Command HALT {or H} Conditions the Monitor to halt in the event of an unrecoverable lOPS error. INSTRUCT {or I} Types list of Monitor commands. INSTRUCT (or I) ERRORS Types system error messages. REQUEST {or R} Types .DAT slot assignments and use: a. For system program when followed by system program name. Example: R DDT b. For all positive .DAT slots when followed by USER. Example: R USER c. For all .DAT slots when followed by carriage return. Example: R J ASSIGN {or A} DIRECT (or D) Allows reassignment of .DAT slots to devices other than those set at system generation time. Example: A PRA -10,3/PPA -6,4 n NEWDIR {or N} Lists the directory of DECtape mounted on unit n (0-7). n Writes empty directory on DECtape on unit n (units 1-7 only). GET {or G} n Restores core image from DECtape {or other system device medium if available} on unit n {0-7}. GET {or G} address n Restores core image from DECtape {or other system device medium if available} on unit n and restarts at specified address. GET {or G} n HALT {or H} CHANNEL (or C) 7/9 Restores core image from DECtape {or other system device medium if available} on unit n and halts. This command establishes whether the default condition for magnetic tape operation is to be 7-channel or 9-channe I. 339 {or 3} ON/OFF This command informs the Monitor whether or not a 339 handler is to be loaded. VC38 {or V} ON/OFF This command establishes whether a character display table for the VC38 option should be set up prior to loading any system or user program. Control Character Commands Command Echoes Action CTRL S t S Starts user program after loading by linking loader. CTRL C t C Returns to Monitor; may be used at anytime -resets all • DAT slot assignments. CTRL T t T a. Returns control to DDT if DDT is being used. b. Skips to next job when in Batch mode. G-2 Command Echoes Action CTRL R tR Allows program to continue after lOPS 4 message. CTRL P tP a. Reinitializes or restarts system program. b. Returns to location specified in user program's last .INIT referencing the Teletype. CTRL Q n tQ Saves core image on save area on DECtape (or other system device medium if available) mounted on unit n (may be system device) and returns to Monitor. CTRL U @ Cancels current line on Teletype (input or output). RUBOUT \ Cancels last character input from Teletype (not applicable with DDT). Batch Processor Commands Command Function BATCH (B) dv Enter Batch mode with dv as batch device; dv can be typed as PR, for paper tape reader, or CD, for card reader $JOB Used to separate jobs. $DATA Beginning of data -- all inputs up to $END are not echoed on the Teletype. $END End of data. $EXIT Leave Batch mode. NOTE The following commands are illegal when operating in Batch mode: QDUMP, HALT, GET (all forms), BATCH, LOAD, DDT, and DDTNS. Special Batch Processor control characters include the following: CTRL T (echoes t T) Skip to next job. CTRL C (echoes t C) Leave Batch mode. G-3 BACKGROUND/FOREGROUND MONITOR COMMANDS Function Command FILES Allows conservation of core space by indicating number of files open simultaneously. Normally typed prior to loading user programs so loader can allocate sufficient buffer space. xx = bulk storage device; n = number of files. xxn Example: $FILES DT3 FCORE n Used to define core requirements of FOREGROUND job prior to loading. n = octal number that represents number of lK increments required. Example: $FCORE 3 FCONTROL n Allows FOREGROUND Teletype assignment to be changed (while operating in FOREGROUND mode only). n = number of exte.·nal Teletype to be assigned to FOREGROUND. Example: $FCONTROL 2 BCONTROL n Allows BACKGROUND Teletype assignment to be changed (while operating in BACKGROUND mode only). The Teletype to be assigned must not currently be assigned to FOREGROUND. n = number of external Teletype to be assigned. Example: $BCONTROL 3 G-4 INDEX Advanced software, 1-1 Options, hardware, 6-6 API on/off command, 5-6 System macros, 3-12 ASCII character set, A-1 Batch processor, 5-26 ASCII/Hollerith correspondence, B-1 Commands, 5-26 ASSIGN command, 5-9 Device, 5-26 Assigning devices Background/Foreground Monitor, 6-9 I/o monitor, 4-8 Keyboard Mon itor, 5-19 .Block,4-1 Bootstrap loader, 4-4 Load ing Keyboard Mon itor, 5-13 Bulk storage systems, DECtape, 5-29, 7-29 Background/Foreground Monitor, 6-1 Disk, 5-32, 5-34, 7-38 Background processi ng, 6-1 Drum, 5-47, 7-43 Commands, 3-12 Magnetic Tape, 5-39, 5-44, 7-48 Device Assignments, 6-9 System Generation, 5-14 Foreground processi ng, 6-1 Functions, 6-1 CAL handler, 2-1, 2-3 Core and I/o protection, 6-4 Chain builder and execute program, 1-8 Job communication, 6-5 Channel registers, 7-2 Multi-unit device handlers, 6-4 Channel 7/9, 5-11 Processing time, 6-2 Checksum error, 2-6 Real time clock, 6-5 .Clear, 3-11 Software priority levels, 6-5 .Close, 3-5 Hardware requirements, 6-5 Keyboard commands, 6-7 Commands (system macros), 2-2, 3 Background/Foreground Monitor, 3-12 BCONTROL, 6-8 I/o Monitor, 3-1 FCONTROL, 6-7 Keyboard Monitor, 3-7 FCORE,6-7 Command processor, 2-2 FILES, 6-7 Control character commands, 5-12 Memory maps, 6-13, 18 CTRL S Operation, 6-8 CTRL C End of job, 6-11 CTRL T Loadi ng background program, 6-10 CTRL R Loading foreground program, 6-9 CTRL P Control character commands (Cont) Bootstrap (.DKSBT), 5-34 CTRL Q DECtape/Disk, 5-15 CTRL U File organization, 5-33 RUBOUT Handlers, 5-32, 7-38 CONV, (7-9 Converter) 1-7 Protection switches, 5-33 Core-to-core transfers, 6-5 System device, 5-33 CTRL Q, 5-7, 12 System generation, 5-37 System operation, 5-34 .DAT (Device Assignment Table) System Save/load from DECtape, 5-38 Background/Foreground Monitor, 6-9 Display handler, 5-11 I/o Monitor, 4-8 .Dlete, 3-10 Keyboard Monitor, 5-19 Drum Data modes, 2-8 File organization, 5-47 Data mode terminators, 2-11, 12 Handlers, 7-43 DDT, 1-6 DSKPTR, 5-32, 34 DECtape systems, 5-15 DSKSAV, 5-32 Fi Ie organization, 5-29 Dump mode, 2-10 Block, 5-29 Dump program, 1-8 Directory entry section, 5-30 Dynamic Debugging Technique (DDT), 1-6 File bit map blocks, 5-31 Staggered recording, 5-31 Device assignments Background/Foreground, 6-9 Editor, 1-6 .ENTER, 3-8 Error detection I/o Monitor, 4-8 Background/foreground, 6-12 Keyboard Monitor, 5-19 I/o monitor, 4-8 Device assignment table (.DAT), 2-1 2-3, 4, 2-12 lOPS, E-1 Keyboard monitor, 5-21 Background/Foreground Monitor, 6-9 • EXIT , 3-6 I/o Monitor, 4-8 Extension, file name, 5-30 Keyboard Monitor, 5-19 Device associations, 2-4 File name, 5-30 Direct command, 5-10 File-oriented DECtape, 5-29 Directory bit map, 5-30 Fortran IV comp i Ier, 1-5 Directory listing 5-29 Fresh directory, 5-31 Disk system, 5-32 •FSTAT , 3-9 Function code, 2-4 I/o call, 2-1 I/o control routine, 2-3, 4 General I/o communication, 2-1 .IODEVpseudo-op, 2-14 GET command, 5- 11 I/o device handlers, 2-5, 7-1 Acceptab Ie to system prog rams, 7-15 HAL T (or H) command, 5-7 Chain Builder, 7-20 Hardware READI N mode, 4-4 Chain Execute, 7-21 Hardware requirements DDT-9, 7-17 Background/Foreground, 1-2, 6-5 DUMP, 7-18 I/o Monitor, 1-1 EDIT-9,7-16 Keyboard monitor, 1-2 Fortran IV, 7-15 Header word 0, 2-6 Library Update, 7-19 Header word pair, 2-5, 7 Linking Loader, 7-17 Macro-9,7-16 IBM-compatible magnetic tape, 5-39 PIP,7-18 .IDLE, 3-15 System Generator, 7-18 .IDLEC, 3-15 System Patch, 7-20 Image modes, 2-10 7 -9 Converter, 7-19 Paper tape data, 2-11 .INIT, 3-2 Input/output monitor Commands, 3-1 Device assignments, 4-8 I/o device handlers (Special), 7-6 Skeleton I/o device handler, 7-9 Special I/o handler type AF1B A/D Converter, 7-11 Standard I/o handler features, 7-21 Errors, 4-9 CD (Card reader), 7-34 Functions, 4-1 DK (disk), 7-38 General description, 1-2 DT (DECtapes), 7-29 Loading DR (drum), 7-43 System programs, 4-3 LPA (647 Line Printer), 7-21 User programs, 4-4 MT (Magnetic Tape), 7-48 Memory maps, 4-5 PP (Paper Tape Punch), 7-26 Operati ng procedures, 4-3 PR (Paper Tape Reader), 7-27 Programming example, 4-1 TTA (TELETYPE), 7-23 I NSTRUCT command, 5-7 Interim disk system, 5-32 I/o bound, 6-2 I/o hardware, API software hand lers, 7-1 API software handlers, 7-4 Setting up API software level System macros, 3-7 channel registers, 7-4 System macro expansion, 5-1 Setting up skip chain/API, 7-2 Keyboard and Background/Foreground monitor Standard API channel/priority, 7-6 errors, C-1 I/o mode bits, 2-7 I/o Monitor . KLIST, 2-2 Description, 1-2,4-1 Library Update program, 1-8 System macros, 3-1 Line buffers, 2-2, 3, 5 lOPS (Input/Output Programming System) ASCII, 2-9 Header, 2-7 Structure, 2-6 ASCII, al phanumeri c data, 2-11 Linking Loader, 1-7, 2-13 Binary, 2-10 Loading lOPS errors, E-1 Monitor systems: Modes, 2-9 Background/Foreground, 6-9 Mode data, paper tape, 2-9 Input/Output, 4-3 Keyboard, 5-13 Keyboard Monitor, 5-1 System programs: Commands (system macros), 2-2, 3-7, 5-4 Background/Foreground systems, 6-10 Control character commands, 5-12 I/o Monitor systems, 4-3 Description, 1-3, 5-1 Keyboard Monitor systems, 5-20 Device assignments, 5-19 User programs: Errors, 5-21 Background/Foreground systems, 6-9, 10 Functions, 5-1 I/o Monitor systems, 4-4 Keyboard listener (. KLIST) and monitor Keyboard Monitor systems, 5-20 command Decoder (.MCD), 2-2, 3 Loading Log command, 5-5 Logical I/o devices, 2-1, 4, 12 Logical/physical I/o device association, 2-1,4 Keyboard Monitor, 5-13 System Programs, 5-20 Macro-9 Assembler, 1-5 User programs, 5-21 Magnetic tape systems, 5-39 Memory maps, 5-22, 23, 24, 25 Continuous operation, 5-46 Operating procedures, 5-13 Directory, 5-42 Programming example, 5-1 Accessibility map, 5-42 System bootstrap, 5-21 Active file count, 5-42 System loader, 5-20 Directory block, 5-43 Magnetic tape systems (Cont) Control routine, 2-3, 4 Name entry, 5-42 Environment, 2-1 Total fi Ie count, 5-42 Errors, 2-3, E-1 File identification and location, 5-42 Functions, 2-1 File organization, 5-40 I/o commands, 2-2, 4 Block checksum, 5-41 .MTAPE,3-11 Block control pair, 5-41 Multiple errors, 2-7 Block format, 5-41 Block word count, 5-41 Handler response to: Data-mode specifications, 7-53 NEWDIR, 5-10 Non-file-oriented DECtape, 5-29 Non-parity lOPS ASCII, 2-10 Function calls, 7-48 System Operation, 5-44 File labels, 5-44 Operating procedures Background/Foreground Monitor, 6-8 Data blocks, 5-45 I/o Monitor, 4-3 Header label, 5-45 Keyboard Monitor, 5-13 System program, 5-45 Disk system, 5-34 System startup, 5-45 trailer label, 5-45 User files Paper tape system skip chain, 7-14 Parity File names in labels, 5-44 Check, 2-9 Header label format, 5-44 Error, 2-6 Labels, 5-42 Patch program, 1-8 Maximum line buffer sizes, 2-8 PDP-9 advanced software, 1-1 . MCD (Monitor Command Decoder) 2-3 PDP-9 monitor system, 1-2 Memory maps PDP-7 to Macro-9 assembly Background/foreground, 6-13, 18 Language converter, 1-7 I/o monitor, 4-5, 7 Peripheral Interchange Program (PIP), 1-7 Keyboard monitor, 5-22, 25 Physical devices, 2-12 Monitor systems, 1-2 Call, 2-4 PIP, 1-7 Programming examples Command, 2-1 I/o Monitor, 4-1 Command decoder (.MCD), 2-2 Keyboard Monitor, 5-1 Commands (system macros), 2-3, 3-2 .READ, 3-2 ·REALR, 3-2 Time-shared environment, 6-1 Real-time input, 6-3 .TIMER, 3-5, 15 .REALW,3-13 . TITLE, 4-1 .RENAM, 3-9 .TRAN,3-1O Request command, 5-8 .RLXIT,3-17 Unit track correspondence, 5-33 Update Program, 1-8 SCaM command, 5-5 User program commands, 3-1 .SEEK, 3-7 .SETUP, 7-2 .WAIT,3-4 SGEN,5-14 .WAITR, 3-4 Skip chain, 5-14 .WRITE, 3-3 Special function commands, 5-5 Word count, 2-6, 7 Standard system tape, 5-14 Word pair count, 2-6 System bootstrap, 5-13 System communication, (.SCOM), 2-13 339 a N/OFF command, 5-11 System device, 5-13, 14 5/7 ASCII, 2-9, 10 System Disk/DECtape addresses, F-1 7-to-9 Converter, 1-7 System Generation DECtape/Disk system, 5-15 DECtape system, 5-15 Paper tape/Disk system, 5-18 System Generator, 1-7, 5-14 System macros (User program commands), 2-1, 2 Background/Foreground Monitor, 3-12 I/O Monitor, 3-1 Keyboard Monitor, 3-7 System macro expansions, 4-2, 5-3 System Patch program, 1-8 System programs, 1-4 System program load commands, 5-4 System tables, 2-12 System tapes, 5-13, 14 Text editor program, 1-6 HOW TO OBTAIN REVISIONS AND CORRECTIONS Notification of changes and revisions to currently available Digital software and of new software manuals is available from the DEC Program Library for the PDP-5, 8, 8/S, 8/I, 8/L, LINC-8, the PDP-4, 7, and 9 is currently published in DECUSCOPE, the magazine of the Digital Equipment Computer User's Society (DECUS). This information appears in a section of DECUSCOPE called "Digital Small Computer News". Revised software products and documents are shipped only after the Program Library rec ei ves a spec i fi c req uest from a user. DECUSCOPE is distributed periodically to both DECUS members and to non-members who request it. If you are not now receiving this information, you are urged to return the request form below so that your name will be placed on the mailing list. r -l I. To: Decus Office, Digita I Equi pment Corporati on, Maynard, Mass. 01754 o Please send DECUS installation membership information. o Please send DECUS individual membership information. o Please add my name to the DECUSCOPE non-member mai ling list. Name __________________________________ Company _______________________________ Address _____________________________ (Zip Code) PDP-9 ADVANCED SOFTWARE SYSTEM MONITORS DEC-9 A-MADO-D READER'S COMMENTS Digital Equipment Corporation maintains a continuous effort to improve the quality and usefulness of its publications. To do this effectively, we need user feedback: your critical evaluation of this manual and the DEC products described. Please comment on this publication. For example, in your judgment, is it complete, accurate, well-organized, wellwritten, usable, etc? Did you find this manual easy to use? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ What is the most serious fault in this manual? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ What single feature did you like best in this manual? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ Did you find errors in this manual? Please describe. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ Please describe your position. _ _ _._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ Name _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ OrganizationL--._ _ _ _ _ _ _ _ _ _ _ _ _- - - - StreetL_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ State _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Zip'------- •.......•................................................................................ Fold Here ......................................................................................... . ............................................................................ Do Not Tear - Fold Here and Staple ................................................................ . FIRST CLASS PERMIT NO. 33 MAYNARD, MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will be paid by: mamaama Digital Equipment Corporation Software Quality Control Building 12 146 Main Street Maynard, Mass. 01754 DIGITAL EQUIPMENT CORPORATION 0 MAYNARD. MASSACHUSETTS
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies