Digital PDFs
Documents
Guest
Register
Log In
DEC-S8-OSSMB-A-D
May 1974
127 pages
Original
4.8MB
view
download
Document:
OS8 v3ssup
Order Number:
DEC-S8-OSSMB-A-D
Revision:
Pages:
127
Original Filename:
http://bitsavers.org/pdf/dec/pdp8/os8/DEC-S8-OSSMB-A-D_OS8_v3ssup.pdf
OCR Text
so~ware support manual digital equipment corporation OS/8 SOFTWARE SUPPORT ~mNUAL (Version 3) DEC-S8-0SSMB-A-D Order additional copies as:directed on the Software Information page at the back of this document. digital equip.ment corporation · maynard. massachusetts First Printing, January 1973 Revised, June 1974 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this manual. The software described in this document is furnished to the purchaser under a license for use on a single computer system and can be copied (with inclusion of DIGITAL's copyright notice) only for use in such system, except as may otherwise be provided in writing by DIGITAL. Digital Equipment Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by DIGITAL. Copyright ~ 1973, 1974 by Digital Equipment Corporation The HOW TO OBTAIN SOFTWARE INFORMATION page, located at the back of this document, explains the various services available to DIGITAL software users. The postage prepaid READER'S COMMENTS form on the last page of this document requests the user's critical evaluation to assist us in preparing future documentation. The following are trademarks of Digital Equipment Corporation: COP COMPUTER LAB COMSYST COMTEX DDT DEC DECCOMM DECTAPE DIBOL DIGITAL DNC EDGRIN EDUSYSTEM FLIP CHIP FOCAL GLC-8 IDAC IDACS INDAC KAlD LAB-8 LAB-8/e LAB-K OMNIBUS OS/8 PDP PHA PS/8 QUICKPOINT RAO-8 RSTS RSX RTM RT-ll SABR TYPESET 8 UNIBUS PREFACE The 8K Operating System (05/8) is an extremely powerful program development system. 05/8 greatly expands the capabilities of any 8K pop-a, 8/I, 8/L, 8/E, or PDP-l2 computer having the necessary disk or DECtape storage. Use of 05/8, is described in detail in the 05/8 HANDBOOK (DEC-S8-0SHBA-A-D). This manual covers a wide range of advanced topics pertinent to the experienced user. In Chapter I the various basic system concepts are described and terms are defined. Chapter 2 explains the process by which user programs call upon the system for the performance of important operations including loading device handlers, opening and closing files, and chaining to other programs. Chapter 3 covers the functions of the Command Decoder and the means by which the user program can employ its services. Chapter 4 explains the use and operation of the device handlers in detail. Chapter 5 covers the details of "custom tailoring" a system, including how to write a device handler for a non-standard device. Technical information, intended to er"~~~ce the information in the OS/8 HANDBOOK, as well as this manual, can be found in t~e Appendices. Appendix A details the 05/8 directory structure and g1ves standard file format. Appendix B describes the system data base and gives the layouts of the system areas. Appendix C gives a complete list of system error messages. Appendix D illustrates some useful advanced techniques and programming "tricksn for use with the 05/8 system. Appendix E is a complete list of the standard ASCII character codes meaningful to 05/8. Finally, Appendix F describes a set of generalized Tin _,... .. +0; "".00'" i=,..._ ""'.0 "10..44........... .... ~.o_ +-ho ,.,\,&w ..... . . . . ...... nC ....,.." 10. .,."p.,.+-o", ., U .... 1W1i;;J . . ....,... .....w~ V iii ~~ IIWII '-,.... ........ ,.....,f"""\' .. ~":"',~~c:: "'-v ............... ~ .... ~ Page OS/8 CONCEPTS ;'':rD TERMINOLOGY 1-1 1.1 SOFTWARE COMPO~~ENTS OF OS/8 1-1 l..-' FILES 1-2 1.2.1 1.2.2 1.2.3 1.2.4 File Names and Extensions 1-2 1-2 1-3 CHAPTER 1 File Structured Devices File Types File Directories and Additional Information Words 1-3 1.3 1.3.1 1.3.2 1.3.3 CORE CONTROL BLOCK Program Starti~g Address Job Status Word. Software Core Size 1-4 1-4 1-5 1-6 1.4 DEVICE ~AMES ;'.~':D DEVICE NUMBERS 1-6 1.5 THE DEVICE AND FILENAME PSEUDO-OPS 1-7 USER SERVICE ROUTINE 2-1 2.1 2.1.1 2.1.2 CALLING THE USR Standard USR Call Direct and Indirect Calling Sequence 2-1 2-1 2-2 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.2.10 2.2.11 SUMMARY OF USR FUNCTIONS FETCH Device Handler LOOKUP Permanent File ENTER Output (Tentative) File The CLOSE Function Call Command Decoder (DECODE) CHAIN Function Signal User Error Lock USR in Core (USRIN) Dismiss USR from Core (USROUT) Ascertain Device Information (INQUIRE) RESET System Tables 2-3 2-4 2-5 2-6 2-8 2-9 2-10 2-11 2-12 2-12 2-13 2-14 THE COMMAND DECODER 3-1 3.1 COMMAND DECODER CONVENTION 3-1 3.2 COMMAND DECODER ERROR MESSAGES 3-3 3.3 CALLING THE COMMAND DECODER 3-3 3.4 3.4.1 3.4.2 3.4.3 3.4.4 COMMAND DECODER TABLES Output Files Input Files Command Decoder Option Table Example 3-4 3-4 3-5 3-6 3-7 CHAPTER 2 CHAPTER 3 v Page SPECIAL HODE OF THE COMMAND DECODER Calling the Command Decoder Special Mode Operation of the Command Decoder in Special Mode 3-9 3.6 CCL AND THE COMMAND DECODER 3-10 3.7 USEFUL LOCATIONS IN BATCH 3-10 3.8 CCL TABLES 3-10 USING DEVICE HANDLERS 4-1 4.1 CALLING DEVICE HANDLERS 4-1 4.2 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.S 4.2.9 4.2.10 DEVICE DEPENDENT OPERATIONS Teletype (TTY) High-Speed Paper Tape Reader (PTR) High-Speed Paper Tape Punch (PTP) Line Printer (LPT) Cassettes Card Reader (CDR) TMSE Handler File Structured Devices TDSE DEC tape KL8E Teletype Handler 4-4 4-4 4-4 4-5 4-5 4-6 4-7 4-8 4-11 4-11 4-12 RECONFIGURING THE OS/S SYSTEM 5-1 5.1 WRITING DEVICE HANDLERS 5-1 5.2 INSERTING DEVICE HANDLERS INTO OS/8 5-5 OS/8 FILE STRUCTURES A-I A.l A.l.l A.l.2 A.l.3 FILE DIRECTORIES Directory Entries Number and Size of OS/S Files Sample Directory A-I A-2 A-3 A-3 A.2 A.2.1 A.2.2 FILE FORMATS ASCII and Binary Files Core Image (.SV format) Files Relocatable FORTRAN Library File A-4 A-4 A-5 A-7 DETAILED LAYOUT OF THE SYSTEM B-1 B.l LAYOUT OF THE SYSTEM DEVICE B-1 B.2 LAYOUT OF THE 05/8 RESIDENT PROGRAM B-2 B.3 B.3.1 B.3.2 B.3.3 B.3.4 B.3.5 B.3.6 SYSTEM DEVICE TABLES Permanent Device Name Table User Device Name Table Device Handler Residency Table Device Handler Information Table Device Control Word Table Device Length Table B-4 B-4 B-4 B-5 B-5 B-6 B-7 3.5 3.5.1 3.5.2 CHAPTER 4 4.2.2 CHAPTER 5 APPENDIX A A. 2. 3 APPENDIX B vi 3-8 3-9 Page SYSTEM ERROR CCXDITIONS AND MESSAGES C-l C.l SYSTEM HALTS C-1 C.2 USR ERRORS C-2 KEYBOARD MONITOR ERRORS C-3 C.4 CCL ERROR MESSAGES C-4 C.5 COMMAND DECODER ERRORS C-7 PROGRAMMING NOTES 0-1 D.l THE DEFAULT FILE STORAGE DEVICE, DSK D-l D.2 MODIFICATION TO CARD READER HANDLER D-2 D.3 SUPPRESSION OF CARRIAGE RETURN/LINE FEED IN FORTRAN D-4 ACCESSING THE SYSTEM DATE IN A FORTRAN PROGRAM 0-4 DETERMINING CORE SIZE ON PDP-8 FAMILY COMPUTERS 0-5 USING PRTC12-F TO CONVERT OS/8 DECTAPES TO OS/12 LINCTAPES 0-6 0.7 0.7.1 0.7.2 NOTES ON LOADING DEVICE HANDLERS Problem with Multiple Input Files Dynamically Loading Device Handlers 0-7 0-7 D-7 0.8 AVAILABLE LOCATIONS IN THE USR AREA 0-8 D.9 ACCESSING ADDITIONAL INFORMATION WORDS IN OS/8 After a LOOKUP or ENTER After a CLOSE Rewriting the Current Directory Segment 0-9 0-9 D-9 D-9 APPENDIX C APPENDIX D 0.4 0.5 0.6 D.9.l D.9.2 D.9.3 D.10 D.10.l D.10.2 SABR PROGRAMMING NOTES Optimizing SABR Code Calling the USR and Device Handler's from SABR Code 0-12 APPENDIX E CHARACTER CODES AND CONVENTIONS E-l APPENDIX F OS/8 INPUT/OUTPUT ROUTINES F-1 F.l GENERAL DESCRIPTION F-1 F.2 SUBROUTINE FUNCTIONS F-1 F.3 F.3.l SUBROUTINE PARAMETERS Example Subroutine Listing F-3 F-3 F-5 F.3.2 vii D-10 D-IO CHAPTER 1 OS/8 CONCEPTS AND TERMINOLOGY Before examining the details of the OS/8 system, the reader should first be familiar with the simpler techniques and terms used within the framework of the OS/8 system. The material in this chapter, along with that contained in the OS/8 HANDBOOK, provides the tools needed to pursue the later chapters. 1.1 SOFTWARE COMPONENTS OF OS/8 There are four main components of the OS/8 system: 1. The Keyboard Monitor performs commands specified by the user at the keyboard console. The nine Keyboard Monitor commands (ASSIGN, DEASSIGN, GET, SAVE, ODT, RUN, R, START, and DATE) are explained in Chapter 1 of the OS/8 HANDBOOK. User programs can exit to the Keyboard Monitor by executing a to location 7600 in field 0. All JMPs to 7600 must be made with the DATA FIELD set to zero. This saves the contents of locations 0000 to 1777 in field 0 and loads the Keyboard Monitor which could be called by a JMP to location 7605 in field O. In this latter case the contents of core are not saved, which conserves some time. JMP Existing system programs, device handlers, and the Command Decoder test for the CTRL/C character in the terminal input buffer and~ on finding this character, abort the current operation and perform a JMP to 7600 in field O. Thus, typing CTRL/C is the conventional method of calling the Keyboard Monitor from the console. 2. Device handlers, which are subroutines for performing all device-oriented input/output operations, can be utilized by any program. These subroutines have standard calling sequences and "mask" from the user program the special characteristics of the I/O device. In this way, device independent I/O is achieved. A detailed description of device handlers is found in Chapter 4. 3. The User Service Routine (USR) is to a program what the Keyboard Monitor is to the user. For example, programs can request the USR to fetch device handlers, perform file operations on any device, chain to another program, or call the Command Decoder. A full description of the USR functions is found in Chapter 2. 1-1 1.2 4. The Command Decoder interprets a command line typed by the user to indicate input and output files and various options. The command line format is described in detail in Chapter 1 of the OS/8 HANDBOOK. The Command Decoder removes the burden of this repetitive operation from the userls program. A full description of the Command Decoder's function is found in Chapter 3. 5. Two other components, ABSLDR and ODT, are not logically part of the 05/8 system. However, in the sources and listings, ABSLDR is combined with the Keyboard Monitor and USR. ODT is combined with the command decoder. FILES Files are basic units of the 05/8 system, and a thorough understanding of file structure is required for its use. A file is any collection of data to be treated as a unit. The format of this data is unimportant; for example, 05/8 can manipulate several standard formats, including ASCII files, binary files, and core image files. The important consideration is that the data forms a single unit within the system. 1.2.1 File Names and Extensions individual file is identified by its file name and extension. The file name consists of up to six alphanumeric characters, optionally followed by a two character extension. The extension is often used to clarify the format of the data within the file. For example, an ASCII file used as input to PAL8 might be given a PA extension, while a core image file has a SV extension. An 1.2.2 File Structured Devices Devices that can be logically divided into a number of 256-word blocks and have the ability to read and write from any desired block are called file structured devices. Disks and DECtapes are file structured devices while a paper tape reader or terminal is not. Cassettes and magnetic tapes form an intermediate case. They may be treated directly as non-file structured devices, or the program MCPIP may appear to be file structured. The system device (SYS) in any 05/8 system is always file as is the default storage device, DSK. structured, All 05/8 file structured devices must be logically divided into these 256-word blocks. Hence, 256 words is considered the standard 05/8 block size. Some devices, like RK8, DECtape, and LINCtape, are physically divided into blocks. These physical blocks should not be confused with the logical 256-word blocks. For example, DECtapes must be formatted with standard 129-word physical blocks. A logical 05/8 1-2 block consists of the first 128 words of two consecutive physical DECtape blocks. The 129th word of every DECtape block is not used by OS/8. Similarly, LINCtapes are formatted with 129 (or 128) words per block but never 256, as this format is unacceptable to OS/8. A given OS/8 file consists of one or more sequential blocks of 256 words each (consecutively numbered). A minimum of one block per file is required, although a single file could occupy all of the blocks on a device. 1.2.3 File Types Three different types of files exist in the OS/8 system: 1. An "empty file" is a contiguous area of unused blocks. files are created when permanent files are deleted. Empty 2. A "tentative file" is a file that is open to accept output and has not yet been closed. Only one tentative file can be open on any single device at one time. 3. i.'\ "permanent file" is a file that has been given a fixed size and is no longer expandable. A tentative file becomes permanent when it is closed. To further understand file types, consider what occurs when a file is created. Normally, the User Service Routine, in creating a tentative file, first locates the largest empty file available and creates a tentative file in ~~at space. This establishes the maxim~Ti space into which the file can expand. The user program then writes data into the tentative file. At the end of the data, the program calls the USR to close the tentative file, making it a permanent file. The USR does so and allocates whatever space remains on the end of the tentative file to a new, smaller, empty file. 1.2.4 File Directories ~~d Additional Information Words To maintain records of the files on a device, 05/8 allocates blocks 1 through 6 of each file structured device as the file directory. Entries in this directory inform the system of the name, size, and location of each file, including all empty files and the tentative file, if one exists. For a detailed description of the entries in the file directory, see Appendix A. Each entry in a directory can, optionally, have extra storage words called Additional Information Words. The number of Additional Information Words is determined at the time the directory is initially created (normally by using the /S or /Z features of PIP: see Chapter 1 of the 05/8 HANDBOOK. Whenever Additional Information Words are used, the first one for each file entry is used to store the value of the System Date Word at the time the file was created. OS/8 automatically uses one extra word per entry for the date. This value is set by executing a DATE command 1-3 (see Chapter 1 of the OS/8 HANDBOOK) which codes the current date into memory location 07666 in the follow~ng format: 89 34 11 YEAR-1970 (0-7 ) A date word of 0 implies that no DATE command has been executed the system initialization. since The values of Additional Information Words beyond the first are user-defined. See Appendix 0 for further information on Additional Information Words. 1.3 CORE CONTROL BLOCK Associated with each core image -file (SV file) is a block of data called the Core Control Block. The Core Control Block is a table of information containing the program's starting address, areas of core into which the program is loaded, and the program's Job Status Word. The Core Control Block is created at the time the program is loaded by ABSLDR or other means and is written onto the SV file by the SAVE operation. More information on the Core Control Block can be found in the description of core image files in section A.2.2. Note that specifying arguments to the SAVE command as described in Chapter 1 of the 05/8 HANDBOOK, can alter the contents of the target program's Core Control Block. When a program is loaded, the starting address and Job Status Word are read from the Core Control Block and saved in core. The Core Control Block itself is saved in the last 200 (octal) words of block 37 on the system device unless the program was loaded with the R (rather than GET or RUN) command. 1.3.1 program Starting Address The current starting address (used by the START command) is stored in two words at locations 07744 and 07745. The format of these words is: LOCATION CONTENTS 07744 62n3 n is the field in which to start. 07745 nnnn Starting address of the program. NOTES 1-4 1.3.2 Job Status I''';ord that affect OS/8 The Job Status ~';ord contains certain flags operations, sucn as ~vhether :.:) save core when loading the USR or The Job Status ~ord for the program currently in Command Decoder. at location 07746 and contains the following core is saved information: Bit Condition Bit a =1 Meaning File does not load into locations rot' ...... .., U 1. ! ! ! = 00000 File does not load into locations to ~1777. ~OOOO .1. _ _ 'Co Bit 1 =1 Bit 2 = 1 Program must be reloaded before be restarted. Bit 3 1 Program does not destroy the contents of the highest existing memory field, an optimization for the Batch system. Bits 4 t.~ru Bit 10 =1 Locations 00000 to 01777 need not be saved when calling the Command Decoder. Bit 11 =1 Locations 10000 to 11777 need saved when calling the USR. 9 it can Reserved for future use. not be When bit 2 of the Job status Word is 1, any attempt to perform a START (without an explicit address) results in a NO! ! error message being printed. As this bit is always zero in the Core Control Block, the user program is expected to internally set this bit (in location 7746) if a program is not restartable. This could be done as follows: COP a TAD I (7746 /LOAD JOB STATUS WORD AND (6777 TAD (1000 DCA I (7746 /JOB IS NOT RESTARTABLE The Job Status Word can be updated from the user's program or with the ABSLDR /P option, thus providing optimization of tape (disk) motion. More information on the Core Control Block can be found in the description of Core Image (SV) files found in Appendix A. Bit 3 of the JSW (Job Status Word) is used as an optimization for the Batch operating system. If a program can never cause the highest existing memory field to be altered, this bit should be set. For example, EDIT, PIP, FORT, and SABR can never use memory above 8K. Thus, they should set bit 3 of the JSW. Programs such as ABSLDR, 1-5 LOADER, PAL8 and CREF can alter all of core. They should perhaps not have bit 3 on. Note that the more core that exists, the more unlikely it is that a program will destroy upper core. Thus, on 28K systems, only the largest FORT~~ programs can alter field 6 and, in general, bit 3 should be set. 1.3.3 Software Core Size Location 07777 contains the software core size in bits 6-8. This represents the highest memory field available for use by OS/8. If bits 6-8 contain 0, all of the available memory is used. Most OS/8 cusps interrogate this word to determine how much memory is available. The other bits of this location are reserved for use by BATCH and should not be touched by user programs. 1.4 DEVICE NAMES AND DEVICE NUMBERS The OS/8 system can accommodate up to 15 separate devices. In Chapter 1 of the OS/8 HANDBOOK the reader is introduced to the concept of device names. Briefly, each device on the system is recognized by either a permanent device name (such as PTR or DTAI) which is created when the system is built, or a user-defined device name determined by an ASSIGN command. The system insures that the user-defined device name takes precedence. For example • • ASSIGN DSK DTA4 causes all future references to DTA4 to address the device DSK. In calling the User Service Routine, a device can be alternatively recognized by a device number. Each device on the system has a unique predefined number in the range 1 to 17 (octal) assigned at the time the system is generated. Thus, user programs have the choice of referring to a device by either name or number. Referencing a device by name is preferable, as it maintains device independence for the program. Accessing devices by number should be done only when the appropriate number has been obtained from a USR INQUIRE CALL. Except for SYS and DSK, the OS/8 peripherals do not have fixed numbers; instead, device numbers vary whenever BUILD is used to modify a system. Thus, it is suggested that reference by name be used whenever possible. To determine whether a device name is recognized in the system, attempt to ASSIGN that device. For example, to determine whether LINCtape handlers are called LTA or DTA, perform: • DEASSIGN .AS LTAO If the system responds with a dot (.), LTAO does indeed exist. system responds with: 1-6 If the LTAO :';OT AVAIL.iillLE no device named 1.5 L~AO is present. THE DEVICE fu'lD FILENAME PSEUDO-OPS Several of the USR functions take device names or file names as arguments. To simplify the task of generating these arguments, the DEVICE and FILENAME pseudo-ops have been added to the PAL8 Assembler. A device name consists of a two word block, containing four alphanumeric characters in six-bit ASCII format. A block in this format can be created by the DEVICE pseudo-op as follows: DEVICE DTAI generates the following two words: 0424 0161 Similarly, the FILENAME pseudo-op creates a four word block, the first three words of which contain the file name and the fourth word of which contains the file extension. For example: FILENAME PIP.SV generates the following four words: 2011 2000 0000 2326 Note that positions for characters 4 through 6 are filled with zeros. The DEVICE and FILENAME following chapters. pseudo-ops 1-7 are used in examples in the CHAPTER 2 USER SERVICE ROUTINE The User Service Routine, or USR, is a collection of subroutines which perform the operations of opening and closing files, loading device handlers, program chaining, and calling the Command Decoder. The USR provides these functions not only for the system itself, but for all programs running under the OS/8 system. 2.1 CALLING THE USR Performing any USR function is as simple as g~v~ng a JMS followed by the proper arguments. Calls to the USR take a standardized calling sequence. This standard call should be studied before progressing to the operation of the various USR functions. 2.1.1 standard USR Call In the remainder of this chapter, the following referenced: calling sequence is TAD VAL The contents of the AC is applicable some cases only. in CDF N Where N is the value of the current progr~" field multiplied by 10 (octal). CIF 10 JMS I (USR Where USR is either 7700 or section 2.1.2). 0200, (see FUNCTION This word contains an integer from 1 to 13 (octal) indicating which USR operation is to be performed. ARG(l) The number and meaning of these argument words varies with the particular USR function to be performed. error return When applicable, this address for all errors. normal return The operation was successful. The AC is cleared and the data field is set to current field. 2-1 is the return This calling sequence can change =~om function to function. For example, some functions take no value in the AC and others have fewer or greater numbers of arguments. Nonetheless, this format is generally followed. The value of the data field preceding the JMS to the USR is exceedingly important. The data field MUST be set to the current field, and the instruction field MUST be set to 1. Note that a CDF is not explicitly required if the data field is already correct. When a doubt exists as to the data field setting, an explicit CDF should be executed. There are three other restrictions which apply to all follows: 1. USR calls, The USR can never be called from any address between and 11777. Attempting to do so results in the: MONITOR ERROR 4 AT xxxxx as 10000 (ILLEGAL USR CALL) message and termination of program execution. The value of xxxxx is the address of the calling sequence (in all such MONITOR ERROR messages). 2.1.2 2. Several USR calls take address pointers as arguments. These pointers always refer to data in the same memory field as the call. 3. When calling the USR from field 1, these address pointers must never refer to data that lies in the area 10000 to 11777. Direct and Indirect Calling Sequence A user program can call the USR in two ways. First, by performing a JMS to location 17700 In this case, locations 10000 to 11777 are saved on a special area on the system device, and the USR is then loaded into 10000 to 11777. When the USR operation is completed, locations 10000 to 11777 are restored to their previous values. N~E By setting bit 11 of the Job Status Word to a 1, the user can avoid this saving and restoring of core when preserving core is unnecessary. Alternatively, a program can opt to keep the USR permanently resident in core at locations 10000 to 11777 by using the USRIN function (see section 2.2.8). Once the USR has been brought into core, a USR call can be made by performing a JMS to location 10200. This is the most efficient way of calling the USR. When USR operations have been completed, the program restores locations 10000 to 11777 to their initial state by executing the US ROUT function, if necessary (see section 2.2.9). 2-2 2.2 Summary of USR Functions Function Code operation Name into device ha~dler cors. address of the the entry 1 FETCH Loads a Returns handler. 2 LOOKUP Searches the file directory on any device to locate a specified permanent file. 3 ENTER Creates and opens for output a tentative file on a specified device. 4 CLOSE Closes the currently open tentative file on the specified device and becomes a permanent file. Also, any previous permanent file with the same file name and extension is deleted. 5 DECODE Calls the Command Decoder. The function of the Command Decoder is described in Chapter 3. 6 CHAIN Loads a specified core image file the system device and starts it. 7 ERROR Prints an error message of the form USER ERROR n AT LOCATION xxxxx. 10 USRIN Loads the USR into core. Subsequent calls to the USR are by an effective JMS to location 10200. 11 US ROUT Dismisses the USR from core and restores the previous contents of locations 10000 to 11777. 12 INQUIRE Ascertains whether a given device exists and, if so, whether its handler is in core. 13 RESET Resets system tables cleared state. 14-17 to their from initial Not currently used, these request numbers are reserved for future use. An attempt to call the USR with a code greater than 13 (octal) will currently cause a Monitor Error 4 message to be printed and the program to be aborted. 2-3 Function Code = 1 FETCH Device Handler 2.2.1 Device handlers must be loaded into core so as to be available to the USR and user program for I/O ooerations on that device. Before performing a LOOKUP, ENTER, or CLOSE function on any device, the handler for that device must be loaded by FETCH. The FETCH function takes two distinct forms: 1. Load a device handler corresponding to a given device name. 2. Load a device handler corresponding to a given device number. First, the following is an example of loading a handler by memory field 0: CLA COF 0 CIF 10 JMS I (USR 1 DEVICE DTA3 6001 JMP ERR name from /AC MUST BE CLEAR /DF = CURRENT FIELD /IF = 1 /FUNCTION CODE = 1 IGENERATES TWO WORDS: ARG(l) /AND ARG(2) /ARG (3) IERROR RETURN INORMAL RETURN • • ARG(l) and ARG(2) contain the device name in standard format. If the normal return is taken, ARG(2) is changed to the device number corresponding to the device loaded. ARG(3) contains the following information: Bits 0 to 4 contain the page number into which the handler is loaded. Bit 11 is 0 if the user program handler. can only accept a I-page Bit 11 is 1 if there is room for a 2-page handler. Notice that in the example above, the handler for DTA3 is to be loaded into locations 6000 to 6177. If necessary, a two page handler could be loaded; the second page would be placed in locations 6200 to 6377. After a normal return, ARG(3) is changed to contain the entry point of the handler. A different set of arguments is used to fetch a device number. The following is an example of this form: TAD VAL COF 0 elF 10 JMS I (USR 1 6001 JMP ERR lAC IS NOT ZERO IOF = CURRENT FIELD IF = 1 /FUNCTION CODE = 1 IARG(l) /ERROR RETURN INORMAL RETURN 2-4 handler by On entry to the USR, ~he AC con~a~ns the device number in bits 8 to 11 (bit a to 7 are ignored). The format for ARG(l) is the same as that for ARG(3) in the previous example. Following a normal return ARG(l) is replaced with the entry point of the handler. The conditions that can cause an error return to occur in are as follows: both cases 1. There is no device corresponding to the given device name device number, or 2. ~~ or attempt was made to load a two page ha~dler into one page~ If this is an attempt to load the handler by name, the contents of ARG(2) have been changed already to the internal device number. In addition, one of the following Honitor errors followed by a return to the Keyboard Monitor: Error l\1essage can be printed, Meaning MONITOR ERROR 4 AT xxxxx (ILLEGAL USR CALL) Results if bits 8 to 11 of the AC are zero (and bits 0 to 7 are non-zero). MONITOR ERROR 5 AT xxxxx (I/O ERROR ON SYS) Results if a read error occurs while loading the device handler. The FETCH function checks to see if the handler is in core, and if it is not, then the handler and all co-resident handlers are loaded. w-nile the FETCH operation ~s essentially a simple one, the user should be aware of the following points: 1. Device handlers are always loaded into memory field O. 2. The entry point that is returned may not be on the page desired. This would happen if the handler were already resident. 3. Never attempt to load a handler into the 7600 page or into page O. Never load a two page handler into the 7400 page. For more information on using device handlers, see Chapter 4. NOTE Two or more device handlers are "co-resident" when they are both included in the same one or two core pages. For example, the paper tape reader and punch routines are co-resident, as are the eight DECtape handler routines. 2.2.2 LOOKUP Permanent file Function Code =2 This request locates a permanent file entry on a given device, if exists. An example of a typical LOOKUP would be: 2-5 one TAD VAL CDF o CIF 10 JMS I (USR 2 ILOAD DEVICE I-;UMBER IDF=CURRENT FIELD lIP = 1 IFUNCTION CODE = 2 IARG(l), POINTS TO FILE NAME /ARG (2) o /ERROR RETURN JMP ERR /NORMAL RETURN FILENAME PROG.PA NAME NAME, This request looks up a permanent file entry with the name PROG.PA. The device number on which the lookup is to be performed is in AC bit 8 to 11. ARG(l) contains a pointer to the file name. Note that the file name block must be in the same memory field as the call, and that it cannot be in locations 10000 to 11777. The device handler must have been previously loaded into core. If the normal return is taken, ARG(l} is changed to the starting block of the file and ARG(2) contains the file length in blocks as a negative number. If the device specified is a readable, non-file structured device (for example, the papertape reader), then ARG{l) and ARG(2) contain the file length in blocks as a negative number. If the device specified is a readable, non-file structured device (for example, the paper tape reader), then ARG(l) and ARG(2) are both set to zero. If the error return is taken, ARG(l) and ARG(2) following conditions cause an error return: are 1. The device specified is a write-only device. 2. The file specified was not found. In addition, specifying illegal arguments following monitor errors, followed by a Monitor: Error Message unchanged. can cause return to The one of the the Keyboard Meaning MONITOR ERROR 2 AT xxxxx (DIRECTORY I/O ERROR) Results if an I/O error occurred while reading the device directory. MONITOR ERROR 3 AT xxxxx (DEVICE HANDLER NOT IN CORE) Results if the device handler for the specified device is not in core. MONITOR ERROR 4 AT xxxxx (ILLEGAL USR CALL) Results if bits 8 to 11 of are zero. the AC The LOOKUP function is the standard method of opening a permanent file for input. 2.2.3 ENTER Output (Tentative) File Function Code = 3 The ENTER function is used to create a tentative file entry to be used for output. An example of a typical ENTER function is as follows: TAD VAL CDF 0 CIF 10 /AC IS NOT ZERO /DF = CURRENT FIELD /IF = 1 2-6 J:·IS I (USR /FUNCTION CODE = 3 /ARG(l) POINTS TO FILE NANE /ARG (2) /ERROR PETURN 3 :~fu\1E o JHP ERROR /NORM_2)..L RETURN NAME, FILENAME PROG.LS Bits 8 to 11 of the AC contain the device number of the selected device: ~~e device handler for this device must be loaded into core before performing an ENTER function. If bits 0 to 7 of the AC are non-zero, this value is considered to be a declaration of the maximum length of the file. The ENTER function searches the file directory for the smallest empty file that contains at least the declared number of blocks. If bits a to 7 of the AC are zero, the ENTER function locates the largest available empty file. On a normal return, the contents of ARG(I) are replaced with the starting block of the file. The 2's complement of the actual length of the created tentative file in blocks (which can be equal to or greater than the requested length) replaces ARG(2). If the file directory contains any Additional Information Words, the system DATE (location 17666) is written as the first Additional Information Word of the newly created tentative file at this time. NOTE If the selected device is not file structured but permits output operations (e.g., the high speed -punch), the ENTER operation always succeeds. In this case, ARG(I) and ARG(2) are both zeroed on return. If the error return is taken, ARG(I) and ARG(2} follo\-ling conditions cause an error return: , J.. are The device specified by bits 8 to 11 of the unchanged. The is a read only device. 2. No empty file exists which requirement. satisfies the 3. Another tentative file is already active on this device (only one output file can be active at any given time). 4. The first word of the file name was 0 (an illegal file nruTle). In addition, one of the following monitor errors can by a return to the Keyboard Monitor: Error Hessage requested occur, length followed Meaning BONITOR ERROR 2 AT xxxxx (DIRECTORY I/O ERROR) Result if an I/O error occurred while reading or writing the device directory" HONITOR ERROR 3 AT xxxxx (DEVICE HANDLER NOT IN CORE) Results if the device handler for the specified device is not in core. 2-7 Error Message Meaning !·10NITOR ERROR 4 AT xxxxx (ILLEGAL USR CALL) Results if AC bits 8 to 11 are zero. NONITOR ERROR 5 AT xxxxx (I/O ERROR ON SYS) Read error on the system device while bringing in the overlay code for the ENTER function. HONITOR ERROR 6 AT xxxxx (DIRECTORY OVERFLOW) Results if a directory overflow occurred (no room for tentative file entry in directory). 2.2.4 The CLOSE Function Function Code = 4 The CLOSE function has a dual purpose: first, it is used to close the current active tentative file, making it a permanent file. Second, when a tentative file becomes permanent it is necessary to remove any permanent file having the same name; this operation is also performed by the CLOSE function. An example of CLOSE usage follows: TAD VAL CDF 0 CIF 10 JMS I (USR 4 NAME 15 JMP ERR /GET DEVICE NUMBER /DF=CURRENT FIELD IIF=l IFUNCTION CODE = 4 IARG(l) IARG(2) IERROR RETURN INORMAL RETURN FILENAME PROG.LS NAME, The device number is contained in AC bits 8 to 11 when calling the USR. ARG(l) is a pointer to the name of the file to be deleted and (ARG(2) contains the number of blocks to be used for the new permanent file. The normal sequence of operations on an output file is: 1. FETCH the device handler for the output device. 2. ENTER the tentative file on the output device, getting the starting block and the maximum number of blocks available for the file. 3. Perform the actual output using the device handler, keeping track of how many blocks are written, and checking to insure that the file does not exceed the available space. 4. CLOSE the tentative file, making it permanent. The CLOSE operation would always use the same file name as the ENTER performed in step 2. The closing file length would have been computed in step 3. After a normal return from CLOSE, the active tentative file is permanent and any permanent file having the specified file name already stored on the device is deleted. If the specified device is a non-file structured device that permits output (the paper tape punch, for example) the CLOSE function will always succeed. 2-8 ~;OTE The user must be careful to specify the same file names ~o the ENTER and the CLOSE functions. ?ailure to do so can cause several permanent files with identical names to appear in the directory. If CLOSE is intended only to be used to delete some existing file, then the number of blocks, ARG(2) should be zero. The following conditions cause the error return to be taken: 1. The device specified by bits 8 to 11 of the AC is a read only device. 2. There is neither an active tentative file to be made into a permanent file, nor a permanent file with the specified name to be deleted. In addition, one of the following :10ni tor errors can occur: Meaning Error Message 2.2.5 MONITOR ERROR 1 AT xxxxx (CLOSE ,ERROR) Results if the length specified by ARG(2) exceeded the allotted space. MONITOR ERROR 2 AT xxxxx (DIRECTORY I/O ERROR) Results if an I/O error occurred while reading or writing the device directory. MONITOR ERROR 3 AT xxxxx (DEVICE HANDLER NOT IN CORE) Results if the device handler for the specified device is not in core. MONITOR ERROR 4 AT xxxxx (ILLEGAL USR CALL) Results if AC bits 8 to 11 are zero. Call Command Decoder (DECODE) Function Code = 5 The DECODE function causes the USR to load and execute the Command Decoder. The Command Decoder accepts (from the Teletype) a list of input and output devices and files, along with various options. The Command Decoder performs a LOOKUP on all input files, sets up necessary tables in the top page of field 1, and returns to the user program. These operations are described in detail in Chapter 3, which shoud be read before attempting to use the DECODE function. A typical call to the Command Decoder looks as follows: CDF 0 CIF 10 JMS I (USR 5 2001 o /DF=CURRENT FIELD /IF=l /FUNCTION CODE = 5 IARG(1), ASSU~.ED INPUT EXTENSION /ARG(2), ZERO TO PRESERVE ALL /TENTATlVE FILES /NORMAL RETURN 2-9 ARG(l) is the assumed input extension, in the preceding example it is ".PA". On return from the Command Decoder, information is stored in tables located in the top page of memory field 1. The DECODE function also resets all system tables as in the RESET function (see RESET function, section 2,2,11) if ARG(2) is 0 all currently active tentative files remain open: if ARG(2) is non-zero all tentative files are deleted and the normal return is to ARG(2) instead of ARG(2)+1. The DECODE function has no error return (Command Decoder error messages are given in Chapter 3). However, the following Monitor error can occur: Meaning Error Message MONITOR ERROR 5 AT xxxxx (I/O ERROR ON SYS) 2.2.6 CHAIN Function I/O error occurred while reading or writing on the system device. Function Code = 6 The CHAIN function permits a program to load and start another program with the restriction that the program chained to must be a core image (.SV) file located on the system device. A typical implementation of the CHAIN function looks as follows: IDF=CURRENT FIELD IIF-l COF 0 elF 10 JMS I (USR 6 BLOCK = /FUNCTION CODE 6 /ARG (1), TARTING BLOCK NUMBER There is no normal or error return from CHAIN. monitor error can occur: Error Message However, the following Meaning MONITOR ERROR 5 AT xxxxx (I/O ERROR ON SYS) I/O error occurred while reading or writing on the system device. CHAIN ERR If an attempt is made to CHAIN to a file which is not a core image (.SV) file. Control returns to the keyboard monitor. The CHAIN function loads a core image file located on the system device beginning at the block number specified as ARG(l) (which is normally determined by performing a LOOKUP on the desired file name). Once loaded, the program is started at an address one greater than the starting address specified by the program's Core Control Block. CHAIN automatically performs a USROUT function (see section 2.2.9) to dismiss the USR from core, and a RESET to clear all system tables see section 2.2.11), but CHAIN does not delete tentative files. The areas of core altered by the CHAIN function are determined by the contents of the Core Control Block of the core image file loaded by CHAIN. The Core Control Block for the file is set up by other ABSLDR or LOADER programs. It can be modified by performing a SAVE command with specific arguments. Every page of core in which at least one 2-10 location was saved is loaded. If the page is one of the "odd numbered" pages (pages 1, 3, etc,; locations 0200 to 0377, 0600 to 0777, etc.), the previous page is always loaded. In addition, CHAIN always alters the contents of locations 07200 to 07577. CHAIN destroys a necessary part of the OoT resident breakpoint routine. Thus be an OoT breakpoint should never maintained across a CHAIN. With the above exceptions, programs can pass data back and forth in core while chaining. For example, FORTRAN programs normally leave the COMMON area in memory field 1 unchanged. This COMMON area can then be accessed by the program activated by the CHAIN. 2.2.7 Function Code = 7 Signal User ERROR The USR can be called to print a user error The following is a possible ERROR call: CoF 0 CIF 10 JMS I (USR 7 2 loF IIF message for a program. = CURRENT FIELD =1 = IFUNCTION CODE 7 IARG(l), ERROR NUMBER THE ERROR function causes a message of the form: USER ERROR n AT xxxxx to be printed. Here n is the error number given as ARG(l); n must be between 0 and 11 (octal), and xxxxx is the address of ARG(l). If ARG(I) in the sample call above was at location 500 in field 0, the message: USER ERROR 2 AT 00500 would be printed. Following the message, the USR returns the Keyboard Monitor, preserving the user program intact. The error number is arbitrary. meanings: Two numbers Error Message have control currently to assigned Meaning USER ERROR 0 AT xxxxx During a RUN, GET, or R command, this error message indicates that an error occurred while loading the core image. USER ERROR 1 AT xxxxx While executing a FORTRAN or SABR program, this error indicates that a call was made to a subroutine that was not loaded. 2-11 2.2.8 Function Code Lock USR in Core (USRIN) = 10 When making a number of calls to the USR it is advantageous for a program to avoid reloading the USR each time a USR call is made. The USR can be brought into core and kept there for subsequent use by the USRIN function. The calling sequence for the USRIN function looks as follows: COP 0 CIP 10 JMS I (7700 10 • /DP = CURRENT FIELD /IF = 1 /FUNCTION CODE = 10 /NORMAL RETURN THE USRIN function saves the contents of locations 10000 to 11777 on the system scratch blocks" provided the calling program loads into this area as indicated by the current JSW, and loads the USR, then returns control to the user program. N~E If bit 11 of the current Job Status Word is a one, the USRIN function will not save the contents of locations 10000 thru 11777. 2.2.9 Dismiss USR from Core (USROUT) Function Code = 11 When a program has loaded the USR into core with the USRIN function and no longer wants or needs the USR in core, the USROUT function is used to restore the original contents of locations 10000 to 11777. The calling sequence for the USROUT function is as follows: COP 0 CIP 10 JMS I 11 • (200 /DP = CURRENT FIELD /IP = 1 /00 N~ JMS TO 17700!! /PUNCTION CODE 11 /NORMAL RETURN = The US ROUT function and the USRIN function are complementary operations. Subsequent calls to the USR must be made by performing a JMS to location 7700 in field 1. N~E If bit 11 of the current Job Status Word is a 1, the contents of core are not changed by the USROUT function. In this case US ROUT is a redundant operation since core was not preserved by the USRIN function. 2-12 2.2.10 Ascertain Device Informa~ion (INQUIRE) Function Code = 12 On some occasions a user may wish to determine what internal device number corresponas to a g~ven device na~e or whether the device handler for a specified device is in core, without actually performing a FETCH operation. INQUIPE performs these operations for the usere The function call for INQUIRE closely resembles the FETCH handler call. INQUIRE, like FETCH, has two distinct forms: 1. Obtain the device number corresponding to a given device name and determine if the handler for that device is in core (example shown below). 2. Determine if the handler number is in core. corresponding to a given device An example of the INQUIRE call is shown below: CLA CDF 0 CIF 10 JHS I (USR 12 DEVICE DTA3 o JMP ERR /AC HUST BE CLEAR /DF = CURRENT FIELD /IF = 1 /FUNCTION CODE = 12 IGENERATES TWO WORDS: IARG(l) AND ARG(2) /ARG(3) /ERROR RETURN INORMAL RETURN ARG(l) and ARG(2) contain the device name in standard format. When the normal return is taken ARG(2) is changed to the device number corresponding to the given name, and ARG(3) contains either the entry point of the device handler if i t is already in core, or zero if the corresponding device handler has not yet been loaded. A slightly different set of argwuents is USed about device by its device number: TAD VAL COF 0 CIF 10 JMS I (USR 12 0 JMP ERR lAC IS NON-ZERO /DF = CURRENT FIELD IIF = 1 IFUNCTION CODE = 12 IARG(I) /ERROR RETURN /NORMAL RETURN On entry to INQUIRE, AC bits 8 to 11 contain the device number. 2-13 a NOTE If AC bits a to 7 are non-zero, and bits 8 to 11 are zero (an illegal device number) a: MONITOR ERROR 4 AT xxxxx message is printed and program execution is terminated. On normal return ARG(l) is set to the entry point of the device handler if it is already in core, or zero if the corresponding device handler has not yet been loaded. The error return in both cases is taken only if there is no device corresponding to the device name or number specified. 2.2.11 Function Code RESET System Tables = 13 There are certain occasions when it is desired to reset the system tables, effectively removing from core all device handlers except the system handler. An example of the RESET function is shown below: COF 0 CIF 10 JMS I (USR 13 o /OF = CURRENT FIELD /IF 1 = = /FUNCTION CODE 13 /0 PRESERVES TENTATIVE FILES /NORMAL RETURN RESET zeros all entries except the one for the system device in the Device Handler Residency Table (see section B.3.3, removing all device handlers, other than that for the system device, from core. This should be done anytime a user program modifies any page in which a device handler was loaded. RESET has the additional function of deleting all currently active tentative files (files that have been entered but not closed). This is accomplished by zeroing bits 9 through 11 of every entry in the Device Control Word Table (see section B.3.5). If RESET is to be used in this last fashion, to delete all active tentative files, then ARG(l) must be non-zero and the normal return is to ARG(l) rather than to ARG(I)+I. For example, the' following call would serve this purpose COF a CIF 10 JMS I (USR 13 CLA CMA /OF:CURRENT FIELD /IF = 1 /FUNCTION CODE /NON-ZERO: = 13 The normal return would execute the CLA CMA and all active tentative files on all devices would be deleted. The Keyboard Monitor currently does not reset the Monitor tables. If user programs which do not call the Command Decoder are used, it is wise to do a RESET operation before loading device handlers. The RESET will ensure that the proper handler will be loaded into core. 2-14 CHAPTER 3 THE CO~~D DECODER 05/8 provides a powerful subroutine called the Command Decoder for use by all system programs. The Command Decoder is normally called when a program starts running. When called, the Command Decoder prints an * and then accepts a command line from the console Teletype that includes a list of I/O devices, file names, and various option specifications. The Command Decoder validates the command line for accuracy, performs a LOOKUP on all input files, and sets up various tables for the calling program. The operations performed by the Command Decoder greatly simplify the initialization routines of all 05/8 programs. Also, since command lines all have a standard basic structure, the Command Decoder makes learning to use 05/8 much easier. 3.1 COMMAND DECODER CONVENTIONS Chapter 1 of the OS/8 H&~DBOOK describes the syntax for the conmuu,d line in detail. A brief synopsis is given here only to clarify the later discussion in this chapter. The command line has the following general form: *output files < input files/ (options) There can be 0 to 3 output files and 0 to 9 input files specified. Output File Format Meaning EXPLE.EX Output to a file named EXPLE.EX on device DSK (the default file storage device). LPT: Output to the LPT. generally specifies structured device. DTA2:EXPLE.EX Output to a file named EXPLE.EX device DTA2. DTA2:EXPLE.EX[99] Output to a file named EXPLE.EX on device DTA2. A maximum output file size of 99 blocks is specified. null No output specified. This format a non-file An input file specification has one of the following forms: 3-1 on :'leaning Input File Format DTA2 : I~lPUT Input from a file named I~PUT.df on device DTA2. "df" is the assumed input file extension specified in the Command Decoder. DTA2:INPUT.EX Input from a file named INPUT.EX on device DTA2. In this case .EX overrides the assumed input file extension. INPUT.EX Input from a file named INPUT.EX. If there is no previously specified input device, input is from device DSK, the default file storage device; otherwise, the input device is the same as the last specified input device. PTR: Input from device PTRi name is needed for structured devices. DTA2: Input from device DTA2 treated as a non-file structured device, as, for example, in the PIP command line: no file non-file *TTY:/L<DTA2: In both of the last two formats, no LOOKUP operation is performed since the device is assumed to be non-file structured. null Repeats input from the previous device specified (must not be first in input list, and must refer to a non-file structured device). For example: * <PTR:" (two null files) indicates that three paper tapes are to be loaded. NOTE Whenever a file extension is left off an input file specification, the Command Decoder first performs a LOOKUP for the given name appending a specified assumed extension. If the LOOKUP fails, a second LOOKUP is made for the file appending a null (zero) extension. 3-2 The Command Decoder verifies that the specified device names, file names, and extensions consist only of the characters A through Z and a through 9. If not, a syntax error is generated and the command line is considered to be valid. There are two kinds of options that can be specified: first, alphanumeric option switches are denoted by a single alphanumeric character preceded by a slash (I) or a string of characters enclosed in parentheses; secondly, a numeric option can be specified as an octal number from 1 to 37777777 preceded by an equal sign (=). These options are passed to ~~e user progrw~ and are interpreted differently by each program. Finally, the Command Decoder permits the command line to be terminated by either the RETURN or ALT MODE key. This information is also passed to the user program. 3.2 COMMAND DECODER ERROR MESSAGES If an error in the command line is detected by the Command Decoder, one of the following error messages is printed. After the error message, the Command Decoder starts a new line, prints an *, and waits for another command line. The erroneous command is ignored. Error Message 3.3 MeaninC! ILLEGAL SYNTAX The command incorrectly. line TOO MANY FILES More than three output files or nine input files were specified. (Or in special mode, more than 1 output file or more than 5 input files. ) device DOES NOT EXIST The specified device name does not correspond to any permanent device name or any user assigned device name. name NOT FOUND The specified input file name was not found on the selected device. is formatted CALLING THE COMMAND DECODER The Command Decoder is initiated by the DECODE function of the USR. DECODE causes the contents of locations 0 to 1777 of field 0 to be saved on the system scratch blocks, and Command Decoder to be brought into that area of core and started. When the command line has been entered and properly interpreted, the Command Decoder exits to the USR, which restores the original contents of a to 1777 and returns to the calling program. 3-3 N~E By setting bit 10 of the Job Status Word to a 1 the user can avoid this saving and restoring of core for programs that do not occupy locations 0 to 1777. The DECODE call can reside in the area between 0000 to 1777 and function correctly. A typical call would appear as follows: still CDF 0 ISET DATA FIELD TO CURRENT FIELD CIF 10 IINSTRUCTION FIELD MUST BE 1 JMS I (USR IUSR=7700 IF USR IS NOT IN CORE lOR USR=0200 IF USRIN WAS PERFORMED 5 IDECODE FUNCTION = 5 IARG(l) ,ASSUMED INPUT EXTENSION 2001 o /ARG(2) ,ZERO TO PRESERVE /ALL TENTATIVE FILES INORMAL RETURN ARG(l) is the assumed input extension. If an input file name is given with no specified extension, the Command Decoder first performs a LOOKUP for a file having the given name with the assumed extension. If the LOOKUP fails, the Command Decoder performs a second LOOKUP for a file having the given name and a null (zero) extension. In this example, the assumed input extension is -.PA-. DECODE performs an automatic RESET operation (see section 2.2.11) to remove from core all device handlers except those equivalent to the system device. As in the RESET function, if ARG(2) is zero all currently active tentative files are preserved. If ARG(2) is non-zero, all tentative files are deleted and DECODE returns to ARG(2) instead of ARG(2)+1. As the Command Decoder normally handles all of its own is no error return from the DECODE operation. 3.4 errors, there COMMAND DECODER TABLES The Command decoder sets up various tables in the top page of field that describe the command line typed to the user program. 3.4.1 1 Output Files There is room for three entries in the output file table that begins at location 17600. Each entry is five words long and has the following format: 3-4 0 2 1 3 5 4 USER SPECIFIED FILE LENGTH WORD 1 8 7 6 9 10 11 4 BIT-DEVICE NUMBER I i I, WORD 2 FILE NAME CHARACTER 1 FILE NAME CHARACTER 2 WORD 3 FILE NAME CHARACTER 3 FILE NAME CHARACTER 4 FILE NAME CHARACTER 5 FILE NAME CHARACTER 6 J FILE EXTENSION CHARACTER 1 FILE EXTENSION CHARACTER 2 } FILE EXTENSION WORD 4 WORD 5 I t OUTPUT FILE NAME ( 6 CHARACTERS I 1 2 CHARACTERS Bits 0 to 7 of word 1 in each entry contain the file length, if the file length was specified with the square bracket construction in the command line. Otherwise, those bits are zero 8 The entry for the first output file is in locations 17600 to 17604, the second is in locations 17605 to 17611, and the third is in locations 17612 to 17616. If word 1 of any entry is zero, the corresponding output file was not specified. A zero in word 2 means that no file name was specified. Also, if word 5 of any entry is zero no file extension was specified for ~~e corresponding file. It is left to the user program to take the proper action in these cases. These entries are function. 3.4.2 in a format that is acceptable to the ENTER Input Files There is room for nine entries in the input file table that begins at location 17617. Each entry is two words long and has the following format: 0 WORD 1 I 1 2 3 4 5 6 7 MINUS FILE 9 10 11 4-BIT DEVICE I I NUMBER LENGTH WORD 2 I 8 II : STARTING BLOCK OF FILE Bits 0 to 7 of word 1 contain the file length as a negative number. Thus, 377 (octal) in these bits is a length of one block, 376 (octal) is a length of two blocks, etc. If bits 0 to 7 are zero, the specified file has a length greater than or equal to 256 blocks or a non-file structured device was specified. 3-5 ~OTE This restriction to 255 blocks of actual specified size can cause some problems if the program has no way of detecting end-of-file conditions. For example, PIP cannot copy in image mode any file on a file structured device that is greater than 255 blocks long, although it can handle in IA orlB modes (ASCII or Binary) files of unlimited size. In IA orlB modes PIP will detect the CTRL/Z marking the end-of-file. If this is liable to be a problem, it is suggested that the user program employ ~e special mode of the Command Decoder described in section 3.5 ard F~rfor.m its own LOOKUP on the input files to obtain the exact file length. The two-word input file list entries beginning at odd numbered locations from 17617 to 17637 inclusive. If location 17617 is zero, no input files were indicated in the command line. If less than nine input files were specified, the unused entries in the input file list are zeroed (location 17641 is always set to zero to provide a terminator even when no files are specified). 3.4.3 Command Decoder Option Table Five words are reserved beginning at location 17642 to store the various options specified in the command line. The format of these five words is as follows: o 1 2 17642 3 4 5 6 7 8 9 10 11 HIGH ORDER 11 BITS F a N OPTIONS B C D E F G H I J 17644 M N 0 p Q R S T U V W X 17645 Y 0 1 2 3 4 5 6 7 17643 A Z 17646 LOW ORDER 12 BITS OF K 8 L 9 = > OPTIONS Each of these bits corresponds to one of the possible alphanumeric option switches. The corresponding bit is 1 if the switch was specified, 0 otherwise. 3-6 NOTE If no = n option is specified, the Command Decoder zeroes 17646 and bits 1 to 11 of Thus, 17642. meaningless cannot tell specified. since that the any typing =0 is user program option was Bit 0 of location 17642 is 0 if the cc~~~d line was terminated bv a carriage return, 1 if it was terminated by an ALT MODE. 3.4.4 Example To clarify some of the preceding, consider the interpretation following command line: of the *BIN[10]<PTR:"DTA2:PARA,MAIN /L=14200$ If this command line is typed to PALS, it would cause assembly of a program consisting of four separate parts: two paper tapes, one file named PARA.PA (or just PARA) on DTA2, and one file named MAIN.PA (or just MAXN) also on DTA2. The binary output is placed on a file named BIN.BN on device DSK, for which only 10 blocks need be allocated. No listing is generated. In addition, automatic loading of the binary output is specified by the /L option, with the starting address given as 4200 in field 1. Finally, the line is terminated by the ALTNODE key (which echoes as $) causing a return to the Keyboard Monitor after the program is loaded. In the case of this example, the Command Decoder returns to PALS the following values in the system tables: NOTE The entries for PTR (where no input file name is specified) have a starting block number and file size of zero. This is always true of the input table for a non-file structured device, or a file structured device on which no file name is given. 3-7 with 17600 II 0242 II 0211 lFILE NAME IS BIN 1600 ~ 0000 1760 4 - 0000 NULL EXTENSION ~~ I 1760 5 REMAINING ENTRIES IN OUTPUT TABLES ARE ZERO ~~ 1761 6 1761 7 ~ FIRST PTR INPUT 0016 ~ 0000 1762 0 1762 1 I 0016 j 0000 1762 2 1762 3 DSK: IS DEVICE NUMBER 2 I I DAT2: PARA PA IS 5 BLOCKS LONG, BEGINNING AT 100(8) 7667 I 0100 1762 4 1762 5 OTA2: MAIN PA IS 256 (10) OR MORE BLOCKS LONG, BEGINNING AT BLOCK 105(8) 0007 I 0105 17626 17627 c:~ ~ 17641 3.5 17642 4001 17643 0001 17644 0000 17645 0000 17646 4200 SECOND PTR INPUT ~I REMAINING ENTRIES IN INPUT TABLES ARE ZERO. - LINE WAS TERMINATED BY ALT MODE /L WAS ONLY OPTION SWITCH PECIFIED Is - = 14200 WAS SPECIFIED SPECIAL MODE OF THE COMMAND DECODER Occasionally the user program does not want the Command Decoder to perform the LOOKUP on input files, leaving this option to the user program itself. Programs such as format conversion routines which access non-standard file structures could use this special format. If the input files were not OS/8 format, a command decoder LOOKUP operation would fail. The capability to handle this case is provided 3-8 in the OS/8 Command Decoder. This capability is generally referred to as the "special mode" of the Command Decoder. 3.5.1 Calling the Command Decoder Special Mode The special mode call to the Command Decoder is identical to the standard DECODE call except that the assumed input file extension, specified by ARG(l), is equal to 5200. The value 5200 corresponds to an assumed extension of "*"1 which is illegal. Therefore, the special mode of the Command Decoder in no way conflicts with the normal mode. 3.5.2 Operation of the Command Decoder in Special Mode In special mode the Command Decoder is loaded and inputs a command as usual. The appearance of the command line is altered by the special mode in these respects: line 1. Only one output file can be specified. 2. No more than five input files can be specified, the nine acceptable in normal mode. 3. The characters asterisk (*) and question mark (1) are leqal in file names and extensions, both in input files and on output files. It is strongly suggested that these characters be tested by the user program and treated either as special options or as illegal file names. The user program must be careful not to ENTER an output file with an asterisk or question mark in its name as such a file cannot easily be manipulated or deleted by the standard system programs. rather than The output and option table set up by the Command Decoder is not altered in special mode. Entries in the input table are changed to . . . '-_ &_, '~".''' . . I..~lt:: ,-r .L.U.Jo..Jo.uW.Jo.U'':J .;:""'....,.,..~ ... . ... ~ .... " ....... . 0 1 2 3 4 c:, WORD 1 NORD 2 WORD 3 WORD 4 ~vORD 5 ~ I 8 9 10 11 4-BIT DeVICE NUMBER BITS 0-7 ARE ALNAYS 0 CHARACTER 1 FILE ~AME CHARACTER 2 FILE NAt-IE CHARACTER 3 FILE NAME CHARACTER 4 : FILE NAME CHARACTER 5 FILE NAME CHARACTER 6 I) FILE EXTENSION CHARACTER 1 FILE EXTENSION CHARACTER 1 I t FILE EXTENSION I ~ 2 CHARACTERS FILE NA.ft.1E ) I ! 3-9 INPUT FILE NAME 6 CHARACTER The table entry for the first input file is in locations 17605 to 17611; the second in locations 17612 to 17616: the third in locations 17617 to 17623; the fourth in locations 17624 to 17630: and the fifth in locations 17631 to 17635. A zero in word 1 terminates the list of input files. If word 2 of an entry is zero, no input file name was specified. The 05/8 batch generating system decoder in special mode. 3.6 will allow calls to the command CCL AND THE COMMAND DECODER CCL uses its own copy of the Command Decoder instead of the copy available from the monitor. Thus, the CCL Command Decoder has several options not available via standard USR calls to the 05/8 Command Decoder, e.g., multiple default extensions. 3.7 USEFUL LOCATIONS IN BATCH BATCH will run whenever bit 0 of location 07777 is a 1. The user may wish to access the following useful locations in BATCH. The locations are in the highest memory field available to 05/8: BATERR = 7000 JMP here to abort BATCH. BATOUT = 7400 JMS here to print character in AC in BATCH log. BATSPL = 7200 3. 8 JMS here to permi t spooling with default extension in AC. ceL TABLES A description of all tables used by CCL is included in the file CCL.PA supplied to all users of 05/8 version 3. 3-10 CHAPTER 4 USING DEVICE HANDLERS A device handler is a system subroutine that is used by all parts of the OS/8 system and by all standard system programs to perform I/O transfers. All device handlers are called in the same way and they all perform the same basic operation: reading or writing a specified number of 128 word records beginning at a selected core address. These subroutines effectively mask the unique characteristics of different I/O devices from the calling programJ thus, programs that use device handlers properly are effectively wdevice independent-. Changing devices involves merely changing the device handlers used for I/O. OS/8 device handlers have another important feature. They are able to transfer a number of records as a single operation. On a device like DECtape this permits many bks of data to be transferred without stopping the tape motion. On a disk, a single operation could transfer an entire track or more. This capability significantly increases the speed of operation of OS/8 programs, such as PIP, that have large buffer areas. N~E The word "record w is defined to mean 128 words of data; thus, an OS/8 block consists of two 128 word records. 4.1 CALLING DEVICE HANDLERS Device handlers are loaded into a user selected area in memory field 0 by the FETCH function. FETCH returns in ARG(l) the entry point of the handler loaded. The handler is called by performing a JMS to the specified entry point address. It has the following format: COF N CIF 0 JMS I ENTRY ARG(l) ARG(2) ARG(3) /WHERE N IS THE VALUE OF THE CURRENT /PROGRAM INSTRUCTION FIELD TIMES 10 (OCTAL) /DEVICE HANDLER ALWAYS IN FIELD 0 /FUNCTION CONTROL WORD /BUFFER ADDRESS /STARTING BLOCK NUMBER 4-1 /ERROR RETU~~ /NORMAL RETU~~ (I/O TRANSFER COMPLETE) JMP ERR ENTRY 0 /ENTRY CONTAINS THE ENTRY POINT OF THE /HANDLER, DETERMINED WHEN LOADED BY FETCH As with calls to the USR, it is important that the data field is to the current program field before teldevice handler is called. exit from the device handler, the data field will remain set to current program field. ARG(l) is the information: function control word, and contains the set On the following Contents Bits Bit 0 o for an input operation, operation. Bits 1 to 5 The number of 128 word records to be transferred. If bits 1-5 are zero and the device is non-file structured (i.e., TTY, LPT, etc.) the operation is device dependent. If the device is file structured (SYS, DECtape, disk, etc.), a read/write of 40 (octal) pages is performed. Bits 6 to 8 The memory field in which the transfer is be performed. Bits 9 to 11 Device dependent bits, can be left zero. Currently only bit 11 is used, on DEC tape bit 11 determines the direction in which the tape is started. If bit 11 is 0, the tape starts in reverse. If bit 11 is 1, the tape starts forward. All other handlers ignore these bits at present (except TM8E and TA8E). 1 for an output to N~E Starting forward saves time as long as the block number, ARG(3), is about seven or more blocks greater than the number of the block at which the tape is currently positioned. ARG(2) is the starting location of the transfer buffer. ARG(3) is ~e number of the block on which the transfer is to begin. The user program initially 'determines this value by performing a LOOKUP or ENTER operation. After each transfer the user program should itself add to the current block number the actual number of blocks transferred, equal to one-half the number of 128 word records specified, rounded up if the number of records was odd. There are two kinds of error returns: fatal and non-fatal. When an error return occurs and the contents of the AC are negative, the error is fatal. A fatal error can be caused by a parity error on input, a write lock error on output, or an attempt to write on a read-only 4-2 device (or vice versa • The meaning can vary from device to device, but in all cases t is serious enough to indicate that the data transferred, if any, s invalid. When an error return occurs and the contents of the AC are greater than or equal to zero, a non-fatal error has occurred. This error always indicates detection of the logical end-of-file. For example, when the paper tape reader handler detects the end of a paper tape it inserts a CTRL/Z code in the buffer and takes the error exit with the AC equal to zero. While all non-file structured input devices can detect the end-of-file condition, no file structured device can; furthermore, no device handler takes the non-ratal error return when doing output. The following restrictions apply to the use of device handlers: 1. If bits 1 to 5 of the function control word, ARG(l), are zero, a transfer of 40 (octal) pages or an entire memory field is indicated. Care must be used to ensure that the handler is not overlaid in this call. This only applies to file-structured handlers. 2. The user program must never specify an input into locations 07600 to 07777, 17600 to 17777, or 27600-27777, or the page(s) in which the device handler itself resides. In general, 7600-7777 in every memory field are reserved for use by system software. Those areas should be used with caution. 3. Note that the amount of data transferred is given as a number of 128 word records, exactly one half of a~ OS/8 block. Attempting to output an odd number of records can change the contents of the last 128 words of the last block written. For example, outputting 128 words to a block on the RK8 disk causes the last 128 words of the block to be filled with zeroes. 4. The specified buffer address does not have to begin at the start of a page. The specified buffer cannot overlap fields, rather the address will "wrap around" memory; For example, a write of 2 pages starting at location 07600 would cause locations 07600-07777 and 00000-00177 of field 0 to be written. 5. If bits 1-5 of the function control word ARG(l) are zero, a device-dependent operation occurs. Users should not expect a 40-page (full field) transfer of data. The CLOSE operation of the USR calls the handler with bits 1-5 and 9-11 of the function control word O. This condition means 'perform any special close operations desired'. Non-file structured handlers which need no special handling on the conclusion of data transfers should treat this case as a NOP. Examples of usage of such special codes: LPT - perform a form feed CSAn, MTAn - write two file marks 4-3 4.2 DEVICE DEPENDENT OPERATIONS This section describes briefly the operation of certain standard OS/8 device handlers, including normal operation, any special initialization operations for block 0, terminating conditions, and response to control characters typed at the keyboard. Further information on device handlers can be found in Chapter 5. 4.2.1 l-Page Terminal (TTY) 1. (AS33) Normal Operation This handler inputs characters from the terminal keyboard and packs them into the buffer or unpacks characters from the buffer and outputs them to the console terminal. On input, characters are echoed as they are typed. Following a carriage return, a line feed character is inserted into the input buffer and printed on the terminal. 2. Initialization for Block 0 None. 3. Terminating Conditions On input, detection of a CTRL/Z causes a CTRL/Z (octal code 232) to be placed in the input buffer, the remaining words of the buffer to be- filled with zeros, and a non-fatal error to be returned. On output, detection of a CTRL/Z character in the output buffer causes output to be terminated and the normal return to be taken. There are no fatal errors associated with the l-page terminal handler. 4. Terminal Interaction CTRL/C forces a return to the Keyboard Monitor. CTRL/ forces an end-of-file on input (see 3). CTRL/O terminates printing of the contents of the current buffer on output. 4.2.2 High-Speed Paper Tape Reader (PTR) 1. Normal Operation This handler inputs characters from the high-speed paper tape reader and packs them into the buffer. 2. Initialization for Block 0 The handler prints an up-arrow (t) on the terminal and waits for the user to load the paper tape reader. By typing any single character (except CTRL/C) the user initiates reading of the paper tape. 4-4 ~;OTE On some terminals, up-arrow is replaced ,r,) character. by the circumflex 3. Terminating Conditions Detection of an end-of-tape condition, indicated by the failure to get a character in a specified period of time, causes a CTRL!Z to be entered in the buffer, the remaining words of the buffer to be filled with zeros, and a non-fatal error to be returned. Attempting output to the paper tape reader causes a fatal error to be returned. 4. Terminal Interaction Typing CTRL/C forces a return to the Keyboard Monitor. 4.2.3 High-Speed Paper Tape Punch (PTP) 1. Normal Operation This handler unpacks characters from the punches them on the paper tape punch. 2. output buffer and Initialization for Block a None. 3. Terminating Conditions Attempting to input from the paper tape punch causes a fatal error to be returned. There are no non-fatal errors associated with this handler. Typing CTRL/C forces a return to the Keyboard Monitor, but only when actual punching has begun, or if tC is typed before punching commences. If the punch is off line, tC is only effective immediately before punching would begin. 4.2.4 Line Printer (LPT) 1. (LPSV) Normal Operation This handler unpacks characters from the buffer and prints them on the line printer. The characters horizontal tab (ASCII 211) causes sufficient spaces to be inserted to position the next character at a "tab stop" (every eighth column, by definition). The character vertical tab (ASCII 213) causes a skip to the next paper position for vertical tabulation if the -line printer- hardware provides that feature. The character form feed (ASCII 214) causes a skip to the top of the next page. Finally, the handler maintains a record of the current print column and starts a new line after 80 or 128 columns have been printed. This handler 4-5 functions properly only on ASCII data. The handler for the LS8E line printer handler utilizes the expand~d character capability of the printer. If a 216 (CTRL/N) character appears anywhere in a line of text, the entire line is printed in the expanded character mode. The 216 must be used on a line-by-line basis. 2. Initialization for Block 0 Before printing begins, the line printer handler form feed to sp~ce to the top of the next page. 3. issues a Terminating Condition On detection of a CTRL/Z character in the buffer, the line printer handler issues a form feed and immediately takes the normal return. Attempting to input from the line printer forces a fatal error to be returned. A fatal error is also returned if the line printer error flag is set. There are no non-fatal errors associated with the line printer handler. 4. Terminal Interaction Typing CTRL/C forces a return to the Keyboard Monitor. 5. Patching the LPSV Handler The following patches are available for the LPSV line printer handler. reI. lac 0: set to -printer width-l (i.e. set to -121(octal) for an 80 column line printer) reI. lac 1: set to 4 the for LV8E printers for the LPOE and printers set to 14 reI. lac 2: set to -40 LS8E to convert lower case to upper case if your printer can print lower case set to 0 4.2.5 line Cassettes 1. Normal Operation This handler performs character I/O between the cassettes and the buffer. It treats cassettes as a non-file structured device. Data appears on cassette in 192-byte records. 2. Initialization for Block 0 On input the cassette is rewound. On output the cassette rewound and a file gap is written. 3. Terminating Condition 4-6 is An end-of-file on input is a software error. Terminal Interaction 4. Typing C':'RL/C forces a return to the Keyboard 5. Special Codes (device dependent features) If the handler is called with bits 1-5 of the function word The meaning of these codes are as follows; =0, then bits 10-11 are examined. o 1 2 3 write a file gap rewind also, then write a file gap if bit 0=1 space backwards one record skip one file (direction depends on bit 0) NOTE The handler neither reads nor writes standard files. It is merely a paper tape replacement. It writes raw data (organized into 192-byte records) onto the cassettes starting at the beginning; and then later reads it back. The source is already in OS/8 BUILD format. The handler has only two entry points (for drives A and B of a controller). The decision as to which controller it uses is made at assembly time by changing the symbol code. The result is as follows: CODE DEVICE NAME HANDLER DEVICE CODE 0 TA8A A:CSAO B:CSAI 70 1 TA8B A:CSA2 B:CSA3 71 2 TA8C A:CSA4 B:CSAS 72 3 TA8D A:CSA6 B:CSA7 73 The handler has the internal device code of 27 (see Table 2-12 Chapter 2 of the OS/8 HANDBOOK. The handler is two pages long. 4.2.6 in Card Reader (CDR) 1. Normal Operation This handler reads characters from the card reader and packs them into the input buffer. Trailing spaces (blank col~~~s) on a card are deleted from input. The handler can accept only alphanumeric format data on cards (the DEC029 standard card codes are used). 4-7 2. Initialization for Block 0 None. 3. Terminating Conditions A card which contains an underline character in column 1 (an 0-8-5 punch) with the rema~n~ng columns blank is an end-of-file card. In addition, after reading each card the handler checks to see if a CTRL/Z was typed at the keyboard. After either an end-of-file card or a CTRL/Z being typed, a CTRL/Z is inserted in the buffer, the remaining words of the input buffer are filled with zeros, and a non-fatal error is returned. Attempting to output to the card reader causes a fatal error to be returned. 4. Terminal Interaction Typing CTRL/C forces a return to the Keyboard Monitor. Typing CTRL/Z forces an end-of-file to occur (see 3.). 4.2.7 TM8-E Handler 1. Normal Operation: When the handler is used in its normal mode, single-file mode, magtapes may consist of exactly one file. It starts at the beginning of the tape and consists of consecutive records until an end-of-file mark (EOF) is reached. In this sense, a magtape is similar to one big paper tape. This is the same way that OS/8 currently treats cassettes. Since the capacity of magtapes is so big, provisions have been made for storing multiple files per tape. In such a structure, several files may exist on one magtape. They are unlabeled and are separated from each other by a single file mark. The last one is followed by two file marks. Each 'file' looks like a paper tape. It is referenced in a non-file structured manner. The magtape handler must be altered first to work in file mode. Then the magtape must bepositioned to exactly the correct spot where· the read or write operation will commence. This may be done with any program using the auxiliary capabilities of the magtape handler (described below), or the positioner program, CAMP. To read a file, the handler must be positioned to just before the first data record of that file. To write file #1, rewind the tape (i.e., be at BOT). To write file In, (n>l) the handler should be positioned after the (n-l)st file mark on the tape. Previous file n and all files past it then become unreadable (non-existent). A. Device-Dependent Capabilities: The TM8-E handler has several auxiliary features which may be invoked by a user program which calls the handler in a device-dependent manner. These features all rely on the contents of bits 9-11 of the function word (argument 1 of the handler call) and some require argument 3 in addition. 4-8 These features are brought to life whenever the handler called ..... ith a page count of a (bits 1-5 of the function word). Call bits 9-11 of the function word, the Special Function Register (SFR) for short, and also refer to bit 0 of the fQ~ction word as the direction bite If the page count is not 0, the contents of the SFR is ignored. is If the page count is 0, then the SFR together with the direction bit (and possibly argument 3) determine what special function to perform, as follows: OPERATION o. CLOSE. 1. Rewind. 2. Space forward/reverse records. The direction to space is determined by the direction bit (0 means space forward, 1 means space reverse). The negative (two's complement) of the number of records to space over is given by argument 3 of the handler call. (-1 means space past one record, 0 means 4096 records.) The error return is taken if either a file mark or BOT is encountered. In such cases, you would be left positioned at the beginning of a file. 3. Space forward/reverse files. The direction to space is determined by ~~e direction bit (0 means space forward, 1 means space reverse). The negative of the number of file marks to space past is given by argument 3 (-1 means space past one file mark, 0 means 4096 file marks). In reverse mode, the tape is left positioned at the end of a file, an error is given if BOT is encountered. In forward mode, the tape is left positioned at the beginning of a file. If EOD is reached, the handler automatically performs a backspace record to leave you between the two file marks; no error is given. 4. Rewind the unit and put drive off-line. 5. Write a single EOF. 6. Special read/write function. The direction bit (as usual) determines read or write (0 means read, 1 means write). The specified I/O operation is performed between the user's buffer (start is specified by argument 2) and the very next magtape record. Only one record is transferred and the user's buffer must be large enough to contain it. The record length is specified by the negative of argument 3 (in words). 0 means a record length of 4096. 7: Unused .. Reserved for future use .. currently acts as a No-OP. Write two EOF's. In each case, the unit affected is determined point. 4-9 by If specified: the handler it entry B. Other Common Operations: (a) To backspace n files, use special code 3 to pass over n+l file marks backwards, then use special code 2 to advance (forward) over one record (EOF) ignoring the EOF error. (b) To advance to EOO, first perform a backspace of one record (or perform a rewind to play safe) then use special code 3 to advance over 4096 files in the forward direction (argument 3=0). 2. Special Handling for Block 0 If the handler is called to read or write block 0, it will first perform a rewind. This feature can be patched out if desired by altering relative location 1 from a 0 to a 1. This altered handler should be operating in file mode. The original handler should be operating in single-file mode. A. Special Handling for CLOSE: A close operation is signaled to the handler by calling it with a function word which has a page count of 0 (bits 1-5) and which has bits 9-11 all zeroes. This is how the USR CLOSE operation calls the handler (OS/8 V3 only. This causes the handler to write two successive file marks on the tape. Two successive EOF's is the software indication of end-of-data (EOD). B. Restrictions: In single-file mode, should not have more than 4095 blocks because on trying to write the 4096th block, the handler will think it's writing block 0 and perform a rewind. This restriction does not apply when using the handler in file-mode: but beware, some cusps, such as PIP, are suspected to behave strangely on block 4096 of non-file-structured devices. 3. Terminating Conditions None. 4. Keyboard Interaction: Typing tC on the keyboard while the handler is in operation causes the handler to abort and return to the 05/8 keyboard monitor via location 7600. Such action is ill-advised since it leaves the magtape without an end-of-file indicator. 5. Error Conditions: On a hard error, the handler takes the error return (with a negative AC) and the AC contains the contents of the main status register, as follows: 4-10 Bit on Xeaning 0 Error flag Tape rewinding 1 2 B~ 3 Select error Parity error (vertical, longitudinal, or 4 C~) 5 6 7 8 9 10 11 4.2.8 EOF Record length incorrect Data request late EaT File protect Read compare error Illegal function File-Structured Devices 1. Normal Operation (DECtape, LINCtape, TD8E DECtape, DF32, RF08, and RK8, RK8E) These handlers transfer data directly between the device the buffer. 2. and Initialization for Block 0 None. 3. Terminating Conditions A fatal error is returned whenever the transfer causes one of the error flags in the device status reqister to be set. For example, a fatal error would result if a parity error occurred on input, or a write lock error occurred on output. The device handlers generally try three times to perform the operation before giving up and returning a fatal error. There are no non-fatal errors associated with file structured devices. 4. Terminal Interaction Typing CTRL/C forces a return to the Keyboard Monitor. NOTE The system device handler respond to a typed CTRL/C. 4.2.9 does NOT TD8E DECtape TD8E DECtape is the new accumulator transfer DECtape. Since 05/8 is a noninterrupt driven system, TD8E DECtape has data transfer rates equivalent to those for TCOS DECtape; however, the interrupt should never be used with the TDSE. Device handlers for T08 DEC tape are supplied as a standard part of 05/8. Each pair of drives (0, and 1,' 2 and 3, etc.) requires a 2-page device handler. Thus, to have all 4-11 eight TD8E drives in the system at one time will require four separate handlers. Thus for TD8E, it is wise to restrict usage to those units that physically exist. Also, the tape drives are hardwired to select one of two possible unit numbers: thus, the first pair of drives installed must be called units 0 to 1. Any others numbers will cause a SELECT error. In this case, the computer hangs until the correct drive is selected. 4.2.10 KL8E Terminal Handler Listed are the features of the KL8E conditional are marked by an asterisk: handler. Those that are 1. It reads a line at a time. Whenever the user types CR, it enters CR, LF into the buffer: it echoes CR, LF: and then pads the remainder of the buffer with nulls and returns to the calling program. The characters get put into the buffer, one character per wQrd. Thus every third character is a null as far as 05/8 is concerned. 2. RUBOUT deletes the previous character. It echoes as either a back slash (\> or as the character rubbed out, depending on assembly parameters. RUBOUT at the beginning of a line acts as tU. 3. CTRL/U echoes as tU and erases the current line, allowing the user to retype it. (It also echoes CR, LF.) The buffer pointer is reset to the beginning of the buffer. 4. CTRL/Z echoes as tZ (followed by CR, LF) and signals end-of-input. The tZ enters the buffer and the remainder of the buffer is padded with nulls. The error return is taken with a positive AC (non-fatal error). 5. Nulls are ignored. *6. The altmode characters (octal 175 and 176) are escapes (octal 33). *7. Lower-case characters typed may be automatically converted to upper case. 8. CTRL/C echoes as tC and returns monitor via location 07600. On output: control to converted the to keyboard (either normal output or when echoing input) 1. CTRL/C on keyboard echoes as tC and returns keyboard monitor via location 7600. 2. CTRL/O on keyboard stops further echoing. All echoing ceases (through possibly many buffer loads) until either the handler is reloaded into core or the user types a character other than to on the keyboard. Not operative during input. 3. tS causes the handler to stop sending to the terminal. No characters are lost and outputting resumes when a to is typed. ts and to do not echo. These characters are 4-12 control to the operative only upon output. On input, they are treated like any other input characters. This is very useful on high speed CRT displays. 4. Nulls are ignored. *5. Lower case ~~aracters may be optionally printed as upper case and flagged with an apostrophe. *6. Tabs may be handled in one of three manners: a. Output as actual tabs, b. Output as actual tab followed by padding of two rubouts, c. Output as the correct number of spaces to bring the to the start of the next tab stop. text 7. Whenever the output line reaches the end of the physical line (length set at assembly time), the handler automatically performs a carriage-return line-feed. *8. The escape character (octal 33) prints as a dollar sign. *9. The handler may be set to delay about 16 rns after typing any character (specified at assembly time), for example, line feed. *10. Control characters are printed as their corresponding preceded by an up-arrow. Thus CTRL/K prints as tK. 4-13 letter CHAPTER 5 RECONFIGURING THE 05/8 SYSTEM It is some~1mes necessary to construct an OS/8 system from scratch r or to make a new peripheral device available to 05/8. Both of these tasks are a part of reconfiguring the 05/8 system. 05/8 BUILD r which is described in detail in Chapter 2 of the 05/8 HANDBOOK r allows the user quickly and easily to build a new system or to alter the device complement of an existing system. 5.1 WRITING DEVICE HANDLERS A device handler is a page-independent subroutine one or two pages long. The device handler must run properly in any single page or two contiguous pages in field 0 (except 0000 to 0177 or 7600 to 7777). All device handlers have the same calling sequence: CDF N elF 0 JMS I ENTRY FUNCTION BUFFER BLOCK ERROR NORMAL IN IS CURRENT FIELD TIMES 10 (OCTAL) /DEVICE HANDLER LOCATED IN FIELD 0 /ENTRY IS DETERMINED BY SR "FETCH" IFUNCTION IS BROKEN DOWN AS FOLLOWS: /BIT 0 - 0 FOR READ /BIT 0 = 1 FOR WRITE /BITS 1 TO 5 = NUMBER OF PGS TO TRANSFER /BITS 6 TO 8 = FIELD FOR TRANSFER /BITS 9 TO 11 = DEVICE DEPENDENT BITS /CORE ADDRESS OF TRANSFER BUFFER /BLOCK NUMBER TO START TRANSFER /ERROR RETURN, AC)=O MEANS END-OF-FILE AC(O MEANS FATAL ERROR /NORMAL RETURN The device handler reads or writes a number of 128 word records beginning at the selected block. In general, device handlers should conform to the following standards: 1. On normal return from a device handler the AC is zero and the DATA FIELD is always restored to its original entry value. 2. Although the starting block number has true significance only for file structured devices r handlers for non-file structured devices can check the block number and perform initialization if the block number is zero. For example, the line printer handler outputs a form feed before 'printing when the specified block number is zero. 3. Handlers should be written to be as foolproof as possible checking for the most common errors in the calling program. 5-1 Examples of typical user errors are: calling handler with non-zero AC (always perform a CLA in the handler): trying to read on a write only device, or trying to write on a read only device (gives a fatal error return): specifying 0 pages to be transferred (accept as meaning no actual transfer is to take place): or attempting to access a nonexistent block (gives a fatal error return). 4. Device handlers normally check to see if a CTRL/C (ASCII 203) has been typed at the system console by the user. If one has, the handler aborts I/O and JMP's to location 7600 in field O. The seven low order bits of the keyboard should be checked for a 3 so as to allow parity terminals. KRS should be used over KRB so that any paper tape in the reader will not be advanced if its character is not tC. 5. Device handlers should be able to detect standard error conditions like checksum or parity errors. Whenever possible, several attempts to perform the transfer should be made before aborting I/O and taking the error exit. In addition, when operator intervention is required, the handler would normally wait for the action rather than take a fatal error exit. For example, if the paper tape punch is not turned on, the PTP handler waits for the punch to be turned on. 6. By convention, in any handler for a device (like DECtape) that can search either forward or backward for a block, Bit 11 of the function word (one of the device-dependent bits) controls the starting direction of the search. Bit 11 is a 1 if the starting direction is forward and a 0 if it is reverse. The other two device dependent bits are not assigned any significance at the present time. 7. Remember that the user specifies a multiple of 128 words to transfer, whereas the transfer starts at the beginning of a 128 or 256 word block. This means that the handler must provide that capability of reading or writing the first half of a block. Writing the first half of the block causes the contents of the second half of the block to be altered. For example, writing 128 words to the RK8 disk (256 word blocks) causes the second half of the block to be filled with zeroes. This is usually done by the hardware controller. 8. The entry point to a two page device handler must be first page. 9. A number of handlers (maximum of 15 decimal) can be included in the one or two pages of code. Where more than one handler is included in a single handler subroutine, the handlers are called co-resident. Co-resident handlers are always brought into core together. For example, all eight DECtape handlers fit into one pageJ hence, the DECtape handlers are co-resident. One restriction on co-resident handlers is that if they are two pages long all entry points must be in the first page"'; 10. The USR, while doing file OP'"·' rations , maintains in core the last directory block reac,". n order to reduce the number of directory reads necessary. . '!1e proper functioning of this feature depends on the fact that every handler for a 5-2 in the file-structured device on a single system has a unique entry point relative to the beginning of the handler. The relative entry points currently assigned for file structured handlers are: Relative Entry Points Device Handlers System Device Handler DECtape, LINCtape or TD8E DECtape RKAO RKAl RKA2 RKA3 RK08 or DF32 Reserved for user 11. 7 10 to 17 20' 21 22 23 24 40 to 67 If the device is block oriented (such as DECtape, LINCtape, or Disk), then the handler transfers data directly with no alteration. However, if the device is character oriented (such as a paper tape reader, Teletype, or line printer), the handler is required to pack characters into the buffer on input and unpack them on output. The standard 05/8 character packing format puts three a-bit characters into two words as follows: I ~ " ." . ,. WORD 1 WORD 2 .. ~ ~ CHARACTER 3 BITS 0-3 CHARACTER 1 I~O~ CHARACTE"R 3 BITS 4-7 o I-- CHARACTER 2 3 4 11 For example, the 3 characters IABCI would be words as follows: packed into 2 Word 1: 6301 Word 2: 1702 When packing characters on input, the character CTRL/Z (octal 232) is inserted at the logical end-of-file (for example, at the end of the tape in the paper tape reader handler). Following CTRLh) the remaining words of the input buffer should be zeroed. 12. A close operation should be performed by non-file structured handlers if bits 1-5 and 9-11 of the function word are O. The device handler, whether one or two pages long, must be completely page independent: it must be capable of executing in any page(s} in field 0, except page 0 and 7600 to 7777. Page independent code can have no address constants. Writing one page handlers is relatively easy, since the addressing structure of the pop-a is essentially page independent. Writing page relocatab1e code for two pages, however, is considerably more difficult, as the two pages must communicate. The usual technique utilized in writing two page handlers is to include some initialization code which includes a JMS. This replaces that location by an address on the page the handler was loaded on. Using this, the handler can then determine where the relevant pieces of code are in core. 5-3 As an example, the following is the initialization procedure performed the TD8E DECtape routine. This is by no means the only technique that is possible, but it is a workable solution. by *200 /EXECUTED CODE JINIT, JMP INIT /START INITIALIZATION • INIT, BASE, JMS. TAD CRDQAD SPA JMP NXINIT TAD INIT DCA CRDQAD ISZ .-1 ISZ BASE JMP BASE /FOUND OUT WHERE WE ARE. /INIT GETS ADDRESS OF BASE /NEGATIVE TERMINATES LIST /INITIALIZE SECOND PAGE /NOW UPDATE THE LIST OF /ADDRESS DEPENDENT LOCATIONS /POINT TO NEXT ELEMENT /NEXT INPUT VALUE /LOOP OVER INPUT TABLE. CRDQAD, CINIT2, CSELCT, CXUNIT, BUFF, R4LINE-BASE INIT2-BASE SELECT-BASE XUNIT-BASE 4000 • • /THESE ARE ALL POSITIVE DIFFERENCES, /SINCE THE ROUTINES INDICATED ARE /IN THE SECOND AGE. AFTER /INITIALIZATION~ CRDOAD POINTS TO /THE ACTUAL ADDRESS OF R4LINE, ETC. /THE 4000 IN BUFF TERMINATES /TBE FIRST INITIALIZATION. /MORE PAGE INDEPENDENT CODE • NXINIT, BASE2, INIT2, INIT3, JMS I CINIT2 /INITIALIZE SECOND PAGE DCA JINIT /CLEAR OUT JINIT. NO MORE JMP JINIT /RELOCATING IS NEEDED UNTIL THE /HANDLER IS LOADED INTO CORE GAIN. *400 /SECOND PAGE OF HANDLER o /ADDRESS OF BASE2 GOES HERE TAD CTRY3 SNA JMP I INIT2 TAD INIT2 DCA CTRY3 ISZ .-1 ISZ INIT3 JMP INIT3 /A 0 TERMINATES THIS LIST /ADD VALUE OF BASE2 TO LIST /PUT BACK INTO LIST /NEXT LOC. TABLE • • CTRY3, CRWCOM, XBUFF, TRY3-BASE2 /THIS LIST GETS VALUE OF BASE2 TRWCOM-BSSE2 /ADDED IN TO POINT TO THE REAL o /ROUTINE. 5-4 Writing 2 page independent code can be expensive in terms of core required. The routines should be set up in such a way as to minimize communication between the two pages. Some other points to keep in mind are: 1. Relocation code is once-only code. It is done once when the handler is loaded and need never be done again until the handler is re-loaded from the system device. For this reason, the relocation code can be placed in a buffer area or setup in temporary scratch locations which are later used as temporarj storage. 5.2 2. A useful hint is that a JMP into the next page of code is not required. The code can just as easily fall through 377 into 400. This may save a few locations of relocation code. 3. Useful techniques for writing 2-page handlers can be found in the source of the KL8E handler. INSERTING DEVICE HANDLERS INTO OS/8 After the handler has been written and thoroughly debugged as a stand-alone routine, it can be integrated into the 05/8 Monitor, where it will become a resident device handler. To accomplish the integration, use 05/8 BUILD, described thoroughly in the BUILD section in Chapter 2 of the 05/8 HANDBOOK. Notes for writing system handlers system handlers may be integrated into BUILD just like non-system handlers with the following additional notes: 1. Body of system handler should be origined to 200 but must start with a 2 BLOCK 7. Entry point must be at relative location 7 (corresponds to location 7607). 2. Name of system handler must be SYS. 3. Each handler entry point has an a-word handler associated with it. The following additions. apply: a. block word 5: bits 9-11 should normally be O. If the device can have multiple platters (like RF08) then this field specifies maximum number of platters allowed. Each platter above first bumps internal DCB code by 1. word 6: bit 0=1 means system device is two pages long. The second page is origined into 400 but resides in field 2 location 7600. Bit 1=1 if entry point is SYS. Bit 2=1 if entry point is coresident with SYS. word 7: must be 0 word 10: number of blocks in device. Immediately following the header records is the code for the deviceis bootstrap. This is preceded by minus ~~e number of words in the bootstrap. No origins may appear in this code. It must be less than 47 locations long. 5-5 APPE~mIX A OS/8 FILE STRUCTURES A.l FILE DI?~CTORIES Blocks 1 through 6 on all file structured devices are reserved for the file directory of that device. Six blocks are always allocated, though all are not necess~rily active at any given time. To minimize the number of directory reads and writes necessary, OS/8 fills one directory block completely before overflowing onto a second block= Thus the user with only a few files can perform directory LOOKUPs and ENTERs faster than one with many files. The directory blocks are each structured according format: ENTRY to the following Locations 0 through 4 of each directory block are called header. the segment o MINUS THE NUMBER OF ENTRIES IN THIS SEGMENT THE STARTING BLOCK NUMBER 1 ! OF THE FIRST FILE IN THIS I SEGMENT , 2 LINK TO NEXT SEGMENT-ZERO IF NO NEXT SEGMENT I FLAG WORD-POINTS TO LAST WORD OF TENTATIVE FILE ENTRY IN THIS SEGMENT DIRECTORY SEGMENTS ARE ALWAYS LOADED INTO LOCATIONS 11400 TO 117777 BY THE USR~ THIS POINTER IS EITHER 0 OR BETWEEN 1400 TO 1777. 3 4 MINUS THE NUMBER OF ADDITIONAL INFORMATION WORDS THE NUMBER OF ADDITIONAL INFORMATION WORDS SPECIFIED MUST BE THE SAME IN ALL DIRECTORY SEGMENTS 5 BEGINNING OF FILE ENTRIES I J 377 END OF DIRECTORY BLOCK ____________________________ (8)1~ A-I ~ A.l.1 Directory Entries There are three types of file directory entries. They are PERMANENT FILE ENTRY, EMPTY FILE ENTRY, and TENTATIVE FILE ENTRY. A permanent file entry appears as follows: Contents Location ~Jotes FILE :~ANE CHARAC':'ER "-" FILE ~A}!E FILE NAHE I 1 CH.P~RACTER 4 ! THE FILE KANE AND EXTENSION CHARF.CTER 3 ---------F--I-L-E-I'-;P.1-lE----l / F.RE PACKED IN SIXBIT ASCII FILE NF"l-m (i.e., "A" would be .0'1) 2 CHARAC':'ER 5 CHF.RP~CTER 6 !I 01 FILE NANE CHA~ACTER 1 ~.---.- I I 3 -I I FILE EXTE!-:SION FILE EXTENSION CHARACTER 2 i j CHARAC':'ER 1 1< N, THE ~UMBER OF ADDITIONAL INFORNATION WORDS, IS GIVEN ADDITIONAL ~: BY WORD 4 OF THE DIRECTORY HEADER. \.-. INFORHATION ~ WORD 4 OF THE ENTRY -:-'/____~W~O~R~D~S~___________~I'I, IS EITHER 0 OR THE CREATION I ' I DATE OF THE FILE. I ! II -4) N+3+-______________________________ N+41 MINUS FILE LENGTH IN BLOCKS NOTE If word 3 is zero, the given file has null extension. a An empty file entry appears as follows: Location Contents o ENTRY IS ALWAYS 1 MINUS THE NUMBER OF BLOCKS IN THIS EMPTY FILE .0'~g~ A tentative file entry appears as a permanent file entry with a length of zero. It is always immediately followed by an empty file entry. When the tentative file is entered in a directory, location 3 in the' segment header becomes a pointer to this entry. The CLOSE function inserts the length word of the tentative file entry, making it a permanent file, and adjusts the length of the following empty file entry (deleting that entry if the length becomes zero). Whether or not there is a tentative file open on any device is determined by examination of bits 9 to 11 of the system Device Control Word Table (see section B.3.5) not the contents of' location 3 in the segment header. Zeroing these bits in the Device Control 'Word Table makes the active tentative file on the device inactive. The next time that the system has to write the directory segment, the inactive A-2 tentative file ent~J is removed. ~he distinction between active and inactive tentative files is marie so that 05/8 can avoid spending the time required to perform an extra read and write of the device directory. A.l.2 Number and Size of 05/8 Files All files on an 05/8 device must occupy a contiguous group of blocks on the device. The length of any file is indicated in its directory entry; and the starting block of the file is deduced by adding together word 1 of the segment header and the lengths of all files whose entries precede it in the directory segment. Each directory segment must have enough unused words at the end to accommodate a permanent file entry (N+5 words, where N is the number of Additional Information Words). Thus, if N is the number of Additional Information Words the maximum number of permanent file entries in anyone segment is: 256-7 - MIN = ( 244-N (N+5) ] = N+7 [-] N+7 with N=l, MAX=40, and MIN=30. Since there are six segments in the directory, the maximum number of files possible (with N=l) would be 240. Finally, 05/8 devices are limited to 4095 blocks, each block being 256 words long. Thus, the maximum size of any single 05i8 file structured device is 1,048,320 words. Blocks 0 through 6 of the device are unavailable for file storage; therefore, the largest possible file is 4088 blocks long, or 1,046,528 words. A.l.3 Sample Directory The initial directory written when the OS/8 system is built follows: A-3 looks as o SEGHE~T HEADER PEID-!ANENT FILE ENTRY EHPTY FILE ENTRY 7776 1 iJ~70 FILE 2 ,00~~ :,IO ,) 0~~0 4 7777 r 5 0102 j~ 2314 STORAG~ C~~Rm~ ~ ... i". J...., -Y r>. ;DDITIONAL DIRECTORY SEGr':;ENTS O:.--JE ADDITIONAL I:~FORHATIO:-J 'dORD FILE NAME IS "ABSLDR" ~422 lto 2326 ~1 537~ DATE IS 10/31/70 ~2 7773 LENGTH IS FIVE BLOCKS FILE EXTENSION IS .SV [13 ~14 ELOCK -0 18 * EHPTY FILE 6534 LENGTH IS 12448 (67610)BLOCKS THIS IS DEPENDENT ON THE SYSTEM DEVICE GSED. 676 IS THE VALUE FOR A DECTAPE SYSTEM *This leaves room fer the OS/8 System Areas. A.2 FILE FORMATS There are three different standard associated system programs: file formats 1. ASCII and Binary files. 2. Core Image files (.SV format). 3. Relocatable FORTRAN library files current example of this format). used by 05/8 and (LIB8.RL is the only NOTE Binary files can contain either absolute binary data (i.e., output from PAL8) or relocatable binary data (i.e., output from SABR). A.2.l ASCII and Binary Files ASCII and Binary files are packed three characters into two words, follows: CHARI~C':'ER WORD 1 3 CHARACTER 1 BITS 0-3 CHARACTER 3 BITS 4-7 WORD 2 as CHARACTER 2 f 11 The following conventions are used by OS/8 system programs: o 1. 3 4 In ASCII files the character NULL (ASCII 000) is always ignored. Most programs only examine the low-order 7 bits, in ASCII files. The parity bit is usually ignored: do not assume that this bit is set or that data transfers will preserve it (image mode transfers, always preserve it). A-4 2. In Binary files the binary data must be preceded by one or more frames of leader/trailer code (ASCII 200 code). The first character of binary data must be either 100 to 177 (octal) (an origin setting for absolute binary files), 240 to 257 (octal) (a COMMON declaration frame for relocatable binary files), UL 300 (octal), which is an origin setting. The end of binary data is indicated by one or more frames of leader/trailer code. 3. ASCII and Binary files are terminated by a CTRL/Z code (ASCII 232). In binary files, a CTRL/Z code data rather than end-af-file. A.2.2 Core Image (.SV Format) Files A core image file consists of a header by the actual core image. The header block is called the Core Control Block. The Core Control Block consists of the first 128 words of the 256 word block reserved for that purpose. The second 128 words are unused. The Core Control Block is formatted as follows: Notes Contents Location CORE CONTROL BLOCK 01 ,I l1INUS THE NUMBER OF CORE SEGr-lENTS I I 62N3 WHERE N IS THE t-- STARTING FIELD CDF CIF (STARTING FIELD) ~----------------------------------~ STARTING ADDRESS JOB STATUS ~10RD CONTROL DOUBLE WORDS 2K +3 377 8 ~ ~r t fr 1 J (K IS THE i-JUMBER OF ~ A-5 CORE SEGHENTS) REMAINDER OF BLOCK IS GNUSED The format of the Job Status Word is as follows: Meaning Bit Condition Bit 0=1 File does not load into locations 0 in field O. to 1777 Bit 1 = 1 File does not load into locations 0 in field 1. to 1777 Bit 2 = 1 Program must be reloaded restarted. Bit 3 = 1 Program never uses above SK. This when Batch processing is active. Bit 10 = 1 Locations 0 to 1777 in field 0 need not be preserved when the Command Decoder is called. Bit 11 = 1 Locations 0 to 1777 in field 1 need preserved when the USR is called. before it can is be used not be The Core Segment Doublewords control the reading and writing of the associated areas of core. The format of each entry is as follows: Contents Location CORE ORIGIN 1 2 Notes l-1ULTIPLE OF 1 ~-T------------------~~----------~-----------1 NUMBER OF PAGES I FIELD TO LOAD o 1 TO LOAD 5 8 6 9 4~~ 8 BITS ~ AND 9-11 ARE ZERO 11 The core 'origin must be a mUltiple of 400 (octal). The Core Seqment Control Doublewords are sorted within the header block in order of decreasing field and increasing origin within the same field. There can be no more than 32 (decimal) Core Segment Control Doublewords in any Core Control Block. The Core Control Block for the program at the time it is loaded into core is always saved in words 200 (octal) through 377 (octal) of block 37 (octal) (one of the system scratch blocks) on the system device. It is placed there by the GET and RUN operations or by the ABSLDR or LOADER programs. This Core Control Block is used when performing a SAVE without arguments. NOTE The R command differs from the RUN command in that the program's Core Control Block is not written onto the scratch area when using the R command. In order to SAVE a program that has been loaded by the R command all of the arguments of the SAVE command must be explicitly stated. A-6 A.2.3 Relocatable FORT~~ Library ?ile FORTRfu~ library consists of a library directory block followed by relocatable binary segments. The .directory block has the following format: A relocatable a 3 CH2 CHI ,} CH4 CH3 --------+---------i 1 ,., Notes Contents Location NAME OF ENTRY IN SIXBIT ASCII PADDED VJITE TPAILING BLANKS ("'UC:: eH6 ~-------+----------.~'J LOAD POINTER ,-,.L.a...." .~ {:' ADDITIONAL ENTRIES I ~ t-~--1I) ~ I I ! I DENOTES END OF NAME ENTRIES ~ 1 ~ /J LOADER CONTROL WORD(S) --.END OF LOADER CONTROL WORDS FOR THIS ENTRY ~ 377 8 ------~f CI--;- " The Load Pointer is a number between 0 and 377 (octal) which points (relative to the beginning of the block) to an array of Loader Control Words. The Loader Control Words have the following information: o 4 5 11 NUMBER OF PAGES OCCUPIED BY THIS SEGMENT AFTER LOADING (STARTING BLOCK OF RELOCATABLE BINARY DATA) (DIRECTORY BLOCK #)-1 There can be one or more Loader Control Words for each entry. The Loader Control Words for an entry are terminated by a word of zero. The following is a simple directory-block. A-7 Contents Location 1117 1 2 4040 3 0376 LOAD POINTER FOR "IOHI! 4 0530 ) 1124 NAME OF ENTRY IS "EXIT 5 6 4040 7 0373 10 0000 12 13 0000 1 " LOAD POINTER FOR "EXIT" 0000 ) 11 LOADER 373 CONTROL WORDS FO "EXIT" 374 LOADER 375 CONTROL {376 WORDS FORo 377 "IOH" 8 ° NAME OF ENTRY IS "IOH ___ " 1040 MARKS END OF ENTRIES 0000 v l....- 0207 0411 0000 2400 0000 A-a (RELATIVE BLOCK 1~8) (ONE PAGE LONG) (RELATIVE BLOCK 12 ) (TWO 8 PAGES LONG) (RELATIVE BLOCK 1) (12 PAGES 8 LONG) APPENDIX B DETAILED LAYOUT OF THE SYSTEM This appendix covers three topics: the reserved areas on the system device, the resident portion of 05/8, and the various system tables. B.l LAYOUT OF THE SYSTEM DEVICE The first 70 octal blocks (14K words) on the system device reserved by the OS/8 system. These blocks are used as follows: Block(s) in Octal o 1-6 7-12 13-15 16-25 26 27-50 51-53 54-55 56 57 60-63 64 65 66 67 are Contents System Bootstrap Routine Device Directory Keyboard Monitor User Service Routine Device Handlers ENTER Processor for USR System Scratch Blocks Command Decoder SAVE and DATE Overlays Monitor Error Routine CHAIN Processor for USR SYSTEM ODT Reserved for System Expansion CCL Reminiscences 12K TD8E Resident code CCL Overlay File storage begins with block 70 (octal). The system scratch blocks are used for preserving the contents of core when the Keyboard Monitor, USR, Command Decoder, or ODT are loaded. In addition, various system programs use the scratch area. Most importantly, the SAVE command expects the Core Control Block to be loaded in words 200 (octal) to 377 (octal) of block 37 (octal). The Core Control Block is stored at those locations by the GET or RUN command or by the ABSLDR or LOADER program. B-1 A detailed breakdown of system scratch block usage follows: contents Block(s) in Octal B.2 27-32 The conten~s of locatic~s lODOO ~o 11777 are saved in ~~is area when the USR is loaded. 33-36 The contents of locations 0 to 1777 are saved in this area when the Command Decoder, Keyboard Monitor, or ODT is loaded. 37 Words 200 (octal) to 377 (octal) of this block contain the Core Control Block for the last program loaded by the GET or RUN command, or the ABSLDR or LOADER program. 40-47 Used as scratch storage LOADER programs. 50 Reserved for future expansion. by the ABSLDR and LAYOUT OF THE 05/8 RESIDENT PROGRAM The top core pages in fields 0, 1, and 2 are used by the resident portion of OS/8 and are not accessable by the user. As a general rule, system and user programs should never destroy the contents of locations 7600 to 7777 of any field. The resident portion of OS/8 is structured as follows: Location 7600 Contents Notes WRITE OPER..2\TION ~ NON-DESTRUCTIVE ENTRY TO PS/8 7605 JMP TO FIELD 1 FOR READ DESTRUCTIVE ENTRY TO PS/8 SYSTEM DEVICE HANDLER ENTRY TO SYSTEM DEVICE HANDLER 7607 ~~r-"" /( 7743 7744 7745 CURRENT STARTING ADDRESS 7746 JOB STATUS 'Y]ORD 7747 ~ ~ MUST ALWAYS BE ZERO 7750 RESERVED FOR DATA BREAK LOCATIONS 7755 7756 ,'fJ.-._ _ _ _-JT ..- THE KEYBOARD MONITOR -- PROGRAM SETUP AREA 7777 B-2 AND ODT MODIFY THIS AREA TOP PAGE OF FIELD 1 7600 7616 7617 7641 1 10 't '" 7645 7646 7647 ~ E __ I' OUTPUT FILE LIST (3 E);TRIESl,[J-., INPUT FILE LIST (MAXIHUM 9 ENTRIES) ~~:;~~::;:~:;;:=:F ..,rA'l 7677 7700 I ----------------------------~I ~ ri 7643 7665 7666 7667 :Jotes Contents Location ~ MARKS END OF LIST ~~ii~~~- JI .~REA =N DEVICE HANDLER RESIDENCY TABLE SYSTEM DATE WORD COMMAND DECODER [ 7740 7741 7757 7760 7776 7777 Systems built around TD8E DECtape without the Read-Only-Memory option use 7600 in field 2 as an extension of the system device handler. TOP PAGE OF FIELD 2. 7600 Used only for 12K TD8E systems. Part of system handler resides here in that case. 7773 7774 Four words reserved for BATCH use if machine has exactly 12K. Contains pointers into input file. 7777 If the machine has more than 12K, the top 4 location the last field are reserved for use by BATCH. (7774-7777) of If a ROM (Read-Only-Memory) is being used with an 8K TD8E system, locations 7400-7777 of field 7 are inaccessible to the user. That core is used for system handler functions. B-3 B.3 SYSTEM DEVICE TABLES Each device is described to the system by entries in five system tables. Each of these tables is fifteen words long, where the device number is the index into the table. The five tables are described below. B.3.l Permanent Device Name Table Entries in this table specify the permanent name of each device. The entries are computed by encoding the actual four-character device name in a single word as follows: 1. The device name is expressed as two words in the standard DEVICE format. For example, if the device name were "PTR" the two words would be: WORD 1: 2024 WORD 2: 2200 Note that when the device name is left inserted to fill four characters. justified; O's are 2. A single word is created by adding together these two words. 3. If word 2 is non-zero, bit 0 of the resulting word is forced to be a one. For example, the table entry for "PTR" would be 4224. An entry of zero means that there is no device for device number. the corresponding NME Conventionally, device names consist only of the characters A to z and 0 to 9. The first character of the device name should be alphabetic. The coding used makes all one and two character device names unique; however, names of more than two characters are not unique. For example, "PTR" and "RTP" have the same encoding. The Permanent Device Name able is fifteen locations long; it resides in the USR. When the USR is in core the beginning of the table is in field 1 at a location the address of which is contained in location 10036. B.3.2 User Device Name Table Entries are made in this table whenever the user performs an ASSIGN and are restored to zero by a DEASSIGN. These entries have the same format as those in the Permanent Device Name Table. The User Device Name Table resides in locations 17741 through 17757. B-4 B.3.3 Device Handler Residency Table When a device handler is loaded by the USR, the entry in this table for the device loaded (and entries for all devices whose handlers are co-resident, if any) is set to contain the entry point for the device handler. Entries ether ~~~~ those that contain an address above 7600 (thus referring to the system handler) are restored to 0 when a RESET, DECODE or CHAIN function is executed. When a program exits to the Keyboard Monitor this table is not cleared. The Keyboard Monitor Commands GET, RUN, R, SAVE, and START (with no explicit address) clear this table. NOTE Since the system device handler is always resident the first entry (SYS is always device number 1) in the Device Handler Residency Table is always 7607 (the entry point of the system device handler). The Device Handler Residency Table resides in locations 17647 17665. B.3.4 through Device Handler Information Table Each entry in this table contains all the information needed by the USR to load the corresponding handler. The format of these entries is as follows: Bit Condition Meaning Bits 0 = 1 If this is a two page device handler. Bits 1 to 4 Contain the relative block location of the device handler record on the system device. This is computed by subtracting 15 (octal) (one less than the first device handler block) from the actual block number. Bits 5 to 11 Contain the offset of the handler entry point from the beginning of the page. Note that the entry points to all handlers must be in the first page. If an entry is 0 the corresponding device handler is not saved in any of the device handler storage·blocks. This is always true of device number 1 (the system device) and for all device numbers that are not used in a given configuration. The Device Handler Information Table is 15 locations long and resides in the USR. When the USR is in core the beginning of the table is in field 1 at a location the address of which is contained in location 10037. B-5 B.3.5 Device Control Word Table Entries in this table specify special device characteristics, including the physical device type. The entry format is as follows: Bit Condition =1 Bit 1 = 1 Bit 2 = 1 Meaning If the device is file-structured. Bit 0 If the device is read-only. If the device is write-only. Bits 3 to 8 Contain the physical (described below), Bits 9 to 11 For file structured devices, these bits contain the directory block number of the currently active tentative file. If bits 9 to 11 are zero, there is no active tentative file on the device. For non-file structured devices, bits 9 to 11 are always zero. Bits 9 to 11 are reset to zero by the commands GET, RUN, R, SAVE, START (with no explicit address) and optionally by the USR functions RESET and DECODE. device type code The device type is a number between 0 and 77 (octal), of which 0 through 20 (octal) are currently assigned to existing devices, as follows: Device Code o 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-37 40-57 Device Teletype High-speed paper tape reader High-speed paper tape punch Card Reader Line Printer RKS Disk 256K Disk (RFOS) 512K Disk (RFOS + RSOS) 76SK Disk (RFOS + 2 RSOS's) 1024k disk (RFOS + 3 RSOS's) 32K Disk (DF32) 64K Disk (DF32 + DS32) 96K Disk (DF32 + 2 DS32's) l2SK Disk (OF32 + 3 DS32's) OECtape LINCtape (PDP-12 only) TMSE Magnetic Tape TDSE DECtape BATCH handler RKSE Disk NULL reserved for future disks TASE Cassette VRl2 Scope reserved for future use by DEC reserved for use by users B-6 The Device Control Word 17776. B.3.6 Table resides in locations 17760 through Device L~~g~~ Table There is a sixth table that is not normally considered part of the system tables. This is the Device Length Table and is used only by PIP to perform the IZ (zero directory) and IS (compress device) options. This table is 64 locations long, one entry for each possible device type. In ~~is table an entry of 0 means that the corresponding device is non-file structured 1 otherwise the entry contains the negative of the number of available 256-word blocks on the device. For example, the entry for a 256K disk would be 6000 2000 (octal), or 1024 (decimal), 256-word blocks). (octal) {minus The Device Length Table resides in PIP. When PIP is brought into core the Device Length Table is in locations 13600 to 13677. When new device types are added to the system this table should be patched with DDT to reflect ~,e device length of the new device. A similar table occurs in RESORC which the user may wish to patch. It is located in field 0 locations 2000-2377 and contains 64 four-word entries 1 one entry for each device type. Words 1 and 2 of an entry are the names of the device (in sixbit) and word 3 is the negative of the number. Word 4 of the entry should be 0 for non-standard devices. B-7 APPENDIX C SYSTEM ERROR CONDITIONS AND MESSAGES This is a summary of all error messages that are a result of system errors. These errors are also described in the relevant sections of this manual and in the OS/8 HANDBOOK. C.I SYSTEM HALTS Errors that occur as a result of a major I/O failure on the system device can cause a system halt to occur. These are as follows: Value of PC Meaning 00601 A read error occurred while attempting to load ODT. Return to the Keyboard Monitor by restarting at 07605. 07461 An error occurred 07605 An error occurred while attempting while reading a program into core during a CHAIN. Return to the Keyboard Monitor by restarting at 07605. to write Keyboard Monitor area onto the system scratch blocks. Verify that the system device is not WRITE LOCKed and restart at location 07600 to try again. ~~e 07702 A user program has performed a JMS to 7700 in field O. This is a result of trying to call the USR without first performing a CIF 10. As location 07700 has been destroyed, the user must re-bootstrap the system. 07764 A read error occurred while loading a program. Return to the Keyboard Monitor by restarting at 07605. 07772 A read error ocurred on the system scratch area while loading a program. Return to the Keyboard Monitor by restarting at 07605. C-I 10066 An input error occurred while restore the USR. Return to Monitor by restarting at 07605. attempting to the Keyboard 10256 A read error occurred while attempting load the Monitor by restarting at 07605. to 17676 An error occurred while attempting to read the Keyboard Monitor from the system device. Try again be restarting at location 07605. DO NOT PRESS CONTINUE. 17721 An error occurred while saving the USR area. Verify that the system device is not WRITE LOCKed, and press CONTINUE to try again. 17727 An error occurred while attempting to read the USR from the system device. Return to the Keyboard Monitor by restarting at 07605. 17736 An error occurred while reading the scratch blocks to restore the USR area. Return to the Keyboard Monitor by restarting at 07605. Also, there is one halt in the LOADER program: 00005 A parity error occurred when attempting to overlay the LOADER from-the system scratch blocks. Return to the Keyboard Monitor by restarting at 07605, and try again. After retrying the operation which caused the failure, if the error persists, it is the result of a hardware malfunction or a parity error in the system area. Run the appropriate diagnostic program to check the device and rebuild the system. C.2 USR ERRORS Fatal errors that occur during operation of the USR cause the message: MONITOR ERROR n AT xxxxx to be printed. In these cases, the value "n" describes the error and "xxxxx" " is the address of the call to the USR that caused the error. The six Monitor errors are: Message .Meaning MONITOR ERROR 1 AT xxxxx [CLOSE ERROR] File length too large. MONITOR ERROR 2 AT xxxxx [DIRECTORY I/O ERROR] An I/O in CLOSE function is error occurred while attempting to read or write a directory block. This is generally caused by the device being WRITE LOCKed. C-2 ~he MONITOR ERROR 3 AT xxxxx [DEVICE HANDLER NOT IN CORE] device handler required for a =ile operation (LOOKUP, ENTER, CLOSE) is not in core. MONITOR ERROR 4 AT xxxxx [ILLEGAL USR CALL] Illegal call to the USRI either an attempt has been made to call the USR from locations 10000 to 11777 or a device number of zero was specified. MONITOR ERROR 5 AT xxxxx [I/O ERROR ON SYS] I/O error occurred while reading or or writing on the syste~ device. Verify that the system device is not WRITE LOCKed. MONITOR ERROR 6 AT xxxxx [DIRECTORY OVERFLOW] Directory overflow occurred (see section A.l.2 for limitations on number of directory entries). In addition to the MONITOR ERROR messages, system can use the USR to print: and user programs USER ERROR n AT xxxxx by using the ERROR function. In this case the value of "n" user-defined and "xxxxx" is the address of the call to the USR. is currently, two USER ERROR numbers have been assigned: Meaning Message USER ERROR 0 AT xxxxx An USER ERROR 1 AT xxxxx While running a FORTRAN or SABR program, an attempt was made to call a subroutine that had not been I/O error occurred while attempting to load a program with the GET, RUN, or R command. loaded. If an I/O error is made during the monitor CHAIN function the message CHAIN ERR is generated, and control returns to the keyboard. Following either a MONITOR ERROR message or a USER ERROR message the USR exits to the keyboard Monitor: the current contents of core are preserved and bit 2 of the Job Status Word is set to a 1 to prevent continuing from the error. C.3 KEYBOARD MONITOR ERRORS In addition to the USR errors described previously, the following errors can occur after a command is given to the Keyboard Monitor: C-3 Meaning Message aaaa? The Keyboard Monitor cannot interpret the command "aaaa". For example if the user types HELLO the system will respond HELLO? BAD ARGS Arguments to a SAVE inconsistent, or illegal. BAD CORE IMAGE The file requested with an R, RUN, or GET command is not a core image file. BAD DATE Improper syntax in a DATE command. device NOT AVAILABLE The permanent device name specified in an ASSIGN, SAVE, RUN, or GET command does not exist. ILLEGAL ARG The SAVE command correctly. name NOT FOUND The file name specified was not located on the device indicated. This error can also be caused by trying to RUN or GET from an output only device. NOll A START was command not are expressed command (with no address is prohibited when bit 2 of the Job Status Word (location 07746) is a 1. specified) e.4 NO CCLI Command was a valid CCL command CCL.SV is not on the system. SAVE ERROR An SYSTEM ERR An TOO FEW ARGS An but I/O error occurred while saving the program. The contents of core remain intact. error occurred while doing I/O to the system device. argument command. has been omitted from a eCL ERROR MESSAGES Message Meaning BAD DEVICE The device specified in a eCL command is not of the correct form, (e.g., DTAO.PA:). BAD EXTENSION Either an extension was specified without a file name (e.g., DTAl:.PA) or two extensions were specified (e.g., DTA1:FILE.PA.BN). e-4 BAD MONITOR The version of the Keyboard Monitor being used is not compatible with ceL. A new version of the monitor must be obtained from Digital before eeL can be used. BAD NUMBER A eeL command which uses the # construction does not have the full l6-digit specification that is required. BAD RECOLLECTION An attempt was made to use a previously remembered argument when no argument was saved. This error occurs when no argument was previously saved or when the DATE command has been used since the argument was saved. BAD SWITCH OPTION The character used with a slash (I) to indicate an option is not a legal option. CANNOT CHANGE CORE CAPACITY WHILE RUNNING BATCH A CORE command was issued while the BATCH program was running. %CANT REMEMBER The argument specified in a eeL command line is too long to be remembered or an I/O error occurred. CCL 3X OVERLAY & The version of CCL being used is not compatible wi~~ the Keyboard Monitor present on the system. Type R CCL to retry. MONITOR INCOMPATIBLE COMMAND LINE OVERFLOW The command line specified with the @ construction is more than 512 characters in length. COMMAND TOO LONG The length of a text argument in a MUNG command is too long. CONTRADICTOR SWITCHES Either two CCL processor switches were specified in the same command line (e.g., FILE-PA-FT) or the file extension and the processor switch do not agree (e.g., FILE.FT-BA). name DOES NOT EXIST The device with the name given present on the OS/8 system. ERROR IN COMMAND A command not entered directly from the console terminal is not a legal CCL command. This error occurs when the argument of a UA, UB, or UC command was not a legal command. ILLEGAL * OR ? is not * or- ? was used in a CCL command that does not accept the wild card construction. Only CCL commands that run FOTP or DIRECT allow the wild card construction. An C-5 ILLEGAL SYNTAX The eeL command incorrectly. line was INPUT ERROR READING INDIRECT FILE CCL cannot read the file specified with the @ construction. I/O ERROR ON SYS: An error occurred while doing I/O to the formatted system device. The system must be restarted at 7600 or 7605. Do not press CONT. as that will surely cause further errors. I/O ERROR TRYING TO RECALL An I/O error occurred while CCL was trying to remember an argument. NO CCL! CCL.SV is device. NOT ENOUGH CORE The number specified in a CORE command is larger than the number of 4K core banks on the system. name NOT FOUND The file with the name given is not present on the specified device, or the user tried to input from an output-only device. 'SUPERCEDED The file specified in a MAKE command already exists. This is a warning message indicating that the file is being replaced. SWITCH NOT ALLOWED HERE Either a CCL option was specified on the left side of the < or was used when not allowed. For example: COMPARE FlLE-NB. TOO MANY FILES To many files were command. C-6 not present on included the in system a CeL C.5 COMMAND DECODER ERRORS The following errors are printed by the Command Decoder. After the error message, the Command Decoder starts a new line, prints a * and waits for &~other co~mand line~ The erroneous command is ignored. Message Meaning ILLEGAL SYNTAX The command incorrectly. TOO MANY FILES More than three output files or nine input files were specified (regular mode) or > 1 output or > 5 input (special mode). name NOT FOUND The specified input file name found on the device indicated. C-7 line is formatted was not APPENDIX D PROGRAMMING NOTES This appendix is a potpourri of ideas and techniques that have proven useful in programming the PDP-8. OS/8 users may find some use in their own programs for the techniques mentioned here. D.l The Default File Storage Device, DSK 0.2 Modification to Card Reader Handler 0.3 Suppression of Carriage Return/Line Feed in FORTRAN I/O 0.4 Accessing the System Date in a FORTRAN Program 0.5 Determining Core Size on PDP-8 Family Computers 0.6 Using PRTCl2-F to Convert OS/8 DECtapes to OS/12 LINCtapes 0.7 Notes on Loading Device Handlers 0.8 Available Locations in the USR Area 0.9 Accessing Additional Information Words in 05/8 0.10 SABR Programming Notes 0.1 THE DEFAULT FILE STORAGE DEVICE, DSK The Command Decoder, as noted earlier, makes certain assumptions about the I/O device where none is explicitly stated. Namely, on all output files where no device name is given, the device DSK is assumed. On the first input file where no device name is given, DSK is assumed. Subsequent input files assume the same device as the previous input file. This convention was adopted to simplify typing command lines. The permanent device name DSK is assigned when the system is built. On all standard systems, DSK is equivalent to SYS. A useful technique is to use the ASSIGN command to redefine the meaning of DSK temporarily. For example, where device DTAO is equivalent to DSK and 0-1 it becomes desirable to change DSK to DTAl, the following command be given: can .ASSIGN DTAl DSK DTAl remains the default file storage device until it is assigned a This technique is new name or a DEASSIGN command is executed. considerably easier to use than rebuilding the entire system. If 'DSK' has not been assigned via the ASSIGN command, then 'DSK' always exists and has internal device number 2. User programs wishing to use DSK should do an INQUIRE to find its number in case the operator has re-assigned it. 0.2 MODIFICATION TO CARD READER HANDLER The standard card reader handler for OS/8 uses the DEC029 standard card codes. Some installations may prefer to use the DEC026 codes instead. This can be done by changing the card conversion codes with the BUILD command ALTER. 1. Call OS/8 BUILD by typing: RUN SYS BUILD in response to the dot printed by the Keyboard Monitor. 2. Load the card reader handler as described on page 2-42 of the OS/8 HANDBOOK. 3. Use the ALTER command (see page to make the following changes: 2-49 of the ~ TO 104 105 106 3203 4007 3502 7735 4076 0774 114 115 116 7514 0577 3637 3314 1002 0305 124 125 126 127 0104 1211 3374 . 0641 3204 1273 3606 1341 134 135 136 7316 3410 1376 3716 1175 3401 CHANGE RELATIVE LOCATION OS/8 HANDBOOK) The new system will have modified card codes. Note that this procedure does not affect FORTRAN run time card input with READ (3,n). The conversion table for FORTRAN is UTILTY.SB on source DECtape #2. (DEC-S8-0SYSB-A-UA2) D-2 026 PUNCH CARD CODES Octal 8-bit CODE DEC026 CODE 300 301 302 303 304 305 306 307 8-4 12-1 12-2 12-3 12-4 12-5 12-6 12-7 / 310 311 312 313 314 315 316 317 12-8 12-9 11-1 11-2 11-3 11-4 11-5 11-6 0 1 2 3 4 5 6 7 320 321 322 323 324 325 326 327 11-7 11-8 11-9 0-2 0-3 0-4 0-5 0-6 8 9 330 331 332 333 334 335 336 337 0-7 0-8 0-9 11-8-5 8-7 12-8-5 8-5 8-2 Octal 8-bit CODE DEC026 CODE 240 241 242 243 244 245 246 247 BLANK 12-8-7 0-8-5 0-8-6 11-8-3 SPACE 0-8-7 % 11-8-7 8-6 & 250 251 252 253 254 255 256 257 0-8-4 12-8-4 11-8-4 12 0-8-3 11 12-8-3 0-1 ( ) 260 261 262 263 264 265 266 267 0 1 2 3 4 5 6 270 271 272 273 274 275 276 277 8 9 11-8-2 0-8-2 12-8-6 8-3 11-8-6 12-8-2 7 CHARACTER II # $ , * + . . , < = > ? NOTE On some IBM 026 Keyboards this character is graphically represented as 0 • A card containing an 8-2 in column 1 with all remaining columns blank is an end-of-fi1e card. D-3 CHARACTER @ 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 [ \ ] t 0.3 SUPPRESSION OF CARRIAGE RETURN/LINE FEED IN FORTRAN It is often desirable to suppress the automatic carriage return/line feed (CR/LF) following FORTRAN WRITE statements to achieve an easily readable text. The following three methods in OS/8 FORTRAN can be used to achieve this result: 1. Follow the I/O list of a WRITE statement with a comma. the following statements: 100 101 Thus, WRITE (1,100) N, FORMAT (lX,lSHTHE VALUE OF A(,I2,SH)4IS ) READ (l,lOl)A(N) FORMAT (F8.4) result in the following single line (assume N has a value 12 and a value of 147.83 is being input): of THE VALUE OF A(12) IS 147.83 2. Use of an empty field print statement enables a text to be printed without a following CR/LF when there is no variable to be printed. For example: 102 3. WRITE (1,102)IDUMMY, FORMAT ('DESIRED TEXT',IO) READ statement using break character, as follows: 101 READ (1,101) IA,IB,IC FORMAT ('A=',Il,'B=',Il,'C=J,Il) results in no CR/LF after each phrase is printed. the output is all printed on a single line. 0.4 That is, ACCESSING THE SYSTEM DATE IN A FORTRAN PROGRAM The availability of the system Date word in location 17666 is useful to many 05/8 programs. The following FORTRAN program illustrates how the Date can be accessed in SABR code: C PROGRAM PRINTS THE CURRENT DATE C 5 DUMMY DATE S S TAD I DATE S 5 TAD TEMP AND (7 5 5 5 DCA\IYR TAD TEMP RAR;RTR AND (37 DCA \IDAY TAD TEMP CLL RAL;RTL;RTL AND (17 DCA \IMO WRITE (1,100) IMO,IDAY,IYR FORMAT (/'DATE: 'I2'-I2-197'I1/) 5 S S 5 S S 100 DCA TEMP D-4 S SDATE, S STEMP, 0.5 CALL EXIT CPAGE 2 6211 7666 0 DETERMINING CORE SIZE ON PDP-8 FAMILY COMPUTERS Many times system programs need to determine the amount of core available to them at run time. For example, the 05/8 system programs LOADER, PAL8, and CREF perform this calculation. Because of differences in the extended memory control of POP-8 family computers, subroutines that work on one machine might not work on another. The following three conditions cause the most difficulty: 1. On a POP-8 with an extended memory control, addressing nonexistent memory from field 0 causes the following instruction to be skipped and the contents of the corresponding field 0 location to be executed. For example: COF 70 TAD I (X) HLT /NONEXISTENT FIELD /EXECUTED LOCATION X /THIS INSTRUCTION SKIPPED • • X, • CLA CLL CML RAR /LOAD 4000 The preceding code causes 4000 to be loaded into the AC and the HLT instruction to be skipped when executed on a PDP-8. 2. On a PDP-12 with an odd number of 4K banks (12K, 20K, 2aX), all reads in the first nonexistent field load zeros. Reads to higher fields, as wel·l as all reads to nonexistent memory on a machine with an even number of 4K banks load all one bits. 3. The PDP-8/L normally treats all CDF's to fields 2 through 7 as NOP's. (It tests bits 6 to 7 of all CDF and CIF instructions for D's before executing the lOT.) However, there is a special 12K option for the PDP-8/L called a BM08. With this option a CDF to field 2 is valid, but a COF's to fields 4 through 7 remain NOP's. For those who are interested, the following subroutine has been tested on the PDP-8, 8/5, 8/L, 8/I, S/E, PDP-12, and LINC-8 computers. For the purpose of this example, it is assembled at 00200. /SUBROUTINE TO DETERMINE CORE SIZE. /THIS SUBROUTINE WORKS ON ANY POP-8 FAMILY /COMPUTER. THE VALUE, FROM 1 TO 10 (OCTAL), /OF THE FIRST NON-EXISTENT MEMORY FIELD IS /RETURNED IN THE AC. /NOTE -- THIS ROUTINE MUST BE PLACED IN FIELD 0 D-5 0200 0000 0201 7300 0201 6201 0203 1237 0204 7006 0205 7004 0206 0217 0207 1232 0210 3211 0211 6201 0201 1635 0213 7000 0214 3211 0215 1213 0216 3635 0217 0070 0020 1635 0221 7400 0022 1221 0223 1236 0224 7640 0225 5232 0226 1211 0227 3635 0230 2237 0231 5202 0232 6201 0233 1237 0234 5600 0235 0221 0236 1400 0237 0001 0.6 ':':::ORE , CORD, 0 CLA eLL CDF 0 CORSIZ TAD RTL /(NEEDED FOR PDP-8L) /GET FIELD TO TEST RAL COR1, COR2, COR70, CORX, COR70 AND COREX TAD DCA .+1 CDF \N CORLOC TAD I NOP CORl DCA COR2 TAD CORLOC DCA I 70 CORLOC TAD I 7400 CORX TAD CORV TAD SZA CLA COREX JMP CORl TAD CORLOC DCA I CORSIZ ISZ CORO JMP COREX, CDFO TAD JMP I CORLOC, CORX CORV, 1400 CORSIZ, 1 CORSIZ CORE /MASK USEFUL BITS /SET UP CDF TO FIELD /N IS FIELD TO TES~ /SAVE CURRENT CONTENTS /(HACK FOR PDP-81) /7000 IS A "GOOD" PATTERN /(HACK FOR PDP-8.,ND-OP) /TRY TO READ BACK 7000 /(HACK FOR PDP-8,.NO-OP) /GUARD AGAINST "WRAP AROUND" /TAD (1400) /NON-EXISTENT FIELD EXIT /RESTORE CONTENTS DESTROYED /TRY NEXT HIGHER FIELD /LEAVE WITH DATA FIELD 0 /lST NON-EXISTENT FIELD /ADDRESS TO TEST IN EACH IELD /7000+7400+1400=0 /CURRENT FIELD TO TEST USING PRTC12-F TO CONVERT 05/8 DECTAPES TO 05/12 LINCTAPES Many users of OS/8 on the PDP-12 will be interested in the fact that, since 05/8 uses an identical file structure on all devices, PDP-8 DECtape in OS/8 format may be directly copied to 05/8 LINCtapes by the PRTC12-F program. The PRTC12-F program uses the PDP-12 TC12-F hardware option to read DECtapes and convert these tapes to LINCtape. This hardware option is required to read DECtapes on the PDP-12 THE PRTC12-F program is described in the document DEC-12-YIYA-D. This document describes the program operation in detail, and must be read before attempting to use PRTC12-F. The operations that convert OS/8 format DECtapes are as follows: 1. Mount the OS/8 DECtape on unit 1 and a PDP-12 formatted with 129 words per block on unit 2. 2. When the READ questionnaire is displayed, respond as follows (responses are underlined: the character ) stands for carriage return and stands for line feed): * READ 1777 ) BLOCKS TAPE FORMAT A ) UNIT 1 ) 0-6 LINCtape STARTING ~vITH BLOCK 0) + etc. 3. ~fuen the follows: ~'lRITE questionnaire is displayed, respond as NRITE THE RESULT IN TAPE FORMAT B) ON UNIT 2) STARTING AT BLOCK 0) + etc. D.7 NOTES ON LOADING DEVICE HANDLERS D.7.1 Problem with Multiple Input Files There is a problem associated with reusing Device Handler OS/8. This problem is best illustrated by an example: areas in Assume a program has reserved locations 1000-1377 for its input handler and locations 7400-7577 for its output handler. If the program gives a USR FETCH command to load the DTAI handler as an input device handler, all 8 DECtape handlers will load into 1000-1377, since they are all co-resident. If another FETCH is issued to load the DTA2 handler as an output device handler, that handler will not be loaded, because it shares space with the DTAl handler currently in core. This is fine -- however, if the user now switches input devices and FETCHes the paper tape reader handler as an input device handler it will destroy the DTA2 handler and the next attempt to output using the DTA2 handler will produce errors. There are two ways to get around ~~is problem. 1. Always assign the handler which you expect to stay in core the longest first. Most programs can process more than one input file per program step (e.g., an assembly pass is one program step) but only one output file~ therefore, they assign the output handler before any of the input handlers. In the above example, the problem would be eliminated if the DTA2 handler were assigned first. 2. Always give a USR RESET call before each FETCH. Obviously, this call should not delete any open output files. This means that the USR will always load the new handler, even if another copy is in core. The user must FETCH the output handler again before issuing the USR CLOSE call, otherwise the USR will determine that the output handler is not in core and give a HONITOR ERROR 3 message. 8K FORTRAN uses this second method for device-independent I/O time. D.7.2 at run Dynamically Loading Device Handlers Some programs which use dynamic core allocations will want to use OS/8 Device h~~dlers but cannot afford to always allocate the maximum of two pages per handler. The following is a subroutine which loads a device handler dynamically, returning its entry in the AC. It assumes that the name of the handler is in locations NAMEI and NAME2, and a D-7 subroutine GETPAG exists uhich -;ets a page :rom the Dottom of available field ~ of storage and re~urns its address in the AC. This example subroutine runs in field : and can only be called from field 1, but can be rewritten for any other possibility. ASSIGN, ;J TAD NAME 1 DCA Nl TAD NAME 2 /MOVE DEVICE NAME INTO "INQUIRE" COMMAND DCA N2 CDF CIF l~ JMS I (7700 /USRIN - FORCE USR INTO CORE 10 JMS I (200 12 /INQUIRE o Nl, o N2, o LOCI, JMP ASSERR /NO SUCH DEVICE - QUIT TAD LOCl SZA /IS THE HANDLER ALREADY IN CORE? JMP I ASSIGN /YES - RETURN ITS ENTRY POINT JMS GETPAG /GET A PAGE DYNAMICALLY DCA LOC2 /LOAD DEVICE NUMBER ASSTRY, TAD N2 JMS I (200 /FETCH 1 /PAGE TO FETCH INTO o LOC2, JMP TWOPAG /FAlLED - MUST BE A TWO-PAGE HANDLER TAD LOC2· JMP I ASSIGN /RETURN ENTRY POINT /GET ANOTHER PAGE TWOPAG, JMS GETPAG ISZ LOC2 /SET "TWO PAGE HANDLER ALLOWED" BIT CLA JMP ASSTRY ASSERR, 0.8 ..... /FETCH WILL SUCCEED THIS TIME /ERROR ROUTINE AVAILABLE LOCATIONS IN THE USR AREA A few programs may need additional storage space in field 1 when the USR is ~n core. A number of locations in the USR area (10000 to 11777) are available and may be used whenever the USR is in core. The locations are as follows: 1. Locations 10000 to 10006 are available for scratch and/or ODT breakpoint usage, without restriction. 2. All auto-index registers (locations 10010 to 10017) may be used, but these locations are destroyed by USR operations. 3. Location 10020 to 10037 may be used as scratch no restrictions. 4. Locations 11400 to 11777 are used by the USR to preserve the last directory segment read while performing a LOOKUP, ENTER, or CLOSE operation. Location 10007 contains a key specifying which segment of which device is currently in core. 0-8 storage storage with Any user program may use locations 11400 to 11777 as scratch storage as long as location 10007 is set to 0 before the first use. Of course, the LOOKUP, ENTER, and CLOSE operations will read a directory segment into 11400 to 11777 and set 100007 to a non-zero value again. D.9 ACCESSING ADDITIONAL INFORMATION WORDS IN OS/8 In all of these cases, the USR must have been previously brought core with ~~e USRIN fQnction e 0.9.1 into After a LOOKUP or ENTER After a LOOKUP or ENTER, location 10017 points to the length word of the file entry. To get a pointer to the first Additional Information Word, a program would execute the following code: CDF 10 TAD I (1404 /GET # OF ADDITIONAL INFORMATION WORDS /FROM DIRECTORY SNA JMP NONE /NO ADDITIONAL INFORMATION WORDS TAD I (0017 DCA POINTER • • • ·POINTER" now points to the first Additional Information Word. 0.9.2 After a CLOSE Because CLOSE is a legal operation even if no output file is present, it ~s not suggested ~~at Additional Inforruation Words be modified following a CLOSE. To alter the Additional Information Words of a permanent file, do a LOOKUP to get the directory segment into core, then alter the words and rewrite the directory segment. D.9.3 Rewriting the Current Directory Segment Whenever a user program changes t..'1e Additional Information Words of a file, it must rewrite the directory segment containing that file entry in order to make sure the changes are permanently recorded. The following code, which must be in field 1, will rewrite the current directory segment: CDF 10 TAD 7 AND {7 DCA SEGNO CIF 0 JMS I 51 /CODE IS IN FIELD 1 /GET DIRECTORY KEY WORD /EXTRACT SEGMENT NUMBER /LOC 51 POINTS TO THE DEVICE HANDLER 0-9 SEGNO, 4210 1400 0 JMP /WRITE OPERATION /DIRECTORY SEGMENT CORE ADDRESS ERROR /ERROR REWRITING DIRECTORY Location 10051 will always point to the device handler entry point used to read in the last directory segment, following a LOOKUP or ENTER operation. D.I0 SABR PROGRAMMING NOTES D.I0.1 optimizing SABR Code There are two types of users who will be using the SABR assembler those who like the convenience of page-boundary-independent code and are willing to pay the price for it, and those who need a relocatable assembler but are still very location conscious. These optimizing hints are directed to the latter user. One way to beat th7 high cost of non-paged code is to Page It Yourself. This 1S done by using the LAP (Leave Automatic Paging) pseudo-op and the PAGE pseudo-op to force paging where needed. This saves 2 to 4 instructions per page from elimination of the page escape. In addition, the fact that the program must be properly segmented may save a considerable amount. Wasted core may be reduced by eliminating the ever-present CDP instructions which SABR inserts into a program. This is done by using "fake indirects". Define the following op codes: OPDEF OPDEP OPDEF OPDEF • • • ANDl 0400 TADl 1400 lSZl 2400 DCAl 3400 These codes correspond to the PDP-8 memory reference instructions but they include an indirect bit. The difference can best be appreciated by an example: If X is off-page, the sequence LABEL, SZA DCA X is assembled by SABR into LABEL, SZA JMS SKP 45 DCA I (X) or four instructions and one literal. 0-10 The sequence x PX, LABEL, SZA DCAI PX assembles into three instructions for a saving of 40 percent. Note, however, that the user must be sure that the data field will be correct when the code at LABEL is encountered. Alse note that ~~e SABR assumes that the Data Field is equal to the Instruction Field after a JMS instruction, so subroutine returns should not use the JMPI op code. The standard method to fetch a scalar integer argument of a subroutine in SABR is: Code IARG, SUBR, DUMMY X o BLOCK 2 TAD I SUBR DCA X INC SUBR' TAD I SUBR DCA X' INC SUBR' TAD I X DCA IARG X, • • • BLOCK 2 This code requires 19 words of core and takes microseconds to execute. The following sequence: several Code IARG, SUBR, X, o BLOCK 2 TAD I SUBR DCA X INC SUBR' TADI SUBR' DCA IARG INC SUBR' HLT /THIS IS A CDF TAD I IARG DCA IARG • takes only 14 words and executes in approximately 0-11 the hundred D.10.2 Calling the USR and Device Handlers from SABR Code One important thing to remember is that any code which calls the USR must not reside in locations 10000 to 11777. Therefore, any SABR routine which calls the USR must be loaded into a field other than 1 or above location 2000 in field 1. To call the USR from SABR use the sequence: CPAGE n 6212 JMS 7700 REQUEST ARGUMENTS ERROR RETURN /N=7+(# OF ARGUMENTS) /CIF 10 lOR 200 IF USR IN CORE /OPTIONAL DEPENDING ON REQUEST IOPTIONAL DEPENDING ON REQUEST To call a device handler from SABR use the sequence: CPAGE12 6202 JMS I HAND FUNCT ADDR BLOCK ERROR RETURN SKP HAND, o 110 IF "HAND" IN PAGE 0 /CIF 0 /00 NOT USE JMSI /"HAND" MUST BE ON SAME PAGE lAS CALL, OR IN PAGE 011 0-12 APPENDIX E CHARACTER CODES AND CONVENTIONS Table E-l contains a list of the control characters used by OS/8 and associated system programs. Table E-2 contains the OS/8 character set, which is a subset of the complete ASCII code, the unlisted codes are generally not used by OS/8 or the system programs. Note the following: 1. On some terminals, the character back-arrow (~) is replaced by an underline () character, and the up-arrow (t) is replaced by circumflex (~). 2. Some terminals use parity codes rather than forcing the leading bit of the 8-bit character code to be a 1. To avoid problems, OS/8 system programs always ignore the parity bit during ASCII input. 3. as/8 does not handle lower case characters (octal codes 341 through 372). The exceptions to this are the editors, EDIT and TECO. The KL8E and LPSV handlers can be modified to handle lower case. Table E-1 OS/8 Control Characters Octal 8-bit Code Character Name Remarks 1 000 null Ignored in ASCII input. 200 leader/trailer Leader/trailer code precedes and follows the data portion of binary files. 203 CTRL/C OS/8 break character, forces return to Keyboard Monitor, echoed as tC. 207 BELL CTRL/G. 211 T~ CTRL/I, horizontal tabulation. 212 LINE FEED Used as a control character by Command Decoder and ODT. 213 VT CTRL/K, vertical tabulation. 214 FORM CTRL/L, form feed. E-1 the Table E-~ (Cant.) OS/8 Cont~c~ Characters Octal I a-bit Character Name I Code Remarks I--------------------------------------------------------------------~ I 215 RETURN Carriage return, generally echoed as carriage return followed by a line feed. Used only on LS8E Puts current line character mode. 216 line into printer. expanded 217 CTRL/O Break Character, used to suppress Teletype output, echoed as to. 225 CTRL/U Delete current input as tU. 232 CTRL/Z End-of-File character for all ASCII and binary files (in relocatable binary files CTRL/Z is not a terminator if it occurs before the trailer code). 233 ESC ESCape replaces ALTMODE on some terminals. Considered equivalent to ALTMODE. 375 ALTMODE Special break Teletype input. 376 PREFIX PREFIX replaces ALTMODE on some terminals. Considered equivalent to ALTMODE. 377 RUBOUT Key is labeled DELETE on some terminals. Deletes the previous character typed. E-2 line, character echoed for Table E-2 ASCII Charac~er Codes octal 8-bit Code Code Punched Card Code 240 40 blank 41 11-8-2 8 .... 7 8-3 11-8-3 0-8-3 241 I 6-bit ...... "'" "It" 243 244 245 43 44 45 46 12 247 47 8-5 250 251 50 246 252 253 254 255 256 257 260 261 262 263 264 265 266 267 51 52 53 54 55 56 * + . 60 61 1 1 62 63 2 3 2 64 65 4 5 6 7 4 66 67 70 71 272 72 273 274 73 304 ( ) 12-8-3 0-1 271 300 301 302 303 0-8-3 11 # $ % & 57 270 275 276 277 12-8-5 11-8-5 11-8-4 12-8-6 Character Representation o 8 9 8-2 I 11-8-6 74 75 76 77 8-6 II 0-8-6 00 8-4 01 02 03 04 12-8-4 0-8-7 I 12-1 / 5 6 7 8 9 ? colon semicolon less than equals greater than question mark @ at sign i < = > A 12-2 B 12-3 12-4 D C G 10 11 12-8 12-9 H I 310 311 opening parenthesis closing parenthesis asterisk plus conuna minus sign or hyphen period or decimal point slash 3 07 06 space (non-printing) exclamation point quotation marks number sign dollar sign percent ampersand apostrophe or acute accent o I 12-5 12-6 II 12-7 05 305 306 307 Remarks E F E-3 I -~ Table E-2 (Cont.) ASCII Character Codes Punched Card Code Octal 8-bit Code 6-bit Code 312 313 314 315 316 317 12 13 14 15 16 17 11-1 11-2 11-3 11-4 11-5 11-6 320 321 322 323 324 325 326 327 20 21 22 23 24 25 26 27 11-7 11-8 11-9 0-2 0-3 0-4 0-5 0-6 330 331 332 333 334 335 336 337 30 31 32 33 34 35 36 37 0-7 0-8 0-9 12-8-2 11-8-7 0-8-2 12-8-7 0-8-5 Character Representation Remarks J K L M N 0 P Q R S T U V w X y Z [ opening bracket,SHIFT/K backs1ash, SHIFT/L closing bracket, SHIFT/M circumflex underline - BOF signal \ ] .... NOTES 1. These are the DBC029 standard card codes. 2. On most DEC Teletypes circumflex is replaced by up-arrow (f). 3. A card containing 0-8-5 in column 1 columns blank is an end-of-file card. 4. On most DEC Teletypes underline is with all remaining replaced by back-arrow (+-) • 5. On some IBM 029 keyboards cent sign (¢). is graphically represented 6. On some IBM 029 keyboards \ logical NOT (-). is 7. On some IBM 029 keyboards vertical bar el>. 8. On a very few LP08 line printers, the character is printed instead of backs lash. 9. On a very few LP08 line printers, the character heart printed instead of underline. 10. The character number sign on same terminals pound sign (I). E-4 as a graphically represented as is graphically represented as is diamond (0) (~) is replaced by APPENDIX F 05/8 INPUT/OUTPUT ROUTINES Appendix F describes a set of generalized I/O routines for use under the 05/8 system. The routines presented here are used in all the 05/8 CUSPs (Commonly Used System~Prograrns) in more or less this form. Variations are made depending on the particular application and how errors are to be handled. The routines, as indicated, will work as presented. The routines work most efficiently in field 1, since CIF 10's are not necessary when addressing the Monitor, and the Command Decoder tables are similarly available. Obviously the routines can be modified to run in any memory field or core locations. F.l GENERAL DESCRIPTION These subroutines assume that the Command Decoder tables have been set up to indicate the proper I/O devices. The routines handle device handler assignment without user interference. All I/O is done by simple subroutine calls. The user program never needs to interface with the Monitor or device handlers. All buffering and internal bookkeeping are performed by the routines. In these routines, it is ass~~d ~~at only one output device is used at a time, i.e., ~~e output routine does not automatically set up for the next output device. This modification can be made if desired. As many as nine inputs are handled automatically. When input from one device is exhausted, the input routine will automatically utilize the next device specified in the Command Decoder list of inputs. F.2 SUBROUTINES FUNCTIONS Following is a brief list of the subroutines and their functions. ICHAR - Character input routine. Call sequence: ICHAR ERROR RETURN NORMAL RETURN JMS F-l Error: If AC)O, an EOF on input has occurred. No more input is available. If AC(O, a device error has occurred. Normal: 8 bit character is in the AC. OCHAR - Character output routine. Call: TAD CHAR /8 BIT CHARACTER OCHAR ERROR RETURN NORMAL RETURN JMS Error: AC(O implies a fatal error. AC ) or = 0 implies that the hole output was exceeded. allotted for Normal: AC-O. The character has been put into the device output buffer. IOPEN - Input initialize routine. Call: JMS IOPEN RETURN Return: Input pointers reset. The next call to ICHAR will read from the first device in the Command Decoder input list. OOPEN - Output initialize routine. Call: JMS OOPEN ERROR RETURN NORMAL RETURN Error: If AC> or = 0, no output device was specified. If AC(O, an error occurred opening the file. Normal: An output file has been opened. No action the output was a non-file structured device. F-2 if OCLOSE - Output close routine. Call: JMS OCLOSE ERROR RETURN NORMAL RETURN Error: Either the closing length is too large for the space allotted or an output error has occurred. Normal: The output file is now a permanent file output device. F.3 on the SUBROUTINE PARAMETERS These subroutines handle device assignment and internal buffering automatically. To accomplish this, certain parameters must be defined at assembly time. These parameters specify all details of handler location, and buffer size for the routines. Parameter Definition INDUF = Address of input buffer. INCTL = Input buffer control word. See the section on using device handlers for details of the control word format. OUBUF = Output buffer address. OUCTL = Output buffer control word. This must be negative number to indicate a writs operation. INRECS = Number of input records in input buffer. INCTL/256 (DECIMAL). INDEVH = Address of input device handler. OUDEVH = Address of output device handler. a INRECS = The parameters can either be a part of the actual subroutine source, or they can be contained in a separate parameter file to be assembled with the subroutine file. The latter approach provides greater flexibility in using the routines. F.3.l Example Following is a s~T.ple of ~~e use of ~~e subrolltines~ The program simply calls the Command Decoder, and transfers input from the input devices to the output file, closes the output, and exits. F-3 FIELD 1 *2000 JMS I (7700 10 JMS I (200 CALLCD, /LOCK MONITOR INTO CORE. /CALL COMMAND DECODER /TO PICK OPTIONS. 5 0 JMS I (IOPEN OK, TSTEOF, CLOSE, JMS I (OOPEN SMA CLA JMP OK JMS TERR TEXT /OPEN FAILED/ JMS I (ICHAR JMP TSTEOF /EITHER ERROR OR EOF. /SAVE IT. JMS I (OCHAR JMP OUTERR JMP OK SMA CLA JMP CLOSE JMS TERR TEXT /READ ERROR/ JMS I (OCLOSE JMP CLERR /CLOSE OUTPUT FILE. /CLOSE ERROR JMP CALLeD /REXT. OUTERR, JMS TERR CLERR, TEXT /OUTPUT ERROR/ TERR TEXT /CLOSE ERROR/ TERR, /SETUP TO START LOOKING AT /CD INPUT FILE. /OPEN UP AN OUTPUT FILE. /IF AC(O, WE HAD A FATAL /TYPE ERROR. AC)O IS O.K. /ERROR. /TRANSFER THE CHARACTER /OUTPUT ERROR /TRANSFER UNTIL EOF FOUND. /IF NEG., FATAL /EOF. CLOSE OUTPUT JMS o TAD I TERR RTR;RTR;RTR JMS TYPIT TAD I TERR JMS TYPIT ISZ TERR JMP TERR+1 TYPIT, o AND (77 SNA JMP CRLF CRLF, TTYOUT, TAD (300 JMS TTYOUT JMP I TYPIT TA (215 JMS TTYOUT TAD (212 JMS TTYOUT JMP CALLCD o TLS TSF JMP.-1; CLA; JMP I TTYOUT F-4 F.3.2 Subroutine Listing A listing of the routines follows. The parameters are set up in such a way as to allow them to be put into a separate file. Another parameter, ORIGIN, determines the location of the routines. F-S PAL8-V7 ';)(h'1Itl OUt1UF=500~ 4cir)~ ouc TL osq2vHl bhioHII OUD~. VH=b60kJ ':It! k1(~ I N d Uf II 5 4 ~H1 0cl.l~ INCTL·020~ 00"'1 INRECS=l INUEVHa1000 OHIGINa6b00 OCB=7760 700r., fo.b~0 ., 7b0 k~ ~1 Vi 1 0V'no "'~HH~ 1 bH~0 7 i.l ((1(,., 1 N 1 4 v) ~ , 7 4 '" ~, lbbOl ~l [1 (1 vl lbb('!2 724r, 3333 lOPEI~, '" CLA eM. DCA INCHCT 2210 1317 TAU lhfo.~b (7b17 3~11 DCA INFPlR IOPEN 1bb07 5h01 0ti1D~ ISZ JMt' ~HHH" INtO"', INFPTR, 0 00Vl0 INtlT~, ~ 1£Jb13 00"~ lCHAt<, tb61q 16615 lb"'lb 7b110 6214 124Cj 11:1b17 1b620 6cvl1 3S31 lbh?l Ibf-i'? 25~Vl tbb?3 lbbcq 1b625 1hb2b 1 bern 53v)r11 2~j3 1211.1 7b~" 5231 4333 IOUTPUT HUfFER STARTS AT 05000. lAND IS 2 PAGES LONG. IOUTPUT HANDLER GETS LOAOED AT bb00. WE IALLOW TWO PAG~ HA~OLERS. IINPUT BUFFER STARTS AT 05400 IALSO TWO PAGES LONG. 12 PAGES • 1 RECORD IALLOW 2 PAGE INPUT HANOLtR AT 7000. ITHE SUB~OUTINES RESIDE AT lb6~~. IDEVICE CONTROL TA~LE IINITIALIZE INPUT lbb04 lbbli15 16b10 t bb 11 1h612 PAGE 1 FIELD 1 *ORIGIN INFLUaINCTL&70 IINPUT BUfFER ~ILEO nUFLOaOUCTL&70 IOUTPUT SUFFER FIELD bl-, \1 Vl lh"'Pl3 12/27/72 INEOF IStT TO READ FROM NEW OEVICE. IFORCE A NEW INPUT FILE. IPOINT TO CO INPUT LIST. ~) o IN7/!)U0, 7600 IINPUT A CHARACTER. ROF TAU DCA INCHAR, COF ISZ INCDIF INHTRN INFLlJ I NJ"'IP lSZ INCI-ICT JMP INJMP TAO INt:O~ SNA eLA Jt1P INGBUF GE1Ntw, JMS I NNE\t.F PIJMPP, ISAVE CALLING FIelD FOR ~ETURN 10ATA FIELD TO FIELD OF SUFFER 13 - WAY UNPACKING S~ITCH IINPuT BUFFE~ EXHAUSTED? INC •• UNPACK THE NEXT CHA~. 1010 LAST READ GIVE tOF ON THIS DEVICE? INO. CONTINUE kEADING e IYES •• GET NExT INPUT If IT EXISTS. ITAKE EOF EXIT FROM ICHAR. IINCTR HOLDS THf CURRENT LENGTH OF ITHE INPUT FILt. WHEN THE AMOUNT REMAINING ITO REAO IS LESS THAN THE SIZE OF THE IINPUT BUFFER, AN EOF IS SIGNALLED, 1bfo<30 thh:51 5217 lbb32 1hfl33 lhf:l34 1""35 7HH' CL..L 131" 142t'1 TAO SNL (INIoH:CS "/430 IUPDATE REMAINING LENGTH 16b37 ()CA :SZL INC,'k tbb$b c!?10 .LSZ I Nt. ClF lAND SIGNAL EOF FOR NEXT READ. 12"'1 32~1 INbHuF, J ~\P tO~f:I<R TAU INC1R PAL8-v7 thfo.4L1' 7172 lhbUl lhb,,2 lhfo.t.l3 '1"12 7"'2 ell.. CML eMA kTR RTR RTR l:n~ TAO {INCTL+1 1hh44 3!!5t' Dr.A INCTLW 12/21112 PAGE 1-1 /CONSTRUCT A CONTROL WORD fOR THIS /READ FROM THE OVEHFLOW, IF ANY. lAND THE STANDARD CONTROL wnRD. PAl8-V7 lhb4S lbb4b Ibb47 &203 &211 474lJ lbbS0 ~000 1bb~1 5400 1"&52 16&53 01'11'1~ Ib"5S 5273 1252 137b Ih~5b 32'::>2 Ibb54 Ih~57 12~0 Ibbh0 1bbbl 1n""'2 0214 lbbb3 ((1214 16064 Ibbb5 1h6b& :i333 1223 16667 33e1Q1 7104 125~ 7L<140 t"'~70 1251 Ibb71 1bf:072 16673 ~212 ~i?c:'~ 2210 Ib~74 770~ 1f-h75 Ibb7'" 10&77 1671110 1b701 52~" In"~2 \,.,71213 Ib704 t671(J5 1b70& It-7~7 1'" 11 0 ,. h 711 733ft' ~3:51 7402 1)3i:!c 531b 1223 33Ui<1 1"'1~ 02121171 7112 H'12 INCOJ.F, elf COF 121 COF l~ JMS I NI'1NDl lNCTLW, o I NHU"·P, INHUF INREC, o JMP INI~Rf(X lINBRtC, TAO I NI~E C TAO CINR~CS DCA INI~EC TAO INI:TL.W ANO IN7&e,0 elL RAl TAO INICTlW ANU IN7600 eMA OCA INICHCT iAO IN,JMPP DCA INJMP TAO II'HWFP OCA INiPTR JMP INCHAR INERKX, ISZ INIE:.OF SMA eLA JMP I NtHH.C INERI<, CLA CLl CMiL. RAR EOFEHR, JMP INRTRN lNJMP, HLT JMP ICHAIH JMP ICHAR2 ICHAl"n, TAU INJMPP DCA INJMP TAD I INPTR IN20~, ANO IN740" eLL RTf< RTR 1~~(.1 1~712 TAO 1V11t? 16713 1,.,714 fHR 1V112 2?12 RTf( Ib715 532~ 16716 '''717 1bl? 0?00 1 h 7?~' th7j:)? 3250 /!?t?12 11011i? JMP TAO AND DCA If;)7~3 10$14 1b724 1672-; IH~ ICI1AH1, TAD INCOMN, AND or AU 7450 Sr-IA ~?27 Ib7~1 Ib7e>& 16127 Ib730 1372 221.s PAGE 2 /NOW DO A CALL TO TH~ INPUT HANDLER IWE ARE IN FIELD 1, HANOLE~ IN FIE~O 0 IINPUT CONTROL WORO IINPUT BUFFER ADDR~SS IPOINTER TO INPUT RECORD IUPDATE POINTE~ INTO FILE INOW COMPUTE THE NUM~ER OF CHARACTERS IlNTHIS INPUT ~UfFER /NEW NUMBER OF CHARACTERS. /RESET 3 WAY SwITCH lAND BUFfE~ POINTER INOW READ TH~ ~UfFER 15fT EOF JUST IN CASE IIF <0, A PHYSICAL ERROR lEaF ON INPUT IfA'TAL IGET OUT 13 WAY UNPACK SWITCH IG~T 1ST OF 3 ISI::COND ISfT fOR FIRST CHAR. NEXT /THE THIRD wORD IS MADE OF THE HIGH 10RDER FOUR BITS OF THE fIRST ITWO" INCTlW lSZ INPTk INCOMN lSZ 12/27/72 INPTR IN7400 INCTLw INPTFI INPTR IPOINT TO NEXT WORD IGET OUT WITH CHAR IN AC ISAVE HIGH ORnER FOR THIRD WORU (3'/7 (e232 115 IT A ·Z (EOF)? JMP GF.TNEW TAO (232 [CHAR IYES •• ~OOK AT NEXT INPUT ISZ ITAKE NORMAL RETURN PAL6-V7 1b7:S1 ~0VH' lbl!? 5&13 INIHt(N, ~ 'f 177 INNE~F, lh734 1(:.155 6733 6211 1371 INCHCT=INNt:,'wF CDF -1 3344 DC~ 1 ~ 11 TAD SNA JMP 7L15~ 161£11 1t:1£12 167£13 5733 4H'IF3 '-1001 JMS lh7L14 O~00 107£15 11-746 7L102 1 h 11 ~b71.l7 (n7CJ1 INHNUL, o HLT TAD , ... 7501 1b751 7L1,,(}I 1361 71.52 It-753 7V.11c 'h7SLl 3~C11 If' 7 ~5 2t!11 1 b 11 lb75b '6757 It-760 tb7bt 1b7b2 'foI7t-3 16710 tb77! lb77~ 1b173 16774 1677'5 t6776 1b777 1 7 ~, ~~ CJI , 701r., 1 I Nr~f. wF IN200 1 I Nt P TH (77&0 ANn SZA TAD 32~2 2211 321"1 2333 ~H33 I SZ It~F P TR TAll I DCA ISZ DCA I SZ JMP I INFPTR INftEC IVtRY IlAOl IGET INPUT FILE LENGTH INFPTR INEOf I N t~ E~~ F INNEwF INtGATIVE OF FILE LENGTH IPOINT TO STARTING BLOCK ISTORE IN HANDLER CALL INEXT INPUT. ICLEAR EOF FLAG. 7 tH'I1 ·'~I.lb 0371 ~20t 001",1 1"17 01i10~ OOPEN, PAGE U 7bVlt'l OlJ7&~CJI, 7fot0~ 7L1"0 IOPEN OUTPUT FILE 32~1 TAO DCA 1HHHI 1377 $21" TAD DCA 16~1 TAO I \1~12 TO GET HANDLER 0232 1 Hl03 lH'I10 17CJ111 MONITO~ INCTR~IOPE.N 13tH t H~rtlb t7l'IQlT INOPE ICALL ""17 7HdJ 17CWl2 11005 IINITIALIZE IN CASt wE NEED A NEw IMORE. INPUT? (17 eLL CML IolTR RTft DCA ItJCT~ 6b~1 '071-1 10 (It-.lOtVH+l INt1NDL II\.tFPTH TAO 1~7L10 1~7~2 PAGE 3 ICIF COF N. JMP , ... 133 1h73& \(.731 12/27/72 037& 71.&50 524£1 4775 17 Q\ 13 0'1101 1701" 17015 0000 74f11? AND SNA JMP JMS 1 OUHNlJL, 0 hLT OU1601 OUHLK (OUOI;Vh+1 IPOINT TO OUTPUT FILE NAME IN CO IAREA OUt;NOL OU7M10 IINITIZLIZE OUTPUT DEVICE HANDLER IPICK UP OUTPUT DEVICE NUMBER ONOFIL (200 lIS THERE ONt? INO •• INHIBIT OUTPUT IFETCH OUTPUT HANDLER (11 IBAO THING P~L8.V7 1 H'C'c 170?3 17024 170~5 \ H'2& 'H'l1/J0 t7ftt?7 22"~~ 1H130 b213 17~31 5"~0 17"32 1&01 "-':512 110~3 17034 17035 17('1:56 lH137 111140 17041 17042 17043 7650 ~2"2 1601 kl376 3601 5216 13301 5230 17~44 ~174 17r,45 ~230 lHHI6 ~HHH1 1 H11.17 :S3~0 t7~50 6211 1 'U 4 17e.~1 170152 1 H'~3 OUtlt.N, 0 5232 3350 3774 l013 DCA DCA I OlJ~:CNT (OIJTINH (OIJ!itTf ISZ OOIPEN OOHETN, CDF Clf 10 JMP I OOIPEN OEFA.i.l, TAU I OU7b00 ANIJ (71b0 SNA tL. Jf>IP ONTEkR TAD I OUlbl2l0 AND DCA (17 OU1b0121 JMP OUENTR a ~JT Et( R, ClAC l l CML RAR JMP OOWETN ONOFll., I5Z (OUTINH JMP OOf<ETN OUTor1P, '" DCA COF TAO I 5ZA ClA JMP TAD SNA ISZ ~304 7451r1 OEI:All JM:i I 7"40 '7~S4 17~~5 JMP 13501 17~5& 2300 17'157 1221 1 Hlb0 170&1 3302 1300 TAO 11"'62 710& 170163 ell 7~0b RTL TAO DCA OUCTLW 1121 TAn OUE.LEN SNl SZA ClA JMP I UUTDMP DI1CIHF, elF CDF o CDF 10 JMS OUHNDL 1 H'I71.1 5~4" b2~3 b211 17t~0 4614 0000 t7HH 512l({l~ 17101? UI2l1c:l0 17103 171\1)4 2246 , 71l-, 1;, ""11ll '::Ib4b 00~" IANO TRY AGAIN IINHIBIT OUTPUT IDUMP OUTPUT BUFFER ISTORE CONTROL WORD IIF THIS IS FIRST WRITE, START THE ISEARCH fORWARO ON DfCTAPE RTL ell. CML 1 '075 17016 17011 IMAKE IT 0 IGET STARTING BLOCK Of THIS ITRANSFER 7120 1222 IWAS 0. FAILEO OUCTLW OUBll< OUREe OUCTlW 11071 7hh0 IRE'TURN O.. K. IIF LENGTH.e, GIVE OPEN ERROR IIF NOT, HAKE IT 0 AND TRV AGAIN IVEP. 135~ 17072 IGtTS SIZE OF HOLE AVAILABLE /FAILUR!. SEE wHAT wt 010. ICLEAR CLOSING LENuTH IClEAR OUTPUT INHIBIT ISt'r UP POINTERS OUNO\llR OUCCNT t7~70 11013 4 115 OUTPUT INHIBITED? 1350 3350 700fo> ~AGE (OUTINH 170b4 1 '1065 1 H'lfl6 1 H'b7 RTl 0376 12/21172 ICOMPUTE • OF RECORDS TO OUTPUT AI~D (11 TAO DCA TAIJ QUeeNT OUCCNT IUPDATE ClOSING LENGTH OUCC~T ISEE IF CLOSING LENGTH WILL UE IBIGGER THAN OUTPUT HOLE UUCTLw, Ic:l DUREt.;, 0 IWIlL BE TOO BIG 100 THE WRITE OU6UF SKP oUNO WR, I 5 7. JMI-' I PTPe0020 0 Ul(> MP UUTOMP IERROR ITAKE NORMAL RETURN PAl.8-V? 17~lb 1MB lHH74715 17020 0003 OUUHH, 17021 OUoLl\, 7&01 TAl) I UU7bli10 JMS I (2e0 12/21/12 PAGE 3-1 IENTER THE OUTPUT FILE j 1b01 IGETS STARTING BLOCK OF MOLE PAL8.V7 171 !/.Ib 001.10 171~7 b211 1714 764'" 17110 17111 \1112 17113 11114 11115 l111b 17117 17120 1 7 t 21 17122 17123 17124 t 7125 1712& 171~7 171:50 17131 17132 17! 33 11134 1713'5 171;S~ 1"11.H 171'1'" 17 ! 41 17142 171£&3 171'''' 17'45 \11 "b 171,,7 J.'" 50 1 7 t 51 OCLO~E, "CDF TAO I 5ZA CLA ~35~ 10 12/27/72 PAGE '5 ICLSOE OUTPUT fILE (OuTIN'" IIF OUTPUT INHIBITED, CLOSE IS A NOP. IA NOP IDETERMINE If OUTPuT IS TO PTP Ilf IT IS, DON'T OUTPUT A ~z. 4711 JMS 1 OClSZ (OTYPE 0310 ~NO (710 1372 7"40 13&7 47&(, 5353 q7"b TAO (-PTP SZA CLA TAO (232 JMS 1 JMP JMS 53~3 Jr-1p IERROR RETURN IfILL WITH 0 CHARACTERS q7b~ FIL\..lP, JMS (OCHAH OCRET COCHAR OCRET (OCH~R 5353 HIP IFILL TO BOUNOARY WITH 0 J~IP 4771 JMS I 7110 13b5 1364 07&3 7&40 5324 1163 137 'i SPA CLA 74')~ ~34U 13&2 4246 ~353 1MB 4775 0004 7&01 13(1100 7"10 t71~2 23~& 171~3 b213 17\54 57ro~ 11't-2 q0(?'0 171b3 7212 171ttU ~1077 17165 171b& 171b7 17170 17171 17112 17113 17174 17175 1717& ~1e.0 7273 020121 0017 17177 bMH 7211 0232 07HI 727" 7760 72~0 ~ODUMP, TAO TAO AND 57.A JMP TAO TAD SNA JMP TAD JMS JMP TAO JMS OCHEl (OlYPE (100 ~z AS EOF IIF OUTPUT IS DIRECTORY OEVICE, fILL IWHOLE RECORD, ELSE HALF RECORD (77 I CLA 1 (OUO"CT IARE WE UP TO BOUNDARY YET? fILLIP (OUOltlCT (OUCTL&3700 INO lIS THERE A FULL WRITE LEFT? IYES. BUT DON'T 00 IT, AS I NOOUlMP (40eI0+0UFLD OUTOMP OCAE:r Ou16~H1 I (2ICH~1 IGET DEVICE NUMBER ICLOSE THE OUTPUT FILE 4 , 7b01 oueCNT, o OU1'~idl SKp OClSl, OCRET, INOT PTP. OUTPUT ISZ OCLClSE COF CIF 10 JMP 1 OCLC)SE IOUMP LAST BUFFER IPOINTER TO fILE NAME ICLOSING FILE LENGTH H~RE IERROR INORMAL RETURN IRESTORE CALLING FIELDS ~z IS OUT. PALS"V7 7200 17200 1720' 00~0 172~2 7~41 17203 17204 172V'1& 17?Vl7 3272 137& 3210 1271 3224 17210 Sb0V1 172~5 1377 PAGE QUSETP, 0 TAD CIA DCA TAD DCA TAO DCA JMP 12/27/72 PAGE 5-1 IINITIALIZE OUTPUT POINTERS (OUCTLI!.3700 OUDwCT (OU~UF IDOUBLE WORD OUTPUT COUNT IINITIALIZE WORD POINTER OUPTR OUJMPE UUJMP 13 WAY UNPACK SwITCH QUSETP PALIi-117 17~ 11 01?1k1~ 17212 17213 17214 0~15 AND (311 326b DCA QUTEt'iP b211.1 131'i RDf 32hl.l UCA TAD 17~1'5 1721& 17217 17220 1b4~ t1i:?~1 5C?b3 b2~\ 17f?2~ 2224 7 4 1tJ2 5261 5256 1722b 11227 172~!I~ 126b 710b 17231 7~0~ 17?~? 037~ 1 7233 17234 17?35 1723& lhb7 3bh7 172.37 17240 12hb 7112 7012 0 (C If" COF TAU 1 ~"' S 17222 1122'1 1722':5 OCriJIl'<, SZA CLA JMP OUCO~IN OllCI-iAH, CO~" OUfLu OllJ"1fJ , IS, HL T Jf>IP OLJJMP JHP OCtiAI~2 OChA~il OCI1Mn, TAU OUl EI'1P ell RTl IHL ANO (74010 TAO 1 DUPOI.!) DCA I OUPOLD TAO OUT EI"lP ell RTH RTH RA~ H'l1 " AND ( 7" ell (1 TAO 17t:'~:i OUPhc ~hH1 11~"~ 1 ?11 :S?24 UCA TAU DCA \7?q? 17?'" 17?Q" 221~ 1 7 c~" 7 227c 1 72 'l v) 5C:'/:I3 JMP 11~"1 1372 TAl) 172.,2 172';3 '*171 JI>15 ~flb4 JMP 172~I.I ~e:>",~ 17()';5 JM~ 52b3 11?'';& 172';7 127~ 32&1 1 1 ;>"o 2270 \72"'1 172t-2 17 ?td 12hh 3h/Vl c211 '7~t>I.I 7£l02 11?b5 ~hl1 112~fJ i.10~0 '7~1o,1 00~.J 17~1~ ~~tl" 17e71 52C2" 17272 1 I ~ 13 0~00 "~H:. J 17274 0V10.(' 1121~ bf?l1.l ISZ ISZ JMP TAU DCA ISZ OCHAtoIl, TAO uCA I ouc 01'1"', ISZ OUCRI:.T, HLT JMP OIlTEi'IP, ~ DUPOLIl, 0 OUPTn:, 0 OIJJ MPE, JMP OIJDWCT, 0 OUT I I'/H, 0 UTvPC:, 0 RnF OCHA~2, PAGE b IOUTPUIT CHARACTER ~OUTINc IISOLATE EIGHT ijITS 0 IGt:.T FIELD WE IIIERE CALLED IFfolDM OUCRt. T OUT I ~;H 037:S lh7\11 17~al 12/27172' IUuTPUT INHItHTEU1 IYES, NOP, IGO TO OATA FIELD OF SuFFER IBUMP CHARACTER SWITCH IGETS JMP,.JMP.+l,ETC. ITI1It<() CHAN IHIGH ORDER BITS GO INTO THE IHIGH ORDER 4 MITS OF THE IfllolST OF Twa WQfo(OS ITHE SECOP\lU DOUBLE WORD GETS ITHE Law ORDER BITS OF ITHE THIRD CHAR UUPTiI< uUJMPE OUJMP OUPTR OUU\t;CT OUCOMN (UUC1L (OuT (IMP OUCRf.T OUSETP OUCOMN ouprk OUPOLo OIJPTf< OUTEMP OUPTIol OCt;AR IRt:.SET CHARACTER S~ITCH IPOINT TO NEXT BUFFEf1 WO~O ISUMP DOUBLE COUNT AFTER 13 CHARS. IGET OUT IREADY TO OUTPUT A BUFf ER IOuTPUT IT IAN ERROR IRESt:T OUTPUT POINTERS IPOINT TO FIRST DOUBLE WORD IPOttliT ouPTR TO SEcnND INORMAL EXIT OCI1AR OUJMP IOTYPE LOOt<S AT THE. OUTPUT DEVICE I, PALS-V7 17t?7& 137~ 17277 17300 173C11 1730? :S.~0b DCA b?ll 1710 0367 OTfn~ CDf" UI 17"503 13bo TAO I ANU 17304 17jC15 :S2bb TAJ) DCA TAO (11 17301) lebh 740? 173"7 Sb7lt 12/27/72 PAGE &-1 TAD (elF CuF 0 OTRT I~, (7bl!l~ (OC£1-l UIJTfMP oua.MP I1LT JMP IA~D LOOKS UP THE DCB wORD FOR ITHAT DEVICE. OTYPt: IGET OCR ENTRY 173r.b 77 1::d 113b1 1d~17 173H'I , 7 .~ 71 17372 7 (II ~ h 421Zi0 7b0~ 17373 7"100 1737'1 '7.575 17:Hb b203 0377 5000 \ 7377 0?'!Joil 0001 FIf.lD 21~"C'J -2101210 120(~0 4n7 JMS 12~HH (H1 1 VI 10 1 r.~h)2 1 ?~H13 ~v;(,15 '5 12vH~4 IIHHoOl (21 12~vl5 ~77S JM~ 12(i'~16 ,,174 7" ~() JMS 12\'07 ~716 12~'110 522iJ 12011 4263 1720 t?"12 12r,13 CALLCO, JMS ~~Ic:l& li!P!15 t2e'16 t2017 0111 (77"10 ILOCK MONITOR INTO CORE (200 ICAlL THE COMMAND DECODER (IOPE.N I (OOPE.N SMA CLA JMP OK JMS TERR J401) 04ftj0 12(7120 4173 t21?l21 52t!.7 (lCHAR JMP TSTEOF 12W'122 120?3 7"~~ SNA 'J2C?(~ 12~24 IH7~ JMP JM5 12112'5 5243 12r71?6 ~i?2'i} t20?7 12030 77001 S2~0 12031 1.?tt132 4263 22ic:1S 1 2l~:3 3 12V1.3h 01104 4005 2222 1722 12~34 12('1.35 ISETUP INPUT POINTERS IOPEN OUTPUT FILE IERROR. IF AC<0, IT WAS fATAL INON FILE STRUCTURED OUTPUT TEXT IOPtN FAIlEDI e~16 li1014 I OK, JMS 1 OK I (OCHAR JMP OLJTERR 12~37 vHH:1~1 ':)253 t2V1L12 JMP CLERR 52"'2 JMP CAl-LCD 1~04:S 12044 42b3 1725 1~17I45 2~20 12~"b i:!5i~ 12",,7 12"'5" 4Q11O') 222~ lAND OUTPUT THE CHARACTER JMP 01( ICONTINUE UNTIL EOF. TSTEOF, SMA CLA IWAS IT FATAL? JMP CLOSE INO •• EOF. CLOSE OUTPUT JMS TERR TEXT IHEAD ERRORI 12040 12(1:41 4771 IREAO A C~ARACTER IEHROR. SEE IF EOF. IIGNDRE BLANKS CLOSL, UUTE~~, JMS 1 (OClOSE JMS TE~R TEXT 10UTPuT IFILE CLOSE FAILED INEW INPUT. E~RUHI PALS-V7 It?C'I'.Jl 12t11c;2 1722 0000 1~\I1~3 42b3 12054 0314 1723 12~c;5 1i:!~5b 0~40 12057 12el"rt'I 120nl 12062 0b~1 0~~;'H} 1b&3 1~~fl5 701? ti?rlhb 7~12 12"67 HI12 4275 12103 12104 12105 \~IPb TVPtT, CRlF, 13&5 431 t 12110 ~20~ 12111 kHH'I0 lr!112 t ~ 113 b04.tb brt'l'41 1211 I) 5313 7200 1211 & 5711 121&5 12166 121&1 0212 1 ~ 1 7 (/J 12171 12172 ~V\77 tf:?173 1217 a bb IS 70ft10 lc17~ bh~1\ \i:!17b 1 r 117 02rl:" TAO (300 JMS TTYOUT JMfI I TYPIT TAl) (215 JMS TTYOUT TAO (212 JMS TTYOUT JMP CALLeD TrYOuT, IROUTINE TO PRINT ERROR MESSAGeS ITYPE THE CHARACTER ~ ANO (77 SNA JMf' CRlF 4311 121@7 121JQ JMS Tvt' IT TAO 1 lE~~ JMS 1 YPIT ISZ TERR JM~ TERFh 1 2263 {{I~~~(.1 121~2 TAO 1 TE~~ RTRIRTRJRTR 52&4 it'370 11.150 5 3~JQ .13& 7 1.1 31 1 5(-175 1366 t 2 1~ t 0 4275 12t11-'5 12100 TE~R, 1b63 12@7b 1?t'l77 JMS TERR ICLose FAILURE TExT ICLOSI:. fAILEOI 0000 tetlin! 12071 1207? 12073 \?C'!7Q CLERIi, 111 t.I 0504 120.,4 t~070 PAGE 7-1 12/27/72 'TLS " TSF JMP .-1 elA JMf- 0~1'.J ifLS0" 11 ~,f, 7211 7700 $$$~)'~$$$ I TTYOUT IISOLATE THE CHARACTER 10 TERMINATES IT PALB-V7 CALLeD 2002 Cl.t.RR 2053 CLOSE 2~40 Cfoll.F t!Hlt.& DCB 77b~ EUFt~R bf:l77 FILLIP 7124 G[ TNE:.W a627 ICHAR bb13 lCHARl 6722 ItHAR2 &71a ItHAR3 6703 INBREC hf.l54 IN~LJF 540" ItJBuFP h"~1 INCOlf h64'5 tNCHAH b62c·' I ~~CHCT 673:5 INCQMN &723 INCTL 020~ INCTLw bb~0 INCTR bh01 INI)I:.VH 7000 INEO": 6h10 INERR bb76 IJRIGIN hb00 UT~TN 1306 UTYPE 7~74 Il1UtjLK 7021 I(JUt;Uf 5~~0 OUI,;CNT 715~ ULJCDIF H'l75 UUI,;HAR 7222 UUCOMN 72fd UUCRET 72&41 UUCTL 4200 OUCTLW 1100 UUUEVH Fl&00 OlJlJwCT 7272 OIj~LEN 7022 UUt::NT~ 101b lJUtLL.) ~0~0 iJlltiNOL 7014 UUJMP 7224 UUJMPt:. 7~71 lJIJNO~H 7Ul4 UUPOLO 1261 uUPTw 7?7~ UUt<EC 71e~ OlJ~fTP 120~ 1V'14b h70A UUTIlMP lJU J EMP tJU 1 t::RH UUTINH uu 11:)110 UU1601 INJ~'PP bbi:!3 PT~ H~~·JE WF b733 TEKR INtIH~)( tNFLD I t~F PTR I Nr.I1UtINHNOL INJMP bb7 :~ 0r10" 6611 bb.H b144 INPTR 6b12 INRfC bb5? INQECS "~01 I r~RTHN &131 I~i?{l0 tN71.li(h1 IN7bA0 IOPEN NODUMP OCHAR OCHA~1 b106 bb~~VJ 661t& 6601 7144 7211 72bl OCHAR2 7?5& OerlAw! 72C?7 OCI52 71~? OCU1SE 7Hlb OCI<I:.T 115 S OEFAIL 1Vi32 Oi'. ONOI-IL 2~2" 1~4" ONTE~R liU4i:! OOPEN H10Q1 OORI:.TN 7Q130 72&b 2~43 7213 7~01 71 tn 0r'\2~ 2ft-Ed TSTEOF- ?027 TTYOUT 2111 TY~lT 2075 12/27/72 PAGE 7 .. 2 INDEX Additional information words, 1-3, 2-7, D-9 Alphanumeric option, Command Decoder, 3-3 switches, 3-6 ALTMODE key, 3-3 Ascertain device information (INQUIRE function), 2-13 ASCII character codes, E-2, E-3 ASCII files format, A-4 ASSIGN command, 1-6 Asterisk,caution in using, 3-9 Batch mode, 3-10 Batch operating system, 1-5 Binary file format, A-4 Block, core control, 1-4 Blocks directory, A-I system scratch, B-1 Blocks of words, 1-2, 1-3 BUILD program, 5-1 Call Command Decoder (DECODE function), 2-10; 3-3 in Special Mode, 3-9 Calling device handlers, 4-1 Calling USR and device handlers from SABR code, D=13 Card codes, DEC029, 4-7 Card Reader (CDR) operation, 4-7 Card Reader handler modification, 0-2 Carriage return/line feed suppression in FORTRAN, D-4 Cassettes operation, 4-6 CCL, 3~10 CCL error messages, C-4 CHAIN f.unction, 2 -1 0 Character codes ASCII, E-2. E-3 OS/S, E-l Character mode, expanded, 4-6 Character packing format, 5-S Characters, lower case, E-l Circumflex (~) character, 4-5 CLOSE function, 2-S, D-9 Code, non-paged, D-10 Command Decoder calling, 3-3 conventions, 3-1 error messages, 3-3 errors summary, C-7 example, 3-6 options, 3-3 output files, 3-4 special mode, 3-S, 3-9 tables, 3-4 COMMON area, 2-12 Control characters, OS/S, E-l Conventions Command Decoder, 3-1 OS/8, E-l Core control block, 1=4, 2=11, A-5 Core image files (.SV format), A-5 Core origin, A-6 Core segment doublewords, A-6 Core size, PDP-8 computers, D-5 software, 1-6 Co-resident device handlers, 2-6 Creating files, 1-3 Data exchange in core, 2-12 Data field value, 2-2 Data transfer, 4-1, 4-2 DATE command, 1-3, 2-7 DECODE function, 2-9 DECtape operation, 4-1 Default file storage device, DSK, 0-1 Deletinq tentative files, 2-14 Device control word table, B-6 Device dependent operations, 4-4 Device handler entry point, 2-14, 5-8 information table, B-5 residency table, 2-15, B-5 Device handlers device dependent operations, 4-4 Card Reader (CDR), 4-7 Cassettes operation, 4-6 High-Speed Paper Tape Punch (PTP), 4-5 High-Speed Paper Tape Reader (PTR), 4-4 file structured devices operation, 4-11 T08E DECtape, 4-11 TM8E Magtape, 4-8 Device handlers, 1-1 calling, 4-1 co-resident, 2-6 inserting into OS/S, 5-5 loading dynamically, D-7 notes on loading, D-7 writing, 5-1 Device length table, B-7 Device names and numbers, 1-6 DEVICE pseudo-op, 1-7 Devices, file structured, 1-2 DF32 disk operation, 4-11 INDEX-l sirec~ call!~g sequence, ~SR, 2-2 Directorles, file, 1-3 sirectory block structure format, A-I Girectory entries, A-2 Directory example, A-3 Directory segment, rewriting, D-9 Directory, system, 5-4 Dismiss USR from core, 2-12 Dot (.) used as system response, 1-6 Doublewords, core segment, A-6 Empty file entry, A-2 Empty files, 1-3 End-of-file card, 4-7 End-of-file condition, 4-2, 4-3 ENTER output (tentative) file function, 2-6, D-9 Entry points for device handlers, 5-2 ERROR function, 2-11 Error messages, Command Decoder, 3-3 Error messages summary, C-l Error returns, device handler, 4-2 Exit to Keyboard Monitor, 1-1 Expanded character mode, 4-6 Extensions of file names, 1-2 FETCH device handler function, 2-4, 4-1 File creation, 1-3 File directories, A-I block format, A-I entries, A-2 example, A-4 formats, A-4 number, A-3 size, A-3 File extension, omission of, 3-2 File length restriction, Command Decoder, 3-5 FILENAME pseudo-op, 1-7 Files, 1-2 additional information words, 1-3 devices, 1-2 directories, 1-3 names, 1-2 types, 1-3 File structured devices operation, 4-11 Formats for character packing, 5-3 command line, 3-1 directory block structure, A-l files, A-4 FORTRAN Library File, A-7 input file, 3-2 Job Status Word, A-6 Form feed, 4-5 FORTRAN Library File Format, A-7 Functions, USR see USR functions High-Speed Paper Tape Punch (PTP) operation, 4-5 High-Speed Paper Tape Reader (PTR) operation, 4-4 Horizontal tab, 4-5 Indirect calling sequence, USR, 2-2 Information words, additional, 1-3, 2-7 accessing, D-10 Input file format, 3-2 Input files, Command Decoder, 3-5 Input/output r~utines, F-l Input table, Command Decoder, 3-9 INQUIRE function, 2-13 Inserting device handlers into OS/8, 5-10 Job Status Word, 1-5, A-6 Keyboard Monitor, 1-1 error summary, C-3 KL8E terminal handler, 4-12 LAP pseudo-oPr 0-10 Layouts for OS/8 system, B-1 LINCtape operation, 4-7 Line Printer (LPT) operation, 4-5, 4-6 Load and start subprogram, 2-11 Loading device handlers dynamically, 0-7 Lock USR in core (USRIN), 2-12 Lo~ical blocks, 1-2 LOOKUP permanent file function, 2-5, 0-9 Lower case characters, E-l Names of devices, 1-6 Names of files, 1-2 Number and size of OS files, A-3 Numbers of devices, 1-6 Numeric option, Command Decoder, 3-3 OOT breakpoint, 2-11 Operations, device dependent, 4-3 Options Command decoder, 3-3, 3-6 Origin of core, A-6 Output files, Command Decoder, 3-4 INDEX-2 PAGE pseudo-op, D-IO Permanent device name Permanent fi:e, 1-3 deletion, 2-8, 2-9 entry, A-2 Physical bloc%s, 1-2 PIP, 3-5 ~able, Tables Command Decoder, 3-4 device centrel word, B-6 device handler information, B-5 device handler residency, B-5 device length, B-7 permanent device name, 3-4 system device, B-4 user device name, B-4 TD8E DEC tape operation, 4-11 Teletype operation, 4-4 Tentative files, 1-3 closing: 2-8 deletion, 2-4 entry, A-2 Terminal handlers I-page, 4-4 2-page, 4-12 B-4 Program, see specific subject notes, D-l PRTC12-F used to convert DECtapes to LINCtapes, D-6 Pseudo-ops DEVICE, 1-7 FILENAHE, 1=7 Punch card codes, DEC026, D-3 Prograrr~ing Records (definition), 4-1 outputting odd number of, 4-3 RESET system table, 2-14 Resident program layout, B-2 RESORC, B-7 Restrictions to USR calls, 2-2 RETURN key, 3-3 RF08 disk operation, 4-11 RK8E handlers, 4-11 ROM (Read-Only-Memory), B-3 SABR prograrrming notes, D-IO SAVE command, 1-4, 2-11 Scratch blocks, B-1, B-2 Signal user ERROR function, 2-11 Size of OS files, A-3 Software components, 1-1 Software core size, 1-6 Special mode of Command Decoder, 3-8 calling, 3-9 operation, 3-9 Standard USR call, 2-1 restrictions, 2-2 START command, 1-4 Starting address of program, 1-4 Storage space, additional, D-9 Stcrage words, 1-3 Sul::routine examples, F-4 functions, F-l, F-2 listing, F-5 parameters, F-3 Summary of USR functions, see USR functions .SV file, 1-4 System DATE, 2-7 System device layout, B-1 System devices, 1-6 System device table, B-4 System halts error messages surrmary, C-l System table values, Command Decoder, 3-7 Up arrow (t) character, 4-4 User device name table, B-4 User Service Routine (USR) , 1-1, 2-1 available location in area, D-9 calling, 1-6, 2-1 calling sequences, 2-2 errors summary, C-2 restrictions on standard call, 2-2 USR functions CHAIN, 2-10 CLOSE, 2-8 DECODE, 2-9 ENTER, 2-6 ERROR, 2-11 FETCH, 2-4 INQUORE, 2-13 LOOKUP, 2-5 RESET, 2-14 summary, 2-3 USRIN, 2-3, 2-12 USROUT, 2-2 Vertical tab, 4-5 Wrap around memory, 4-3 Writing device handlers, 5-1 Word blocks, 1-2 INDEX-3 OS/8 Software Support Manual DEC-S8-0SSMB-A-D READER'S NOTE: CO~ll~ENTS This form is for aocur:1ent cornments only. Problems with software should be reported on a Software Problem ""F.epcrt (SPR) form (see the HOW TO OBTAIN SOFTWARE INFOR}ffiTION page). Did you find errors ,~ tn~s manual? If SO; specify by page. Did you find this manual understandable, usable, and well-organized? Please make suggestions for improvement. Is there sufficient documentation on associated system programs required for use of the software described in this manual? If not, what material is missing and where should it be placed? Please indicate the type of user/reader that you most nearly represent. o Assembly language programmer [J Higher-level language programmer o Occasional programmer (experienced) o User with little programming experience o Student programmer o Non-programmer interested in computer concepts and capabilities Name Date __________________________ Organization _________________________________________________________________ Street _____________________________________________________________________ City ___________________________ State _____________ Zip Code ______________ or Country If you do not require a written reply, please check here. [J · - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fold Here ----------------------------------------------- . :.." .---------------------------------------- Do Not Tear - Fold Here and Staple ------------------------------------- FIRST CLASS PERMIT NO. 33 MA YNARD. MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STATES Postage will he paid by: Software Communications P. O. Box F Maynard, Massachusetts 01754
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies