DEC IN GRZA D_INDAC_8 2_Handbook_Dec71 D INDAC 8 2 Handbook Dec71
DEC-IN-GRZA-D_INDAC_8-2_Handbook_Dec71 DEC-IN-GRZA-D_INDAC_8-2_Handbook_Dec71
User Manual: DEC-IN-GRZA-D_INDAC_8-2_Handbook_Dec71
Open the PDF directly: View PDF .
Page Count: 214
Download | |
Open PDF In Browser | View PDF |
f:or industriai detection. anaiysis and controi o handbook In the Experimental Laboratory, the QC Station, the Process Control Room, wherever you work in modern industry, you will find the growing explosion of minicomputers. Digital Equipment Corporation, the company with the largest number of minicomputer installations in the world, presents an integrated hardware/ software system to help industry solve the problems of detection, analysis and control. ~or industrial detection. analysis and control handbook For additional copies, order No. DEC-IN-GRZA-D from the Program Library, Digital Equipment Corporation, Maynard, Mass. 01754 digital equipment corporation Price: $6.00 1st Edition December 1971 Copyright © 1971 by Digital Equipment Corporation The material in this manual is for informational purposes and is subject to change without notice. The following are trademarks of Digital Equipment Corporation, Maynard, Massachusetts: DEC PDP FLIP CHIP FOCAL DIGITAL COMPUTE R LAB CONTENTS Page CHAPTER 1 AN OVERVI EW The I ndustrial Environment 1-1 Data Collection 1-1 1-1 1-2 1-2 Process Control INDAC Language Capabilities Facilities of the INDAC Software System CHAPTER 2 BUILDING THE SAMPLE SYSTEM 2.1 2.2 Loading the HINDAC (Tape 1) Program 2.3 Loading the Monitor System Dump and INDAC File Tapes 2-2 2.4 Loading and Building the I NDAC Compiler 2-4 2.5 Running the SGEN 8/2 Program 2-5 2.6 Loading the I NDAC Executive 8/2 2-5 2.7 Loading GENDAC to Configure the Sample System 2-6 2.8 Loading Sample Program 2 Using the Editor 2-7 2.9 Compiling Sample Program 2 2-8 2.10 Executing Sample Program 2 2-9 CHAPTER 3 PROGRAMMING THE INDAC 8/2 SYSTEM Introduction 2-1 2-1 3.1 Introduction 3-1 3.2 Programming an Industrial Algorithm 3-2 3.2.1 LET Statement (Assignment) 3-3 3.2.1.1 Arithmetic 3-3 3.2.1.2 Boolean 3-6 3.2.1.3 Statement Evaluation Rules 3-8 3.2.2 GOTO Statement (Branching) 3.2.3 IF Statement (Conditional Testing) 3-9 3-10 3-12 3.2.4 FOR/NEXT Statements (Looping) 3.2.5 DO/RETURN Statements (subroutines) 3-15 3.3 Message and Logging Capabilities 3-16 3.3.1 .HEADER Statement 3-22 3.3.2 .FORMAT (Picture) Statement 3-22 3.3.3 .FORMAT (Declarative) Statement 3-23 3.3.4 .STO RAG E Statement 3-24 3.3.4.1 Development of Array Names 3-24 3.3.4.2 Specification of Array Size 3-25 3.3.4.3 Specification of Array Elements 3-25 3.3.4.4 Specification of an Array Window 3-25 3.3.4.5 Array Spanning Windows 3-26 3.3.4.6 Presetting Stored Values 3-26 3.4 Data Collection and Control 3-27 3.4.1 DAC (Digital-to-Analog Conversion Devices) 3-34 iii CONTENTS (Cont) Page 3.4.1.1 Hardware Device 3-34 3.4.1.2 Equipment Declaration Statement 3-34 3.4.1.3 Language Statement 3-34 3.4.2 ADC (Analog-to-Digital Conversion Devices) 3-34 3.4.2.1 Hardware Device 3-34 3.4.2.2 Equipment Declaration Statement 3-34 3.4.3 AF04 (Integrating Digital Voltmeter) 3-36 3.4.3.1 Hardware Device 3-36 3-36 3.4.3.2 Equipment Declaration Statement 3.4.3.3 Language Statement 3-37 3.4.4 UDC (Universal Digital Controller) 3-37 3.4.4.1 Hardware Device 3-37 3.4.4.2 Equipment Definition Statement 3-37 3.4.4.3 Language Statement 3-38 3.4.5 FILE (Pseudo-Device) 3-38 3.4.5.1 Hardware Device 3-38 3.4.5.2 Equipment Definition Statement 3-38 3.4.5.3 Language Statement 3-38 3.4.6 Equipment Statement Summary 3-39 3.5 Structure of an INDAC Job 3-40 3.5.1 Program Segmentation 3-40 3.5.1.1 Job Specification Segment 3-41 3.5.1.2 .PHASE Segment 3-42 3.5.1.2.1 Activity Statements 3-42 3.5.1.2.2 .ACTION Statement 3-42 3.5.1.3 .SNAP Segments 3-43 3.5.1.4 Subroutine 3-44 3.5.1.4.1 Internal Subroutine 3-44 3.5.1.4.2 External Subroutine 3-44 3-45 3.5.1.4.3 Implicit Subroutine 3.5.7 Scheduling 3.5.2.1 Activity Statements Crlprlhilitip.~ ~-46 3-47 3.5.2.1.1 EVE RY Activity Statements 3-47 3.5.2.1.2 DE LA Y Activity Statements 3-48 3.5.2.1.3 AT Activity Statements 3-49 3.5.2.2 Action Statements 3-49 3.5.2.2.1 Timer Action Statements 3-49 3.5.2.3 EX IT Program Control Statement 3-49 3.5.2.4 Resolving Timer Requests 3-50 3.6 The Run-Time System/Making the Pieces Work 3-50 3.6.1 Time and Priority Scheduling 3-51 3.6.1.1 Division of the Process Stack 3-51 3.6.1.1.1 Executive Command Decoder 3-51 3.6.1.1.2 Field Interrupt Processing 3-51 iv '. CONTENTS (Cont) Page 3.6.1.1.3 Foreground Processing 3-52 3.6.1.1.4 Background Processing 3-53 3.6.2 Dynamic Core Management and Swapping 3-53 3.6.2.1 Job Specification Segment 3-0,,) ........ 3.6.2.2 The PHASE Segment 3-53 3.6.2.3 The SNAP Segment 3-53 3.6.2.4 External (Disk-Resident) Subroutines and Functions 3-53 3.6.2.5 Switching Priority Levels 3-53 3.6.2.6 Executive to SNAP Communication 3-54 3.6.3 Dynamic I/O Buffers 3-54 3.6.4 Operator Communication 3-54 3.7 Servicing Field Interrupts 3-55 3.7.1 Equipment Declaration Statement 3-55 3.7.2 Language Statements 3-55 3.7.2.1 The Standard Call 3-55 3.7.2.2 IN ITIALIZE Request 3-56 3.7.2.3 IDENTI FY Request 3-56 3.7.2.4 TRANSFE R Request 3-57 3.7.3 Sample Program 3-58 3.8 Handling the Consoles 3-59 3.8.1 Equipment Declaration Statement 3-60 3.8.2 Language Statements 3-60 3.8.3 Program Examples 3-61 CHAPTER 4 CONFiGURING A SYSTEM HAVING STANDARD DEC PROCESS I/O DEVICES 4.1 Introduction 4-1 4.2 Loading the HI NDAC Program 4-2 4.3 Loading the Monitor System Dump and INDAC File Tapes 4-3 4.4 Loading and Building the INDAC Compiler 4-5 4.5 Running the SG EN 8/2 Program 4-6 4.6 Loading the INDAC Executive 8/2 4-6 4.7 Loading GENDAC to Configure a Specific System 4-7 CHAPTER 5 PREPARING THE PROGRAM 5.1 Introduction 5-1 5.2 Monitor 5-1 5.2.1 Monitor Residence 5-1 5.2.2 Starting the Monitor 5-1 5.2.3 Bootstrapping the Monitor 5-2 5.2.4 Monitor Error Messages 5-2 5.3 System Programs 5-2 5.3.1 Command String Format 5-3 v CONTENTS (Cont) Page 5.3.1.1 5.3.1.2 5.3.1.3 5.3.1.4 Device Names 5.3.2 5.3.3 5.3.3.1 5.3.3.2 5.3.3.3 5.3.3.4 5.3.3.5 5.3.3.6 5.3.4 5.3.4.1 5.3.4.2 5.3.4.3 5.3.5 5.3.6 5.3.6.1 5.3.6.2 Examples of Command Strings Binary Loader Error Messages 5-3 5-3 5-4 5-4 5-4 5-5 5-7 5-7 5-8 5-8 5-11 5-13 5-13 5-14 5-15 5-15 5-16 5-22 5-22 5-24 CHAPTER 6 EXECUTING THE PROGRAM 6-1 CHAPTER 7 MODIFYING THE SYSTEM 7.1 7.2 7.2.1 7.2.2 7.2.3 7.2.4 7.2.5 7.2.6 7.3 7.3.1 7.3.2 7.4 7.4.1 7.4.2 7.4.3 7.4.4 Filenames Punctuation Special Characters Editor Modes of Operation Input Commands Output Commands Editing Commands Special Characters and Functions Editor Error Messages INDAC Compiler Compiler Output Errors During Compilation Correcting Compilation Errors PIP Loading Programs - Disk System Binary Loader Binary Loader Operating Procedures 7-1 7-1 7-1 Introduction System Communication Tables Intrinsic F unctions (I F) .,1- ..I External Subroutines (XS) Additiona1 Notes 7-2 7-2 7-2 7-3 7-3 7-3 7-4 7-5 7-5 7-6 7-6 7-6 7.5 Library Tape Format 7-9 7.5.1 7.52 7.5.3 Definitions 7-9 System Devices (SD) Core Map (CM) Page Zero (PZ) Special GENDAC Table (**) Updating the Software System Mode of Updating Binary Mode of Updating Library Structure Basic Module Extension Modules Call-Up Modules Library Tape Header 7-9 Module Header "'71n '-IV vi CONTENTS (Cont) Page 7.5.3.1 Functionai Group Declaration 7- iO 7.5.3.2 Module Declaration 7-11 7.5.3.2.1 Physical Descriptions of Module 7-11 7.5.3.2.2 Logical Description of Module 7-13 7.5.3.3 Module Body 7-14 7.5.3.3.1 Module Title 7-15 7.5.3.3.2 Fixup Declarations 7-15 7.5.3.4 Group and Module Termination 7-16 7.6 Coding Details 7-16 7.6.1 Function (Core-Resident in Field 0) 7-17 7.6.2 Subroutine 7-18 7.6.2.1 Subroutine Requirements and Analysis 7-18 7.6.2.2 Sample of Subroutine Coding 7-18 7.6.3 I/O Handler 7-19 7.6.3.1 I/O Handler Operation 7-19 7.6.3.1.1 The Control Driver Table 7-20 7.6.3.1.2 The Format Driver Table 7-20 7.6.3.1.3 Data Information and Calls 7-20 7.6.3.1.4 Executive Page Zero Parameters 7-20 7.6.3.1.5 Interrupting Devices 7-21 7.6.3.2 A Typical I/O Handler 7-21 7.7 Vector Code 7-22 7.7.1 Numeric Formats 7-22 7.7.2 Vector Code Example 7-22 7.7.3 Load and Store Instructions 7-23 7.7.3.1 Load a Simple Variable 7-23 7.7.3.2 Store a Simple Variable 7-24 7.7.3.3 Load an Array Element (Indexed Variable) 7-24 7.7.3.4 Store an Array Element 7-24 7.7.3.5 Load an External Argument 7-24 7.7.3.6 Store into an External Argument 7-24 7.7.3.7 Load an External Argument, Indexed 7-24 7.7.3.8 Store into an External Argument, Indexed 7-25 7.7.4 GOTO Statements 7-25 7.7.4.1 Unconditional GOTO 7-25 7.7.4.2 Computed GOTO 7-25 7.7.5 I F Statement 7-25 7.7.6 DO Statements 7-26 7.7.6.1 Internal Subroutine Call 7-26 7.7.6.2 External Subroutine Call 7-26 7.7.7 Return Statement 7-26 7.7.8 Loop Statements 7-27 7.7.8.1 FO R Statement 7-27 7.7.8.2 NEXT Statement 7-27 vii CONTENTS (Cont) Page 7.7.9 Arithmetic and Logical Operators 7-27 7.7.9.1 Binary Vectors 7-27 7.7.9.2 Unary Vectors 7-28 7.7.10 Special Vectors 7-28 7.7.11 Special PAL-I Code 7-28 7.8 Running GENDAC 7-29 APPENDICES APPENDIX A SUMMARY OF INDAC STATEMENTS A.l Executable Statements A-1 A.2 Non- Executable Statements A-2 APPENDIX B EXAMPLE PROGRAM B-1 APPENDIX C USING THE DISK MONITOR SYSTEM C.l Editor Command Summary C-1 C.2 Editor Key Function Summary C-2 C.3 Error Messages C-2 APPENDIX D INDAC COMPILER ERROR MESSAGES D-1 APPENDIX E SPUT ERROR CONDITIONS E-l APPENDIX F F-1 INDAC 8/2 EXECUTIVE ERROR MESSAGES APPENDIX G GENDAC ERROR MESSAGES G-1 APPENDIX H EXECUTIVE COMMAND DECODER OPERAT!ON H.1 Operator Commands H-1 H.2 Command Decoder Error Messages H-1 APPENDIX I THE GENDAC LIBRARY 1-1 APPENDIXJ SYSTEM COMMUNICATION TABLES J-l APPENDIX K ESUP OPERATION K.1 Introduction K-1 K.2 Loading Procedure K-l K.3 Producing the Equate Tape K-1 K.4 Producing the Core Map K-2 viii APPENDICES (Cont) Page K.5 Returning to Monitor K-2 K.6 Restrictions K-2 K.7 References K-3 K.8 Examples K-3 K.8.1 Loading and Usage K-3 K.8.2 Sample Equate Printout K-3 ILLUSTRATIONS Figure No. Title Art No. Page 08-0727 3-29 2-i 2-1 Sample System Log Output 3-1 Sample Process Control Application 3-2 Structure of an INDAC Job 3-41 4-1 GENDAC and I/O Handler Dialogue 4-11 4-2 GENDAC and Function Dialogue 4-17 7-1 System Communication Tables - Interaction 08-0657 7-2 7-2 Paper Tape Binary Image 08-0671 7-5 7-3 Internal Format of Numeric Data 08-0670 7-22 SKELETONS Skeleton No. Title Page Basic Skeleton 3-1 1 The Algorithm 3-3 2 Sample Alarm Test Routine 3-16 2 Header/Format Details 3-19 2 Storage Details 3-21 3 3 3-28 Equipment Details 3-32 CHARTS Chart No. Title Page 4-1 INDAC I/O Device Handler Library Summary 4-9 4-2 INDAC Function Library Summary 4-10 ix TABLES Table No. Title Page 3-1 Basic Arithmetic Notation, Algebraic vs. INDAC 3-4 3-2 Relational Operators 3-10 3-3 Mask Generation 3-13 3-4 Declarative .FORMAT Specifications 3-24 3-5 Job Specification Segment, Organization and Contents 3-41 3-6 Organization of PHASE Segment 3-42 3-7 Organization of a SNAP Segment 3-43 5-1 System Error Messages 5-2 7-1 Allocation Codes 7-12 7-2 Allocation Parameters 7-12 7-3 Table Update Information 7-13 7-4 CALL Statements 7-20 7-5 Executive Parameters 7-21 7-6 Binary Vectors 7-27 7-7 Unary Vectors 7-28 7-8 ESUP Commands 7-29 G-1 Numbered GENDAC Error Messages G-1 G-2 Unnumbered GENDAC Error Messages G-3 J-1 System Communication Tables J-1 x CHAPTER 1 AN OVERVIEW THE INDUSTRIAL ENVIRONMENT Accurate gathering and reporting of data is indispensable to the efficient operation of a modern industrial facility. The data is needed to evaluate the overall operation, to determine its efficiency, and to calculate actual vs. theoretical yields. Data must also be displayed either permanently in printed copy or temporarily through CRT displays and indicator panels, to keep operators informed of the status, trends, and disturbances within the process or test. As a result of calculations performed on the data, the process can be controlled and modified by operator interaction or through feedback hardware. Multichannel analog graphic recorders can monitor a number of variables and compare them to a known time base, but interpretation has limited accuracy and the reduction and analysis of the data requires considerable time and effort. Also, with graphic recorders, the possibility of automatic feedback control is lost. The high speed, accuracy, and flexibility of a computer-based system provides data gathering techniques greatly beyond the ability of simple displays and recorders. DATA COLLECTION The basic function of any computer-based data acquisition system is to measure and record the operating characteristics of various equipment or process sensors and to compare these measured values with predetermined standards. The system controller, the computer, monitors input signals, controls the data sampling process, evaluates input data, detects process malfunctions, calculates data necessary to define system performance, formats data for display or storage, and controls process actuators. A computer-based system will characteristically monitor many process sensors, both analog and digital. Analog inputs, such as those from thermocouples, potentiometers, strain gauges and flow meters, must be converted to digital signals acceptable to a data processor. In addition to converted analog inputs, the complier may accept digital information from sources such as contact closures, limit switches, and manual entry consoles. System outputs, both direct digital and digital converted to analog, may be used to control displays, recorders, and actuators. Data and information may also be transferred to mass storage units, alphanumeric printers and punched paper tape. PROCESS CONTROL A computer controller gives the data acquisition system total flexibility. The computer program is used to determine what to measure, when to measure, and how to interpret the measurement. The system can thereby translate voltage readings into meaningful engineering units and can subject the inputs from different transducers to the proper linearization functions. The computer program can calculate indirect measurements, such as flow, from the measurable quantities of velocity~ cross-sectional area, and time. The data acquisition and control function may need to be established as a foreground priority task. If this function does not demand all available 1-1 computer time, a background task could be implemented to perform such functions as calculating overall process or plant efficiency or maintaining inventory control records. In an application such as engine testing, a designer may build a computer-based data acquisition system that can format and pre-process incoming data before placing it on tape for later analysis at a computation center. Formatting and pre-processing save considerable computation time. The computer can also set limits for critical parameters, and provide an alarm when the limits are exceeded, thereby increasing the safety of facilities and personnel. With feedback hardware, the computer can control fuel flow rate, air mixture, load environmental conditions, etc. Because of their high speed, accuracy, and flexibility, computers are being implemented in the industrial world. Successful implementation depends largely on the availability of process interface devices and easy-to-use software. I NDAC 8/2, for example, offers an industrial language to simplify bringing the computer into the process. INDAC LANGUAGE CAPABILITIES The current high-level languages do not allow such functions as time and priority sequencing, handling of random external interrupts, analog and digital input and output, and file handling - all of which may be called for in data acquisition and control systems. With these limitations in mind, Digital's engineers and programmers implemented statements, similar to those used in BASIC and FORTRAN for arithmetic and logical computations and program control with additional English statements to provide for: • Control of the start of tasks accordihg to a time lapse, or time-of-day. • Segmentation of programs into several units, with each unit occupying computer storage only when it is actually in use. • Definition of process interface equipment, associated channels, and modes of operation. • Easy-to-use data collection and control statements. • Transfer of data between the computer and mass storage for recordkeeping or"analysis. The result: the INDAC 8/2 language, the first compiler-level language designed for real-time data acquisition and control in a mini-computer. With a few hours training an engineer familiar with BASIC or FORTRAN can produce simple piOgiams in the INDAC 8/2 ianguage for anaiysis of process environments. FACILITIES OF THE INDAC SOFTWARE SYSTEM The I NDAC Software System provides the user with facilities for: • Rapidly loading the INDAC 8/2 Software System • Configuring or modifying the I NDAC 8/2 System to meet the users application needs • Creating and Editing the application source program • Compiling the application algorithms into an efficient run-time program. • Running under control of a real-time Executive • Utility Support Functions All INDAC 8/2 programs are on paper tapes supplied with the system. The tapes can be loaded quickly using the detailed procedures given in Chapter 2 or 4. Once the basic I NDAC software system is loaded it can be configured to meet specific users application needs using GENDAC (the system configuration program). 1-2 The standard PDP-8 Disk Monitor System, which is unique in the field of small computers, controls all INDAC 8/2 program preparation. With this powerful tool the user can establish and maintain files for INDAC 8/2 source programs, edit, compile, and execute them using simple keyboard commands. The Disk Monitor System also includes utility programs for loading, deleting, and transferring I NDAC files. The compiler converts the source program into object code, which is executed at run time. Extensive diagnostics hel p the user debug h is programs. The operating system (or Executive) provides for automatic overlays of program units and provides for program or task scheduling based on time, priority, events, or program decisions. Tasks made of program overlays have distinct priority levels. The tasks may be executed in response to process interrupts, events, or timers; or whenever the system is idle. The system transfers tasks, program u'nits, and data automatically from disk to core and vice versa. f:or slow peripherals, such as the Teletype@, the INDAC 8/2 System provides for buffered outputthis allows the output operation to go on independently of the program processing. @Teletype is a registered trademark of Teletype Corporation. 1-3 SAMPLE SYSTEM LOG (Sheet 1 of 5) Fold out and use this log for reference while you build the sample system (see Chapter 2) 2-i • • • • • • • • • • • • • • • • • • • • LOAD, DUMP OR VERIFY- L ENTIRE DISK OR 1 "An LoV"'V, nlIW'D no uunc vn • FILE~?-E • • • • • • • • • IJrOTC"'v_' vLn~rl-L. ENTIRE DISK OR FILES?-F LOAD, DUMP OR VERIFY- L ENTIRE DISK OR FILEi?-F LOAD, DUMP OR VERIFY.LOAD * I N-R: *ST=2ItH} tf .LOAD * HI-R: *ST:2 ff .LOAD *IN-R: *51=2 tt .~ .LOAD * I N-R: *51=2 ft .LOAD * HI-R: * 51=2. tt .SGEN .SAVE11400; .HELD • _t . . . • • • • L.l:.L.1I . GEt/oAe ~27 TYPE '? • III' CONFUSED. 4Kl-N *OPT-B *Hi-R: ttP Figure 2-1 Sample System Log Output (Sheet 1 of 5) 2-ii SAMPLE SYSTEM LOG (Sheet 2 of 5) Fold out and use this log for reference while you build the sample system (see Chapter 2) 2-iii • II 0 LIBRARY I NDAC 8/2 • SAVEO ! 1400; FROM SGEN?-Y CHKS... STORED AT 10200 < • INITIAL RU/'n-y [ZC) STORED AT 10117. END ADDED TO 10 CHAIN. .. DISABLE CTRl/C IN COMMAND MODE?-N • • • ~0 HZ CLK8 ClKS CLK8 PDP-8/E PROGRAMMABLE CLOCX?-N 5~ HZ PDP-S/I OR PDP-8/l?-N .. ~0 HZ PDP-S ClOCK?-N • 5~ HZ PDP-8 CLOCK?-N .. Gt:NERIC 2?-N • AHH?-N • AFIZ3?- N ANY OF THE ABOVE A/D?-H • • • • • • • • 50 HZ PDP-8/E lINE rREQ CLOCK?-N HZ PDP-B/l OR PDP-8/L?-N . • • PDP-8/E LINE FREQ ClOCK?-Y STORED AT 05102 STORED AT 05e45 STORED AT 0531' '0 • • • U2 IC> UDCP7-N • AFC-8?-N .~ AD~l?- N AH~4?- N UDCE?- N • "Ae 17- N • AA5187- N • PTP?-Y PTP ADDED TO [PPl STORED AT 01320 PTP ADDEO TO 10 CHAI.N~:.-._ - -_ _ Figure 2-' Sample System Log Output (Sheet 2 of 5) 2-iv • • • SAMPLE SYSTEM LOG (Sheet 3 of 5) Fold out and use this log for reference while you build the sample system (see Chapter 2) 2-v • • • • • • • • • • • • • • TTY2?-Y [Tf] TTY2 [T2] TTY2 [T2] ADDED Ta <**> ADDED TO STORED AT 91344 ADDED TO 10 CHAII. STORED AT 03.32 • • • • rrY3?-N rry4?-N END OF LIBRARY TAPE • *OPTGENDAC COMPLETED. .EDIT *OUT-i: TEiT e ** IN-R: **OPT-B e· • *R .COMP *OUT-S: TEiT • **IIi-S:TEST * *OPTICLK@ IEXE@ INPU@ 13 2244 22i14 2215 2215 2150 2150 2211 2211 2733 2733 13211 0211 4 IDEV@ 9 IiWI@ 10 ICTR@ 11 IPlOD@ • 12- • _, 21351 • .SPUT 4t • • • • * U-S: TEST *FILE START 03'8 EXEC LOADED ;~DRII DO you ~HIS tt • WISH TO BYPASS DEiCRIPTIONS? PROGRAM CONTAINS 3 EXERCliERi. ALL THREE EXECISERS MAy BE CALLED TO OPERATE AUTOMATICALLY BY TYPING 'AUTO' AND 'C/R' (CARRIAGERETURN). ANY lINGLE EXERCISER MAY BE CALLED TO OPERATE By TYPING 'GOTO' fOLLOWED BY THE EXERCISER NUPlBER (ONE-DIGIT) AND A 'C/R'~ ANY [XERCliE MAY BE STOPPED BY TYPI~G 'STOP' AND 'e/R'e * * Figure 2-1 Sample System Log Output (Sheet 3 of 5) 2-vi I I J :.~II _I SAMPLE SYSTEM LOG (Sheet 4 of 5) Fold out and use this log for reference while you build the sample system (see Chapter 2) 2-vii ~ ~ .~ • • • • • • • • • • • • • • *PLEASE ENTER THE CORRECT TIME. THE TIME-Or-DAY, PRESS 'fA' (CTRL A), GET REjPO~SE, PRESS 'tV' (CTRL V); 'c' (NO CTRL): AND THEN 'C/R'. THE EXECUTIVE WILL TYPE OUT THE CURRENT TIME-OF-DAy AND WAIT. WHEN THE TYPING STOPS, EHTER EXACTLY' DIGITi AND TWO COLONS AS FOLLOWS: 'HH:MM:SS' FOR HOURS, MINUTES AND SECONDS. THEN TYPE 'C/R'. AFTER YOU HAVE INSERTED THE CORRECT TIME, PRESS 'tP' (CTRL P> TO PROCEED IN OPERATOR M0DE, THEN PRESS 'C/R' (CARRIAGE RETURN) TO CONTINUE WITH THE PROGRAr.. tA *tVC CLOCK o: 2: 7,08:00:00 tP TO ~ET # THANK YOU! DO YOU HAVE- TTY2 ? N DO YOU HAVE- PTP 7Y TURN ON PTP-TYPE CARRIAGE RETURN WHEN READy ENTER 'AUTO' AND 'C/R' FOR AUTOMATIC TESTING OR ENTER 'GOTON' WHERE N IS THE EXERCISE NUMBER REQUIRED. AUTO EXERCISER #1- 20 SECOND DELAy BEGINS NOW 12~45~7890:-QWERTYUIOPASuFGHJKL;ZXCVBNM,.1 THE TIME IS NOW 8: 1:11 12345'7890:-QWERTYUIOPASDFGHJKL;ZXCVBHM,.1 THE TIME IS NOW 8: 1:31 12345'7890:-QWERTYUIOPASDFGHJKL;ZXCVBNM,.1 THE TIME IS HOW 8: 1:51 12345'7890:-QWERTYUIOPASuFGHJKL;ZXCVBNM,.1 THE TIME IS NOW 8: 2:11 12345'789~:-QWERTYUIOPASDFGHJKL;ZXCVBNMf.1 THE TIME IS NOW 8: 2:31 !2345i789~~-QWERTYU!OP~iDFGHJKL~ZXCVBWM;~1 THE TIME IS NOW 8: 2:51 Figure 2-1 Sample System Log Output (Sheet 4 of 5) 2-viii • • • • • • • • • • 81 .1 .1 • .1 SAMPLE SYSTEM LOG (Sheet 5 of 5) Fold out and use this log for reference while you build the sample system (see Chapter 2) 2-ix • • • • • • • • • • • • EXERCISER 12 THIS EXERCISE DISPLAYS THE VALUE REPRESENTED BY THE COMPUTER SWITCH REGISTER IN OCTAL, DECIMAL, SIGHED DECIMAL, AND E-TYPE NOTATION. THE EXERCISE REPEATS EVERY 28 SECOHDS FOR .3 MIIUTES IN AUTOMATIC MODE. 020~ 128 + 128 +0. 128080EH100.3 4iH!l0 21it48 -2048 -0.204800E+0004 -0. 10i080[+0001 7771 012100 + 5252 13 •• " -13 •• 2525 13.5 +J3'5 (lIeral " 1 + +0. 0001ih1121E+0000 +0. -0.1.3 •• 00[+0004 1.3'~00E+0884 .~ ... +1iJ.10B01210EH"'~81 3333 1755 +1755 +0. 175508EHHi04 "., 58' - 58' -0.58.000E+0003 • • • • • • EXERCISER 13 THE TIME IS NOW B: ':39 WORKING!-INPUT ALLOWED AFTER HEXT TYPEOUT OF TIME THE lIME Ii NOW 6: ':41 STOP END OF' TEST 'fA * NOTE EXERCISER #3 was stopped by typing "STOP". This exerciser will repeat every 15 minutes if allowed to continue. Following the "STOP) " command. the operator typed CTRL/C (controi key and (; key togetner; to return to the 0 isk Monitor System. Figure 2-1 Sample System Log Output (Sheet 5 of 5) 2-x 1 e e, • I CHAPTER 2 BUILDING THE SAMPLE SYSTEM 2.1 INTRODUCTION This chapter contains step-by-step procedures for the nevv user to check out the basic software/hardware operation of his INDAC 8/2 System by building a sample system. In building the sample system, the new user becomes familiar with some of the operating mechanics of the system which will be of benefit when he builds his specific system. NOTE The PDP-8/E control panel differs slightly from other PDP-8 Computers. The procedures presented in this section detail the PDP-8/E controls. When INDAC is implemented with a PDP-8/1 or L, use the START switch whenever CLEAR/CONT ;s specified in the procedures; use LOAD ADDR whenever EXTD ADDR LOAD or ADDR LOAD is specified in the procedures. The log output from the loading and execution of the sample system is shown in Figure 2-1. 2.2 LOADING THE HINDAC (Tape 1) PROGRAM To load the computer from a cold-core start proceed as follows. NOTE Verify that RUN light is off. If the light is on, press HALT and return HALT switch to up position. Step Procedure Load the switch register with 0000. 2 Press EXTD ADDR LOAD. 3 Load the switch register with 0027. 4 Press CLEAR. 5 Press ADDR LOAD. (continued on next page) 2-1 Step 6 Procedure Successively deposit the following: Location Instruction 0027 6011 30 5027 31 6016 32 7450 33 5027 34 7012 35 7010 36 3007 37 2036 40 5027 7 Load the HINDAC (Tape 1) program in the high-speed reader - begin anywhere in the initial blank tape portion. 8 Load switch register with 0031. 9 Press ADDR LOAD. 10 Press Clear. 11 Press CONT. NOTE The tape should now read completely through the reader and stop on the trailer portion (code 02(0) of the tape. The computer should also halt. At this point, both RIM and the Binary Loader are in core. If the RUN light does not go out, or if the tape does not read in properly, repeat the above procedure. 2.3 LOADING THE MONITOR SYSTEM DUMP AND INDAC FILE TAPES After the HI NDAC program is loaded successfully, load the Monitor Support program using the Binary Loader. Step Pi'vceduie Place the MSUP tape (Tape 2) in the high-speed reader. Set the leader portion (code 200) of the tape under the read lamp. 2 Load switch register with 7777. 3 Press ADDR LOAD. 4 Set switch register to 3777. 5 Set the rotary console switch to AC. 6 Press CLEAR, then CONT. The tape should now read until the trailer portion (code 200) is under the read lamp. At this point, the computer will halt with the AC containing 0, and the link may be on. (continued on next page) 2-2 Step Procedure 7 Load switch register with 200. 8 Press ADD R LOAD. 9 Press CLEAR, then CONT. The MSUP program will begin a series of questions to determine the operation required. Each question may be answered by a single letter followed by a carriage return (designated) ). After it is loaded, the first question is: LOAD, DUMP OR VERIFY- 10 Type L) The next question asked is: ENTIRE DISK OR FILES?- 11 Type E) The MSUP program will come to a halt after typing "E) ". The program is now waiting for the user to load the Monitor System Dump (Tape 3) in the high-speed reader. 12 At this point, before loading the tape, set the switch register to 0001. The LSB switch is used to control the loading of the System Dump tape. When the switch is in the "1" position, the program will idle after completion of loading the current block (one "block" of information). When the switch is set to "0", the program will resume loading. NOTE Make certain that all checksums are torn from the end of the Monitor System Dump tape before loading. 13 Place the Monitor System Dump (Tape 3) in the high-speed reader. Start tape at leader portion (code 200). 14 Press CONT. At this point, if you have correctly set the LSB switch, the program will be idling. 15 Set the LSB to "0" to start the loading process. At any time setting the LSB to "1" will stop the tape at the next leader/trailer. Loading will resume whenever the LSB is reset to "0". NOTE During the loading process, if the reader malfunctions, MSUP will print "CHECKSUM OR VERIFY ERROR" and halt. Back the tape up one block (blocks are groups of punches separated by leader/ trailer, code 200). Place the leader of the block that failed under the reader lamp. Set LSB for continued loading and press CONT. If the block will not load correctly, the tape has been damaged and must be replaced. 16 When MSUP completes the loading of the Monitor System Dump (Tape 3), there will be a slight pause and the program will type out: LOAD, DUMP OR VERIFY(continued on next page) 2-3 Step Procedure 17 Place the INDAC Support Programs (Tape 4) in the high-speed reader. Start tape at leader portion (code 200). NOTE Tear all checksums from the end of the tape (information foiiowing the iast ieaderitraiier punches). Type L) 18 The next question asked is: ENTIRE DISK OR FILES?Type F) 19 When MSUP completes the loading of the INDAC Support Programs (Tape 4) there will be a slight pause and the program will type out: LOAD, DUMP OR VERIFYPlace the I NDAC System Tables (Tape 5) in the high-speed reader. Start tape at leader portion (code 200). 20 NOTE Tear all checksums from the end of the tape (information following the last leader/trailer punches). Type L) 21 The next question asked is: ENTIRE DISK OR FILES?Type F ) 22 When MSUP completes the loading of the INDAC System Tables (Tape 5) there will be a sli9ht pause and the program will type out: LOAD, DUMP OR VERIFY- 23 When both file tapes have been loaded, type CTR LlC (hold both CTR Land C keys down); this will return control to the Disk Monitor System just loaded. The Monitor will respond with a period. At this point, the disk system is established for a single disk and the Disk Monitor is resident in core. 2.4 LOADING AND BUILDING THE INDAC COMPILER Load the MAKE 8/2 (Tape 6) program using the Disk Monitor Loader. To load MAKE 8/2 from the high-speed reader, use the following command string: .LOAD) *IN-R:) * ST=2(0) ff (User types CTRL/P after each f). NOTE Start the tape at leader portion (code 200). 2-4 MAKE 8/2 will execute and return to the monitor. Now load the Compiler tapes: COMP1 (Tape 7) COMP2 (Tape 8) COMP3 (Tape 9) COMP4 (Tape 10) The loading sequence (using the high-speed reader) is the following for each tape: . LOAD) *IN-R: ) * ST=2) tt (User types CTR L/P after each t). NOTE Start tape at leader portion (code 200). After the user's second CTR LIP, control returns to the Monitor after about one minute. The same sequence is repeated for each compiler tape. 2.5 RUNNING THE SGEN 8/2 PROGRAM SG EN 8/2 takes a single-disk system and expands the file structure into as many disks as are connected to the system (Limit 4), and protects the Executive and data file areas that will be used later in the system. Any disk units on the system that are not to be used by the I NDAC system should be switched to "off". To run SG EN 8/2, type the following sequence: .SGEN) .SAVE (SD)! 1400;) SG EN 8/2 expands the single-disk system to include as many as the user has DS32 expander units selected and returns to the monitor after a short pause. The SAVE command initializes the System Devices Table in preparation for the system configurator program. 2.6 LOADING THE INDAC EXECUTIVE 8/2 Load the I NDAC Executive as follows: Step Procedure Place the Executive 8/2 (Tape 11) in the high-speed reader. Start the tape at leader portion (code 200). 2 3 Set the switch register to 3600. Type HELD) The HELD program will load the Executive and halt after loading. NOTE 1 Since paper-tape to disk operations are taking place, the loading may appear "jerky" or "erratic"; this is normal. (continued on next page) 2-5 Procedure Step 3 (cont) NOTE 2 At this point the AC register should be "0", indicating that the checksum comparison is correct. If the AC is not "0", repeat the Executive loading procedure. 4 Set the switch register to 7600. 5 Press EXTD ADDR LOAD. 6 Press ADDR LOAD. 7 Press CLEAR, then CONT. NOTE Control returns to the Monitor after pressing CONT. This completes the procedures required to build the initial system. Continue with the following procedures to build the specific sample system for checkout and experimental usage. 2.7 LOADING GENDAC TO CONFIGURE THE SAMPLE SYSTEM The function of GENDAC is to configure the INDAC System for the specific requirements of each installation. To configure the sample system for checkout and initial experimentation, follow the log as indicated. NOTE The sample system contains the specific real-time clock purchased for this system, the high-speed paper-tape punch, and the TTY2. This configuration is specified regardless of the exact hardware actually connected. Procedure Step Load GENDAC (Tape 12) in the high-speed reader.. Start tape at leader portion (code 200). 2 Set the s'Nitch register to 3600. 3 Type LELD) 4 Thp. LELD rrogr~m willlo~ GENDAC and return to the monitor after loading. NOTE Since paper-tape to disk operations are taking place, the loading may appear "jerky" or "erratic"; this is normal. About a third of the way through loading the tape the Teletype@ will echo a carriage return! line-feed. 5 When loading is completed, LELD will return to the monitor. 6 Press HALl, then return switch to normai position. 7 Set switch register to 0200. (continued on next page) ®re!etype is a registered trademark of Te!etype Corporation. 2-6 Step Procedure 8 Press ADDR LOAD, CLEAR, then CaNT. 9 GENDAC will begin execution. 10 The initial dialogue from GENDAC types the version number and a reminder to the operator that if he is unsure of the response to a question, type "?". 1i GENDAC will then ask if this is to be a 4K system. The response wili be "N", because you do not have a 4K system. 12 GENDAC will request the mode of operation to be used via the question "*OPT-", the response will be "B" for binary mode. 13 The next request is for the input device via the question "* I N-" the response will be "R:) " for the high-speed reader. 14 GENDAC thenJypes "t", waiting for the binary tape to be loaded. Load the I/O Handlers (Tap~'1:3) into the high-speed reader (start tape at leader code 200) and reply by striking CTR L/P (hold CTR L key and strike P key). GENDAC echos tP. 15 Answer all questions as in the log, except for selection of clocks; only respond to the correct computer and line frequency for your configuration. In general, if you do not understand what the routine in question is type "1" (inspect). The requests for TTY2 and PTP must be answered "Y" for the sample system. 16 When GENDAC reaches the end of the I/O Handlers tape it will type "END OF LIBRARY TAPE and *OPT-". Then respond with carriage return to complete GENDAC. 17 GENDAC will return to the Monitor System. 2.8 LOADING SAMPLE PROGRAM 2 USING THE EDITOR Load the Sample Program as follows: Step Procedure Place Sample Program 2 (Tape 14) in the high-speed reader. Make certain that all punched checksums are torn from the end of the tape. 2 Type EDIT) 3 Follow the dialogue listed below: *OUT-S:TEST) * *IN-R:) * *OPT-B (NOTE: Carriage return is not used) *R) 4 At this point, the ED IT program will read one buffer of information from the tape, stop reading, and return an asterisk (*). 5 Type E) 6 The EDIT program will process the entire tape, close the TEST file on the disk and return to the Monitor System. 2-7 2.9 COMPILING SAMPLE PROGRAM 2 Compile the Sample Program as follows: Step Procedure Type COMP) This command will begin execution of the Compiler. Follow the dialogue listed below: *OUT-S:TEST) * *IN-S:TEST) * *OPT) NOTE Both the input and output files are allowed to have the same name - this is a feature of the monitor system to simplify bookkeeping for the user. 2 The Compiler will now begin processing. The Compiler is disk-bound and may appear to be in a loop accessing the disk; this is normal. 3 The Compiler will type out the information as shown in the log, with pauses between typeouts as the information is processed. 4 If the Compiler generates any error conditions, there are two possible causes for the errors: a. Sample Program 2 has not been loaded correctly, or the checksum at the end of the tape has not been torn off. If this is the case, go back to Paragraph 2.8, Loading Sample Program 2 Using the Editor. b. The compiler does not recognize a device name. If this is the case, the system was not configured properly with GENDAC. Refer to compiler error messages, Appendix D. You have now gained the experience necessary to proceed correctly again from Paragraph 2.3 or as follows: (1) Press CTRLiC to return to Monitor. (2) Load the MSUP tape from the high-speed reader using the following command string: . LOAD) *IN-R:) * ST=200) tt (User types CTR LIP after each t.) NOTE The MSUP program will begin a series of questions to determine the operation required. Each question may be answered by typing a single letter followed by a carriage return (designated) ). After the MSUP program is loaded, the first question is: LOAD, DUMP or VERIFY- (3) Proceed ".... ith Paragraph 2.3, Step 17. 2-8 2.10 EXECUTING SAMPLE PROGRAM 2 To run the Sample Program proceed as follows: Procedure Step Type SPUT) This command calls the System-Put Together program. SPUT will transform the Test program to an absolute configuration used during run time. SPUT will also automatically link to the Executive for execution. NOTE If any errors are generated in this portion of the system, refer to Appendix E. 2 Follow the dialogue listed below: *IN-S:TEST) *FILE START 0368 EXEC LOADED 3 4 At this point, the Executive is loaded and operating. This is the "idle" loop portion of the Executive waiting for commands. To begin Sample Program 2, follow the dialogue listed below: tA (CTRL/A) *tDR #1) (CTRL!D followed by an "R", an optional space, a "#", a "1", and a ") ".) The Sample Program will begin typing instructions. If this is the first time you are running this system, answer liN) " to the first question asked. The dialogue should follow the sample log. You may now answer correctly when asked about the equipment you have. If you have TTY2, this device should be "ON-LINE" and connected for the test. Refer to Figure 2-1 for Sample Program 2 dialogue. 2-9 CHAPTER 3 PROGRAMMING THE INDAC 8/2 SYSTEM 3.1 INTRODUCTION The INDAC language is an application language for IDACS 8 Data Acquisition and Control Systems. Although the language utilizes BASIC/FORTRAN like program statements, it also contains facilities for scheduling, for specifying industrial interface equipment and for servicing field interrupts; making it a much more powerful industrial application tool. The facility for specifying industrial user interface equipment is also available for special devices the user may wish to integrate into his system. A process, whether it is: Calibration and Testing Material Preparation Parts Manufacturing Control Process Control (Batching) Materials Handling Machine Control is controlled by an algorithm that can effect data collection; operate on process variables and parameters to deve!op control values (set points, on-off signals, open-close signals, etc.) and send these values to process control equipment; activate schedules; and accept operator inputs or commands. The INDAC language permits the user to create the algorithm that he needs using simple, easy to understand English statements. If the algorithm is too large for the available computer core, I NDAC's segmented structure permits the user to develop individual segments for each function of the algorithm. Each segment will be automatically maintained on mass storage. The user can then schedule these segments using I NDAC's scheduling capability so that each segment is executed as though the whole algorithm were core resident. Since INDAC has a segmented structure and certain key words must be used to identify executable code from scheduling parameters, program skeletons are used in this chapter to place the segments into perspective for the reader. Basic Skeleton #1 .PHASE .ACTION #2 .SNAP .PROCESS .END The above skeleton shows the two basic segments of the INDAC language: the PHASE and the SNAP. The PHASE contains the key word .ACTION; the SNAP contains the key word .PROCESS. The last statement of the job is .END. 3-1 3.2 PROGRAMMING AN INDUSTRIAL ALGORITHM An algorithm contains routines and/or subroutines for handling process control functions such as: a. Conversion of process variables to engineering units b. Conversion of calculated control values for driving process equipment c. Decision making based on process variables and parameters d. Initializing e. Sampling f. Limit checking g. Normalizing h. Scaling i. Optimizing Control Parameters The I NDAC language provides the user with the necessary facilities for coding these and many other algorithmic functions. Some of the basic facilities the INDAC language provides are: a. Arithmetic including: Add Subtract Multiply Divide Exponentiation Square Root b. Bit isolation facilities for: Testing Setting Resetting c. Relational Comparison for process decisions including: Greater than Greater than or equal to Equal to Not equal to Less than or equal to Less than d. Mu!ti!atera! branching e. Looping f. Subroutines Skeleton No.1 shows the basic structure of an INDAC program and where the algorithm must be placed. To compile an I NDAC source program without error, the program must contain a .PHASE and a .SNAP. The PHASE must contain at least one scheduling statement foHowing the key word .ACTION. The algorithm must appear in the .SNAP and must be bracketed by the key word .PROCESS. The last statement of the job is .END. 3-2 Skeleton No. 1 - The Algorithm .PHASE LET .ACTION GOTO I DO SNAP #2 PRIOR ITY 1 #2 .SNAP DO/RETURN INDUSTRIAL ALGORITHM .END 3.2.1 IF FOR/NEXT LET Statement (Assignment) To resolve process parameters or process variables in developing control values or set points, "Arithmetic" will have to be performed in the algorithm. The LET statement allows the user to do arithmetic. The LET statement also allows the user to deal with the computer bits (Boolean type operations) asthough he were opening or closing valves, turning solenoids on or off, setting indicators high or low, etc. 3.2.1.1 Arithmetic - Consider the following: LET HI LIMIT = 80.0 LET LOLIMIT = 60.0 Notice the use of the LET statement to assign a fixed parameter to a name. The assigned name can then be used in a limit checking algorithm. Assigning a value to a name rather than using the value itself in the program provides the option of changing the value at a later time. This option may be required in applications where dynamic limits prevail such as checking reject figures under varying production rates. To reduce HI LIMIT from 80.0 to 70.0 one simply writes: LET HILIMIT = HILIMIT - 10.0 The resulting value of an arithmetic expression can also be assigned to a variable name. For example: LET RANGE = HILIMIT - LOLIMIT The expression, HI LIMIT - LOLIMIT, is evaluated during program execution and the result (+10) is transferred to the assigned name RANG E. I n arithmetic assignment statements, the assigned name and the expression or fixed parameter represents either integer or real quantities. I nteger quantities requ ire less core storage than real quantities because an integer quantity is represented by one computer word, while a real quantity is represented by three computer words. The criteria for assigning a quantity a real or integer representation is its size. Integer quantities are limited to -2048 to +2047 inclusive" Real quantities are within the range ±1 x 10(±991" To distinguish integer from real variables in the assigned name, the prefix I is used for all integer representation. Assigned names of real variables are prefixed by any alphabetic character except I. The preceding examples of the LET statement define real variables and expressions. These statements can be rewritten to define integer variables and expressions as follows: LET IHI LIMIT LET ILOLIMIT = 80 = 60 LET IRANGE = IHILIMIT - ILOLIMIT 3-3 Notice that the integer constants, 80 and 60, do not use a period as do the real constants. The LET statement allows the user not only to define and then operate on the data, but also to redefine and operate on process data collected from sensors. For example: LET TEMP = REFERENCE + SENSOR iF TEMP GE 90.0 THEN GOTO 21 GOTO 50 LET IVALVE = 1 21 The LET statement in this example shows how two data items (REFERENCE and SENSOR) that have been collected from the process are added together and defined as TEMP. A decision, using the I F statement, is then made using the variable named TEMP. Arithmetic expressions for the LET statement may be formed using the INDAC arithmetic operators detailed in Table 3-1. A comparison between the algebraic and the I NDAC notations is also given in the Table 3-1. The primary differences are that the operator (symbol) used to denote arithmetic must appear, and all data must be on the same line (that is, %notation not permitted). Table 3-1 Basic Arithmetic Notation, Algebraic vs. INDAC Notation Algebraic INDAC Arithmetic Operation Differences in Notation A+B A+B ADDITION NONE A -B A-B SUBTRACTION NONE AXB A*B MULTIPLICATION An asterisk is used as the I NDAC operator ISor A+ B AlB DIVISION A slash is used as the INDAC operator I At 2 EXPONENTIATION An up arrow is used as the I NDAC operator instead of a superscript or A·B A A2 I I Two major factors that must be observed when writing arithmetic expressions in INDAC are: a. Compatibiiity of data type b. INDAC-established precedence in the execution of arithmetic operations. Except for exponentiation, unlike data types (integer vs. real) cannot be used in the same expression. I n exponentiation, the exponent is always an integer. The following examples illustrate both acceptable and unacceptable expressions based on data compatibility. Acceptabie Comments Unacceptable Comments HI LIMIT + LOLIMIT Both real variables IHILIMIT + LOLIMIT Mixed types, IHILIMIT is integer, LO LI M IT is a real variabie IHIUMIT + ILOLIMIT Both integer variables HI LIMIT + I LOLIMIT Mixed integer I LOLIMIT and real HILIMIT variable (continued on next page) 3-4 II Comments Unacceptable Comments Acceptable 5 + IRANGE Both integer types 5 + RANGE Mixed integer number and real variable 5 + 10 Both integer numbers 5 + 10.2 Mixed integer and real numbers 12E5 + RANGE Both real data types 12 E5 + IRANGE Mixed real number and integer variable 1.2 t 5 Mixed types permitted 1.2 t 5.3 Power must be expressed as an integer number Evaluation of arithmetic expressions is carried out according to the following precedence of execution: Precedence Operation Operator t Exponentiation 2 */ Multiplication and division 3 +- Addition and subtraction NOTE Where operations have the same precedence of execution, they are evaluated from left to right, according to their occurrence within the expression. The steps that are performed by I NDAC in evaluating the expression 2 t 2 * 3/2 + 1 according to the established hierarchy are: Step 1 Raise 2 to the 2 power 22 = 4 Step 2 Multiply result by 3 3X4 Step 3 Divide product by 2 12/2 = 6 Step 4 Add 1 to the quotient 6+1=7 = 12 Parentheses are used to group terms and factors of an arithmetic expression to specify a desired sequence (hierarchy) of execution. Operations grouped within parentheses are always performed first. For example, in the expression: 5 * (1 + 3) the grouped expression is evaluated first (that is, 1 + 3 5*4 = 4); then the remaining operation is carried out (that is, = 20). Multilevel grouping by parentheses is permitted in INDAC (for example, (((A+B) +C) *0)). In multilevel grouping, the evaluation of the expression is carried out starting with the innermost group and proceeding in sequence to the outermost group, as illustrated in the following example: (... {(({FIRST) SECOND) THIRD) FOURTH) .... ) The manner in which grouping affects INDAC's evaluation of an expression is illustrated by the following versions of the expression 2 t 2 * 3/2 + 1. 3-5 Examples: 1. 2. 3. a. 2 t (2 * 3)/2 + 1 b. 2 t (6) /2 + 1 c. 64/2 + 1 d. 32 + 1 e. 33 a. ((2 b. ((4) * 3) /2 + 1 c. ti2) /2 + 1 d. 6+1 e. 7 a. ((2 b. ((4) *3) / (2 + 1) c. (12) / (3) d. 4 t t 2) * 3) /2 + 1 2) * 3) / (2 + 1) 3.2.1.2 Boolean - Consider the following LET IMASK = '1000 LET lOUT = '4000 Note the use of the LET statement to assign an octal constant to a name. In INDAC, octal constants are identified by an apostrophe preceding the number. Octal constants are used in Boolean operations to isolate or set bits in bit patterns. The assigned name must be an integer type because all INDAC bit patterns are limited to one computer word. The reason that octal constants rather than decimal constants are used in Boolean operations is that octal constants are easily identifiable with a specific bit pattern. A named variable may also be set to the result of a Boolean expression. For example, to test the state of a bit (0 or 1) one may write LET IBIT = IMASK AND IPATTERN The expression IMASK AND IPATTER N is evaluated on a bit-by-bit basis during program execution and the result is transferred to the assigned name. Remember that the IMASK isolates the bit of interest. If bit 2 of IPATTERN is set then the result will be 10008 because IMASK = '1000, but if bit 2 is not set, then the result will beO. NOTE Engineering conventions prevail on the PDP-8 and bits are labeied left to right. To set a bit to 1/1" one may write: LET IPATTERN = lOUT OR IPATTERN The expression lOUT OR IPATTERN is evaluated on a bit-by-bit basis during program execution and the result is transferred to the assigned name. Assuming that lOUT is set to 40008 (bit 0 is set to 1), the result (JPATTERN) will be that bit 0 will be set and the remaining bits will not be affected. Boolean expressions for the LET statement may be formed using the following I NDAC Boolean operators: a. NOT b. AND c. OR 3-6 Some examples of Boolean expression using the above operators follow: a. lAB OR ICD b. lAB AND ICD c. lAB OR '1777 d. lAB AND ' 1777 e. NOT lAB f. NOT (lAB AND ICD) In AND operations, the resultant of the corresponding bits of the logical data being combined is a "1" only if both corresponding bits are "1". To illustrate, given that: a. ICHA = 010 100 111 000 b. ICHB = 101 000 101 000 the value of the dependent variable IRES in the expression: LET IRES = ICHA AND ICHB results in IRES = 000 000 101 000 The AND operation is used to isolate one or more bits of a logical word for testing or to eliminate a given bit in the pattern so that their individual states (states of the devices and/or variables they represent) may be evaluated. Isolating data using the AND operation is performed by ANDing the data word with a mask word designed to eliminate all unwanted data bits from the resultant. The mask word must contain a "0" corresponding to each unwanted data bit and a "1" for each desired bit. For example, to isolate the third bit of a word (that is, bit 2 in word format): Bit No: Bit Pattern Octal 0 1 2 3 4 5 6 7 8 9 10 11 Equivalent 1 1 1 1 1 1 1 1 1 1 1 1 7777 Mask Word 0 0 1 0 0 0 0 0 0 0 0 0 1000 Resultant 0 0 1 0 0 0 0 0 0 0 0 0 1000 Data Word AND Mask words are expressed in octal forms as constants or as integer variables. In 0 R operation, the corresponding bits of the words being combined result in a 1/1" if either or both of the combined bits are "1". To illustrate, given that: a. ICHA = 010 100 111 000 b. ICHB = 101 000 101 000 the expression LET I RES = ICHA OR ICHB results in IRES = 111 100 111 000 If either of the bits being ORed contains a "1", the result will contain a "1". 3-7 The NOT operator inverts or complements the value of any logical data or expression which it precedes. For example, if ICHA NOT = 010 100 ICHA = 101 111 000 011 000 111 The order in vvhich the logical operators are evaluated by IND.AC is: Precedence Operation NOT 2 AND 3 OR As with arithmetic expressions, INDAC always evaluates quantities within parentheses first, regardless of the operation involved. This feature permits the user to dictate the order of evaluation by grouping within parentheses. In the following expression, the result is changed by the use of parentheses to alter the sequence in which the expression is evaluated. For example, the basic expression: ISWl AND ISW2 OR NOT lAB may also be represented as (ISWl AND ISW2) OR (NOT lAB) The meaning of the expression is not altered by adding the parentheses as shown above because the basic order of evaluation is not changed by the parentheses. The result of ISWl AND ISW2 is still ORed with NOT lAB resulting in a "1" if a given bit is a "1" in both ISWl and ISW2 or is a "0" in lAB. Now consider the same expression with the parentheses placed as follows: ISW1 AND (ISW2 OR (NOT lAB)) In this expression NOT lAB is still resolved first. Since the expression formed by the OR operator is in parentheses, it takes precedence over the expression formed by the AND operator, thereby changing the result of the whole expression. Now, the result of ISW2 OR NOT lAB is ANDed with ISWl resulting in a "1" if a given bit is a 1/1" in ISWl and the result of ISW2 OR NOT lAB is a "1". The result of ISW2 OR NOT lAB is a "1" if ISW2 is a "1" or if lAB is a "0". As shown above, the result of the expression was changed by adding parentheses to alter the sequence in which the expression was to be evaluated. Therefore, care must be taken in writing Boolean expressions to ensure that they are interpreted as intended. 3.2.1.3 Statement Evaluation Rules - Since assignment statements may cause the transfer of integer, real, or logical values into either integer or real variables or arrays, the evaluation of this type of statement is performed according to the following rules (where LET v = e): Assigned Name (v) if And Expression (e) is INDAC does the following Integer Integer Transfers the result of e, unchanged, to v Integer Real Truncates any fractional part of e and transfers it as an integer to v integer Logical Transfers e, unchanged, to v (continued on next page) 3-8 And Expression (e) is Assigned Name (v) if INDAC does the following Real Integer Transforms value of e to a real data form and transfers it to v Real Real Transfers the result of e, unchanged, to v Real Logical Not permitted 3.2.2 GOTO Statement (Branching) The GOTO Statement provides the user with a convenient way to transfer control from one part of his program to another. The statement can be used to link procedures in the algorithm. Control can be transferred unconditionally using the following statement: GOTO 21 21 LET ITEMP = IREFERENCE + ISENSOR This statement, which references a statement label, can be used anywhere in the process algorithm to transfer control to another part of the algorithm. NOTE A label is an integer number from 1 to 999 that precedes an executable statement so that it can be referenced by a GOTO statement. Control can also be transferred conditionally using the following statement: GOTO (21,25,29), INDEX This statement is the computed GOTO statement that can be used to transfer control to one of many possible alternative procedures based on the value of an integer control parameter or index (INDEX). Statement labels identifying the starting point of alternative procedures are enclosed in parentheses. There is virtually no limit to the number of labels that can be referenced. If the index of the computed GOTO statement is 0, negative, or greater than the number of referenced labels a default to the statement following the GOTO will occur. The integer quantity INDEX referenced in the above example may be derived in a number of different ways depending on what the user wishes to do. One way to generate the index is shown below: LET INDEX = 0 2 LET INDEX = INDEX + 1 GOTO (21,25,29), INDEX GOTO 2 These statements set INDEX to 0 and then increment INDEX by one. When used as one control parameter of the computed GOTO statement, INDEX acts as a switch causing a transfer to the statement labeled 21 if INDEX is 1, or to the statement labeled 25 if INDEX is 2, or to the statement labeled 29 if INDEX is 3. If INDEX is either negative, 0 or greater than 3 the computed GOTO statement defaults to the next statement in the program. The following program and flow chart illustrate the operation and power of a computed GOTO statement. 3-9 GOTO 2 LET INDEX= INDEX +1 LET INDEX 2 21 =1 GOTO (21,21,22,22),INDEX default LET INDEX = INDEX + 1 GOT02 22 LET INDEX = INDEX + 1 LET INDEX= INDEX+1 GOT02 DEFAULT 08-0726 3.2.3 I F Statement (Conditional Testing) In any process algorithm, decisions have to be made based on collected or calculated process data so that the desired controls can be activated. The IF statement is a control statement that allows the user to compare process data (quantities or expressions). The statement uses the words IF and THEN GOTO to select another process procedure (program sequence) according to the outcome of the comparison. The statement employs a relational operator to make the comparison and a GOTO statement to branch to the alternative procedure. IF TEMP GR 90.0 THEN GOTO 4 This version of the IF statement uses an unconditional GOTO statement. The real variable TEMP may be the product of an arithmetic operation using the LET statement or may represent data collected from the process. G R is a relational operator meaning greater than. Six different relational operators are at the disposal of the user. These are defined in Table 3-2. Table 3-2 Relational Operators Meaning Operator Symbol GR > Greater than GE ~ Greater than or equal to I::Q - -t:qual to NE Not equal to LE Less than or equal to LS < Less than 3-10 Relational operators can only be used with the IF statement. The sample IF statement above compares real quantities. Real assignments require three computer words of storage and should be used only when the quantities or expressions can not be represented in one computer word (an integer quantity between -2048 and +2047 inclusive). The IF statement can be rewritten to compare integer quantities as follows: IF ITEMP GR 90 THEN GOTO 4 08-0723 Notice that the integer constant (90) does not use a period but the real constant (90.0) does. Both sample IF statements above use an unconditional GOTO statement. If the quantity represented by TEMP (lTEMP) is greater than 90.0 (90), then program control is automatically given to the statement labeled 4; otherwise, the next statement in the program is executed. NOTE A label is an integer number from 1 to 999 that precedes an executable statement so that it can be referenced by a GOTO statement. A computed GOTO can be used in the I F statement instead of one unconditional GOTO. This capability allows the user to resolve decisions where there are multiple alternatives in the algorithm. IF ITEMP GR 90THEN GOTO (4,5,6),INDEX NO DEFAULT PROCEDURE FOLLOWING IF STATEMENT 08-0724 3-11 If the value of ITEMP is greater than 90, then the value contained in INDEX is used as a control parameter to branch to labeled statements. (Refer to GOTO description.) If INDEX is neither 1, 2 nor 3, or if ITEMP was not greater than 90, then the statement following the I F statement is executed (called a default condition). The quantities and/or expressions being compared in an I F statement may be integer or real; but not mixeci; for example: a. ISW1 GR ISW2 (acceptable, both terms are integer) b. ABSA G R ABSB (acceptable, both teims aie ieal) c. ISW1 G R ABSA (not acceptable, terms are mixed types) The terms of a relational expression may be simple or complex. For example: a. (ISW1-5) GR (lSW2-5) b. (12E-05*ABSA) GE (128E05*ABSB) 3.2.4 FOR/NEXT Statements (Looping) Repetitive operations can be implemented by using the FOR/NEXT statements to form a loop. For example: LET IMASK = 1 FOR IPASS = 1 TO 12 STEP 1 IF IMASK AND IPATTERN NE 0 THEN GOTO 10 LET IMASK = IMASK * 2 NEXT IPASS 10 LET IALARM = IPASS I IPATTERN IS DIGITAL PROCESS DATA (12 BITS) WHERE EACH BIT REPRESENTS A DIFFERENT ALARM SENSOR , SEND ALARM MESSAGE NO 08-0725 Notice that the FOR statement precedes a sequence of instructions that are to be repeated. The FOR statement defines a control variable (IPASS) and specifies the number of times the instructions following are to be repeated. The number of times the loop is to be repeated is defined by an initial parameter, a terminal parameter, and an incremental parametei (1 TO 12 STEP 1). The N EXT statement is the last statement in the loop. This statement 3-12 signals the end of a pass through the instructions and initiates a test to determine if the number of passes specified have been executed. After the last pass through the loop, control is automatically released to the statement following the N EXT statement. The Fa R/N EXT flow chart illustrates the operation of the Fa R/N EXT loop example presented on the previous page. The example illustrates how a FOR/NEXT loop can be usr!d to test a particular computer word to see which bit is set. In this example, the variable IPATTERN which was collected from the process is to be tested. This variable is a 12-bit computer word, where each bit is associated with a different process alarm sensor. If during the test, a bit is found to be set, a unique alarm message can be issued using IALARM as an index. Notice that the integer parameter IMASK is set to "1" before entering the loop. IMASK is then multiplied by 2 before repeating the next pass through the loop, resulting in an IMASK variable that has a progressive value of the powers of two. The IF statement in the loop is used to test each bit. IMASK is used to isolate bits in IPATTERN using the AND operation; the relational operator NE is used to test if the specific bit is set ("1 If). Table 3-3 shows the powers of two progression with the octal equivalent associated with the alarm index. Table 3-3 Mask Generation IMASK Decimal IPASS/ALARM BIT 1 1 0001 2 2 0002 4 0004 4 8 0010 5 16 0020 6 32 0040 7 64 0100 178 0200 9 256 0400 10 512 1000 11 1024 2000 12 -2048 4000 3 I Octal 8 I I Once a bit is found to be set, the control variable (lPASS) of the FOR/NEXT loop can be used to inform an operator of the indicator in alarm or to take programmatic action in the process. NOTE PDP-8 engineering conventions prevail. The bits of a PDP-8 computei word aie iiumbeied fiOm left to right and not from right to left reflecting the programming convention of the binary weight of the bits. Therefore, when the algorithm is developed, the user must keep this characteristic in mind. In the preceding example, the FOR statement specified an incrementing parameter of 1 (STEP 1) for the loop control variable IPASS. This resulted in 12 passes through the Loop because after each pass IPASS was incremented by 1. 3-13 NOTE The incrementing parameter (STEP) may be omitted for increments of 1. However, if increments other than 1 are desired, STEP must be included to specify the increment. If we change the incrementing parameter to 3 (STEP 3) then the FOR/NEXT loop would only make 4 passes and would test alarm sensors 1,4, 7, and 10 because the control parameters will progress from 1 to 4 to 7 to 10 and then release control. I n addition, the preceding example used fixed parameters (integer quantities) in the FOR statement to define the number of times the loop was to be executed. Named integer variables can also be used to define the number of passes to be performed. For example: =1 LET IMASK = 1START TO FOR IPASS ISTOP STEP INCREMENT IF IMASK AND IPATTERN NE 0 THEN GOTO 10 LET IMASK = IMASK * 2 NEXT IPASS 10 LET IALARM = IPASS Using named integer variables to define the number of passes the loop is to execute provides the option to change the FOR statement under program control. This option may be helpful, as related to the example, to selectively test alarm messages based on process variable evaluations. If the following assignment statements preceded the FOR/NEXT loop, then the loop would make 6 passes, thereby permitting any of the 6 alarm sensors to be tested: LET 1START LET ISTOP =1 =6 LET I NCR EMENT = 1 The previous examples of the FOR/NEXT loop illustrated how 12 indicator alarms can be tested. Many industrial applications contain more than 12 such alarms. I n these applications, more computer words would be required for computer storage. The simple FOR/NEXT loop developed in previous examples only tested the bits of a singie word. However, this singie ioop can be incorporated (inserted) into a larger loop to test additional words. Inserting one loop into another loop is called nesting. In the following example, the parameter IWORD is used to select the word for the test and the parameter IPASS is used to test the individual bits of the word. The following example illustrates how 5 alarm indicator words can be tested: FOR IWORD = 1 TO 5 LET IMASK =1 FOR IPASS = 1 TO 12 IF IMASK AND IPATTERN (lWORD) NE OTHEN GOTO 10 LET IMASK = IMASK * 2 NEXT IPASS NEXT ;WORD 10 LET IOFFSET LET !ALARM = (!WORD -1) * 12 = !OFFSET + !PASS 3-14 In the earlier example, the alarm number was the same as the pass number. In this example, the alarm number, which could be from 1 to 60 (5 computer words) is calculated. An offset based on the IWORD parameter is established. This offset assumes a value that is based on the value of IWORD (1 through 5) when a set bit is found. 10FFSET can assume the following values: o when IWORD = 1 12 when IWORD = 2 24 when IWORD =3 36 when IWORD =4 48 when IWORD = 5 With this offset defined, the alarm number can be determined by simply adding 10FFSET and IPASS. Nesting is allowed as long as the range of one loop does not cross the range of another loop. The following diagrams illustrate acceptable nesting techniques. Acceptable Nesting Techniques Two-Level Nesting [ [ Three-Level Nesting FOR FOR FOR Ir:~: NEXT FOR NEXT NEXT Unacceptable Nesting Techniques I [NEXT I [~~~T ~ FOR FOR NEXT NEXT L NEXT NEXT An inner (nested) loop is cycled through its entire range for each cycle of the outer (primary) loop. If, for example, the primary loop has an iteration of 5 cycles and the inner loop an iteration of 10 cycles, the nested loop will have completed a total of 50 cycles when the outer loop reaches its limit of 5 cycles. 3.2.5 DO/RETURN Statements (subroutines) When particular process variables or parameters are evaluated several times, or a sequence of instructions must be executed several times in an algorithm, the user may code these op~rations as a subroutine that can be called by the algorithm when needed. Two types of subroutines are permitted in INDAC: a. Internal b. External internal subroutines are an integrai part of the aigorithm, whiie externai subroutines are stored on the disk separately. External subroutines are discussed later in this chapter. An internal subroutine is called into operation by the DO statement referencing a label. For example: DO 21 The statement labeled 21, which should be the first instruction in the internal subroutine, and all statements until a RETURN statement is encountered are then executed. Executing the R ETUR N statement terminates the subroutine and returns control to the statement directly following the call DO 21. The following example shows the techniques for installing a subroutine into the algorithm. 3-15 c21 D021 GOTO 50 (first subroutine statement) RETURN----------------~ Other uses of the DO/R ETURN statements are discussed later in this chapter. 3.3 MESSAGE AND LOGGING CAPABILITIES Messages, Reports, and Logs may be required to inform the operator of alarm conditions, process states, process variables, and parameters or any other information that may be significant in implementing and keeping the process running smoothly. To illustrate the reporting and logging capabilities of the INDAC language, the examples for testing alarm indicators developed in programming an industrial algorithm (Paragraph 3.2) will be expanded. NOTE Skeleton No.2 shows the basic structure of an INDAC program and shows where the algorithm and information pertaining to the Message, Report or Log is to be placed. A sample alarm test routine is included in the algorithm section. Skeleton No.2 - Sample Alarm Test Routine #1 .PHASE .ACTION DO SNAP #2 PRIOR ITY 1 #2 .SNAP I.STORAGE III( I·FORMAT I.HEADER .... IGET/SEND 1 .PROCESS LET IPATTERN = '0100 LET !MASK = 1 FOR IPASS = 1 TO 12 IF (lMASK AND IPATTERN) NE 0 THEN GOTO 21 GOT010 21 LET IALARM = IPASS 1-----------11 GET/SEND 1.......... ~~~~~~~~~~~~~ 1 1 10 I LET iMASK = iMASK*2 NEXT IPASS .END MESSAGE AND LOGGING 3-16 Messages, Reports, or logs can be sent to the Teletype, the paper-tape punch, or other ASCII type output devices using a simple SEND statement in the algorithm. The SEND statement must identify the device name, the message to be sent, and a data list if data is to be sent with the message. SEND (TTY,#1 01) This statement sends the message tagged #101 to the Teletype. Notice the device name and the tag are separated by a comma and are enclosed in parentheses. A message without accompanying data is identified by the .HEADER statement as follows: #101 .HEADER ALARM INDICATOR REPORT The .HEADER statement must always be tagged so that the message can be referenced in the SEND statement. The message declared in the .HEADER statement can occupy more than one line. To send the same message to another ASCII type output device, it is only necessary to change the device name in the SEND statement. For example, to send to the paper tape punch: SEND (PTP, #101) Operators consoles may not be attended so when a message is sent, it may be desirable to report the time of day the message was sent. For this reason and for scheduling purposes, the INDAC System contains a real-time clock (CLOCK) that maintains the time of day. The time of day is maintained as integer quantities in three computer words of storage; one for hours, one for minutes, and one for seconds. Before the time of day can be reported it must first be obtained. The time of day can be obtained using a simple GET statement in the algorithm. The GET statement must identify the device name (pseudo-device) and a data list of three integer variables. GET (CLOCK) IClK1, IClK2, IClK3 This statement gets the time of day from the real-time clock and stores it in the specified data list. Notice each integer variable specified in the list is separated by a comma. Now the time of day may be sent with the alarm message using a simple SEND statement as before. This time, however, a data list must be included in the statement to send the time of day with the message SEND (TTY,#102) IClK1, IClK2, IClK3 This statement sends the message tagged #102 and the data list to the Teletype. Notice the use of parentheses and commas as described earlier. A message with accompanying data is identified by a FORMAT statement. INDAC offers two types of .FORMAT statements: picture type and declarative type. A picture .FORMAT statement for the alarm message and accompanying data is written as follows: #102 .FORMAT "ALARM INDICATOR REPORT AT: "XX": "XX" : "XX The .FORMAT statement must always be tagged so that the message can be referenced in the SEND statement. Notice the use of quotation marks and Xs in the message. The quotation marks are used to bracket characters, thereby identifying the characters of the message to be printed. Each digit of the data to be printed is represented by an X. Military time representation is used in INDAC. 3-17 0- 23 for hours 0- 59 for minutes o- 59 for seconds If the time is 11 :30 a.m., the above .FORMAT statement causes the time to be printed as follows: AI AOr.IIII\II"'\If"'I\Tt"'IO OCDt"'IOT I\T. I'"\L.I'"\ I I IVI II"LlI\JI'"\IVI\ 111...1 V I \ I ~I. 11."0.00 II."'V,VV Notice digits for hours, minutes, and seconds are printed where the Xs were placed in the .FO RMAT statement. Since the colons (:) are declared as printable characters of the message, the colons are also printed. To send the same rnessage to another ASCI I type output device, it is only necessaiy to change the device name in the SEND statement. For example: SEND (PTP,#102) I'CLK-l, ICLK2, ICLK3 The message declared in the picture .FORMAT statement cannot exceed one line of a printing device. If the line length of the input device (device program is prepared on) is shorter than the output device (device to which the message is sent), then a continuation line can be used to prepare a message that will extend the full line length of the output device. A continuation line is indicated by typing an up-arrow (t). Another limitation of the picture type .FORMAT statement is that it can only be used to provide formats for integer or real decimal data having a maximum of 15 digits including sign. The declarative .FORMAT statement is more powerful than the picture type .FORMAT statement. The declarative .FORMAT statement permits the use of a virtually unlimited number of continuation lines (indicated by an up-arrow, t) and permits the user to specify the data to be output as fixed point, floating point, signed, unsigned, octal, binary, exponential, or ASCII representation. The statement also permits the user to specify special characters for CR/LF Editing and for control of the operator console modes. A declarative .FORMAT statement for the Alarm message and accompanying data is written as follows: #103 .FORMAT ("ALARM INDICATOR REPORT t AT: ",R3.0":" ,R3.0": ",R3.0) The ASCII string to be printed is bracketed by Quotation marks as in the picture FOR MAT statement. The output data format however, is represented differently. The commas indicate the start of a data format declaration. Also, notice that the entiie message and data declaration is enclosed in parentheses. In the above example, R3.0 means the data is to be output as 2 unsigned digits with no decimal point. R3.1 means that the data is to be output as 2 unsigned digits with the decimal point between the two digits. The SEND statement is the same whether the message is defined by a picture or a deciarative .FORMAT statement, that is: SEND (TTY,#103) ICLK1, !CLK2, ICLK3 The sample algorithm in the skeleton (starting with LET IPATTERN = '0100) is similar to those developed in programming an industrial algorithm, Paragraph 3.2. Notice that the sample algorithm in the skeleton is structured to continue testing after an alarm is found. When an alarm is found (a bit is found to be set) by the I F statement in the loop, the statement labeled 21 is then executed to assign the IPASS parameter to IALARM. The value of IALARM will then be the number of the sensor that caused the alarm. The following SEND statement can then be used to report the sensor number that caused the alarm. SEND (TTY,#104) IALARM 3-18 As explained earlier, the tag should reference a .FORMAT statement since data is to accompany the report. The statement may be of the picture or declarative type. For example: Picture Type #104 .FORMAT "SENSOR NO. " XX Declarative Type #104 .FORMAT ("SENSOR NO.", R3.0) NOTE If no FORMAT is declared in the SEND statement, the data list will be output as real data in exponential type notation of the following form (16 data items per line). ±O.XXXXXXE±XXXX Some of the statements developed in this paragraph have been placed in perspective for the reader in the following update to skeleton No.2 for instructive purposes. Notice that all message declarations .H EAD ER and .FORMAT statements are located between the key words .SNAP and .PROCESS, and all executable statements are located in the algorithm section between .PROCESS and .END. Skeleton No.2 - Header/Format Details ,,"~I~~-.,.-.-~S~E_ND--,.,(T,..,..-T_Y......"#-..,.1-..,.0_4)-..,.I_A_LA_R,....,..M~-,....,..--,.,-..,.-..,.--.,.--..,.-..,.~..,--,....,..--,....,..~_ _ _ _ _-Jt 10', , " L E T lMASK'~ I MASI< *2 ',,' , NEXT 1PASS', , .END 'MESSAGEAND LOGGING 3-19 In the previous examples illustrating the message and logging techniques of the INDAC language, the parameters IMASK and IPATTERN, and the storage location for the time of day (lCLK1, ICLK2 and ICLK3), were defined in the algorithm. Parameters (or constants) and storage locations can also be defined with the .STORAGE statement. The following .STORAG E statem~nt defines the integer parameters IPATTER N, IMASK and integer storage locations for the time of day . .STORAGE IPATTERN/l/, t I MASK (1,12) /'000 1, '0002, '0004, '00 10, '0020, '0040, t'0100,'0200,'0400,'1000,'2000,'4000/,ITIME (1,3) Continuation lines, indicated by an up-arrow (t), are permitted in the STORAGE statement. Notice the use of names, numbers in parentheses and numbers between slashes. The name identifies the parameter or storage location so that it can be referenced in the algorithm. The two numbers separated by a comma in parentheses define the number of storage locations (commonly referred to as a dimensioned array) to be defined for the named variable. When the number of words are not defined, as in IPATTERN, only one storage location is set aside. A storage location is one computer word for integer variables and three computer words for real variables. The number enclosed by slashes are the values to which the storage locations of the array are to be set. For real arrays the preset values must contain a period. If no preset values are specified (as in ITIME) the locations will be automatically set to O. Notice that the integer storage locations defined in the .STO RAG E statement can be preset with decimal or octal quantities. Having the parameters and storage locations defined in the .STORAG E statement, a simpler code can be developed for the algorithm as follows: GET (CLOCK) ITIME SEND (TTY, #102) ITIME FOR IPASS = 1 TO 12 IF IMASK (IPASS) AND IPATTERN NE 0 THEN GOTO 21 GOT010 21 LET IALARM = IPASS 10 NEXT IPASS .END The statement GET (CLOCK) ITIME obtains the time of day from the real-time clock as before but now stores the three words in the predefined array called ITIME. Therefore, to report the time of the alarm message the following SEND statement is used. SEND (TTY, #103) ITIME No change is required in the .FORMAT statement when storage locations are predefined. All three words of iTi ME are automaticaily transferred since the whole array is deciared in the data iist of the SEND statement. Notice that the statements that defined IPATTERN and IMASK and the statement that generated the powers of two progression in the earlier algorithm are no longer needed. Removing these statements makes the Algorithm faster to operate since the multiply operation is no longer used. Also notice that the I F statement has been changed sl ightly. The statement now reads: 3-20 IF IMASK (IPASS) AND IPATTERN NE 0 THEN GOTO 21 IMASK is now subscri'pted with IPASS to step through the IMASK array defined in the .STORAGE statement. Subscripted variables provide the user with additional computing capabilities for dealing with lists, tables, matrices, or any set of related variables defined in the .STO RAG E statement. I n I NDAC, variables are allowed one subscript. A named variable followed by a constant or a named integer variable in parentheses indicates the location of the variable in the list. This facility allows the user to reference any data item or storage location defined in the .STORAGE statement. In the previous example, IMASK is subscripted with IPASS and IPASS assumes the values 1 through 12 as the loop is executed. Therefore, for each pass through the loop, the corresponding IMASK parameter in the list defined in the .STORAGE statement is used in the I F statement. The .STORAGE statement and Alarm test algorithm developed in the previous paragraph have been placed in perspective for the reader in the following update to Skeleton No.2 for instructive purposes. Notice that the .STORAGE statement is located between the key words .SNAP and .PROCESS along with the .FORMAT and .HEADERstatements; the executable statements are located in the algorithm section between the key words .PROCESS and .END. Skeleton No.2 - Storage Details SEND (TTY,#102)ITIME 5 FOR IPASS = 1 TO 12 IF IMASK (lPASS) AND IPATTERN NE 0 THEN GOTO 21 GOT010 , 21 LET IALARM = IPASS SEND (TTY, #104)IALARM NEXT ;PASS The folloyving paragraphs serve as a summary and provide additional details of the .HEADER, .FORMAT, and .STO RAG E statements. 3-21 3.3.1 .HEADER Statement The specification of messages or headings to be printed for tabular and other types of reported information is accomplished by .HEADER statements. This type of statement, referenced by a SEND statement, consists of two or more lines with the initial line having the form: #t .HEADER where t presents a mandatory reference tag. The following lines contain alphabetic and alphanumeric information arranged exactly as they are to appear when printed. The .HEADER statement is terminated by any line whose first nonblank character is a period. The following example illustrates the use of .HEADER statements: .HEADER #2 COMPUTER COOLING ANALYSIS SAMPLE CLOCK NR TIME BANK BANK BANK TEMP A B C DEG 3.3.2 . FORMAT (Picture) Statement This .FORMAT statement is used to specify message and/or the format in which designated output data is to be printed. These statements are referenced by SEND statements for formatting purposes. The picture .FORMAT statement consists of two lines, with the initial line having the form: #t .FORMAT Where t is a mandatory reference tag. The second line of the .FORMAT statement contains a message, if any, and an actual representation of the data as it is to appear in its printed form. The representation will consist of: a. Declaration of space characters (blanks). Spaces are regarded as meaningful elements in a picture .FORMAT statement; they specify the actual spacing to be established between nonblank format elements. Tabs are retained as TAB characters and are effective only on Teletypes with TAB capability. b. Declaration of number formats. Both real and integer numbers are represented by: 1) A letter S for the sign (if used) 2) A letter X for each digit (15 digit maximum - INDAC maintains 6 digits of accuracy), and 3) A decimal point which cannot precede the sign (letter S). For example, the format for a 6-digit signed integer would be represented by: SXXXXXX A 6-digit real number with a 3-digit integer portion is represented by: SXXX.XXX C. Declaration of Text. Titles, comments, etc., may be specified for printout of a .FORMAT statement by enclosing each text line segment within quote (") marks. These quote marks are not printed; they identify and delimit text units. 3-22 The following are examples of text declarations: "FURNACE" "VALUE" liT 104" "NO." Thus the information contained in the second line of a declared. FO R MAT statement consists of number and text declarations separated by spaces. For example: #10 .FORMAT "TEMP"L-ISXXX.XXL-I"DEG REES CENTIG RADE" NOTE In the examples given, the symbol L......J represents unit spaces that would be entered into systems using the INDAC keyboard space bar. The .FORMAT statement may contain continuation lines that extend the number of characters to be printed on a single line. For example: #5 .FORMAT "SENSOR NO.1" t "TEMP" SXXX.XX "SENSOR NO.2 TEMP" SXXX.XX A format statement that specifies a group repeated in a serial manner throughout the line (for example, SXXXX SXXXX SXXXX .... ) may be written using a shorthand technique. This technique consists of placing the format group to be repeated (including interposing space units) within parentheses and preceding the enclosed group with an integer that specifies the number of times the group is to be repeated. For example, the line: SXXX.XX SXXX.XX SXXX.XX may be expressed: 3 (SXXX.XX The shorthand technique may be used to reduce statements which specify mixed repetitive and nonrepetitive format groups. For example, the statement: "TEMP" SXX SXX SXX "PRESSURE" XX.XX XX.XX XX.XX may be written: ''TEMP'' 3(SXX ) "PRESSURE" 3(XX.XX ) 3.3.3 .FORMAT (Declarative) Statement A declarative form of .FORMAT statement is availab!e with expanded capability. The statement has the form: #t Where #t is a mandatory tag, the left parenthesis is the first non-blank character following the ".FORMAT" and S is a FORMAT element containing either an ASCII string, a data field specification, or a special FORMAT character. Blanks may be used for readability but will be ignored by the Compiler (except in text strings). The declarative format string may contain continuation lines, and repeat groups as in the picture type format. Repetition of format groups is restricted as in picture type format to a single level of nesting. Declarative format statements are terminated by the first right parenthesis not terminating a repeat group. A synopsis of the declarative format is in the following table. 3-23 Table 3-4 Declarative. FO R MAT Specifications Control Function Sample Sample Output Output Specifications Fw.d Output a real or integer variable as a signed field, characters wide, including sign and period, with d decimal places. 1::'"7 ., I.") +99.999 Rw.d Same as "Fw.d" except that field is unsigned. R7.3 999.000 "v"oJ I E Output ieal data in exponential notation. output. E +0. 123456E-0003 o Output integer data as octal number o 7654 nX Output n blanks, if n not specified one (1) assumed 2X nW Transmit n words, each as a twelve bit word - no conversions 2W Special Format Characters As in picture format used to delimit an ASCII string to be generated. Delimits FORMAT elements. / Generate a CR/LF in format. # Generate a CR in format. Does not generate LF. $ Suppress CR/LF at termination of format. Must be followed by terminating parenthesis of statement. ? Suppress CR/LF at termination of format but ieaves console in "0 perator" mode. Must be followed by terminating parenthesis of statement. NOTE Integer data is limited to four digits (-2048 to +2047). Real data is accurate to six digits; data output greater than those limits should be viewed with these restrictions in mind. Data output greater than 15 digits will generate a compiler error. 3.3.4 .STOR.L\.GE Statement In many applications, INDAC is required to accumulate and store large amounts of identifiable numeric data. Acquired and computed data as well as constants and other items entered by the user must be stored in lists or tables (arrays) that are defined by the user. In addition to defining arrays, the most important function of .STORAGE is to supply common areas for data communication. To define required arrays, the user must write a .STORAG E statement and follow it with a listing of symbolic names unique to each required array. Once defined, an array name may be referenced by a statement (GET, SEND, IF, LET) each time the data is to be entered into or read from that array. 3.3.4.1 Development of Array Names - Observe the following rules in developing an array symbolic name: a. It must be unique within the program. b. It may consist of an uniimited number of alphabetic or alphanumeric characters. (continued on next page) 3-24 c. The first character must be alphabetic and must identify the type of data or constant (real or integer) which the array is to store. The first character must be: 1. I for an integer array. (For example, lAMP, IH10, 1256, etc.) 2. Any letter but I for a real array. (For example, AMPS, B526, ZZZZ, etc.) 3.3.4.2 Specification of Array Size - The use of a symbolic name in a .STORAGE statement reserves only one storage element (one word for integers, three words for real numbers). When multielement storage is required, the user must specify the size of the array by adding an enclosed range of elements having the form (1, N) to the array's symbolic name. The subscript is interpreted as: 1 = The first element in the array N = An integer representing the last element in the array (N > 1) For example, an integer array for the storage of 50 sampled voltage levels could be specified as: ISVOLTAGE (1,50) 3.3.4.3 Specification of Array Elements_- Individual elements of an array can be specified by using the symbolic array name followed by an enclosed integer that represents the number of the element within the array. For example, given the designation of a 50-element array: IABC (1,50) The 30th word element is specified by the expression: IABC (30) The following examples illustrate the manner in which the .STORAGE statement is written: Statement Meaning .STORAGE ISUM Single-element array -'SUM .STORAGE ISUM (1,20) 20-element array I SU M .STORAGE ISUM (1,20),120,C,D 20-element integer array ISUM, single-element integer array 120, and single-element real arrays C and D 3.3.4.4 Specification of an Array Window - INDAC provides a unique technique that permits the user to specify a subset of an array or a superset spanning a number of arrays. Dimensioned arrays consist of a sequential group (list) of word locations within the processor memory; to specify a particular subset of locations within an array, the programmer: a. Lists the name of the array, (for example, lAMP) b. Indicates the first element of the subset (for example, lAMP (5) or lAMP (IJ)) c. Specifies the number of elements in the subset. For example, the statement: lAMP (5) * 4 establishes a window 4 elements long (4 word locations for integer variable elements and 12 word locations for real variable elements) beginning with the fifth element of array lAMP (that is, elements 5,6, 7, and 8) of array lAMP. Note that the number of elements must be an integer constant. 3-25 3.3.4.5 Array Spanning Windows - When arrays are defined in the same .STORAGE statement, they are established in core as a continuous series of word locations in the order listed. For example: .STORAGE lAMP (1,6), ISTAT (1,10), ILOG (1,5) establishes the list: !AMP (1) lAMP (6) 6 ISTAT (1) 7 ISTAT (10) 16 ILOG (1) 17 I LOG (5) 21 In situations such as described in the preceding example, the user may specify a window that can include portions of two or more sequentially defined arrays by using the same technique described in Paragraph 3.3.4.4. For example, the following statement: lAMP (5) * 14 specifies a window that spans portions of arrays lAMP, ISTAT, and ILOG of the preceding example. The following array elements are included in the window: lAMP (5) 1 2 3 lAMP (6) ISTAT (1) 12 ISTAT (10) ILOG (1) 13 ILOG (2) 14 The array window permits the user to specify a consecutive series of small arrays that simplifies gaining access to data; moreover, it considerably reduces the code developed by the Compiler by having only one window bringing in or sending out data to and from all the defined arrays. 3.3.4.6 Presetting Stored Values - In INDAC, the user can preset the value of stored data whenever the array to contain the data is defined. This feature of the .STORAG E statement is useful for establishing constants or initial data values. The required statement formats and procedures for presetting value in .STORAG E statements are as follows: a. To preset a single defined item the format is: .STORAGE NAME/value/ NOTE a. The value must be preceded by a slash (/). b. A value preset is terminated by a slash (/). c. To specify an octal value, precede the number by an apostrophe ('), e.g. d. Commas are used to delimit each item specified. 3-26 a. (cont) Examples: .STORAGE ISUM/50/ .STORAGE ISUM/,0050i b. To write a statement which presets a series of values into an array, the required format is: .STORAGE NAME (ARRAY SIZE)/n1 ,n 2 , .•. ,n/ For example: .STORAGE ISUM (1,4)/50,60,70,80/ NOTE a. The number of values specified in the preset list may not exceed the defined size of an array. b. Any elements of an array which are not preset are set to O. c. If the same value is to be preset into more than one array element, the statement has the following format: .STORAGE NAME (array size)/No. of Elements (Value)/ Example: .STORAGE ISUM (1,20)/5 (50)/ This statement establishes the 20-element array ISUM and presets the first five elements to the decimal value 50; the remaining 15 elements are set to O. 3.4 DATA COLLECTION AND CONTROL In automating any industrial process, process variables must be collected and control must be effected. Since there are usually many sensors and controls involved in a process, multiplexing devices are used to interface the computer with the process. It is through individual channels of these devices that process data is collected and control is effected. DEC provides a full line of such multiplex devices to service the sensors and control equipment of industrial plants. DEC multiplex devices (lDACS) include: Digital-to-Analog Converters Analog-to-Digital Converters Digital Output Digital Input Integrating Digital Voltmeter The following names have been assigned to the INDAC System multiplex devices: ADC (Analog-to-D igital Converter) DAC (0 igital-to-Analog Converter) UDC (Digital I/O) AF04 (lDVM) To illustrate the data collection and control capability of the INDAC language, a simple example of a process control application is detailed in the following paragraphs. 3-27 NOTE Refer to Skeleton No.3 to place the program statements of the example into perspective. The example demonstrates maintaining the bath temperature of a solution, including the following operations: a. Open hot and cold water valves b. Open drain and turn BATH OK lamp off. c. Measure water temperature. If water temperature is 68 ±0.5 degress, turn BATH OK lamp on. If water temperature is not 68 ±0.5 degrees turn BATH OK lamp off and adjust hot water valve. d. Repeat c. Skeleton No.3 I . ~~~----------------------~ #1 .PHASE 'EQUIP~ENT device channel control .ACTION DO SNAP #2 PR lOR ITY 1 #2 .SNAP .PROCESS . . . .I-----------il . GET/SEND .END DATA COLLECTION AND CONTROL An illustration of the process and sensor device and channel assignments is shown in Figure 3-1. Since the process interface devices are multiplexed (that is, more than one channel can be accessed in each device) the channels of interest must be specified in the program to send data to and to get data from the process elements. The .EQUIPMENT statement permits the user to declare the channels of interest. The .EQUIPMENT statement must be the first non-comment line in the program. A series of continuation lines (indicated by an up-arrow, t) are used to declare the channels of interest for each multiplex device. Control options and any associated signaland subroutine declaration are discussed later in this chapter. The following statement declares two DAC channeis, iHOT and iCOLD: .EQUIPMENT t t t *DAC CHAN (1) IHOT CHAN (2) ICOLD Notice that devices are identified by a preceding asterisk and channel declarations follow the name of the associated device. Also notice that both channel declarations contain the key word CHAN, a number in parentheses, and a name. The name declares both channels as integer variables. The I HOT variable is assigned channel one and the ICOLD variable is assigned channel two. Notice that when a DAC channel of interest is declared it is just like declaring the process control element itself. Once the above .EQUIPMENT declaration is made, the HOT and CO LD valves can be positioned by writing: 3-28 = '2000 ICOLD = '2000 LET I HOT LET SEND (DAC) IHOT, ICOLD Note that the .EQUIPMENT statement does not declare the data to be sent to the device; but, only the channel associated with the variable name. The name can then be used for assignment of data using a LET statement. The octal number 2000 has been chosen to represent a value setting for a half-open valve. IHOT HOT WATER lORAIN COLD WATER BATH ~ _~_ IBATHOK TEMP CHANNEL MUX DEVICE PROCESS ELEMENT HOT valve DAC COLD valve DAC 2 Temperature sensor ADC 37 Drain valve UDC 15* BATH OK indicator UDC 16* *NOTE Drain valve and BATH OK indicator are connected to the screw terminals for UDC channels 15 and 16 as follows: CHANNEL 15 o 8 0 0 L - -_ _--J} "-z_ _ _ 9 10 11 ~~~-:-+-...!...1-0-0-0-0-0-0---'1 ~ DRAIN VALVE CHANNEL 16 o o 9 8 0 o 10 11 0 BATH OK LAMP 08-0727 Figure 3-1 Sample Process Control Application The next step in the sample program is to open the drain and turn off the BATH OK lamp. As defined earlier, the drain valve and the BATH OK lamp are connected to the UDC. There are two methods of declaring UDC channels: Explicit and Point methods. Only the explicit method is discussed at this time. The following .EQUIPMENT statement declares the channels for the drain valve and the BATH OK lamp. 3-29 .EQUIPMENT t t t * UDCE CHAN (15) IDRAIN CHAN (16) IBATHOK The device name UDC is modified with an E to denote explicit channel declaration. Both channels are declared as integer variables. IDRAIN is assigned channel 15 and IBATHOK is assigned channel 16. NOTE Octal constants are generally used to set or reset bits of interest in a particular channel. The bits of interest and the associated constants for setting these bits in this example are as follows: Process Element CHAN Bit Constant Drain Valve 15 8 '0010 BATH OK lamp 16 11 '0001 When bit 8 of channel 15 is set the drain valve is open; when bit 11 of channel 16 is set the BATH OK lamp lights. The following program statements cause the drain to open and the lamp to go out. = '0010 IBATHOK = 0 LET IDRAIN LET SEND (UDCE) lORAIN, IBATHOK The LET statements assign octal 10 (bit 8 is set) to IDRAIN and 0 (bit 11 and all other bits are reset) to IBATHOK. The SEND statement sends these two bit patterns to the UDC channels declared in the .EQUIPMENT statement. The next step in controlling the sample process is to measure the bath temperature, adjust the HOT water to obtain a bath temperature of 68 ±0.5 degrees, and turn on the BATH OK lamp. As defined earlier, the temperature sensor is connected to channel 37 of the ADC. In addition to declaring the channel to which the sensor is connected, ADC's with variable gain capability also require a control option declaration (see Paragraph 3.4.2). The following .EQUIPMENT statement declares the temperature sensor and a control option .EQUIPMENT t t CHAN (37) TEMP t#901 X200 DO TCONV *ADC The temperature sensor is declared on channel 37 as a real variable named TEMP. By declaring a real variable for the temperature channel, temperature may be maintained in 0.5 degree increments. An integer variable would restrict the temperatures to full degree increments. The control option declared is X200 with a tag of #901. Control options must always be tagged so that the option can be referenced in the GET statement. A control option declaration is required when the ADC of the system has scaling capabilities. Some DEC ADCs do not have scaling capabilities (fixed gain) and therefore do not require a control option declaration. To get and test the temperature and to control the water temperature and indicator lamp, the following statements are used. 3-30 11 GET (ADC, #901) TEMP IF TEMP GR 68.5 THEN GOTO 12 IF TEMP LS 67.5 THEN GOTO 13 LET IBATHOK = '0001 GOTO 10 12 LET iHOT = IHOT - 1 GOT09 13 9 LET I HOT = IHOT +1 LET IBATHOK = '0000 SEND (DAC) IHOT 10 SEND (UDCE) IBATH OK GOTO 11 Notice the structure of the GET statement for the temperature (TEMP); the device name and the control option tag are separated by a comma and enclosed in parentheses. Since TEMP was declared to be associated with channel 37 in the. EQU IPMENT statement, the GET statement transfers the quantity in channel 37 to the storage location TEMP while the ADC is operating with a gain of 200 (X200). The two IF statements test the quantity that was stored in TEMP by the GET statement. If the sensor supplies a value that must be converted or linearized before a meaningful measurement can be made, the required conversion routine can be declared with the control option (see Paragraph 3.4.2). In the example, a conversion routine is declared (DO TCONV). The routine is performed during the GET statement and must be coded to perform the following: convert the 12-bit ADC value to a real variable, linearize the value and store it in the location named TEMP. If the temperature is not within 0.5 of 68 degrees, the statement labeled 12 or the statement labeled 13, depending on the temperature, will be executed. These statements increase or decrease the variable named I HOT. I n either case, the statement labeled 9 is executed next to set IBATHOK to 0, thereby turning the light out. The two SEND statements that follow transmit the new position value to the HOT water valve and turn off the power to the iBATHOK lamp. Program control is then transferred to the statement labeled 11 to repeat the sequence. When the bath temperature reaches 68 ±0.5 degrees, then the statement following the I F statements is executed to set bit 11 of IBATHOK to 1. The statement labeled lOis then executed to turn on the BATH OK lamp and the sequence is repeated. All the statements related to data collection and control that were developed in the previous paragraphs have been placed in perspective in the following update to Skeleton No.3. Slight changes have been made to the program to illustrate how algorithm code can be minimized. Notice that the channel and option declarations for each device appear on continuation lines following the .EQUIPMENT statement. All executable statements are located in the algorithm section between the key words .PROCESS and. END. in the previous example, 2 UDC channels (words) were used; one for the drain valve and another for the BATH OK lamp. Since each UDC channel contains 12 bits, the valve and lamp can both be connected to one channel, in addition to other controls and indicators. NOTE A given UDC channel is limited to input or output applications, not both. 3-31 Skeleton No.3 - Equipment Details .EQUIPMENT t t CHAN (1) IHOT '" CHAN (2) !COLD *DAC I *UDCE CHAN (15) lORAIN CHAN (16) IBATHOK *ADC CHAN (37) TEMP LET ICOLD = '2000 LET IDRAIN 9 = '0010 LET IBATHOK = 0 SEND (DAC) IHOT, ICOLD 10 SEND (UDCE) IDRAIN, IBATHOK GET (ADC,#901) TEMP IF TEMP GR 68.5 THEN GOTO 12 IF TEMP LS 67.5 THEN GOTO 13 LET IBATHOK = '0001 GOTO 10 12 LET IHOT = IHOT - 1 When more than one control, indicator, or other field element is connected to one UDC channel, then Boolean operations must be used to isolate the bit of interest to test, set, or reset the bit. The following example illustrates how Boolean operations can be used to operate on specific bits of a UDC word. Assume that the drain valve and the BATH OK lamp are connected to one UDC channel as follows: CHANNEL 15 o 2 o I 0 10 C) ~ 0 8 9 0 }-J 10 11 0000 ~~LAMP TO DRAIN TO BATH OK VALVE 08-&728 3-32 With the valve and lamp connected to one channel as shown above the .EQUIPMENT statement should be changed to reflect that only one UDC channel is used. The following .EQU IPMENT statement defines UDC channel 15. .EQUIPMENT t *UDCE t CHAN (15) lOUT Notice that a different integer variable name is used in declaring the channel. The algorithm for the sample process can now be rewritten as follows: LET I HOT = '2000 LET I CO LD = '2000 LET lOUT = '4000 LET lOUT = lOUT AND NOT '4 SEND (DAC) IHOT, ICOLD SEND (UDCE) lOUT 10 GET (ADC, #901) TEMP IF TEMP GR 68.5 THEN GOTO 12 IF TEMP LS 67.5 THEN GOTO 13 LET lOUT = lOUT OR '4 GOT010 12 LET IHOT = IHOT-1 GOT09 LET IHOT = IHOT +1 13 GOT09 Notice that octal constant 4000 is assigned to lOUT. The LET statement labeled 9, using Boolean operations, sets up the bit pattern required for opening the drain and turning off the lamp. The LET statement following the I F statements, using another Boolean operation, sets up the bit pattern required to turn on the lamp. Otherwise, the algorithm is the same as the one presented earlier. The reader was introduced to the following three process 1/0 devices in the preceding example: DAC ADC UDC All three devices require channel declarations in that they are all multiplex devices. Only the ADCs require control option specifications. The following paragraphs provide additional details for each of the above devices and introduce the following two devices: AF04 FILE 3-33 3.4.1 DAC (Digital-to-Analog' Conversion Devices) 3.4.1.1 Hardware Device - DEC offers two digital-to-analog conversion devices: the AAOl and the AA50. Both devices are assigned the name DAC. G ENDAC declares this name to the INDAC software system when the I/O handler of either device is selected from the GENDAC library. Therefore, only one of these devices can be declared in the I NDAC System. 3.4.1.2 Equipment Declaration Statement - The DAC and associated information is declared in the INDAC program as follows: t t *DAC CHAN (m,n) v Where m, n are, respectively, the first and last channels associated with the integer array. If v is a single integer variable, then only a single channer is dectarec:t There may be as many repetitions of the channel multiplexer line as there are channels to declare. The DAC has no control options to be declared. 3.4.1.3 Language Statement - The INDAC language statement is: SEND (DAC) (data list> Where (data list> is the list of the items to be output. Note that every variable specified in the list must also appear in the equipment definition to establish the correlation between the variable and the associated channel address. 3.4.2 ADC (Analog-to-Digital Conversion Devices) 3.4.2.1 Hardware Device - DEC offers five analog-to-digital converter devices: the AF01, AF02, AF03, AFC8 and AD01. All of these devices are assigned the name ADC. GENDAC declares this name to the INDAC software system when the I/O handler of anyone of the above devices is selected from the G ENDAC library. Therefore, only one of these devices can be declared in the I NDAC System. 3.4.2.2 Equipment Declaration Statement - The ADC and associated information is declared in the INDAC program as follows: l ',lADe t t#t t#t t#t CHAN (m,n)v DO s Xn DO s DO AREF Where m, n are, respectively, the first and last channels associated with the integer or real array v. If v is a single variable, then only a single channel is declared. There may be as many repetitions of the channel multiplexer line as there are channels to declare. For the AF03, AFC8 and ADOl the control line contains a tag reference a gain factor (Xn) where n may be: 3-34 #t and Xn AFOl AF02 AFC8 AD01A x x x t 1 2 4 X I 5 8 AF03 (Fixed Gain) X x X 10 X X 20 X X X X X X X X 50 X 100 200 1000 I ." The control line may also contain a subroutine call DO s, where s is a linearizing or signal conditioning subroutine. There may be as many control lines of this type as there are variable gains or signal conditioning subroutines to declare. In addition to the optional control lines, one line must contain the statement DO AREF. This subroutine establishes the location of the reference junction or offset variable required by some of the conversion routines. The AF01 and AF02 are fixed gain devices and do not require a gain specification on the control line, but may require specification of the same subroutines described above. Language Statement - The I NDAC language statements are: GET (AOC) (data list> GET (AOC, #t) Where #t is a tag reference to the control line and (data list> is the list of the items (v) to be converted. Note that every variable specified in the list must also appear in the equipment definition to establish the correlation between the variable and the associated channel. If the signal conditioning subroutines created by the user are called in a control1ine (DO s) and used in a GET statement, then the first GET statement for the AOC executed in the job must define the variable used as the reference junction or offset variable by referencing the liAR EF" subroutine call on the control line in the GET statement. Then the GET statement for the data channel of interest can be executed with the reference to the conversion routine call. For example: .EQUIPMENT t *AOC t CHAN{mlREF t CHAN (1,6; iLEV X200 DO AREF X100 DO CONV t#10 t#11 GET (AOC, #10) IREF GET (AOC, #11) I LEV 3-35 NOTE The I/O handler for the ADC returns a 12-bit integer count for the conversion. Normally the variable in the data list is an integer variable. If a real variable input is required, it is the responsibility of the subroutine called through the control line to convert the integer variable to a real variable. If a channel declaration is made using a real variable name, then that channel may only be called by referencing a control line with a subroutine declaration. 3.4.3 AF04 (Integrating Digital Voltmeter) 3.4.3.1 Hardware Device - DEC offers one Integrating Digital Volt Meter (IDVM) designated and named AF04. GENDAC declares this name to the INDAC software system when the I/O handler of the IDVM is selected from the GENDAC library. 3.4.3.2 Equipment Declaration Statement - The AF04 and associated information is declared in the I NDAC program as follows: t t t#t t#t *AF04 CHAN (m,n) v a1 I a2 , a3 DO s DO AREF When m, n are, respectively, the first and last channels associated with the array v, the array must be a real array. If v is a single variable, then only a single channel is declared. There may be as many repetitions of the channel multiplexer line as there are channels to declare. The control line contains the item specifying the selectable function, range, and resolution required of the AF04. One each from the following three lists may be selected (a" a2 , a3 ) a1 a2 a3 FUNCTION RANGE RESOLUTION DC 10MV .1 FREQ 100MV .01 PERIOD 1000MV .001 OHMS 10V P·.C 100V AUTO Note that the selectable voltage ranges provide for increased conversion accuracy. The array or variable v is always supplied in volts (with the proper exponent) regardless of the selected range. The control line may also contain a subroutine call DO s, where s is a linearizing or signal conditioning subroutine. There may be as many control lines of this type as there are variable gains or signal conditioning subroutines to declare. In addition to the optional control lines, there must exist one line containing the statement DO AREF. This subroutine estabiishes the ioeation of the reference junction or offset variabie required by some of the conversion routines. 3-36 3.4.3.3 Language Statement - The INDAC language statement is: GET (AF04, #t) (data list> where #t is a tag reference to the control line and (data list..) is the !ist (rea! variables) of the items to be converted. Note that every variable specified in the list must also appear in the equipment definition to establish the correlation between the variable and the associated channel. If the signal conditioning subroutines created by the user are called in a control line (DO s) and used in a GET statement, then the first GET statement for the AF04 executed in the job must define the variable used as the reference junction or offset variable by referencing the "AREF" subroutine control line in the GET statement. For example: .EQUIPMENT t t t t t *AF04 CHAN (0) REF CHAN (1,6) LEV #10 DC, 100 MV, .01 DO AREF #11 DC, 1000M, .01 DO CONY GET (AF04, #10) REF GET (AF04, #11) LEV NOTE The I/O handler for the AF04 returns a real variable for the conversion. Normally the data list contains only real variables. If an integer output is required, it is the responsibility of the subroutine called through the control line to convert the real variable into an integer variable name, then that channel may only be called by referencing a control line with a subroutine declaration. 3.4.4 UDC (Universal Digital Controller) 3.4.4.1 Hardware Device - DEC offers one highly flexible digital I/O device designated UDC8. Two I/O handlers have been developed for this device: an explicit handler called UDCE and a point table handler called UDCP. GENDAC declares these names to the INDAC software system if the handlers are chosen from the GENDAC library. Either or both handlers may be selected. The following descriptions of the equipment declaration and language statements deal with the UDCE handler only. The UDCP handler is discussed later in this chapter. 3.4.4.2 Equipment Definition Statement - The UDCE and associated information is declared in the INDAC program as follows: t t *UDCE CHAN (m,n) v 3-37 where m, n are, respectively, the first and last channels associated with the variable v. If v is a single variable, then only a single channel is declared. There may be as many such multiplexer lines as are required to define the input and output channels. 3.4.4.3 Language Statement - The INDAC language statements are detailed below: a. Each set of 12 input lines, connected to a digital input channel, is available to the system on demand through the statement GET (UDCE) (data list> where (data list> is the list of items to be input. Note that every variable specified in the iist must also appear in the equipment declaration to establish the correlation between the variable and the associated channel. b. Each set of 12 output lines, connected to an output channel, may be exercised by the system on demand, through the statement SEND (UDCE) (data list> where (data list> is the list of the items to be output. Note that every variable specified in the list must also appear in the equipment definition to establish the correlation between the variable and the associated channel. 3.4.5 FILE (Pseudo-Device) 3.4.5.1 Hardware Device - The FILE is maintained on the system storage device, Mass Storage Disk D F32. 3.4.5.2 Equipment Definition Statement - The FILE and associated information is declared in the IN DAC program as follows: t t#t *FILE k where #t is the tag reference of the control line and k may be one of thefollowing three identifiers: 1, 2, or 3. 3.4.5.3 Language Statement - The INDAC language statements are: GET (FILE, #t) la, (data list> SEND (FILE, #t) la, where #t i:) a tag reference to the contm~ nne specifying the FILE identification, ;a is an integer variable sPecify- ing the record (page) within the FILE, and (data list) is the list of the items contained within the record. NOTE The total word count of the data-list items may not exceed one page (128 decimal words). The total number of records available is dependent upon the size of the user job and the number of disks in the user's system. The total file is organized as one sequential set of records from the base of FILE 1, for as many; records as are used by the program. FILE 2 and 3 are simply convenient locations within the sequential set of records for reference purposes. There is no protection within the FI LE, since the overlap feature has a useful function. The starting location of each of the FILEs may be altered via the Executive Command Decoder at run-time. 3-38 3.4.6 Equipment Statement Summary The .EQUIPMENT statement must be the first non-comment line of any program that uses multiplex devices or devices that require specification of control options. This statement uses a series of continuation lines to specify each device, its channel declarations, control option, and any associated-conditioning subroutines. The .EQUIPMENT statement has the following general form: .EQUIPMENT t t t (device code line) (multiplexer line) (control line) Each specified device (code line) must be followed immediately by applicable multiplexer lines, then applicable control lines. The .EQUIPMENT statement is used to declare symbolic names of devices, device control options, and subroutines. Standard device declarations (TTY, KEYS, STATUS, PRIORITY and FILE) are a permanent part of the compiler tables. These tables can be modified by GENDAC (Generate INDAC) to add I/O handlers for additional devices. The description and format of the line types which make up the .EQU IPMENT statement are as follows: a. Device Code Line This continuation line contains a device symbolic name and has the form: t*u where u is the assigned symbolic name for the device to be specified. The asterisk (*) indicates that all information presented until the detection of the next asterisk or (.) statement refers to the specified device. The symbolic name used must correspond exactly to that supplied to the system during initialization (refer to Appendix I). b. Multiplexer Line When the specified device has multiplexed input or output lines, the code line must be followed by a multiplexer line which has the form: tCHAN mux v where 1. CHAN identifies the type of information presented. 2. mux represents the multiplexed channel or channels of the device to be associated with v. 3. v represents a name of a variable array to which the specified channel or channels are assigned and defines the data buffers for the I/O operations. When more than one device channel is to be specified, the following form is used: tCHAN (m, n) v where m is the first channel and n is the last channel in the desired range. For example, the list (0, 19) specifies a range of 20 channels identified as 0 through 19. The array named is automatically dimensioned to the number of elements specified by m and n. The array name is the data buffer where the digitized values of input signals connected to multiplexer channels will be stored. When the specified input or output channel or channels of a multiplexed device are to be assigned to more than one variable or array, one multiplexer line is required for each different assignment. (continued on next page) 3-39 c. Control Line One or more control lines may be used to list the symbolic names assigned to the device-control options available for the specified device. If a signal-conditioning subroutine is required for the device input or output operations, it is specified in the control line. t #t SCN1 , SCN 2 , ••. , SCN n t #t SCN1 , SCN 2 , ..• , SCN n or DO s where 1. t is a mandatory reference tag. 2. SCN represents symbolic control names assigned to control options available for the specified device. 3. s represents the assigned symbolic name of a conversion subroutine. Control statements for each device must be listed immediately after the last multiplexer line for that device. Control lines must be tagged since they are referenced by input/output statements (G ET, SEND) to specify the manner in which the manipulated data is to be handled. Control lines are used only to specify a particular control option or set of options required to carry out the GET or SEND statement. A separate, individually tagged control line is required for each specified set of options used. 3.5 STRUCTURE OF AN INDAC JOB Usually in an on-line, real-time acquisition and control application, there are many tasks that must time·share core memory for economy of core storage. To attain such a goal in INDAC 8/2, all programs (or program segments) are disk resident; they are brought into core by the operating system in response to process interrupts, elapsed timers, or task requests, see Figure 3-2. To allow this kind of time-sharing, an INDAC program is not made of a string of statements such as a BASIC or FORTRAN program which is executed as a single program unit. Rather, it is a collection of different tasks or program units separated by appropriate segmentation statements. Process interrupt handling is covered later in this chapter, 3.5.1 Program Segmentation a. Job Specification - This segment of the program includes the .EQUIPMENT, .INTERRUPT, .STORAGE, .HEADER, ~nd .FORMAT statements. These statements define the Global parameters of the job, This information is transferred to core during the initial call for the job and remains in core throughout the life of the job. This area is never swapped. b. The PHASE - This segment contains the timer parameters for calling SNAPS or other PHASEs. The PHASE segment exists in core only when the PHASE is operational. If a PHASE is released and then recalled, that PHASE will be completely initialized on recall. c. The SNAP - This segment (task) contains the actual algorithms used to perform the job. SNAPs may also call other SNAPs or PHASEs as required to service the job. d. The SUBROUT!NE - This unit contains code for common operations to avoid duplication of effort. When included in a job, the SUBROUTINE becomes an integral part of the job. The iNDAC Executive and the INDAC language permit a variety of sequencing and scheduling functions. Some of the functions are programmed to occur at a specific interval of time or at the next available opportunity. Other functions are dependent upon the operation of a peripheral device. Due to the random operation of such devices, the Executive is prepared to resoive conflicts between the different requests to operate parts of the system. 3-40 Job Device channel and Control Declaration, System Parameters (Globals)/messages, Logging format, storage PHASE Activity Schedule Action Local Parameters Algorithm PHASE Activity Schedule Action Local Parameters Algorithm Local Parameters SUBROUTINE Code Return .END Figure 3-2 Structure of an INDAC Job 3.5.1.1 Job Specification Segment - This is the first segment in a program. It presents any parameters required for systems-level program activities (Giobai). A detailed breakdown of the organization and contents of the Job Specification segment is given in Table 3-5. The segment components introduced in the table are described in detail in the following paragraphs. Table 3-5 Job Specification Segment, Organization and Contents Hierarchy of Possible Statement Type and Use Job Statements .EQUIPMENT Specifications of logical device units, channels, control modes, and linearization subroutines associated with the particular device .INTERRUPT Specification of field interrupt device .STORAGE Specification of system-level data storage areas .HEADER Specification of messages, titles, or other types of information which is to be output (printed or displayed) on demand from other segments within the program .FORMAT Specifications of exact format(s) for the output of data common to the system 3-41 3.5.1.2 .PHASE Segment - The phase segments consist of: a. The key word .PHASE preceeded by a tag. b. A group of statements that specify the scheduling of the data-handling operations to be performed in the PHASE. c. One or more .SNAP program segments that contain the actual operational instructions for carrying out the task assigned the PHASE segment. The PHASE identifier has the following form: #t where .PHASE #t is a mandatory reference tag. The basic organization and content of a .PHASE segment are shown in Table 3-6. Table 3-6 Organization of PHASE Segment Statement Type and Use Hierarchy of Possible PHASE Statements #10 .PHASE PHASE segment identifier #14 DO SNAP #50 EVERY 5 SEC PRIORITY 2 Example of an activity statement .ACTION Compiler directive statement which introduces a list of PHASE action and timer statements TIMER (START, #14) TIME R statement initializing previously defined activity statement DO SNAP #55 PRIORITY 1 Example of a SNAP call statement Identifies first SNAP to operate in PHASE 3.5.1.2.1 Activity Statements - The activity statements define the scheduling parameters of the actions listed under the .ACTION statement. The key words EVERY, DELAY and AT, in conjunction with the DO statement, are used in the activity statements. For example: .PHASE #14 #15 DO SNAP #501 DELAY 10 MIN PRIORITY 3 #16 uO DO SNAP #500 EVERY 5 SEC PRIORITY 2 ~NAP #502 AT 13:15 PRIORITY 1 3.5.1.2.2 .ACTION Statement - .ACTION is a statement which is used in PHASE segments to introduce a list of specified actions to take place in the PHASE. The .ACTION statement occurs only once in each PHASE. The action list consists of executable DO and TIMER statements. The list is started by the .ACTION statement and is terminated by the occurrence of the first .SNAP segment. For example: .ACTION DO SNAP #500 PRiORiTY 2 T!MER (START, #14) #500 .SNAP 3-42 3.5.1.3 .SNAP Segments - The snap segments consist of: a. The key word .SNAP preceeded by a tag. b. SNAP specification which may include .STORAGE, .HEADER, and .FORMAT statements. These statements define the local parameters of the task. c. A list of executable program statements which are introduced by a SNAP level .PROCESS statement. The SNAP identifier has the following form: #t .SNAP where t is a mandatory reference tag. The SNAP specification statement is a list of statements written immediately after the SNAP identifier that specifies SNAP-level (local) data storage and output header and format requirements. The organization and contents of a .SNAP are shown in Table 3-7. A .PROCESS compiler directive is employed in each SNAP to introduce the executable statements that form the operational portion of this type of program segment. Table 3-7 Organization of a SNAP Segment Hierarchy of Possible SNAP Statements #10 Statement Type and Use .SNAP SNAP segment identifier .STORAGE Statement for specification of SNAP-level storage #12 .HEADER Statement for specification of SNAP-Ieve! header outputs #13 .FORMAT Statement for specification of SNAP-level output data formats .PROCESS Compiler directive, identifying executable portion of SNAP List of executable statements EXIT or Program control statements EXIT THEN DO SNAP #_ PRIORITY or EXIT THEN DO PHASE #_ PRIORITY _ NOTE Comment lines may appear anywhere in the INDAC program to simplify readability. A comment line is written as follows: .L-..J ______ _ Notice that a space delimits the period and the first word of the comment. 3-43 3.5.1.4 Subroutine - Often certain operations are used repeatedly throughout the procedures specified in the program segments. In order to avoid duplication of effort, such common operations may be specified as subroutines. Subroutine call statements are inserted into the program list at each point where the subroutine operation is required. During the execution of the program, each call causes the processor to execute the specified subroutine before proceeding to the next listed statement. There are two types of INDAC subroutines. a. Internal b. External The manner in which each is written and used is described in the following paragraphs. 3.5.1.4.1 Internal Subroutine - Subroutines of this type are written as part of a standard .SNAP segment. The repeatable group of statements that may be referenced (called) as a subroutine unit is defined by: a. A labeled executable statement used as the first statement in the subroutine group. b. The use of a program control RETURN statement. The call statement for an internal subroutine has the form: DO k where k represents the label of the first subroutine statement. For example, the internal subroutine: LET N = N + 1 401 RETURN would be called by the statement: DO 401 Internal subroutines are defined only for the .PROCESS segment in which they appear. More than one RETU RN statement may be used within a subroutine to facilitate alternative operations. 3.5.1.4.2 External Subroutine - Subroutines of this type may be included as part of a complete job. When included in a job, external subroutines may be called only from the segments of that job. When entered into INOAC separateiy, an externai subroutine may be caiied from within any iNDAC system program. externai suuroutine identifiers have the form: .SUBROUTINE s (v" v2 ' ... , vn) where s is a unique symbolic name assigned to the subroutine, and the parenthetical list contains dummy variables for input and output data. The identifier dummy variables represent those used throughout the subroutine only; their equivalent variables in the program segments that call the subroutine must be specified in the call statement. The list v" ... vn may contain variable or array names. If a variable is an array name, it represents the base of the array. a. Calling the External Subroutine - Cal! statements for external subroutines have the following form: (continued on next page) 3-44 a. (cant) where s represents the name of the called subroutine, and the call list contains a one-for-one equivalent variable for each dummy variable in the subroutine identifier. For example, given the subroutine identifier: .SUBROUTINE TCON (X, Y, Z) one example of an acceptable call would be: DO TeON (A, B, C) An example of a subroutine call is given in a listing shown in Appendix B. Note the way in which arrays I K and A are made available to the subroutine. b. Returning Control to the Caller - External subroutines return control when the following statement is encountered: RETURN s where the RETU R N statement specifies that the processor return to and execute the statement immediately following the subroutine call. The external subroutine is organized in a manner similar to that of a SNAP segment, that is, .SUBROUTINE s (v1 ' v2 ' ... , vn ) .STORAGE .PROCESS (List of Executable Statements) RETURN s As indicated above, the only nonexecutable statement which may be used in the body of the external subroutine are .STORAGE and .PROCESS. Executable I/O statements GET and SEND, plus TIMER and activity statements are not permitted. NOTE There may be more than one RETURN s statement· in the external subroutine. 3.5.1.4.3 Implicit Subroutine - Implicit subroutine calls are defined in the device control of the .EQUIPMENT definition statement, such as: .EQUIPMENT t *ADC t CHAN(~10)VALUE t#10 X200 DO IRONC Whenever a GET (ADC, #10) VALU E statement accesses the device ADC, the converted value from ADC is given as input to the implicit subroutine I RONC; the output value of the subroutine is then deposited in VALUE. Three parameters are implicit in this subroutine call. The first is the raw value read from the device; the second is the output value of the routine, and the third is an argument to supply a reference or offset value for conversions or linearizations. The following is an example of a temperature scanning program using iron/constantan thermocouples in channels 1 through 10. The RTD of the isothermal reference box is connected to channel O. 3-45 .EQUIPMENT t t t t #10 i #30 *AOC CHAN (0) REF CHAN (1,10) TEMPERATURE X200 DO IRONC .STORAGE REF #1 .PHASE .ACTION #2 DO SNAP #200 EVERY 5 MIN PRIORITY 1 #3 DO SNAP #300 EVERY 40 SEC PRIORITY 1 TIMER (START, #2) TIMER (START, #3) DO SNAP #100 PRIORITY 1 #100 .SNAP .PROCESS GET (AOC, #30) REF LET REF = 10.94 * (REF + 57.5) EXIT #200 .SNAP .PROCESS GET (AOC) REF EXIT #300 .SNAP .PROCESS GET (AOC, #10) TEMPERATURE EXIT .SUBROUTINE IRONC (IVAL, CONV, REFOUM) .PROCESS LET COUNT 1 = IVAL LET COUNT 2 = K 1 * REFOUM + K2 LET CONV = COUNT 1 + COU NT 2 LET CONV = CO + (Cl RETURN!RONC * CONV + (C2 * CONV + (C3 * CONV))) .ENO The implicit subroutine AREF called at initialization establishes the location of the reference variable required. The variable "REF" contains the reference value, in this case, reference junction temperature. 3.5.2 Scheduling Capabilities The activity and action sections of a .PHASE segment define the initial scheduling parameters of a job. One or more phase segments may be used depending on the size of the job or the scheduling requirements of the job. The scheduling statements that may be included in the phase segment are: 3-46 .PHASE DO SNAP #_ EVERY PRIORiTY DO SNAP #_ DELAY PRIORITY' DOSNAP#_AT PRIORITY DO PHASE #_ DELAY PRIORITY DO PHASE #_ AT __ PRIORITY _ .ACTION TIMER (START, #_) DO SNAP #_ PRIORITY _ Note that a DO PHASE # _ EVERY ___ PR lOR ITY _ is not permitted. This statement is not permitted because the scheduling parameters of the calling phase are overlayed at call time. Scheduling requests may also be specified in the .SNAP segments intermingled with executable code. The scheduling requests that may be included in a .SNAP segment are: .SNAP #10 DO SNAP #_ PRIORITY TIMER (STOP, #_) DO PHASE #_ PRIORITY TIMER (START, #_) EXIT THEN DO SNAP # _ PR lOR ITY _ EXIT THEN DO PHASE #_ PRIORITY EXIT When a SNAP terminates (exits) with an EXIT THEN DO _ request, the request is stacked on the scheduling queue for execution at the priority specified. This type of request is placed in front of all other requests at that priority level. A SNAP terminated with a simple EXIT statement releases control to the INDAC Executive. 3.5.2.1 Activity Statements - Activity statements operate in conjunction with TIMER statements to establish incremental control timers that schedule the performance of specified SNAP and PHASE program segments. These statements can appear only in the activity section of a phase. There are three activity statements: CJ. EVERY b. DELAY c. AT All activity statements must be listed in the PHASE before a .ACTION statement. 3.5.2.1.1 EVERY Activity Statements - EVERY activity statements are used in the formation of incremental timers to control the repetitive execution of program SNAP segments. EVERY statements must be assigned a tag reference (that is, #Xxx) and can be referenced only by TIMER statements located in the ACTION or in the SNAP program segments. 3-47 The EVERY statement has the form: DO SNAP #t 2 EVERY c PRIORITY k where a. 1, is a mandatory tag reference b. t2 is the tag reference assigned to the SNAP to be executed c. c is a time unit declaration which has the form 1. i SEC 2. i MIN 3. i HR where i in an integer variable or integer constant d. k is the assigned priority level 1 through 11 For example: #200 DO SNAP #300 EVERY 5 MIN PRIORITY 1 This execution of this statement causes the SNAP tagged #300 to be executed at five-minute intervals. 3.5.2.1.2 DE~AY Activity Statements - DELAY activity statements are used in the formation of elapsed timecontrol statements that specify the time at which designated SNAPs or PHASEs are to be performed. DELAY activity statements must be assigned a tag reference. This type of statement has the form: DO SNAP #t 2 DELAY c PRIORITY k or DO PHASE #t 2 DELAY c PRIOR ITY k where: a. t1 is a mandatory tag reference b. t2 is the tag reference assigned to the SNAP or PHASE to be executed c. c is a time unit declaration which specifies a time interval of delay after which the designated - - - - - - - - - - - ..... - ... :_ ... _ L.. _ _ ..... __ ..... _...J IJIV~lalll :::>C~IIICIIL I~ LV UC C;I\.C;\..ULC;U. 1. i SEC 2. i MIN 3. i HR T ...... ;_ ,..I,.,.,..I ......... ":'I+;"'n ....... i+ 1111..:1 \,.n... v l l l•. I ' U \ . I V I I t""I"\~" Uilit. .I.U,/ h":a"o +ho fr\r~· '-II'" • ...., • • • • • f f .... .,,,, where i represents an integer variable or integer constant d. k is the assigned priority level 1 through 11 For example, the execution of: #101 DO SNAP #300 DELAY 10 M!N PRIOR!TY 1 causes the SNAP tagged #300 to be scheduled for operation 10 minutes after the TIMER (START, #101) statement is executed. 3-48 DELAY statements are single-shot in operation; they specify an action to be carried out after one specified interim of elapsed time. 3.5.2.1.3 AT Activity Statements - AT activity statements are used to specify the time-of-day program segment execution. The AT statement must be assigned a tag reference. This statement has the form: DO SNAP #t 2 AT HH:MM PRIORITY k where HH is the hour (0-23) and MM is minutes (0-59) of the day. For example: #101 DO SNAP #1 AT 18:30 PRIORITY 1 or #102 DO SNAP #2 AT 01 :09 PRIORITY 1 will, when system clock has been set, execute SNAP #1 at 6:30 p.m. or SNAP #2 at 1 :09 a.m. This statement is re-initialized every time it is executed and will take place at the same time every day unless the timer is stopped with a TIMER (STOP, #_) statement. 3.5.2.2 Action Statements - The action statements are executable DO and TIMER statements. These statements may appear in the .ACTION section of a PHASE or the PROCESS section of a SNAP. DO action statements are used for executing program segments without regard to system incremental timers. DO action statements have the form: DO SNAP ~ PRIORITY k where t1 is a SNAP tag in this PHASE segment and k is the priority level 1 through 11. DO PHASE #t2 PR 10 R ITY k where t2 is a tag of the current or another PHASE. 3.5.2.2.1 Timer Action Statements - TIMER statements control the operation of the EVERY, DELAY, and AT activity statements. This statement has the forms: a. TIMER (STOP, #t) Where t is the reference tag of an EVERY, DELAY, or AT statement. Execution of this statement halts the timing actions associated with the designated activity statement. b. TIMER (START, #t) Where t is the reference tag of an EVERY, DELAY, or AT statement. Execution of this statement starts the timing action associated with the designated activity statement. 3.5.2.3 EX!T Program Control Statement - This program control statement is used to terminate the program .SNAP segments; its execution halts the operation of the SNAP being processed, and either returns control to the Executive or specifies a new program segment to be executed. The EXIT statement has two forms: a. As a stand-alone statement EXIT which, when executed, terminates the current SNAP, or 3-49 b. As a combined statement EXIT THEN DO SNAP #t PR lOR ITY k or EXIT THEN DO PHASE #t PR lOR ITY k \-vhien, vvhen executed, terminates the current SNAP operation, then directs the processor to the next SNAP or PHASE to be executed. 3.5.2.4 Resolving Timer Requests - Timed requests are resolved using the single system incremental counter and the process queue. As each second is recorded by the hardware clock, the system clock is incremented by one. Each phase contains the individual timer parameters established by the user under the activity list of the phase. A timer parameter is established by one of the following five activity statements: #t 2 EVERY c PRIORITY k #t 2 DELAY c PRIORITY k PHASE #t2 DELAY c PRIORITY k SNAP #t 2 AT HH:MM PRIORITY k PHASE #t 2 AT HH:MM PRIORITY k DO SNAP DO SNAP DO DO DO These language statements generate timer parameters examined by the timer scan operation. The parameters are initially inactive and remain inactive until the statement: TIMER (START, It) in the .ACTION section of the PHASE or the PROCESS section of the SNAP is executed. At this point, the timer is considered active in the scan. Correspondingly, an active timer may be disabled by executing the statement: TIMER (STOP, #t) in the .PROCESS section of a SNAP. A phase may contain more than one active timer at any point. The timer scan resolves any conflict by selecting the timer with the highest priority and time-due. If there is no single, highest time-due and the priorities are the same, the scanner resolves the conflict by selecting the timers in the order in which they appear in the .ACTION list. A DO or an EXIT THEN DO statement from a SNAP is resolved by the process queue. The highest priority SNAP or PHASE is executed first. If a new PHASE is initialized all subsequent SNAPs in the calling PHASE are terminated. An arbitrary division is made in the assignable priority levels: priority 0 (I nterrupt) and priorities 1 through 7 are considered "foreground" levels that must be run to completion, once initiated. This guarantees completely dependable sequential operation. Each SNAP within each priority level must run to completion before the next priority may operate. Priority 0 is discussed later in this chapter. Priority levels 8 through 11 are considered interruptable levels that may be suspended. Each SNAP called to operate at these levels will be stacked in the process queue and called in priority sequence. When a background SNAP begins operation, no other background priority SNAPS, higher or lower, can intervene. The operating background SNAP can be suspended, however, if a foreground SNAP is called. 3.6 THE RUN-TIME SYSTEM/MAKING THE PIECES WORK The I NDAC 8/2 Executive executes the compiled program. Services provided to the user by the I NDAC Execu- tive include: a. Time and Priority Scheduling of SNAPs b. Dynamic core management and swapping c. Dynamic I/O buffers d. Operator communications (Command Decoder) 3-50 3.6.1 Time and Priority Scheduling The INDAC Executive and the INDAC language permit a variety of sequencing and scheduling functions. Some of the functions are dependent upon the operation of a peripheral device; other functions are programmed to occur at specific times, intervals of time, or the next available opportunity. Due to the random operation of such devices as the operator's console, or the field interrupt device, the Executive must be prepared to resolve conflicts between the different requests to operate parts of the system. The Executive resolves requests to operate by building a process stack. Following the successful operation of any member of the stack, the executive returns to the stack and executes the next scheduled process call. All process calls scheduled in the stack have an associated priority level ranging from 0 (highest) to 11 (lowest). If any priority level is inactive, the Executive proceeds to the next lower level. If no level is active, the Executive is considered idle and returns to the highest priority level to begin again. 3.6.1.1 Division of the Process Stack - The process stack is considered to have three primary scheduling divisions: a. I nterrupt Priority (0) - This level is available only to the Executive Command Decoder and the Interrupt Device Handlers. b. Foreground Priority (1-7) - These levels are used for SNAPs that cannot be suspended in their operation. c. Background Priority (8-11) - A SNAP running at th is priority will be suspended in its operation if a Foreground or Interrupt call is scheduled for operation. Only one such background SNAP may be held in suspension at any moment of system operation. 3.6.1.1.1 Executive Command Decoder - The Executive Command Decoder may be called from the command Teletype. Once called, the following job requests can be made: a. Display and/or modify system parameters b. Stop or suspend operation of job c. Activate a specific PHASE of the job Operator communication through the Teletype is usually a time-consuming typing process compared with the speed of the computer. To avoid lengthy system tie-ups, the operator input is buffered and the Command Decoder is not activated until the entire request is completely entered. J"he Command Decoder is scheduled at priority level 0 when a completed process request is received. 3.6.1.1.2 Field Interrupt Processing - Field interrupt devices (the I/O handlers) are declared by the INDAC language statement: .INTERRUPT (device names) This statement must appear with the job specification statements following the .EQU IPMENT statement. The statement must declare all device handlers expected to call the INTER RUPT SNAP. For example: .INTERRUPT (UDCP) The name UDCP identifies the point-table I/O handler for the UDC. This name is declared to the INDAC software system by GENDAC if the point-table handler is selected. Programming details employing the UDCP handler are covered in Paragraph 3.7. The actual INTERRUPT SNAP that will service the interrupt is declared by the INDAC language statement: DO SNAP #t PRIORITY INTERRUPT 3-51 This statement must appear as part of the PHASE scheduling parameters immediately following the .ACTION statement of a phase. Only one PR lOR ITY INTER RUPT SNAP call is permitted within a phase. For example: .ACTION DO SNAP #10 PRIORITY INTERRUPT This statement declares the INTERRUPT SNAP to the interrupt device handlers. The INTERRUPT SNAP rePRIORITY INTERRUPT SNAP call is permitted, the INTERRUPT SNAP algorithm must first determine which device interrupted if more than one interrupt device is declared by the .INTERRUPT statement. The pseudodevice STATUS will contain the index to the device specified in the INTERRUPT statement when a field interrupt occurs. Therefore, the following statements may be used to segment the SNAP for handling more than one interrupt device: GET (STATUS) IDEX GOTO (1,2,3), IDEX Code for device 1 EXIT Code for 2 device 2 EXIT Code for 3 device 3 EXIT The INTERRUPT SNAP is activated by a hardware interrupt-level I/O handler. Once activated, the SNAP will run until it releases control through an EXIT or EXIT THEN DO statement. The INTERRUPT SNAP itself cannot be interrupted. 3.6.1.1.3 Foreground Processing - SNAPs assigned priority levels 1-7 are considered foreground segments. Once a foreground priority SNAP is activated, system control is retained until that SNAP executes one of the following statements: a. EXiT THEN DO SNAP #r. PRiORiTY k b. EXIT THEN DO PHASE #t PRIORITY k c. EXIT Statements a. and b. above allow the SNAP to release control, but they establish a process request at the stated priority level. Statement c. releases control unconditionally. I n all three cases, the Executive interprets the EXIT key word, terminates the SNAP, and returns to the top of the process queue for the next request. Statement b. schedules an action that will unconditionally release the operating phase, eliminate all associated timers of that phase, and establish a new phase for operation. A foreground SNAP may also execute the following statement calling a background priority SNAP. DO SNAP #t PR lOR ITY k In this case, the background priority SNAP is scheduled and the current SNAP proceeds with the next language statement. 3-52 3.6.1.1.4 Background Processing - SNAPs assigned priority levels 8-11 are considered background segments. Any background SNAP may be interrupted in its operation at the following points: a. While the SNAP is processing a source language statement. b. Any bid for the teletype core buffer that cannot be serviced (all bids are broken down to no more than 20 characters). c. An execution of an EXIT statement. A background priority SNAP may also execute the following statement calling a foreground priority SNAP: DO SNAP#t PRIORITY k In this case, the foreground SNAP is scheduled and the background SNAP is suspended. The Executive then returns to the process queue to activate the scheduled SNAP. 3.6.2 Dynamic Core Management and Swapping 3.6.2.1 Job Specification Segment - This segment of the program is the .EQUIPMENT, .INTER RUPT, .STORAGE, .HEADER, and .FORMAT information that the user defined at system level in his job. This information is transferred to core during the initial call for the job and remains in core throughout the life of the job. This area is never swapped. 3.6.2.2 The PHASE Segment - This segment contains the scheduling of the SNAPS that may be run under that PHASE. The PHASE segment exists in core only when that .PHASE is operational. If a PHASE is released and then recalled, that PHASE will be completely initialized on recall. 3.6.2.3 The SNAP Segment - The base core location of all of these units, and the address referencing within each unit to the other unit, are all precalculated during compile time. The relative disk addresses of each of the units are all converted to absolute addresses by SPUT - the System Put-Together Program - before the Executive is activated. Thus, all calls during the operation of the Executive are absolute; there is no time lost in table look-up, relocating, or link loading. 3.6.2.4 External (Disk-Resident) Subroutines and Functions - The INDAC 8/2 System allows the user to develop external subroutines and functions that may be called at run time. The system also allows the user to call mathematical functions supplied with the library. Calls for these routines direct the Executive to transfer the requested code from the disk to allocated call pages, in core. The Executive maintains two subroutine call areas: one reserved for interrupt or foreground priority SNAPs and the other reserved for background priority SNAPs. Because there is only one reserved area for each priority group, subroutine nesting is not permitted (that is, one external subroutine may not call another external subroutine). 3.6.2.5 Switching Priority Levels - The priority level at which a SNAP operates is determined by the process call scheduling the SNAP, rather than by some pre-assigned value associated with the actual SNAP. It is possible, therefore, to schedule a single SNAP within a PHASE to operate at different levels of priority. The Executive is structured to take advantage of th is as follows: a. Common routines are not re-entrant but, maintain linkage parameters in page zero. This reduces the overhead time and core of re-entrancy (significant on the PDP-8), yet allows the linkage parameters to be saved on demand. b. A save area is reserved in core for the linkage parameters. This save area is used wheo a SNAP operating at a background priority level is suspended. (continued on next page) 3-53 c. A swap area is reserved on the disk. This area is used when a suspended SNAP must be moved out of core. The suspension of a SNAP, therefore, takes place in two stages. Initially, the Executive reacts to the suspend command by transferring the linkage parameters for the background/priority to a reserved core area. If the next I scheduled request is to oPE1rate that same SNAP at a foreground priority level, then the SNAP is directly executed and no disk transfer is required. if the next scheduied request is to operate a new SNAP, then the suspended SNAP is swapped to the disk to make room for the new request. With this system, it is practical to develop a program of one SNAP, run that SNAP at different priority levels, and never access the disk again after the startup procedures. 3.6.2.6 Executive to SNAP Communication - Since SNAPs may operate at different priority levels, the Executive must provide some technique of communicatin§ to the SNAP the reason why it was scheduled. Communication between the Executive and source-level code is provided generally by the STATUS item; a one word, integer item available through the pseudo-device command: GET (STATUS) la' When a SNAP is called into execution by the Executive, the STATUS item is set to one of three values, depending upon the original function that scheduled the SNAP to operate. a. SNAP scheduled by a timer - STATUS contains the index value of the timer in the activity list (for example, the third timer statement would have index value 3). b. SNAP scheduled by a device interrupt handler - STATUS contains the index value of the interrupting device in the .INTER RUPT (. .. ) statement; if only one device is declared in the statement, then it is not necessary to test for the interrupting device. C. SNAP scheduled by a DO SNAP ... statement - STATUS contains a O. To differentiate which value of a. or b. STATUS contains (only required for SNAPS that run at both interrupt and foreground priority), the pseudo-call GET (PRIORITY) la will set la to the current priority level of the SNAP running. 3.6.3 Dynamic I/O Buffers The Executive provides a number of I/O handlers to service the different devices supported by INDAC 8/2. Those handlers that require core buffers (F ILE, TTY, etc.) request allocated core from the Executive. Such allocations are on a dynamic basis by job; thus, for each job only the core required to support the I/O handlers for that job is allocated. This is opposed to many systems where the user defines the total set of I/O devices supported by the and rnust reHfiquish the cure vvt"iathsi the spec;fh: job uses uH those dcv:ccs or net. The 8K Exect:ti'!s a!!o- :sy~terYI cates buffers in one page segments. The total number of words allocated, subtracted from the highest location allowed (7000) will yield the top limit of User Area. This information, combined with the top iimit of SNAPs supplied by the Compiler, is sufficient to calculate the core requirements of the job. 3.6.4 Operator Communication INDAC 8/2 applications vary from almost completely automatic operations to highly interactive, almost manual control of systems and experiments. A wide variety of operator communication is available, ranging from the Teletype console (using the Command Decoder supplied with the Executive) to more sophisticated operator consoles supplied by the user and interfaced to the digital liD subsystems. The standard INDAC 8/2 System is supplied with a Model 33 (optionally 35 or 37) Teletype. This Teletype is the Command Console and is required to initiate the different jobs. The Executive's Command Decoder recognizes this console and provides the user with a means of inspecting and modifying parameters during the execution 3-54 of a job. The Executive can be configured to support additional Teletypes and may have any or all Teletypes in Command mode. The command instructions recognized by the Executive are covered in Chapter 6, Executing the Program. The essential information is that the Command Decoder can access only permanently core-resident parameters. Such parameters are defined as system-level storage items in each job. It is possible to access a greater amount of data, but, this involves code which the user must create within his own job. 3.7 SERVICING FIELD INTERRUPTS The contact interrupt modules of the UDC provide the necessary hardware interface for field devices capable of issuing interrupts. The point-table I/O handler (UDCP) provides a convenient method for obtaining the interrupt information. In addition, the UDCP handler allows the user to access his UDC by channel selection rather than by scanning a predefined set of channels. A consistent method of accessing the UDC is held throughout the handler by using a point-table to define the channels required. The UDCE handler requires that the user define to the Compiler the explicit channels that will be used during his running program. The Compiler then allows a data item to be associated with the defined channels. While this has the advantage of coding simplicity, there is no provision for altering the number of channels to be scanned, or the channels that an operator or program would like to select at any given moment. The UDCP handler allows the user to develop a "point-table" defining the channels (or points) to be selected for a given scan. Any point-table may be associated with any data item (or array). This allows the input or output of information without pre-defining channels and data items for the Compiler. 3.7.1 Equipment Declaration Statement The UDCP and associated information is declared in the INDAC program as follows: t *UDCP t#1 t#2 t#3 INITIALIZE IDENTIFY TRANSFER where the equipment control lines define the requests that may be made on the point-table I/O handler to supply information. 3.7.2 Language Statements The I NDAC language statements are detailed in the following paragraphs. 3.7.2.1 The Standard Call- The standard calls for accessing digital input and output functional modules are: GET (UDCP) (v1, v2) SEND (UDCP) (v" v2 ) where v1 and v2 are the two components of the data list. The first component is the point-table. This item may be a simple variable, an indexed variable, or an array defining the channels to be accessed. The second component specifies the data items that either contain the information to be output, or will receive the information to be input. Generally, the point-table and the data item contain the same number of elements; however, this is not required. The UDCP handler will sequentially process through both components until one component is exhausted. The first component to be exhausted terminates the I/O operation. 3-55 NOTE The control lines declared in the .EQUIPMENT statement are not referenced in the standard call. Reference to these control options are required only to service contact interrupt modules. 3.7.2.2 INITIALIZE Request - The iNiTiAliZE request is required oniy for those moduies that require the Executive to buffer information, that is, information relating to the previous status of the device. The initialize statement has the following form: SEND (UDCP, #t) where #t is a tag reference to the device control line specifying the INITIALIZE command, and the (data list> is constructed as follows: a. The first item of the data list must be a system-level storage array containing two (2) words of storage for every channel of Contact Interrupt (Generic Code 2). NOTE This array must be provided for the exclusive use of the Executive. b. The second item of the data list, and all succeeding items, are point-table declarations. Each item is a simple variable or an array containing the channel numbers of those interrupting modules that require special buffering by the Executive (like the Contact Interrupt Module). Each point-table must be a system-level storage item. The Executive will reference these tables whenever interrupts occur, and the tables must be core-resident. Each array declared must contain channel numbers of the same generic type modules. The first channel declared in each array will be sampled for generic type by the Executive; the remaining channels of that array will be assumed to have the same generic code. 3.7.2.3 IDENTIFY Request - The IDENTIFY request is required for all modules that create a "PR 10 RITY INTERRUPT" in the job (that is, call the INTERRUPT SNAP). The identify statement has the following form: GET (UDCP, #ti Iv 'v·v'here #t is a tag reference to the device control line specifying the !DENT! FY command, and II/ is an integer variable. The command will return the generic code of the module forcing the system interrupt in the item Iv' This statement is normally followed by a computed GOTO statement using the item Iv' By this technique, the user can branch to the correct access statement for "[he specific generic code of the mouuie. A typical coding scheme for servicing a UDC with several channels of interrupt modules is to create a loop using the IDENTIFY request and the computed GOTO to control the loop. The GET statement is executed repetitively until a 0 is returned in the integer item. The following GOTO statement is then executed with a 0 value, causing a default condition. For example: 3-56 t *UDCP t#101 IDENTIFY 900 GET (UDCP,#101) IGEN GOTO (901, 902, 903, xxx), IG EN (default condition - no more interrupts outstanding) 901 (service UDC device error) 902 (service Contact Interrupt) 903 (temp, reserved) xxx (etc.) GOTO 900 3.7.2.4 TRANSFER Request - The TRANSFER request is used in conjunction with the IDENTIFY request. TRANSFER and I DENTI FY are a matched set and must occur in pairs or the Executive will generate an error condition. Any GET or SEND statement separating an IDENTIFY and TRANSFER pair is prohibited. The transfer statement has the following form: GET (UDCP, It) (data list> where #t is a tag reference to the device control line specifying the TRANSFER command, and the (data list> is formatted according to the specific generic type module being accessed. I n all cases where the TRANSF ER command is used, the Executive will allow only one channel of data to be accessed, regardless of whether that channel is directly scanned from the UDC or buffered in core by an interruptlevel I/O handler. The following UDC access request is available: a. For Contact Interrupt Module (Generic Code 2) GET (UDCP,#t) Ip1 , Iv1 , Iv2 , IV3 Ip1 is the name of the point-table containing all the channel numbers that hold a Contact Interrupt board already specified under INITIALIZE. IV1 will be supplied by the Executive with an index into the point-table Ip1 , of the interrupting channel. If it is required, the statement: LET I CHAN = Ip1 (Iv1 ) will place the interrupting channel number in ICHAN. IV2 is a logical item (may be array element) that will be supplied with a 12-bit identification of the interrupting channel status. The 12-bit word will contain a "1" bit for every relay of the Contact Interrupt board that has changed state (COS), in the direction wired by the user, since the last time that the board was sampled. IV3 is a logical item (may be an array element) that will be supplied with the last scanned value (LSV) of the Contact I nterrupt channel. This value will contain a "1" bit for every relay that is "closed". Note that "closed" refers to the state of the isolation relay on the module. 3-57 3.7.3 Sample Program The following "program" was created to illustrate the usage of the UDCP handler. The UDC in the example has the following configuration: a. A BM804 FIrp..Flop Relay board in channel 2. c. A BM804 Flip-Flop Relay board in channel 5. The function of the program is to indicate that an operator has pressed a push-button and to display the total number of buttons or switches closed, as well as the last button(s) or switch(es) closed. The BW732 board has been wired as Close-Only (Pulse-Close). The information is displayed on both the Console Teletype and the UDC. Both BM804 boards are connected to lamp indicators and the BW732 board is connected to either 12 switches or 12 push-buttons. Channel 5 will display the last change and channel 2 will display the current status of the input. There are some features of the program that require explanation: a. The array IRA Y( 1,6) ... has been set aside for exclusive use of the Executive according to the requirements of INITIALIZE. b. The array ICONIS( 1,3)/4,104,105/... provides for the current channel 4 of Contact Interrupt and two expansion channels (containing Contact Interrupt modules) that the user would like to implement in the future. Since the Executive will not "see" any interrupts on these channels, there is no loss in time by including these channels in the table. If the empty channels had been specified first in the table, there would be a time loss in lookup and match for the active channel. c. The array IDIGS(1,3)/5,2,-1/... contains a negative channel designation and also demonstrates that channels do not have to be specified in ascending sequence. The negative channel is another method of reserving a channel slot; but, for a totally different purpose. The Executive will bypass all negative channel declarations on input and output; however, the Executive will also bypass the data item associated with that channel. The user, for example, may code an output transmission to six channels using six items of data and dynamically modify the actual list of channels to receive the information, as well as the number of channels to be output. Conversely, the user may code the system to allow an operator to add or delete sample or display points to the process scanner. d. The item IDIG2 is reserved in system-level storage and used in #100 .SNAP(102+1). The item is initially associated with the negative channel and will be bypassed by the Executive; however, if the operator, or another .SNAP entered a legal channel value in place of the "-1", the Executive wouid ouiput iDiG2 tu thai chann~i. 3-58 .EQUIPMENT t *UDCP t#10 INITIALIZE t#ll IDENTIFY t#12 TRANSFER .STORAGE IRAY(1,6). ICONIS(1,3)/4, 104, 105/, tIDEX, ICOS, ILSV, IDIGS(1,3)/5,2,-1/, IDIG2 .INTERRUPT (UDCP) .PHASE #1 .ACTION DO SNAP #100 PRIORITY INTERRUPT DO SNAP #2 PRIORITY 2. #100 .SNAP #121 .HEADER UDC FAULT #122 .FORMAT "CONI INPUT" XX XXXX XXXX .PROCESS 100 GET (UDCP,#ll) IA GOTO (101,102), IA EXIT 101 SEND (TTY,#121) GOTO 100 102 GET (UDCP,#12) ICONIS, IDEX, ICOS, ILSV SEND (UDCP) IDIGS, ICOS, ILSV, IDIG2 SEND (TTY,#122) ICONIS (lDEX), ICOS, ILSV GOTO 100 .SNAP #2 .PROCESS SEND (UDCP,#10) IRAY, ICONIS EXIT .END 3.8 HANDLING THE CONSOLES INDAC 8/2 is capable of handling up to four ASCII compatible (TTY type) consoles such as the ASR33, KSR35, VT05, VT06, LP30, etc. One console, which is standard in the I NDAC 8/2 System, is permanently defined in the compiler tables as TTY. Three additional consoles, TTY2, TTY3, and TTY 4, can be configured through GENDAC. The TTY console has been discussed in terms of the system output (message and logging) device in previous paragraphs. The use of the console in this application is termed the system mode. The standard TTY console and any additional consoles can also be used in the "operator mode" for operator guidance of the job. Two options are available in the operator mode: System input Command functions 3-59 The ability to perform command functions can be allowed through program control. Thus, consoles primarily designated for operator interface can be restricted for system input functions, that is, operator responses to programmed questions. The console designated for the designer or supervisor can be opened for command functions as well, so that he can inspect and modify system parameters, stop a job, or start another job. After a job is started (by calling SPUT and commanding the Executive to start the job) all consoles are placed in the system mode unless specifically programmed other.'... ise. If any console is placed in the operator input mode, (Ind the operator responds with an answer, the console is automatically reverted back to the system mode. If the operator does not respond, the console remains in the operator input mode unless the program cancels the request. 3.8.1 Equipment Declaration Statement Consoles and associated information are declared in the INDAC program as follows: t t#1 t#2 *TTY COMMAND CANCEL where the equipment control lines define the requests that may be made of the I/O handler to handle information. 3.8.2 Language Statements The language statements for accessing the consoles vary in format depending on the mode in which the user wishes to access the console. a. System Mode - The following statements are acceptable when the console is in the system mode: 1. SEND (TTY, #t) This statement is used to send the .HEADER or a .FORMAT statement tagged #t to the console. Normally, a .FORMAT statement would be referenced when the user wishes to place the console in the operator mode without having a data list to be sent. The declarative .FORMAT statement terminated with a question mark (?) should be used for this purpose. 2. SEND (TTY) (data list> This statement is used to send unformatted data (in exponential notation) to the console where (data list) is the list of items to be sent. 3. SEND (TTY,#t) This statement IS used to send formaned data to the consoie where where (data list> are the locations where the information in ASCII representation (one character per word) is to be stored. After this statement is executed, the program may examine the operator message. 2. Command Option The console may be placed in this mode to allow the user to call the Executive Command Decoder to inspect and modify system parameters, to stop the job, or to start a new phase. 3. Cancel The operator mode can be cancelled to revert the console to the system mode by using the following statement SEND (TTY,#t) where #t is the tag reference to the control line containing the key word CANCEL. 3.8.3 Program Examples The following program examples are included to illustrate some techniques in programming the consoles. Example 1 illustrates two methods of placing a console in the operator mode. The coder has the option to allow any console access to the command mode by simply referencing the control line containing the key word COMMAND. Example 1 - Placing console in operator mode .EQUIPMENT t t #100 #1 *TTY COMMAND .PHASE .ACTION DO SNAP #2 PRIORITY 2 #2 .SNAP #3 .FORMAT ("ENTER VALUE-",?) #4 .FORMAT ("COMMAND MODE AVAILABLE",?) .PROCESS SEND (TTY, #3) or 2 SEND (TTY, #100, #4) EXIT 3-61 The INDAC output command SEND (TTY ... ), assumes that the specified console is in the system mode, not the operator mode. If the console happened to be in the operator mode because it was not released by the user, the output command will default to the next statement. If this conflict is possible, the "STATUS" item may be tested to determine if the output was successful. Examp~e 2 presents an INDAC code that waits for the console to be released from the operator mode. The STATUS item will be set to "0" when the output is successful. Example 2 - Waiting for a console 101 SEND (TTY,#t) GET (STATUS) Ix GOTO (101), Ix Any console placed in the operator mode may be cancelled to release the console under program control. The system designer can then take appropriate action. Example 3 illustrates some programming techniques for cancelling a non-responding console. Example 3 - Canceling a non-responding console .EQUIPMENT t t #101 CANCEL #1 .PHASE #10 DO SNAP #3 DELAY 20 SEC PR lOR ITY 11 #11 *TTY DO SNAP #4 DELAY 40 SEC PRIORITY 2 .ACTION DO SNAP #2 PRIORITY 2 #2 .SNAP #21 .FORMAT ("ENTER VALUE-", 7) .PROCESS SEND (TTY, #21) TIMER (START, #10) TIMER (START, #11) EXIT #3 .SNAP .PROCESS GET (TTY) IVALUE EXIT #4 .SNAP .PROCESS SEND (TTY, #101) EXIT 3-62 The SNAP that typed the output message and placed the console in operator mode was at a "foreground" priority level. This is usual though not required; however, notice that the SNAP containing the ... GET(TTY ... is operated at a "run-interruptable" level. This operation guarantees that if the SNAP must be suspended, the entire system is not suspended also, By this technique, the Executive suspends the input requests and allows the "cancel" to take place. a. The user may: 1. Output information to a console in system mode 2. Change a console to operator mode 3. Allow a console to access command mode 4. Cancel the operator mode of a console, placing it in system mode 5. Input information from a console ... GET (TTY ... 6. Test if an output request was successful b. The Executive will: 1. Initialize the primary console in operator mode (command mode allowed) to access the Command Decoder 2. Initialize all other consoles in system mode to prevent unauthorized access to the system 3. Allocate a single page of dynamic buffer for each console, to be used for input or output of data respectively 4. Collapse the input or output buffer if a CANCEL command is received 5. Bypass the output request if a ... SEND command is received for a console in operator mode 6. Set the STATUS word to a "0" if an output request is successfu I or to "1" if the request cannot be honored. G ET (STATUS) la will transfer the status word into la 7. Revert any console that has initiated a "run" command (tD R# ... }.back to system output mode 8. Revert any console that has completed a GET (TTY) ... back to system output mode c. System Considerations: 1. Once the primary console initiates the first phase run command, all consoles will be in system output mode. It is the prerogative of the user to place any console in operator mode and to permit any operator mode console access to the Command Decoder and system-level storage. 2. Any SNAP requesting a ... G ET (TTY ... will be suspended until the operator has completed the input. If the suspended SNAP is a "foreground" priority then, by definition, the entire system is suspended. It is therefore, adviseable to interrogate consoles from run-interruptable SNAPs. 3-63 CHAPTER 4 CONFIGURING A SYSTEM HAVING STANDARD DEC PROCESS 1/0 DEVICES 4.1 INTRODUCTION A specific system can be built and configured by the guidelines and procedures contained in this chapter. The cold-start procedure for building and configuring the system is as follows: Procedure Step Load the following programs: Manually enter the bootstrap loader for H INDAC HINDAC MSUP Monitor System Dump I NDAC Support Programs INDAC System Tables MAKE 8/2 COMP1 COMP2 COMP3 COMP4 2 Run SGEN. 3 Load following programs: Executive 8/2 GENDAC 4 Run GENDAC to configure system. After all programs are loaded and SG EN is run, the specific system can be configured using G ENDAC and its library tapes. Currently, the G ENDAC library tapes contain I/O handlers for standard DEC I/O devices and trig functions. As new I/O devices are developed and new applications or requirements encountered; the GENDAC library tapes will be updated accordingly by DEC. GENDAC, in conjunction with the library tape, generates a dialogue to enable the operator to select the desired I/O handlers and functions. Handlers for the TTY, pseudodevices: KEYS, STATUS, PRIORITY and FILE are not included in the library since they are a permanent part of the Executive. Once a library routine is selected for inclusion in the system, the routine becomes a permanent part of the system and cannot be deleted by GENDAC. If a routine is inadvertently selected, or if a routine is no longer desired, the complete system must be rebuilt starting with loading the Monitor System Dump (Paragraph 4.3). Then, when GENDAC is run again, it should be run under the initial run option. However, if the user wishes to add a library 4-1 routine, he can simply run G ENDAC under the non initial run option and select only that routine he wishes to add. If the user answers "Y" (yes) to a question pertaining to a routine already in the system, GENDAC will abort and print "CANNOT CONTINUE". At this point, the syst.em communications tables are incomplete and the system must be rebuilt starting with loading the Monitor System Dump (Paragraph 4.3). The following paragraphs contain the procedures for building and configuring the software system to complement the user's hardware. If a sample system was built (see Chapter 2), the system communications tables are configured to reflect the sample system. Since these tables cannot be modified, the system must be rebuilt starting with loading the Monitor System Dump (Paragraph 4.3). NOTE The PDP-8/E control panel differs slightly from other PDP-8 Computers. The procedures presented in this chapter detail the PDP-8/E controls. When INDAC is implemented with a PDP-8/1 or L, use the START switch whenever CLEAR/CONT is specified in the procedures; use LOAD ADDR whenever EXTD ADDR LOAD or ADDR LOAD is specified in the procedures. Paragraphs 4.2 and 4.3 contain procedures that are designed for starting the building process from a cold start; that is, the monitor head is not in core or disk resident (refer to Chapter 5 for the procedure to bootstrap the Monitor into core). If the monitor head is in core (the monitor period is typed when CTRL/C is pressed), the MSUP program required for loading the Monitor System Dump (Paragraph 4.3) can be loaded from the highspeed reader with the following command string, instead of with the cold-start procedure described in Paragraph 4.3. .LOAD) *IN-R:) * ST=200 tt (User types CTRL/P after each t) Then continue with Step 10 of Paragraph 4.3. 4.2 LOADING THE HINDAC PROGRAM To load the computer from a cold-core start proceed as tollows: NOTE Verify that RUN light is off. If the light is on, press HALT and return HALT switch to up position. Step Procedure Load the switch register with 0000. 2 Press EXTD ADDR LOAD, 3 Load the switch register with 0027. 4 Press CLEAR. 5 Press ADDR LOAD. {continued on next page} 4-2 Procedure Step 6 Successively deposit the following: Location Instruction 0027 0030 6011 5027 0031 6016 0032 0033 0034 0035 0036 0037 0040 7450 5027 7012 7010 3007 2036 5027 7 Load the HINDAC (Tape 1) program in the high-speed reader - begin anywhere in the initial blank tape portion. 8 Load switch register with 0031. 9 Press ADD R LOAD. 10 Press CLEAR. 11 Press CONT. NOTE The tape should now read completely through the reader and stop on the trailer portion (code 0200) of the tape. The computer should also halt. At this point, both RIM and the Binary Loader are in core. If the RUN light does not go out or if the tape does not read in properly, repeat this procedure. 4.3 LOADING THE MONITOR SYSTEM DUMP AND INDAC FILE TAPES After the H INDAC program is successfully loaded, the Monitor Support program is loaded using the Binary Loader: Procedure Step Place the MSUP tape (Tape 2) in the high-speed reader. Set the leader portion (code 200) of the tape under the read lamp. 2 Load switch register with 7777. 3 Press ADDR LOAD. 4 Set switch register to 3777. 5 Set the rotary console switch to AC. 6 Press CLEAR, then CONT. The tape should now read until the trailer portion (code 200) is under the read lamp. At this point, the computer will halt with the AC containing 0; the link may be on. 7 Load switch register with 200. (continued on next page) 4-3 Step 8 9 Procedure Press ADDR LOAD. Press CLEAR, then CONT. The MSUP program will begin a series of questions to determine the operation required. Each question may be answered by a single letter followed by a carriage return (designated) ). After it is loaded, the first question is: LOAD, DUMP or VERIFY- 10 Type L) The next question asked is: ENTIRE DISK OR FILES?- 11 Type E) The MSUP program will come to a halt after typing the liE)". The program is now waiting for the user to load the Monitor System Dump (Tape 3) in the highspeed reader. 12 At this point, before loading the tape, set the switch register to 0001. The LSB switch is used to control the loading of the Monitor System Dump tape. When the switch is in the "1" position, the program will idle after completion of loading the current block (one "block" of information). When the switch is set to "0", the program will resume loading. NOTE Make certain that all checksums are torn from the end of the Monitor System Dump tape before loading. 13 Place the Monitor System Dump (Tape 3) in the high-speed reader. Start tape at leader portion (code 200). 14 Press CONT. At this point, if you have correctly set the LS.B switch, the program will be idling. 15 Set the LSB to "0" to start the loading process. At any time, setting the LSB to "1" will stop the tape at the next leader/trailer. Loading will resume whenever the LSB is reset to "0", NOTE During the loading process, if the reader malfunctions, MSUP will print "CHECKSUM OR VERIFY ERROR" and halt. Back the tape up one block (blocks are groups of punches separated by leader/ trailer, code 200). Place the leader of the block that failed under the reader lamp. Set LSB for continued loading and press CONT. If the block will not load correctly, the tape has been damaged and must be replaced. 16 When MSUP completes the loading of the Monitor System Dump (Tape 3), there wiil be a slight pause and the program wiii type out: LOAD, DUMP OR VERIFY- 17 Place the I NDAC Support Programs (Tape 4) in the high-speed reader. Start the tape at leader portion (code 200). (continued on next page) 4-4 Procedure Step NOTE Tear all checksums from the end of the tape (information following the last leaderltrailer). Type L) 18 The next question asked is: ENTIRE DISK OR FILES?Type F) 19 When MSUP completes the loading of the INDAC Support Programs (Tape 4) there will be a slight pause and the program will type out: LOAD, DUMP OR VERIFYPlace the I NO AC System T abies (Tape 5) in the high-speed reader. Start tape at leader portion (code 200). 20 NOTE Tear all checksums from the end of the tape (information following the last leader/trailer). 21 Type L) The next question asked is: ENTIRE DISK OR FILES?Type F) 22 When MSUP completes the loading of the INDAC System Tables (Tape 5) there will be a slight pause and the program will type out: LOAD, DUMP OR VERIFYWhen both file tapes have been loaded type CTR LlC (hold both CTR Land C keys down), this will return control to the 0 isk Monitor System just loaded. The Monitor will respond with a period. At this point, the disk system is established for a single disk and the Disk Monitor is resident in core. 23 4.4 LOADING AND BUILDING THE INDAC COMPILER Load the MAKE 8/2 (Tape 6) program using the Disk Monitor Loader. To load MAKE 8/2 from the high-speed reader, use the following command string: .LOAD) *IN-R: ) * ST=200) tt (User types CTRL/P after each t). NOTE Start the tape at leader portion (code 200). MAKE 8/2 will execute and return to the Monitor. Now load the compiler tapes. COMP1 (Tape 7) COMP2 (Tape 8) COMP3 (Tape 9) COMP4 (Tape 10) 4-5 The loading sequence (using the high-speed reader) is the following for each tape: .LOAD) *IN-R: ) * ST=2) tt (User types CTRL!P after each t). NOTE Start tape at leader portion (code 200). After the user's second CT R LIP contro i retu rns to the Mon ito r after about one minute. The same sequence is repeated for each compiler tape. 4.5 RUNNING THE SGEN 8/2 PROGRAM SG EN 8/2 takes a single-disk system and expands the file structure into as many disks as are connected to the system (Limit 4), and protects the Executive and data file areas that will be used later in the system. Any disk units on the system that are not to be used by the INDAC System should be switched to "off". To run SGEN 8/2, type the following sequence: .SGEN) .SA VE (SO)! 1400;) SGEN 8/2 expands the single-disk system to include as many as the user has DS32 expander units selected and returns to the monitor after a short pause. The SAVE command initializes the System Devices Table in preparation for the system configurator program. 4.6 LOADING THE INDAC EXECUTIVE 8/2 Load the I NDAC Executive as follows: Step Procedure Place the Executive 8/2 (Tape 11) in the high-speed reader. Start the tape at the leader portion (code 200). 2 Set the switch register to 3600. 3 Type HELD) The HELD program will load the Executive and halt after load ing. NOTE 1 Since paper-tape to disk operations are taking place, the loading may appear "jerky" or "erratic"; this is normal. NOTE 2 At this point the AC register should be "0" indicating that the checksum comparison is correct. If the AC is not 0, repeat the Executive Loading procedure. 4 Set the switch register to 1600 5 Press EXTD ADDR LOAD. 6 Press ADDR LOAD. 7 Press CLEAR, then CONT. 4-6 NOTE Control returns to the Monitor after pressing CONT. This completes the procedures required to build the initial system. Continue with the following procedures to build the specific sample system for checkout and experimental usage. 4.7 LOADING GENDAC TO CONFIGURE A SPECIFIC SYSTEM The function of GENDAC is to configure the INDAC System for the specific requirements of each installation. To configure the system proceed as follows: Step Procedure Load GENDAC (Tape 1-2) in the high-speed reader. 2 Set the switch register to 3600. 3 Type LELD) 4 The LELD program will load GENDAC and return to the Monitor after loading. NOTE Since paper-tape to disk operations are taking place, the loading may appear "jerky" or "erratic"; this is normal. About a third of the way through loading the tape the Teletype will echo a carriage return/ line-feed. 5 When loading is completed, LELD will return to the Monitor. 6 Press HALT, then return switch to normal position. 7 Set switch register to 0200. 8 Press ADDR LOAD, CLEAR, then CONT. 9 GENDAC will begin execution (see Figure 4-1). 10 The initial dialogue from G ENDAC types the version number and a reminder to the operator that if he is unsure of the response to a question, type "?". 11 ·GENDAC will then ask if this is to be a 4K system. The response will be liN" because you do not have a 4K system. 12 GENDAC will request the mode of operation to be used via the question H*OPT-"; the response will be liB" for binary mode. NOTE In the binary mode GENDAC expects to find a formatted binary image produced by the assembly of a program such as the I/O Handler and Function paper tapes. The contents of these tapes is summarized in Charts 4-1 and 4-2. In the system mode GENDAC expects to find vector code produced by the INDAC compiler. 13 The next request is for the input device via the question "*IN-". The response will be "R: ) " for the high-speed reader. 14 GENDAC then types lit", waiting for the binary tape to be loaded. Load the I/O Handler (tape 13) tape into the high-speed reader and reply by striking CTRL/P (hold CTRL key and strike P key). GENDAC echos tP. (continued on next page) 4-7 Step 15 Procedure Answer all questions. Answer "Y" (yes) if the I/O Handler is to be inserted into the system; answer "N" (no) if the I/O Handler is not to be inserted. In general, if you do not understand what the routine in question is, type" I" (inspect). Refer to Figure 4-1 for sample dialogue of current I/O Handler tape. NOTE GENDAC also asks whether CTRL/C is to be disabled when the console is in the Command mode. If the user answers yes to this question return to the Monitor is not possible via the Executive Command Decoder. 16 When G ENDAC reaches the end of the I/O Handler tape it will type: END OF LIB RARY TAPE. *OPT- 17 If you wish to add one or more of the following functions: SIN COS EXP LOG ATAN the response to GENDACs question "*OPT-" should again be "B" for binary mode. If none of these functions are desired, respond with a carriage return to the question "*OPT-" to terminate G ENDAC. G ENDAC will then release control to the monitor system. 18 If GENDAC is terminated at this point in the system building phase, proceed to Chapter 5 for information on program preparation or to Chapter 7 for information on modifying the basic system. If one or more of the specified functions are to be added to the system, proceed as foltows: a. Respond with "B" to G ENDACs question H*OPT-" b. GENDAC will then type "*IN-" requesting the input device specification. Type "R:) " for the high-speed reader. C. GENDAC then types "t" and waits for the binary tape to be loaded. d. Place the Function tape (Tape 15) into the high-speed reader and strike CTRLlP (hold CTRL key down and hit the P key). GENDAC echos "tP." e. Answer ail questions. Refei to Figure 4-2 for sample dialogue of current Function tape. r. When GENDAC reaches the end of the Function tape, it will type: END OF LIBRARY TAPE. *OPT- g. Respond with carriage return to terminate GENDAC and refer to Chapters 5 and 7 for operating and modifying the system. 4-8 Chart 4-1 INDAC I/O Device Handler Library Summary SELECT ONE 60 Hz PDP-S/E LINE FREQ CLOCK CLOCK 50 Hz PDP-S/E LINE FREQ CLOCK I/O HANDLER (eLK8) PDP-S/E PROGRAMMABLE CLOCK BY ANSWER I NG 60 Hz PDP-SII YES(Y) 50 Hz PDP-S/I TO ONE OF 60 Hz PDP-S THESE QUESTIONS 50 Hz DIGITAL 1/0- POINT-TABLE I/O HANDLER SELECT ONE ANALOG-TO-DIGITAL CONVERTER (ADC) I/O HANDLER DIGITAL PDP~S UDCP GENERIC 2 INTERRUPT MODULE B D B B B AF01 AF02 AF03 AFCS AD01 AF04 1/0UDCE D DIGITAL-TO-ANALOG AA01 CONVERTER (DAC) AA50 B PTP D EXPLICIT I/O HANDLER SELECT ONE I/O HANDLER HIGH-SPEED PAPER TAPE PUNCH ADDITIONAL CONSOLES TTY2 TTY3 TTY4 4-9 Chart 4-2 INDAC Function Library Summary SELECT DR SIN, COS FUNCTION B CR EXP II BY DR EXP CR SIN, COS tj ANSWERING YES (Y) CR LOG TO THESE DR LOG QUESTIONS CR ATAN DR ATAN 4-10 R L--J B • • 4K?-? 4K INDAC • *OPT-B *IH-R: uP • • • • • • • • I.i· I I I: I~_. .'• •GElWAC 427 TYPE '1' IF CONFUSED. • • • • .1 • .. LELD 110 EXECUTIVE?-N • • • • • LIBRARy I NDAC 8/2 SAVED <50>11400; YROM SGEN?-? TYPE 'y' TO INCLUDE, 'N" TO OMIT, 'I' FOR MORE INFORMATION.-I HAVE you SAVED FOR INITIAL RUN IF NOT TYPE CTRL/C TO RETURN TO MONITOR7-Y CHKS... ~IORED AT !020~ INITIAL RUN1- I IS THIS THE INITIAL LOADING OF ANy 1/0 HANDLER1-Y [ZC] SIORED AT ~117' END ADDED 10 10 CHAIN. • • • • • • • • CISABLE CIRL/C IN COMMAND MODE7-1 DO YOU WISH 10 DISABLE CTRL/e RETURNING TO THE MONITOR FRO~ CONSOLE COMMAND MODE?-y SCAN SIORED AT 03235 6G HZ PDP-8/E LINE FREQ CLOCK?-I _0 HZ PDP-8/E WITH DK8-fA LINE FREQ CLOCK?-Y eLKS STORED AI 05182 elKS ~IORf.D AT ~5e45 elK8 SToRED AI 0531. 5~ HZ PDP-8/E LINE FREQ CLUCK?-I 5~ HZ PDP-8/E wITH DK8-EA LINE FREQ CLOCK?-N PDP-B/E PROGRAMMABLE CLOCK?-I POP-b/E WITH DK8-EP PROGRA~MABlE CLOCK?-N .101 HZ POP-8/I OR PD?-8/L7-1 If, LI NE FREQ .0 HZ FOR PDP-81 I OR PDP-8/L?- N 5~ HZ PDP-8/1 OR PDP-8/L7-1 IS LINE FRlQ 5~ HZ FOR PDP-8/Z OR PDP-8/L7-N Figure 4-' GENDAC and I/O Handler Dialogue (Sheet 1 of 3) 4-11 ,r • .0 HZ PDP-8 CLOCK?-I • 50 • IS PROCESSOR A PDP-8 WITH A 51 HZ CLOCK?-N • • • • • .. IS PROCEiSOR A PDP-8 WITH A •• HZ CLOCK?-N UDCP?- I GENERIC 21- I DO YOU HAVEUDC CONTACT-INTERRUPT MODULES1-Y UDC. ADDED TO <**> UDC5 ADDED TO <**> UDC5 STORED AT 07208 UDC' STORED AT 07400 UDCO STORED AT 0224. • • AF021-I A-D CONVERTER MODEL AF021-N A-D CONVERTER MODEL AF01?-N •• AF~3?-I 4t A-D CONVERTER MODEL AF031-N • ANY Of THE ABOVE AlD?-I • • DO YOU HAVE AN AF01, AF02, AF03?-N •• • AFC-8?-I .. DO YOU HAVE AN AFC-8?-Y ADC ADDED TO [AF} STORED AT 81584 AFC ADDED TO 10 CHAIN. • • • • • • • • • UDC POINT-TABLE AND INTERRUPT MODULE HANDLER?-Y UDC3 ADDED TO <**> UDCI ADDED TO <**> UDCP ADDED TO UDCP STORED AT S22~1 UDCI ADDED TO 10 CHAIN. UDC3 STORED AT 82!00 AF01 1- I • • • HZ PDP-8 CLOCK1- I • • • • • AD01?-I .. A-D CONVERTER MODEL AD01?-N • AF"'4?-I DO YOU HAVE AN rDVM AFS4?-N ~----- Figure 4-1 GENDAC and I/O Handler Dialogue (Sheet 2 of 3) 4-13 Figure 4-1 GENDAC and I/O Handler Dialogue (Sheet 3 of 3) 4-15 • • • • • • • • • • • • • • • • • • • .. -'-----~ *OPT-B • * I N-R: uP • • • • • • • • • • • • • • • • • • INDAC 8/2 FUNCTION LIBRARY [Cl] ADDED TO,<**> ANY OF: lIN, COS, EXP, LOG, ATAN1-1 TYPE .y' IF ANY OF THE ABOVE DESIRED.?-Y [00] ADDED TO <**> [~0] STORED AT 875.1 ***~YSTEM BASE ALTERED1*** [Ll] ADDED TO <**> [Ll] STORED AT 1281a [L0) ADDED TO <**> [La] ~TORED AT 0.371 ANY DISK-RtS: SIN, CO~, EXP, LOG, ATAN?-Y [Dl] ADDED TO <**> [01] STORED AT 10153 [00] ADDED TO <**> [00] STeR~D AT e7505 CR 81 N, COS?- N DR 51 Nt COS?- Y SIN ADDED TO COS ADDED TO [SO) STORED AT 17,7574 EXP?-N DR EXP?-Y EXP ADDED TO [ED] STORED AT 17,7373 CR CR LOG?-N DR LOG?-Y [HI] ADDED TO <**> [HI] STGRED AT 111.5 [HI] ADDED TO <**> [H0] STORED AT 0.574 LOG ADDED TO [GO] STORED AT 17,.1., CR ATAN?-N DR ATAN?-Y ATAN ADDED TO [AD] ~TORED AT 17,51.5 END OF LIBRARY TAPE • *OPT- GENDAC COMPLETED. • • Figure 4-2 GENDAC and Function Dialogue 4-17 CHAPTER 5 PREPARING THE PROGRAM 5.1 INTRODUCTION After configuring a specific I NDAC software system in accordance with Chapter 4, the user can prepare his source program on-line via the EDITOR and the Teletype. The EDITOR, COMPILER, and PIP are useful in preparing the source program. These programs are resident on the disk and can be called into operation simply by typing the assigned name (command string) in response to the Disk Monitor period (.). For example: .EDIT .PIP .COMP Other system programs that can be called into operation are: .LOAD .HELD .LELD .SGEN .SPUT 5.2 MONITOR INDAC uses the standard disk-oriented keyboard monitor, allowing the user to control the flow of INDAC 8/2 programs through the computer. The Disk Monitor also allows the user to LOAD, SA VE, or CALL any other PDP-8 program he wishes to run. (Refer to Disk Monitor System Manual, DEC-08-SDAB-D for a complete explanation of the Disk Monitor facilities.) 5.2.1 Monitor Residence The Disk Monitor and INDAC system programs reside on disk. Part of the Monitor, called Monitor Head, also resides in core. It resides in the top page (locations 7600 through 7777) of field O. The starting address of the Monitor is 7600. Nonresident portions of the Monitor, such as the Command Decoder, are automatically called into core as needed by the system programs. 5.2.2 Starting the Monitor If the computer is turned off or stopped for any reason, the Monitor must be restarted at location 7600. This can be done by setting the switch register to 7600, pressing ADDR LOAD (EXTD ADDR, if necessary), CLEAR and CONT. If the Monitor is in the User mode, that is, a system program is running, CTR LlC may be typed to return to the Monitor mode. The rubout key may be used by the operator when his input command string is erroneous. 5-1 5.2.3 Bootstrapping the Monitor If the Monitor Head is destroyed for any reason (Monitor cannot be started), the Monitor must be bootstrapped into core; turning the computer off and subsequently turning it on again does not destroy the contents of core. Use the following procedure to bootstrap the Monitor into core: Procedure Step Toggle the following routine into core. 2 Address Contents Symbol 0200 0201 0202 0203 0204 7750 7751 6603 6622 5201 5604 7600 7576 7576 DMAR DFSC JMP .-1 JMP I .+1 7600 After toggling this routine into core, set switch register to 0200 and press ADDR LOAD, CLEAR and CaNT. 5.2.4 Monitor Error Messages If an illegal command string is entered, when the user types a carriage return, the Monitor responds with "?" to indicate invalid input. Error messages output by the Command Decoder are given in Table 5-1. Table 5-1 System Error Messages Message Meaning ? Illegal syntax or miscellaneous error condition D Directory on the systems device is full E Too many inputs or outputs were entered I No such inputs S System I/O failure Monitor time read or write errors cause a halt to occur. Persistence of this condition indicates a hardware failure or that vvrite lock is enabled on the system device, as the system I/O routine attempts to read or write three times before halting. 5.3 SYSTEM PROGRAMS The following I NDAC System programs indicate other readiness to receive information by typing either an asterisk or a query: .EDIT .PIP .COMP .LOAD .SPUT 5-2 The most common queries are: *OUT- Requests that the user specify one output device name. In the case of disk or DECtape, the filename to be assigned to the output data must also be specified. *IN- Requests that the user specify one or more (up to 5) input device names. For disk and DECtape, filenames of input files must also be specified. *OPT- Requests that the user specify one option or switch, entered as a single alphanumeric character; options available in each system program are described in system program descriptions (EDIT, PIP, COMP, etc.). * System program is ready to receive commands. The following paragraphs describe the use and operation of EDIT, COMP, and PIP which are needed to prepare the INDAC source program. The system program, LOAD, is also discussed. This program is not needed in preparing the source program. 5.3.1 Command String Format Command strings are composed of a few basic elements and follow certain rules of punctuation. To call a system program into operation and to give it necessary information, the following formats and conventions must be followed. 5.3.1.1 Device Names - Device names permitted in command strings are as follows. S: System device (disk or DECtape unit 0) R: High-speed paper tape equipment (reader or punch) T: Low-speed paper tape equipment on the Teletype (reader or punch) Dn: DECtape unit, if both disk and DECtape are present in the system (n = unit number, 0 through 7) 5.3.1.2 Filenames - Filenames are limited to four characters in length and can be composed of any combination of alphanumeric characters or special characters with the following exceptions. a. Imbedded spaces should not appear in a filename. * b. A filename cannot be one of the following words or symbols. CALL SAVE Extensions (n) to the filenames specified by the user are automatically appended by the system. They are used internally by the system and cannot be referred to or modified by the user. SYS (n) System program file in core bank n ASCII Source language program file (input to PAL-I Assembler or INDAC Compiler) BINARY Binary program file (output from PAL-I Assembler) Filenames (and extensions) are meaningful only for file structured devices (disk and D ECtape). If they are specified for other devices, they are ignored. Both the filename and extension name appear on directory listings produced by the list feature in PIP.** "'Note that the INDAC Executive is given the filename lOS; one reason for this unconventional use of an imbedded blank is to protect Executive from accidental destruction by the user (for example, deletion via PIP). **AF in example means VERSION A, change F. 5-3 Example: NAME TYPE AF PIP .SYS EDIT .SYS LOAD.SYS .CD. .SYS HGB .ASCII BLK (0) (0) (0) (0) (0) 0025 0016 0011 0007 0001 5.3.1.3 Punctuation - Punctuation within command strings is as follows. , (comma) Used to separate device names, when more than one is given in a command string. Terminates each device name. 5.3.1.4 Special Characters - Special characters are used as follows. tc If given while the system is in Monitor mode or while most system programs are running, control is returned to Monitor start (location 7600). Monitor responds with a dot. tc is typed by holding down the CTR L key and striking C. tc does not echo (does not print). 5.3.2 tP Typed in response to a t typeout. I nstructs the system to proceed with the next operation. tP can also be used to prematurely terminate certain operations while in progress (for example, the typing out of a file directory by the list option in PIP). tP is typed by holding down the CTR L key and striking P. tP does not echo (does not print). ) Carriage return terminates current command string input. When typed alone, in response to a system query, it indicates that the user does not desire to specify the item (for example, device name) requested. RUBOUT Causes the current command string to be ignored, and the system returns to the beginning of the command string and is ready to receive a new command. RUBOUT does not echo. Examples of Command Strings These following examples illustrate the elements and rules previously explained. Samples of both Monitor mode and System mode operation are given. a. Monitor Mode Commands: .EDIT) Call system program file, EDIT, from disk into core for execution .PIP) Call system program file, PIP, from disk into core for execution .COMP) Call system program file, COMP, from disk into core for execution b. System Mode Dialogue: *IN-S:PR02 , Use the file PR02 on the disk as the input file * I N-S:TST i,R:) Use the file TST 1 on the disk and one file from the high-speed paper tape reader as the input files ~ (continued on next page) 5-4 b. (cant) *OUT-S:SPEC) Write the output file on the disk and assign it the filename SPEC *OUT-T: ) Punch the output on the Teletype paper-tape punch *OPT-B Select option B 5.3.3 Editor The Editor (Disk System Editor) enables the user to generate and edit INDAC source programs on-line from the teleprinter keyboard. The I NDAC program may be either printed on the teleprinter, punched on paper tape using the high-speed punch, or saved on the disk as an ASCII file. To use the Editor, the user must call EDIT via the Monitor; this can be done only in response to a period. If a period is not present as the last system response, the user must type CTR LlC which should appear as follows: .EDIT) The Editor is transferred from disk into core and responds by typing: *OUTThe user selects one of the following output devices: (T:) for low-speed reader/punch; (R:) for high-speed reader/ punch; (S: name) for output to the systems device on a file called name and types his choice immediately after OUT-. If the specified device is not valid, that is, not declared when building Monitor, Editor will respond with an error message (refer to Paragraph 5.3.3.6) and return control to Monitor. Thus, the user must call EDIT and respond to *OUT- with a valid device. When Editor recognizes a valid device, it responds with *) (asterisk, carriage return/line feed) and * I N-, as shown below. * *INThe user now specifies the input device by typing T: ) , R: ) , or S:name ) or) in the same manner as when replying to *OUT-, above. The Editor now responds with: *OPTasking the user to specify one of the following options. B Preserve blanks. Editor normally replaces multiple blanks (spaces) with tabs, resulting in considerable saving of space on the system device. D Enter dynamic deletion mode if input is from the system device. As the file is read, it is deleted from the system device, thus allowing space for output if desired. (F ilename remains on the directory but without any assigned blocks.) C Combine the functions of Band D options. ) None of the above options; assume conversion of two or more blanks to tabs, and not D. After the user has specified one of the options listed above, Editor responds with a carriage return/line feed and asterisk. The entire printout might appear as follows. 5-5 .EDIT) *OUT-S:CLK 1 ) * *IN-T: ) * *OPT-B * * The appearance of the last asterisk in the preceding example indicates that Editor is ready to accept and operate on the user's symbolic program. The user may now type the symbolic program directly into core by using the A command. *A) To list a file called CLK1 with a new output file (CLK) declared, the command string and printout would be as follows: .EDIT) *OUT-S:CLK) * *IN-S:CLK1) * *OPT-B *R) *L) .STORAGE IA #1 .PHASE #10 DO SNAP #100 AT 15:00 PRIORITY 1 #11 DO SNAP #101 EVERY 1 SEC PRIOR ITY 2 .ACTION DO SNAP #104 PRIORITY 5 #104 .SNAP .PROCESS TIMER (START,#10) TiMER (START,#i ij EXIT #100 .SNAP #102 .FORMAT ("3:00:00 PM ALLS WELL") .PROCESS SEND (TTY,#102) EXIT #101 .SNAP #103 .FORMAT (0,1) .PROCESS LET IA=IA + 1 SEND (TTY,#103) IA EXIT .END 5-6 5.3.3.1 Modes of Operation - To distinguish between editing commands and the actual text to be entered in the buffer, the Editor operates either in Command mode or Text mode. In Command mode, all input typed on the Teletype is interpreted as commands to the Editor to perform some operation, or to allow the operator to perform some operation on the text stored in the buffer. In Text mode, all typed input is interpreted as text to replace, be inserted into, or be appended to the contents of the text buffer. After being loaded into core memory the Editor is in Command mode; that is, the program is waiting for a command. The user types the desired command code and terminates it by striking the carriage return (RETURN) key. This nonprinting character (represented by) ) tells the Editor to carry out the command. The Editor then enters Text mode and responds with a line feed character (represented by -.j,) as soon as it has processed the command and begun the operation. With the Editor in Text mode, the user types the desired corrections or insertions to his text. To terminate the text he enters a form feed (CTRL/FORM combination) to tell the Editor to return to Command mode. The Editor answers by ringing a bell to indicate the transition back to Command mode. 5.3.3.2 Input CommandsCommand R) Action and Explanation READ a page of text from the paper-tape reader or disk as specified. The Editor will read information from the input tape or disk until a form feed character (CTR L/FORM key combination) is detected. All incoming text except the form feed is appended to the contents of the text buffer. I nformation already in the buffer remains there. I n the case of input via the photoelectric reader, the end of the tape will be interpreted as a form feed and the Editor returned to Command mode, if an actual form feed character does not appear on the tape. I n the case of input via the Teletype reader, a form feed must be entered via the keyboard to return the Editor to Command mode, if an actual form feed character does not appear on the tape. If this is not done, the READ command is still in effect and all subsequent commands will be interpreted erroneously as text and appended to what was just read from tape. Any rubout encountered during a READ command will be ignored. (See RUBOUT.) A) APPEND the incoming text from the teleprinter keyboard to the information already in the buffer (the buffer may be empty initially). The Editor will enter the Text mode upon receiving this command and the user may then type in any number of lines of text. The new text will be appended to the information already in the buffer, if any, until the form feed (CTR L/ FORM) key combination is struck. By giving the APPEND command with an empty buffer, a symbolic program tape may effectively be generated on-line by entering the program via the keyboard. The APPEND command must not be used to read paper tapes from the Teletype reader since every rubout on the tape will delete a character. NOTE In both of these commands, the Editor returns to the Command mode only after the form feed character. 5-7 5.3.3.3 Output Commands - Output commands are subdivided into List and Punch commands. List commands will cause the printout, on the Teletype, of all or any part of the contents of the text buffer to permit examination of the text. Punch commands provide for the output of leader/trailer, form feeds, corrected text, or for the duplication of pages of an input tape. List or Punch commands do not affect the contents of the buffer. a. List Commands - The following commands cause part or all of the contents of the text buffer to be listed on the Teletype. Command L /I'\ Action and Explanation L!ST the entire page. This causes the Editor to !ist the entire contents of the text buffer. nL) LIST line n. This line will be typed out, followed by a carriage return and a line feed. m,nL) LIST lines m through n, inclusive. Lines m through n will be printed on the Teletype. The Editor remains in Command mode after a List command and the value of the current line counter is updated to be equal to the number of the last line printed. b. Punch Commands - The following commands control the punching onto paper tape of leader/ trailer, text and form feeds. Command Action and Explanation p) Proceed and output entire contents of the buffer followed by a form feed and return to Command mode. nP ) Output line n, followed by a form feed, return to Command mode. m,nP) Output lines m through n, followed by a form feed, return to Command mode. Process entire file (perform enough NEXT commands to transfer the remaining input to the output file) and create an end-of-file indicator (legal only for output to the system device). T ), '/1 TRAI LER. This command causes about 4 in. of blank tape to be punched. If using low-speed punch, turn punch off before typing command then turn on immediately after typing carriage return. N) NEXT. This is a utility command that combines the functions of four commands. it punches the contents of the buffer, punches some blank tape, a form feed and more blank tape, kills the buffer, and reads in the next page of text from the input device specified (that is, it executes P), K), R)). nN) Execute the above sequence n times. If n is greater than the number of pages of input tape the command will proceed in the specified sequence until it reads the end of the input tape, then it will return to Command mode. 5.3.3.4 Editing Commands - The following commands permit deletion, alteration, or expansion of text in the buffer. 5-8 Command Action and Explanation K ~' KI LL the entire page in the buffer. The values of special characters "." are set to O. The Editor remains in Command mode. nD) DELETE line n. Line n is removed from the text buffer. The numbers of all succeeding lines are reduced by one, as is the line count. m,nD) DELETE lines m through n, inclusive. The line following n becomes the new line m and the rest of the lines are renumbered accordingly. The value of the current line counter, ".", is equal to the number of the line preceding the deleted line or lines. The Editor remains in Command mode after all DELETE operations. nl) INSERT the typed text before line n, until a form feed (CTRL/FORM) is encountered. The-Editor enters Text mode to accept input. The first line typed becomes the new line n. Rubouts are recognized. Both the line count and the numbers of all lines following the insertion are increased by the number of lines inserted. The value of "." is equal to the number of the last line inserted. To re-enter the Command mode, the CTR L/FORM key combination must be entered to terminate Text mode. If this is not done, all subsequent commands will be interpreted erroneously as text and entered in the program immediately after the insertion. I) INSERT without an argument will insert text before line 1. nC) CHANG Eline n. Line n is deleted, and the Editor enters Text mode to accept input. The user may now type in as many lines of text as he desires in place of the deleted line. Rubouts are recognized during any CHANG E operation. If more than one line is inserted, all subsequent lines will be automatically renumbered and the line count will be updated appropriately. m,n C) CHANGE lines m through n inclusive (m must be numerically less than n). Lines m through n are deleted and the Editor enters Text mode allowing the user to type in any number of lines in their place. All subsequent lines will be automatically renumbered to account for the change and the line count will be upqated. II / " and After any CHANGE operation, return to Command mode is accomplished by entering a form feed (CTRL/FORM key combination) to terminate input. After a CHANGE the value of the current line counter, ".", is equal to the number of the last line of the change. Lines which are changed or deleted do not physically disappear from the buffer area, thus the space they occupied is not recovered upon completion of the command. This being true, it is possible to overflow the buffer by changing, or deleting and inserting lines. This possibility may be effectively eliminated by logically segmenting a program on paper tape into "pages" of 50 to 60 lines. This is done by punching groups of 50 lines followed by a form feed character (see output commands). There is a way to retrieve lost space in some cases by use of the SEARCH command (refer to SEARCH command which follows). m,n$kM) MOVE lines m through n inclusive to before line k (m must be numerically less than n, and k may not be in the range between m and n). Lines m through n are moved from their current position and inserted before line k. The lines are renumbered after the move is completed, although the value of the current line pointer, ".", is unchanged. Moving lines do not use any additional buffer space. (continued on next page) 5-9 Command . Action and Explanation m,n$kM ~ (cont) A line or group of lines may be moved to the end of the buffer by specifying k as 11/+1". Example: 1, 10$/+M). Since the MOVE command requires three arguments, it must have three arguments to move even one line. This is done by specifying the same line number twice. Example: 5,5$23M). This will move line 5 to before line 23. The Editor remains in Command mode after a MOVE command. G) GET and list the next line that begins with a tag or label. The Editor begins with the line following the current line (line .+1) and tests for a line which does not begin with a tab, slash, or a space. This will most often be a line beginning with a tag or label. nG) GET and list the first line after line n which begins with a tag. The Editor begins with line n and tests it and each succeeding line as previously described. Both G and nG update the current line counter after finding the specified line. However, if either version of the GET command reaches the end of the buffer before finding a line beginning with other than a tab, slash, or space, the current line counter retains the value it had before the GET was issued and a II?" is typed to indicate that no tagged line was found. The Editor remains in Command mode after a GET command. SEARCH line n for the character specified after the carriage return. Allow modification of line when character is found. The SEARCH command is one of the most useful functions in the Editor. It is also structured somewhat differently from the other Editor commands. After terminating the command nS with a carriage return the user has told the Editor to SEARCH line n, but he has not specified what to search for. The Editor is, therefore, waiting for the user to type a character. The character he types is taken as the object of the search but is not echoed. The Editor instead immediately begins typing out the specified line. After typing the character for which it is searching the Editor stops. All of the editing features are then available to the user. He may proceed using any of the following: a. Delete the entire typed portion of the line by typing "+-" (back arrow). b. De!ete the entire untyped portion and terminate the line and the search by typing) (carriage return). c. Delete from right to left one of the typed characters for each "\" (ruboutj typed. d. Insert characters after the last one typed simply by typing them. e. Insert a carriage return and line feed, thus dividing the line into two, by typing t (line feed). f. Continue searching to the next occurrence of the search character by typing CTRL/FORM. When typing stops all options are again available. g. Change the search character and continue searching by typing CTR L/ BELL followed by the new search character. Each time the Editor types the character for which it is searching, typing stops and all or any combinations of the above operation may be carried out. (continued on next page) 5-10 Command Action and Explanation m,nS) SEARCH lines m through n inclusive as previously described. The search character is input after the carriage return and all of the options are available. The only difference is in point b. Typing) (carriage return) delet~s the entire untyped portion and terminates that line, but the search continues on the next line. By typing CTRLlBELL to change search characters, ali editing of a single line may be done in one pass. Clearly, typing CTR LlBE LL twice will cause the search to proceed to termination, since the search character will now be BE LL, which is not stored in the buffer. An additional feature is availc;lble to the more sophisticated user: by typing S with no arguments the entire buffer may be searched for occurrences of a single character. It must be remembered, however, that as with every CHANG E command, every SEARCH command uses additional buffer spac.e for storage of the new line. This is obviously necessary, since the program can have no prior knowledge of whether the size of the line will be less than, greater than, or equal to that of the old line, and it must therefore assume that it will be larger. As the entire buffer is searched, a new image of the text is created in core that is guaranteed to occupy the same or less space than previously, since all deleted spaces have been removed. The Editor recognizes this and immediately moves the text image back to the top of the buffer space. Thus, the only prerequisite to condensing the text image is that there be enough core space left to contain another image of the edited text. 5.3.3.5 Special Characters and Functions - A number of keys have special operating functions. These keys and their associated functions are listed below. The nonprinting characters are noted; the symbols for these are shown in parentheses. All others echo the character in parentheses. a. tP (CTR LIP) - During output, processing stops and control is returned to the Command mode. b. tc (CTRLlC) - Always returns to Monitor. c. Carriage Return () nonprinting) - In both Command and Text modes, striking the carriage return key (RETURN) signals the Editor to process the information just typed. In Command mode, it allows the Editor to execute the command just typed. A command will not be executed until it is terminated by striking the RETURN key (with the exception of = which needs no)). In Text mode, it causes the line of text which it follows to be entered in the text buffer. A typed line is not actually part of the buffer until terminated by a carriage return. d. Back Arrow (+-) - The back arrow (+-) is used for error recoveries in both Command and Text modes. When used in Text mode, +- cancels everything to the left of itself back to the beginning of the line. The user then continues typing on the same line. When used in Command mode, +- cancels the entire command and the Editor issues a "?" and a carriage return/line feed (CR/LF), Back arrow cannot cancel past a CR/LF in either Command or Text mode. A+- ? (CR/LF) THIS +- "HERE IS A TEXT MODE EXAMPLE" (CR/LF) only the part in quotes is entered in the buffer e. Rubout (\) is also used in error recovery in both Command and Text modes with one exception. When executing a READ command from either the paper tape or Teletype reader, rubouts are ignored completely and do not go into the buffer. (continued on next page) 5-11 e. (cant) It is necessary for the READ command to disable the rubout function since all tab characters on paper tape are, for timing purposes, followed by rubouts which would destroy the tabs. Rubouts are not stored in the text buffer but are inserted by the Editor following all tab characters on the output tape. At any other time in Text mode (specifically if Text mode 'vvas entered via the APPEND,CHtU'JGE, INSERT, or SEARCH command) typing rubout echoes a back slash (\) and deletes the last typed character. Repeated rubouts delete from right to left up to, but not including, the CR/LF combination, separating the current line from the previous one. Example: THE QUUICK \\\\ ICK BROWN FOX (CR/LF) will be entered in the buffer as THE QUICK BROWN FOX When used in Command mode, rubout is equivalent to back arrow and cancels the entire command. The Editor then issues a "?" and a CR/LF combination. f. Form Feed (CTR L/FORM nonprinting) - Form feed signals the Editor to return to Command mode. A form feed character is generated by depressing and holding the CTR L key and hitting the FORM key. This combination is typed while in Text mode to indicate the desired text has been entered and the Editor should now return to Command mode. The Editor rings a bell in response to a CTRL/FORM to indicate the transition back to Command mode. If Editor is already in Command mode when CTR L/FORM is typed, no bell will sound. CTR L/BELL is equivalent to CTRL/FORM except in the case of a SEARCH command (see editing commands). g. Period (.) - The Editor keeps track of the implicit decimal number of the line on which it is currentlyoperating. At any given time the symbol period (.) stands for this number and may be used as an argument to a command. Example: . L) means list the current line .. -1,.+1 L) means list the line preceding the current line, the current line, and the line following it. After a READ or APPEND command, the current line counter (.) is the number of the last line in the buffer. After an I NSE RT or CHANG E command, (.) is equal to the number of the last line entered. After a LIST command, (.) is the number of the last listed line. After a DELETE command, (.) is the number of the line immediately before the deletion. After a KI LL command, (.) is O. After a GET command, (.) is the number of the line typed by GET. After a MOVE or SEARCH command, the current line counter (.) is not updated and remains at whatever it was before the command. h. Slash (/) - The symbol slash (/) has a value equal to the decimal number of the last line in the buffer. It may also be used as an argument to a command. Example: 1O,/L) means list from line 10 to the end of the buffer. i. Lint: Ft:t:d (,J, nonprinting, - Commands an:; terminated by a carriage retuiii/niie feed {CR/Lf} combination and the lines on each page of text are separated by a CR and LF. The user need only strike the RETURN key, however, to terminate a command or input line, since the Editor automatically generates a line feed to follow each carriage return. On input from paper tape, line feed characters are completely ignored. On output the Editor automatically punches a line feed following each carriage return. Typing a line feed while in Command mode is equivalent to typing ".+1 L) and will cause the Editor to type out the line following the current one and increment the value of (.) by one. II i. ALT MODE (ALT nonprinting; - Hitting the AL T MODE key (ALT MODE) while in Command mode wi!! also cause the line following the current line to be typed out and (.) to be incremented by one. If the current line is also the last line in the buffer, typing either ALT MODE or Line Feed will be answered by a "?" from the Editor indicating there is no "next" line. Some Teletypes have an Escape (ESC) key in place of the ALT MODE. The function is identical for ESC or ALT MODE. (continued on next page) 5-12 k. Left Angle Bracket «) - Typing Left Angle Bracket «) while in Command mode is equivalent to typing ".-1 L) " and will cause the Editor to echo < and then type out the line preceding the current line. The value of {.} is decreased by one so that it still refers to the last line typed out. I. Equal Sign (=) - The equal sign (=) is used in conjunction with the pointers (.) and (f). When typed in COrl?mand mode, it causes the Editor to print out the decimal value of the argument preceding it, followed by a CR/LF. I n this way, the number of the current line may be found (.=XXX), or the total number of lines in the buffer (/=XXX) or the number of some particular line U-8=XXX) may be determined without counting from the beginning. m. Colon (:) - Colon is a lower case character with exactly the same function as (=). n. Blank Tape and LeaderfTrailer - Both Blank Tape and LeaderfTrailer (code 200) are completely ignored on an input tape, as are line feed characters and rubouts. Line feeds and rubouts are automatically replaced wherever necessary on output; blank tape and leader/trailer are not. o. Tabulation (-+ nonprinting) - The Editor is written in such a way as to simulate "tab stops" at ten space intervals across the carriage. When the user holds the CTR L key and strikes the TAB key, the Editor produces a tabulation. A tabulation consists of from one to ten spaces, depending on the number needed to bring the carriage to the next tab stop. Thus, the user may use the Editor to produce neat columns on the hard copy. 5.3.3.6 Editor Error Messages - Editor will print an error message consisting of a question mark whenever the user requests nonexistent information or uses an inconsistent or incorrect format in typing a command. The question mark wi" be followed by a carriage return/line feed and the command wi" be ignored. If the computer halts at location 2330, a system error has occurred while reading from the disk. The user should, therefore, run the disk maintenance tests to determine the cause of the error. 5.3.4 INDAC Compiler After the I NDAC source program is prepared and saved on the disk or on paper tape using ED IT, the compiler is used to translate the INDAC program from ASCII (source) to vector (object) code for disk storage. To use the compiler, the user must call COMP via the Monitor. This can only be done in response to a period. If a period is not present as the last system response, the user must type CTR LlC, which should cause the Monitor to type the needed period. The printout should appear as follows: .COMP) The compiler is transferred from disk into core and responds by typing: *OUTThe user must then respond with the output device name and the filename to be given the compiler program. The device name wi" always be the disk (S:). The filename can be any four printing characters except the exclamation mark and the space. When the compiler recognizes the device and filename as valid, it responds with (*) (asterisk, carriage return/line feed) and *IN-, as follows: * *IN- 5-13 The user must now respond with the input device name and the filename given to the INDAC source program if it was stored on the disk during the Editing operation. The compiler will accept an input from the disk (S:) or the high-speed reader (R:). Because the INDAC source file is in ASCII and the object file will be stored on the disk as a system file, no conflict is caused by using identical names if the input file is on the disk. No name need be specified if the source file is received from the high-speed reader. Examples of the command strings for the two input methods follow: Disk Reader .COMP) .COMP) *OUT-S:TST1) *OUT-S:TST1 ) * * *IN-S:TST1) *IN-R: ) * * *OPT- ~ *OPT- ) t type CTR LIP in response to up-arrow. After the user responds to the input question correctly, the compiler types: *OPTThis question is asked to inquire if a listing of the entire compiled program and accompanying data is desired. A reply of L produces the list. No list is produced if the CR ()) key is pressed. NOTE Complete listings are lengthy and are normally used for system diagnostic purposes only. If the input file is on the disk, compiling starts when the CR ()) key is pressed. In the case of inputs from the high-speed reader, the user must then type CTR LIP in response to the up-arrow (t). If, during compilation, the system halts with a value of 07218 in the accumulator, there is no more room available on the disk. Remove some files from the disk, via PIP, and recompile the program. Any extra user files should be deleted. 5.3.4.1 Compiler Output - The compiler prints all system level variables, those items declared in the job-level storage statement, regardless of the option used following termination of the *OPT- command. The format of these variabies is: Variable name @ storage location The storage location addresses are required later to modify or inspect parameters by the Executive Command Decoder. A possible system level storage table would resemble the following format: IHR ES @ @ 1 IMIN 5 R @ @ 2 ISEC 8 PRES @ @ 3 IHR1 11 VPR @ @ 4 17 immediateiy after the storage variables, the compiier prints pairs of identical 4-digit numbers and then a final 4digit number, in the format: 0221 0162 0221 0342 0342 0162 1236 5-14 These numbers are SNAP and external subroutine level requirements that refer to the highest location used in each SNAP and SUB ROUTI N E segment. The row containing the three 4-digit numbers is always printed last by the compiler. The third number in the last row is the core address for the start of the user's system. The sum of the third number in the last row and the largest of the other numbers printed cannot exceed 66008 for an 8K system consisting of one Teletype. For each additional Teletype subtract 2008 from 66008 and, if FI LE is used, subtract an additional 2008 from it. Therefore, for a system composed of two Teletypes and FILE, the sum cannot exceed 62008 , !f the sum of the two numbers is greater than the calculated limit, the program must be rewritten to occupy less space in memory, by segmenting the largest SNAP into two SNAPS, for instance. After compilation is complete, control is returned automatically to the Disk Monitor System, as indicated by its reply of a period. 5.3.4.2 Errors During Compilation - If any errors occur in the user's source level program during compilation, the compiler prints an error message that consists of a number or a letter and a number. The error messages are printed out as they are encountered during compilation and are, therefore, interspersed with the system level parameters. Each error message is always followed by an address indicating exactly where the error occurs in the program. For errors found before the first program tag, the notation STRT is used; for errors found after the first program tag, the tag number is printed. The exact address is determined by the +n value printed after the tag, where +n means n statement down from the tag statement, E7 STRT+3 TEMP @ 01 ILOG @ 10 H2 #200+4 17 #600+1 0614 0614 5376 In this example, the first error is an E7 encountered three statements from the start of the program; the second error is an H2 located four statements from tag #200; and the last error is a 17 found one statement from program tag #600. Notice that the system level parameters TEMP and I LOG were printed as they were encountered in the program. Refer to Appendix 0 for the meaning of each error message. 5.3.4.3 Correcting Compilation Errors - The Editor is used to correct any errors in the INDAC program. Use the following procedure to correct the errors. Procedure Step Call the Editor by typing ED IT after Monitor's period printed after compilation. 2 Answer Editor's *OUT- with a new name to be given to the corrected program in the form S: filename. A different name must be used from that of the error containing ASCII program already on the disk. As when the user's program was loaded initially; the compiler will accept input from the disk or from the high-speed reader. If the high-speed reader is to be used as the input for the Compiler, the corrected I NDAC program must be on paper tape. 3 Respond to the Editor's *IN- with the present name of the program. Use the notation S: filename for the program stored on the disk with the errors. 4 Choose the appropriate Editor option for *OPT-; B is generally a good choice. 5 Type R) to cause the Editor to read in the first block (buffer) of the program. (continued on next page) 5-15 Step Procedure 6 If the exact location of the error is not known, type /L (slash and L) to list the last line of the first block. If the error is in this block, use the Editor commands to correct the error. 7 After the errors in the first block are all corrected, or if there are no errors in the first block, advance to the next block containing an error. Type N) to write the first block onto the device specified in Step 2 and to read in the next block. Type N) enough times to read in the program blocks up to the block containing the next error. The same technique can be used to locate the block containing the error, namely, type /L to list the last line of the block presently in the buffer. Use the Editor commands to correct all errors when they are located. 8 When all errors have been corrected and if output is not to the system device, type N until a? is printed, indicating an end-of-file condition. If output is to the disk, type E) to output the rest of the program to the disk. When all the errors have been corrected, the program must be recompiled. Be sure to use the new file name given to the Editor in response to the output question, Step 2, before correcting the errors. Most users may find it advantageous to call PIP to delete the incorrect file from the disk to save space. 5.3.5 PIP PIP (Peripheral Interchange Program) performs general utility operations, such as listing the contents of specified directories, deleting unwanted files from the system device, and transferring files between devices, and copying specified files. PIP enables the user to do any of the above operations merely by typing commands from the teleprinter keyboard. To use PIP, the user must call PIP via Monitor which can be done only in response to a period. If a period is not present as the last system response, the user must type tc, which causes Monitor to type the needed period. The printout appears as follows: .PIP) PIP is transferred from the disk into core and responds by typing: *OPTThe user now selects one of the following options. L List entire directory of device to be specified D Delete a file to be specified Aor) Copy ASCII file (destination and origin(s) to be specified) B Copy binary file (destination and origin to be specified) F Copy FORTRAN binary file (destination and origin to be specified) U Copy user file (file structured origin and destination to be specified) * S Copy system file (file structured origin and destination to be specified) * The user types only the option character, to which PIP immediately responds with a carriage return/line feed. The user does not terminate the line with the RETURN key; it-is a meaningful option. *User and system files may not be copied onto paper tape because they are core images and have no defined paper tape format. 5-16 If the user selects an option using any character other than one of those listed above, the option is illegal, and PIP ignores the request, types? (question mark), and asks for another option character. The output would appear as follows: *OPT-G ? *OPTThe L option lists the entire directory of the system device (disk) or DECtape on which a directory exists. For example, .PIP ) User calls PIP *OPT-L list option of the *IN-S: ) system device directory FB=0241 PIP types number of free (unused) blocks remaining on specified device NAME TYPE BLK AF PIP followed by filename and descrip.SYS (0) 0025 tion; for example, PIP is a system ED IT .SYS (0) 0016 program in field 0 and occupies 25 8 LOAD.SYS (0) 0011 blocks of storage .CD. .SYS (0) 0007 HELD.SYS (1) 0001 LE LD .SYS (0) 0001 SGEN .SYS (0) 0015 SPUT .SYS (0) 0012 When the user specifies the D (delete a file) option, PIP responds with *FILETYPE (A,B,F,U,S)where A, B, F, U, and S are legal options from which the user may choose; indicating ASCII, binary, FORTRAN binary (compiler output), user, and system program, respectively. Options F and U are not used in INDAC 8/2. If the user's reply is S ) , indicating a system file, PIP asks REALLY? PIP will not delete a system file unless the user answers by typing Y) (mean ing yes) to the question. Any reply other than Y) causes PI P to repeat the FiLE TYPE request. When the user types Y) , PIP responds with *INand waits for the user to specify the device and filename of the system file to be deleted. The printout would appear as: 5-17 *OPT-D Delete option specifying *FILE TYPE (A,B,F,U,S)-S ~ system file, user must reply REALLY?N) *FILE TYPE (A,B,F,U,S)-S ') with Y'), PIP repeats req uest, REALLY?Y) *IN-S:SGEN} PIP needs device and filename, *OPT- file is deleted and PIP asks for user replied correctly, the next option. When the file has been properly identified and deleted PIP returns to ask for another option. If filename SGEN, in the example above, had not been on the specified device, PI P would have ignored the request and typed a"?" before asking for another option. For example, SG EN is not the name of *IN-S:SGEN ') ? *OPT- a file on the specified device The user should not try to delete system files .CD. or LOAD. Options A, B, and S are used to transfer files from one device to another in the INDAC 8/2 System. When the user has requested any of these options PIP responds with *OUTand waits for the user to specify the destination or output file and, if the destination is disk or DECtape, the name of the file. For example, *OPT-A copy an ASCII file option *OUT-S:TST1 ') specifying the destination and filename Only one destination is legal; if the user specifies more than one, PIP will ignore the response, type the error message E, and return control to Monitor. For example, *OPT-A copy an ASCII file option *OUT-S: TST1, E PIP recognizes the comma, which is used to separate fi Ie names; control returns to Monitor NOTE The Land D options return to PIP's option request (*OPT-) when the user responds illegally, and all other options return control to Monitor. PIP indicates acceptance of the user's destination by responding with *, carriage return/line feed, and *IN-, and waits for the user to specify the input, that is, to state from where the input is to originate. An attempt to specify more than one input to any but the A option will cause PIP to ignore the response, type tne error message E, and return control to Monitor. For example, *OPT-S copy a System file option *OUT-S: TST1 ; specifying system device and filename * * IN-S: TST2, E PIP accepts user's destination input to system device, comma is used to separate device names control returns to Monitor 5-18 The A option will allow any combination of up to 11 ASCII input files to be merged into one output file in the order specified by the input list. The user, therefore, may write generalized subroutines as separate files to do his often repeated operations and then, by combining these with each specialized program before assembly, eliminate the need to rewrite such operations for each program. PIP acknowledges each legal input file by printing an *. If, however, the input file specified to any option is not found on the specified device, PIP prints I in place of the * and returns to the Monitor. For example, the file does exist; when the user types CTRL/P, copying begins *IN-S:TST1 ) *t *IN-S: TST2) I the file does not exist control returns to Monitor If the user requests the B option, indicating he wishes to copy a binary file but the filename he has specified appears as an ASCII file, it is not acceptable; therefore, PIP prints an I and control returns to Monitor. The user can ascertain file types by using the L option and checking the file directory. A summary of the copy features of PIP is presented in the following table. Number of High-Speed Option Input Files Disk DECtape Reader/Punch Teletype ASCII A 11 Yes Yes Yes Yes Binary B Yes Yes Yes Yes FORTRAN Binary F Yes Yes Yes Yes User U Yes Yes No No System S Yes Yes No No 5-19 Examples .PIP ) User calls PIP *OPT-L and requests the list option *IN-S: ) of the system device directory PIP types number of free (unused) FB=0111 blocks remaining on specified device NAME TYPE BLK e.g., PIP is a system program in field 0 AF PIP followed by filename and description; .SYS (0) 0025 and occupies 25 8 blocks of storage ED IT .SYS (0) 0016 LOAD.SYS (0) 0011 . CD. .SYS (0) 0007 HELD.SYS (1) 0001 LELD .SYS (0) 0001 SGEN .SYS (0) 0015 SPUT .SYS (0) 0012 .SYS (0) 0001 .SYS (0) 0001 .SYS (0) 0001 .SYS (0) 0003 .SYS (0) 000 1 COMP.SYS (0) 0022 OVAL.SYS (0) 0125 COPS .SYS (0) 0014 I OS .SYS (0) 0152 FILE .SYS (0) 0106 DDC .ASCII 0035 *OPT-D User requests the delete option and *FILE TYPE (A,B,F,U,S)-A) specifies type of file, A(ASCII) and *IN-S:DCC) device and filename; file is deleted *OPT-D User requests the delete option and *F:U: TYPC{A,S,f,U,S}-S) specifies type of file, S (system} REALLY?Y) (PIP double checks); Y is only the meaningfui answer *IN-S:SGEN) User specifies file and filename; file is deleted *OPT-L User requests list option *IN-S: ) and system device directory, FB=0163 Note increase of 528 free blocks (see above) (continued on next page) 5-20 NAME TYPE 8 LK AF PIP .SYS (0) 0025 EDIT .SYS (0) 0016 Note removal of two files: ASCII file DDC LOAD.SYS (0) 0011 .CD. .SYS (0) 0007 and System file SGEN HELD.SYS (1) 0001 LELD .SYS (0) 0001 SPUT .SYS (0) 0012 .SYS (0) 0001 .SYS (0) q001 .SYS (0) 000 1 .SYS (0) 0003 .SYS (0) 0001 COMP.SYS (0) 0022 OVAL.SYS (0) 0125 COPS .SYS (0) 0014 lOS .SYS (0) 0152 FILE .SYS (0) 0106 *OPT-D User requests delete option * FILE TYPE (A,8,F,U ,S)-S ) REALLY?N; Y is only response for deletion of *FILE TYPE (A,8,F,U,S)-S) a system file; other responses REALLY?W) cause PIP to repeat the file type *FILE TYPE (A,8,F,U,S)-S) request REALLY?Y) *IN-S:I OS) Even if user responds to R EALL Y? ? *OPT-D *FILE TYPE (A,8,F,U,S)-U with Y, PIP will not delete the *IN-S:NONE; ? *OPT-D PIP knows NONE is not an existing Executive user filename on the system device and indicates by typing? *FILE TYPE (A,8,F,U,S)-A) User requests ASCII file option *IN-S:EDIT) PIP also knows when the filename ? *OPT-D and file type do not match; EDIT is a system program *F!LE TYPE (A,B,F,U,S)-B) *IN-S:EDIT) ? *OPTMerge, into an ASCII file on disk "TST1", one tape from the reader, one tape from the Teletype, one file from disk called SRC, and one file from DECtape 7 called SRC1. 5-21 *OPT-A *OUT-S:TSTl ) * *IN-R:,T:,S:SRC,D7:SRCl ) * * * *tttt (type CTR LIP after each file) *OPTCopy the system file PIP from disk to DECtape 3 using filename PIPX. *OPT-S *OUT-D3:PIPX) * *IN-S:PIP) *t (type CTRLlP) *OPTTry to merge two binary files onto disk called BIN from paper tape. *OPT-B *OUT-S:BIN) * *IN-R:,E (list exceeded) Try to copy an ASCII paper tape from high-speed reader, a nonexistent file from DECtape 5, and a paper tape from Teletype to high-speed punch. *OPT-A *OUT-R) * *IN-R:,D5:FOO,T:) * (R: accepted as legal) (D5:FOO rejected, no such file on D5:) 5.3.6 Loading Programs - Disk System Binary loader The Disk System Binary Loader takes as input the binary coding produced by the PAL-I Assembler or other DEC assemblers and loads it into core in executable form. When loading is completed, Loader "disappears" after first entering the loaded program at the starting address typed by the user just prior to loading. Loader accepts input from the system device or paper tape. 5.3.5.1 Binary Loader Operating Procedures .LOAD) Direct Monitor to print Binary Loader from the system device into core for execution. (continued on next page) 5-22 Loader requests source of input(s). Type one or more device names, separated by commas. If an input device is a file-structured device, include filename(s). *IN- Up to five files can be specified. Examples *IN-R:) I nput one tape from the paper tape reader. *IN-R :,R:,R: ) I nput three tapes from the paper tape reader. *IN-S:INPT) Input the file INPT from the system device. *IN-S:BIN2,R: ) Input the file BIN2 from the system device and one tape from the paper tape reader. *IN-S:BIN 1,S:B IN2 ~ Input the files BIN1 and BIN2 from the system device. * If device(s) are valid and filenames (if any) are actually found on the system device, Loader responds with one asterisk for each correct input. *ST= Loader requests the starting address to which control is to be transferred when loading is completed. The address is typed in the form fnnnn where f = field number 1 (omitted if field 0), and nnnn = location with field. Examples *ST=) Load into field O. *ST=76(0) Return to Monitor after loading. *ST=O ~ *ST=30225 ) Load into field 3. Jump to location 255, field 3, after loading. *ST= 10000 ) Load into field 1. Return to Monitor after loading into field 1. Loader now types a series of up-arrows, one at a time, as explained below. Following each up-arrow typeout, the user is required to perform one or more actions. tt First up-arrow: Loader is ready to load. If paper tape input, put the tape in the reader. Type tP.2 Second up-arrow: End of pass. Type tP to jump to previously specified starting address. (continued on next page) l The f-digit forces Loader to start loading into the specified field until a "field setting" is found in the input file or tape. 21f Teletype paper tape equipment is used, type tp before turning on the reader. 5-23 tt (cont) Multiple Input Files An up-arrow is typed out as the processing of each input file is completed. If paper tape input, insert the next file in the reader and type tP. Repeat the above step until all files given in response to the *! N- request have been processed. After all files have been entered, type tP to jump to the previously specified starting address. NOTE After each input paper tape is read, the high-speed paper tape version of Loader loops until the user types tP to continue. At this point, Binary Loader disappears and control is transferred to the previously specified starting address. 5.3.6.2 Binary Loader Error Messages - An illegal checksum error condition causes Loader to type "?" and return to Monitor after the user types tP or te. Error messages for illegal filenames or devices are as specified in Paragraph 5.2.5. 5-24 CHAPTER 6 EXECUTING THE PROGRAM After the I NDAC source progra.m is compiled error free, the object program is stored on the disk as a system file. SPUT, the system-put-together program, converts the object program into absolute disk format so that the I NDAC Executive can locate and execute the source program at the most efficient speed. After converting the source program, SPUT bootstraps the Executive into core. The Executive performs scheduling, interrupt control, disk/ core management, input/output, handles operator terminal communication, and executes the compiler generated code. Once bootstrapped into core, the Executive waits for the operator to start the program by giving it a specific run command. These commands are interpreted by the Executive Command Decoder which can be called by typing CTRL/A on any command console. After the run instruction (CTRL/D R # [Phase tag]) is given and the Command Decoder is released, the console reverts to the system mode. The only way the Command Decoder can be called again is via the I NDAC program placing the console in the operator mode with the command mode permitted. Then, the operator may call the Command Decoder to inspect and/or modify system level parameters without interfering with the execution of the INDAC program. The INDAC object file is stored on the disk only after error-free compilation, as indicated by the compiler printout. Before running SPUT, make sure that no SNAPS are too large to be run (refer to Chapter 5 for details). After the compiler finishes with its printout, it will release control to the monitor which then types the monitor period. The user may then cal! SPUT by typing: .sPUT) SPUT is transferred from disk to core and responds by typing: * INThe user must now respond with the input device name and the file name given to the I NDAC object program during compilation. SPUT will only accept an input from the disk (S:). When SPUT recognizes the device and file name as valid it responds by typing: *FILE START XXXX EXEC LOADED The Executive is called directly by SPUT and only the name given to the object program file during compilation needs to be specified. SPUT types a decimal block number after *F I LE START indicating where the file may start. This information is useful when more than one job is to be run and data collected and stored in the FI LE by one job is to be used by another job. Different jobs usually vary in size and therefore the start of the F I L E area will be different. Therefore, to run two related jobs where the FILE is used, the start of the file must be changed for the shorter job to eliminate the conflict. The start of the file can be changed under the control of the Executive Command Decoder in the same way the system level variables printed by the compiler can be changed. 6-1 After the Executive is called into operation, indicated by SPUT typing EXEC LOADED, system level parameters may be altered and/or the job can be started via the Executive Command Decoder. To interact via the Command Decoder, a Teletype must be in the command mode. Any Teletype may be a command Teletype. To attach any Teletype to command mode, type CTR L/A. If an tA is echoed, the Teletype is now in command mode. A Teletype is released from command mode by typing CTRL/P and the RETURN key. Commands to the Command Decoder are terminated by typing the RETURN key. A RUBOUT deletes the last character in the current line and echoes that character; when no character is echoed, no characters remain in the line. An entire line may be deleted by typing CTRL/U. The Command Decoder has two basic operations: value modification and run commands. Value modification, initiated by CTR L/V, executes interlaced; that is, phases are allowed to execute when the Command Decoder is not processing commands. System level variables, including the FI LE START parameters, may be displayed and modified while the system continues to execute. The run command processor, initiated by CTR L/D, can flag phases for running. A run command, in the form tD R#n, is used to flag the phase n, where n is the phase tag, for execution. When the user types the RETURN key, the system begins to execute the flagged phase and will release the command Teletype to the system output mode (refer to Appendix H for a list of the available commands and their meanings). Such a series of commands appears as follows on the Teletype: tA *tDR#l) (CTRL/A) Typing CTRL!V indicates to the Command Decoder that some value changes are going to be made to the system level variables. There are four number systems available for examining and modifying the contents of a particular variable in memory. Abbreviation Variable Type clock C System Clock Number System octal 0 Integer decimal D Integer p.xponential (floating-point) E Real It may be helpful to remember that for access to memory you have a memory "CODE". The combination of floating-point and integer arithmetic provides increased data acquisition capability. For an integer variable, one whose name starts with an I, such as IMIN or ISEC, decimal or octal numbers are used for inspection. For a real variable, one whose name does not start with I, such as VPR, exponential numbers must be used. To examine a particular storage variable, type the abbreviation for the number system to be used and the storage location number of the variable (the number after the variable's name in the storage table printed by COMP). For example: *tVD 3 +0003\+0000, ) *E17 +0017\+O.350000E-0002, The Executive types the storage iocation number, a back slash, its present value, and a comma. 6-2 To change the present value in a location, simply type in the new value after the comma is printed. A carriage return typed after the new value closes this location, leaving it with the new value. A line feed after the new value closes the location with the new value and then types the contents of the next location. If the present value in a particular iocation is not to be changed, but the user wants to check the next storage location, a line feed will cause the next location and its contents to be printed out in the same format and same number system as above. The value of the new location can then be changed after the comma is printed. NOTE The F IL E START parameters are located at 0-1, 0-2 and 0-3; they reflect the respective base of FILE addresses for FILE #1, #2, and #3. These addresses refer to the disk page address beginning at 0 for disk O. The locations may be called in their appropriate number system(s) in any order. For exponential notation, a number may be entered with or without the power of 10 portion. For example: *E21 (line feed) +0021/+0.230000E-0002 +0024/+0.105000E-0001, +0027/+0. 780000 E-0003, (line feed) .01035 73E-5 (carriage return) The first location number, 21, was called by typing E21 and no changes were required, so a line feed was typed to examine the next variable. Note that the next location number has been increased by a value of 3. This is because each exponential (floating-point) number requires 3 memory locations for storage. Location 24 required a change which was incorporated by typing in the new value in decimal point notation. The new !'1umber will internally be changed to exponential notation. A line feed now causes another three locations to be advanced (still using the exponential number system) and this time a variable was entered followed by a power of 10 exponent. These variable changes are automatically performed while the system is running by starting the value change sequence with CTRL/V and then typing the appropriate number system abbreviation and storage location variable after the response of a period. Clock mode allows the user to inspect the value of the system clock and to preset to the time of day. Typing tc will display the system clock in "HH: MM: SS," and open the clock for modification. The system clock is closed by) , or preset by XX:YY:ZZ) . *tvc CLOCK 0: 1:35,12:15:00 After the system is started, the keyboard is locked and will respond to the CTRL!A command only if the system designer opens the console (command mode permitted). All of the possible CTR L commands are listed below: CTRL!A Attach this Teletype to command mode CTRL!C Return to Monitor (available only if not disabled by GENDAC) CTRL!D Initiate a "RUN" command CTRL!V Initiate a value change CTRL!P Return to operator mode CTRL!U Delete this line (start line over) If the same program is to be used again, only SPUT need be called because the program has already been compiled. Follow the same procedure for calling SPUT as already specified. Note that this may not apply if FILE is used. 6-3 CHAPTER 7 MODIFYING THE SYSTEM 7.1 INTRODUCTION The I NDAC Compiler (CaMP) is unique among compilers in that the source-level language to be processed has been defined in tables. While this feature alone is not exceptional, the fact that these compiler tables may be modified by the user is unique. The tables are called System Communication Tables, and they define, to the different programs in the INDAC system, the location of code, the names of devices, the disk areas, and other system parameters. It is the function of G ENDAC to interact with these tables (under user direction) and to update certain disk images to incorporate additions or modifications to the INDAC system (see Figure 7-1). GENDAC is a conversational program that accepts one or more formatted paper tapes called library tapes and/or accepts one or more disk images developed by the user. The entire acceptance or rejection procedure is under operator control through the Teletype keyboard. 7.2 SYSTEM COMMUNICATION TABLES These tables provide the basic intercommunication link between the various component programs in the I NDAC System. They are updated by G ENDAC to contain all data relevant to the use of library routines within the system. These tables are described in the following paragraphs. 7.2.1 I ntrinsic Functions (I F) The (I F) table contains the vector locations of the intrinsic functions of the I NDAC language (the Executive routines that resolve the GOTO statement, the + in arithmetic statements, the DO statement, etc). The (I F) table is a by-product of the Executive Assembly and contains addresses generated by the assembler. In the INDAC System, the user is permitted to update this table (using G ENDAC) to include certain core-resident functions in the INDAC Executive. Highly repetitive functions, such as bit shifting, thumbwheel input conversion, and output digital formatting, can be made core-resident parts of the language to save the overhead time of continual disk accessing. 7.2.2 External Subroutines SYSTEM PUTTOGETHER CONFIGURE COMMTABLES EXEC DISK IMAGE RUN TI ME EXEC FIELD 1 FIELD 0 08 -0 657 Figure 7-1 System Communication Tables - Interaction 7.2.3 System Devices (SO) The (SO) table contains the atphabetic names and definitions of all system hardware devices and pseudo-devices (see Appendix I). The INDAC Compiler uses this table to resolve all device requests such as the following: GET (KEYS) IA SEND (TTY, #101) IClK GET (CLOCK) IClK 7.2.4 Core Map (CM) The (CM) table contains the core map of the Executive areas available for user insertions. This table is also generated through the assembly of the I NDAC Executive. This table contains, for each page of core, the first address and the number of words available on that pcge. 7.2.5 Page Zero (PZ) The table is one page in length and becomes Page 0 of Field 0 in the INDAC Executive during runtime. This page is updated and supplied by the Compiler as part of each compiled INDAC program. During the loading of the program, the page 0 table overlays the INDAC Executive page o image. For this reason, no direct modification of the disk image of Executive page 0 is possible. 7-2 7.2.6 Special GENDAC Table (**) GENDAC creates a special table (**) for its processing that contains tags, fixups, and entry points to support the "Iinking loader" function. This table is created for each separate run of GENDAC and exists for that run alone. 7.3 UPDATING THE SOFTWARE The I NDAC Compiler does not produce PDP-8 assembly-level code. The Compiler produces, instead, what we shall call"vector" code. While most compilers producing an interpretive code point to a location in a table that, in turn, gives the location of the desired information in core; the INDAC Compiler's vector code points directly to the desired core location by using the (IF) table. Vector code is a highly compact form of information, allowing the INDAC Executive to receive its commands in an abbreviated form, and thereby reducing the time required to retrieve commands stored on disk and the time required to "interpret" normal interpretive code. The I NDAC Executive contains routines to process arithmetic and logical operations, routing, 1/0, timing, and other system functions. The Compiler supplies the vector code to call these routines into action, based on the resolution of INDAC source-language statements. Two kinds of code appear in core while the Executive is operating: a. Vector Code: The command-level code produced by the INDAC Compiler and used by the Executive to run the system. b. PAL-I Assembly Code: The operating-level code performing the functions and commands specified by the vector code. GENDAC can process both the vector code and the assembly-level code. Generally, vector code is a product of the INDAC Compiler and appears as a disk image; however, provision has been made to allow the user to produce his own vector"code and to direct GENDAC to include this code in the system. The provision also exists for a user to create a new INDAC EXecutive function in the PAL-I code and to call this function into action through a new (user-created) vector command. To more fully understand the vector code that the Compiler generates for source-language statements, code a simple INDAC program and run the Compiler under the List Option, as shown below: .COMP *OUT-S:TEST *IN-S: TEST *OPT-L Paragraph 7.6, on Coding Details, contains the specifications and functional descriptions for each of the vector commands. 7.3.1 " System Mode of Updating The I NDAC Compiler produces vector code as a normal part of its operation in compiling a program. Since GENDAC can process vector code, and since the Compiler can generate vector code, there ought to be some method of combining both capabilities so that code generated by the Compiler could become defined to the Compiler for future referencing. This would ensure that the next time the Compiler is run, the code previously generated can be referenced in source langauge. The provision to define previously compiled code to the Compiler is known as the System Mode of Updating and can only be done when adding disk-resident subroutines. The procedures are summarized as follows. 7-3 Step Procedure Generate an I NDAC program that consists of only one subroutine. This I NDAC program is then compiled, using the INDAC Compiler. 2 Run GENDAC, using the liS" ("System") option. Assign a particular name to the subroutine, give the current name of the compiled subroutine, and other pertinent information as requested by G ENDAC via the Teletype keyboard. 4 GENDAC updates the appropriate system tables with the new name and moves the image of the subroutine to an area of the disk selected by a G ENDAC algorithm. 5 Refer to the processed subroutine code with the I NDAC statement: DO aaa where aaa is the name of the subroutine just processed. 7.3.2 Binary Mode of Updating GENDAC operates in a second mode, termed the Binary Updating Mode. In this mode, GENDAC expects to find a formatted binary image produced by the PAL-I Assembler either as binary paper tape(s) or as binary disk image(s). In Binary Mode, the user can elect to manually simulate the INDAC Compiler output (vector code), develop complete assembly language routines, or produce some hybrid code, making use of the conveniences of both. GENDAC requires information to update the System Communication Tables and disk images. One part of the information is the actual code for the library routine. Additional information is needed to define: a. The function of that code (subroutine, device handler, function) b. The area within the Executive that the code may exist c. The information that the code is to be considered a disk-resident function or subroutine external to the INDAC Executive image. STRUCTURE OF A BINARY IMAGE IDENTIFYING INFORMATION USER CODE IDENTIFYING INFORMATION Because GENDAC sees only an assembled binary image, a technique for dividing and identifying code and information is required. G ENDAC requires a specific set of origin declarations (*76XX, *7777) and FIELD declarations to separate and identify the library routines to be processed. Because these declarations are assembled by PAL-I as distinctive binary images, GENDAC is able to interpret them as declarations to separate and identify information and code. These declarations, therefore, are not to be considered origins for code or data, they are merely identification codes. (See Figure 7-2.) 7-4 PAPER TAPE BINARY IMAGE x x x x x x ............................ x X X x x x x x x x x x tf LEADER/TRAILER~ ORIGI N x ·~~FIELD CHANGE 08-0671 Figure 7-2 Paper Tape Binary Image 7.4 LIBRARY STRUCTURE G ENDAC Library Tapes may contain subroutines, functions, and I/O device handlers; the tapes may be in the form of punched paper tape or disk binary files. Library tapes consist of blocks of code referred to as "modules." 7.4.1 Basic Module A module is a disk-resident or core-resident code that is assembled and located as a single unit. To identify these modules to G ENDAC, the "type" of module (core or disk, function, subroutine, or device handler, etc.) is specified and linkage information and other pertinent system data is provided. The following PAL-I Assembler pseudoops are used to provide information regarding modules to G ENDAC: *76XX *7777 FIELD X Because this area in core is prohibited (Monitor Bootstrap), these origins are considered by GENDAC to be descriptive information. The following origin numbers have English word equivalents (Equates) that are used in coding the modules: 7600= GROUP 7610 = OLDMOD 7620 = NEWMOD 7630 = CA LMO D 7640= ENTRY 7650= CODE 7660 = FIXUP 7777 == ENDGRP Disk-resident modules are used for subroutines and functions and must be one page of code or less to be loaded by GENDAC. During Executive run-time, disk-resident modules are called into core when needed for execution and are placed into one of two (foreground/background) system buffers. Each such module contains one or more entry points defined in the (XS> table, for use by the compiler at compile time. Core-resident modules are used for functions and device handlers. Each relocatable, core-resident module must be one page of code or less if coded in PDP-8 machine code, or two pages or less if coded in I NDAC vector code (all vector code must reside in Field 1). 7-5 7.4.2 Extension Modules Each function or device handler can be constructed from several modules, if necessary. This set of functional modules is considered a "functional group". I n each case, one module contains the basic entry point(s) to the routine as named in the (SD) or (XS) system table, while the remaining modules are "extension" types. The module containing the entry point must be loaded by G ENDAC into the appropriate part of Field 0 according to its purpose, that is, whether it is a function or device handler. Any modules loaded, in addition to the initial module, as part of a core-resident function or device handler must be loaded by GENDAC and may contain an "extension entry point," named in the G ENDAC (* *) table, in order that the modules may reference each other. These modules need not be loaded into prespecified core locations. The user can specify the absolute location of any core-resident module or can allow G ENDAC to allocate any relocatable code according to its function and the current (CM) table. The modules of an inter-related group are bracketed on a library tape between a *7600 and a *7777 code; the entire group can be omitted (optionally) from any given GENDAC run. The *7600 is followed by a userformulated text comment, which GENDAC types as the tape is read. The operator determines whether the group is to be loaded or bypassed. For example, consider the following code: *7600 TEXT 'ADC' When the above code is encountered on a library tape, GENDAC recognizes that it has encountered another library routine (*7600). G ENDAC then types: ADC?At operating time, the operator replies yes or no, depending on whether the routine is desired. 7.4.3 Call-Up Modules If an extension module is common to each of several library routines, and the user desires to have G ENDAC load the module only if one or more of the routines requiring it has been selected for loading, then such an extension module is defined as a "call-up" module. A definition of its allocation requirements, and a specially flagged entry in (**) must then precede all modules that may reference it. The actual body of code (together with any necessary global definitions) must follow all referencing modules. 7.4.4 Add itional Notes To insert an entry into a system table (either (SD> or (I F») pointing to code already present in the INDAC Executive, but omitted from the table, a pre-existing module may be declared with a *761x to avoid having G ENDAC load the code again. The special entry declaration *7642 is used to extend the Executive I/O interrupt skip-chain. It may be used only once in a module (any Field 0 module) to point to the first device skip lOT in the module. The last device skip lOT, of one or more in the module, must be followed by a jump indirect through the first word of the module. GENDAC inserts a connection address into the first word of an I/O interrupt module, joining that module into the interrupt skip-chain. The last module in the group points to a system error routine; thus, if no module responds to the interrupt, the interrupt chain defaults to the system error routine. 7-6 (This page intentionally left blank.) 7-7 · IIEQUATES FOR GENDAC GROUP=1600 OLDMOD=7610 NEWMOD=7620 CALMOD=1630 ENTRY=7640 CODE=1650 FIXUP=1660 ENDGRP=1111 TEXT 'SPECIAL DEVICE HANDLER' IIFUNCTIONAL GROUP DECLARATION *GROUP TEXT 'MY DEVICE' TEXT 'SPECIAL DEVICE 1013 MOD 2' IIPHYSICAL DESCRIPTION OF MODULE *NEWMOD 4 IREQUEST FOR 1-0 MODULE ALLOCATION *215 10RIGIN WITHIN PAGE (DETERMINED FROM TABLE> LAST-MYDEV+l ISET UP LENGTH OF MODULE IlLOGICAL DESCRIPTION OF MODULE 1 INUMBER OF ENTRY POINTS WITHIN MODULE *ENTRY 3 IDEFINING AN 1-0 HANDLER ENTRY POINT TEXT 'MYDEVICE' INAME THAT COMPILER WILL RECOGNIZE o IRELATIVE ENTRY POINT WITHIN MODULE 2000 IBIT PATTERN FOR "GET" DEVICE 6361 IIOT CODE FOR DEVICE o INO CONTROL WORDS IIACTUAL CODE OF MODULE *CODE TEXT '[MY]' fv.YDEV, DEV2, *215 CALL SETUP CALL DATA JMP IINITIALIZE THE DATA ROUTINE NOtvcOR SKP NOMOR, LAST, SYSOUT DCA ADOR 6362 DCA 1 ADDR Jt"'P DEV2 CALL DEVRET IGET THE ADDRESS OF THE DATA ITEM lEND OF DATA LIST IINTEGER RETURN IREQUEST FOR REAL VAkIABLE-ERkOR IHOLD ADDRESS IGET DATA FRO~ DEVICE ISTORE DATA-NOTE DATA FIELD SET TO ONE ON ENTRY IGET NEXT ADDRESS IRETURN FROM DEVICE HANDLER IIFUNCTIONAL GROUP TERMINATION *ENDGRP lEND OF r-'tODULE GROUP FOR MYDEV ICE * 7-8 7.5 LIBRARY TAPE FORMAT The G ENDAC Library Tape Format is graphically represented by the following diagram. A typical library tape comprises the elements indicated. (----------------~ LIBRARY TAPE HEADER MODULE HEADER LIBRARY TAPE MODULE MODULE HEADER MODULE 7.5.1 Definitions The library tape is coded with PAL-I origin definitions of 76xx for communication purposes. Because this area is prohibited (Monitor Bootstrap), these origins are considered by GENDAC to be descriptive information. The equate statements listed in the Teletype example provide an English word equivalent that is more descriptive than the origin number. Refer to the coding sample shown on the foldout in the subsequent discussion. Gk (; 1JP =7 6(71 C OLCWOD =761 () NF !:i ~.n (I n 7 f, 2 vl CAU';OD =7 630 = ENTRY=76L;0 CCDE=765(1 FIXUP=7660 A PAL-I coded line such as: *ENTRY 3 results in *7643 as an assembler output. 7.5.2 Library Tape Header The first element of the G ENDAC Library Tape Format is the title for the entire library tape. With the PAL-I pseudo-op TEXT, the user creates a title for the tape as follows: TEXT 'TITLE OF TAPE' or 0 if no title is desired. 7-9 7.5.3 Module Header The header data for modules is dea~t with in subsequent paragraphs and consists of the following: Functional Group Declaration .............. Defines a group of related modules (basic entry, *GROUP extension, and call-up, which can be selected or bypassed). Module Declaration Physical Description ................. Declares the type of module and storage allocation requirements. *OLDMOD Y *NEWMOD Y *CALMOD 2 or 3 Logical Description .................. Declares the purpose of the modu Ie, and conse*ENTRY quently what system communication tables are to be updated. 7.5.3.1 Functional Group Declaration - This data defines a group of modules, all of which may be either se- !ected for !oading at GENDAC run-time Qr bypassed at the user's discrp.tiQn, A functional group begins with a *G ROUP code and contains a description of the module to be printed at run-time. For example: / '[ F XT 'r'" y TF"T '~~H~IAL I) ~ \) Ie!:. ' DE\/lCF lPk,(STC'AL.DESGkI~JJ: (5 N" lVil3 ["CD!::' or' '.~i(;;Dui:E' 4··lKEb}.tJR~·rF.nt<,.·,1·~n ,*;315 M~f) I;J~'li: ~~'-;"'-;''--'''~~~~22l~~~ 7-10 The *GROUP code indicates to G ENDAC that it has come to a new group. When the tape is read into the computer by GENDAC, the following is typed on the Teletype: MY DEVICE?At this point, the user indicates whether or not the group is to be included in the system at this time. If the operator requests additional information about the group (by typing "I"), the Teletype output at this point appears as follows: MY DEVICE? - I SPECIAL DEVICE 1013 MOD 27 Now the user must answer either "Y" if the group is to be included or "N" if it is to be bypassed. There may be more than one line of text to be printed out as a description of the group. This is done by supplying the material on subsequent lines with a TEXT pseudo-op for each line. All such descriptive material is printed when and if "I" is typed by the operator. 7.5.3.2 Module Declaration - This data consists of two units of information: a. A physical description of the module, defining the allocation requirements. b. A logical description of entry point(s) within the module. There may be one or more such logical descriptions. 7.5.3.2.1 Physical Descriptions of Module - The first information to be placed after the Functional Group Declaration is one of the following module definition codes. Definition Code *OLDMOD Y The module is already core-resident, and Y cannot be O. *NEWMOD Y The module is being supplied for addition to the INDAC System. The module may be a basic entry module or an extension module. *CALMOD Y A call-up module (where Y=2 or 3) is being defined at this point. This call-up module is some form of common routine and is to be loaded only if a request is subsequently made for this module. The "Y" in the module definition codes above defines the allocation requirements of the module and is described in Table 7-1. The allocation code is followed by a set of parameters that depend on the chosen value of Y. Table 7-2 lists the various parameter codes to be used. The user should insert the codes in the order listed, depending on whether the type of moduie being handied beiongs to the moduie type iisted (the vaiue in the aiiocation codeL if the code is required, the correct sequence must be observed. 7-11 Table 7-1 Allocation Codes YCode Resident Area Relocatab ility 0 Disk - 1 Core Nonrelocatable 2 Core By page 3 Core By word 4 Core By page 5 - - 6 Core By page Function 7 Core By word Function Add itional Information External subroutine or function User specifies absolute origin User specifies page origin I/O handler only Illegal Table 7-2 Allocation Parameters Module Types Actual Code Used 1,2,3 FIELD X Reason for Code Where x may be 0 or 1. FIELD 1 is required for any module written in vector code in an 8K system. FIELD 0 is required for any module containing a *7642 interrupt-chain extension. II 1 *XXXX Where XXXX is the absolute core origin of the module. (XXXX may not be in page 0 or of the form 76XX or 77XX.) 2,4,6 *OXXX Where *OXXX is the origin within the page. All page-relocatable code must be assembled in page 200 - 377. 3,7 - All word-relocatable code must be assembled in pages 200 - 577, and *200 should begin the body of code. All cases except 0 II XXXX - Where XXXX IS tne size of the module In word~. There is a maX imum of one page for absolute, call-up, and page-relocatable modules; a maximum of two pages for word-reiocatabie moduies (except call-up); exactly one page is assumed for disk-resident modules. ~ I n the following example, the physical description of the module, the origin within the page is arbitrarily selected as *275. I n practice, the ESUP (Executive Support) program would be run against the current core map (CM) and an address chosen based on the available core. 7-12 NOTE The size of the module does not have to be counted. Because this code will be processed by the PAL-I Assembler, it is sufficient to generate an expression for the length of code and let the assembler generate the actual number. 7.5.3.2.2 logical Description of Module - The next item in the module declaration is the collection of codes that specify the purpose of the module, and correspondingly specify what system tables must be updated to refer to points within this module. Table 7-3 is a summary of the table update information, similar to Table 7-2. Each module to be considered uses all or part of this information for each entry point. If used, it must be in the sequence indicated. Table 7-3 Table Update Information Code Significance XXXX XXXX is the number of entry points to be defined within this module, or 0 if none are defined. Each entry point definition is preceded by a *ENTRY X code. *ENTRY X Where X defines the system table(s) to be updated, and the nature of the table entry. X is one of the following codes: 0 Extension module or Extension Entry point names in (* *) for use in global definitions only. 1 Call-up module, used if this is a *CAlMOD X call-up module. limit is one per module, also uses (**). 2 Device handler interrupt-chain extension. Uses no system table, word 0 of module code is filled in by GENDAC. 3 Device handler, called by source program, uses (SO). 4 Core-resident function, uses (I F). 5 Disk-resident function, uses (XS). 6 Disk-resident subroutine, uses (XS). 7-13 TEXT 'NAME OF ENTRY POINT' For ENTRY 3, 4, 5 and 6, TEXT "name" specifies the name to be used in the I NDAC source program. Where OXXX is the location of the entry point relative to the base of the module. (If the module is of the type *ENTRY 2, then OXXX points to the f;rst lOT of the skip-chain segment in the module.) OXXX When the module is of Type *ENTRY 3, a device handler called by the source program, the following additional data is required: Where XXXX is the bit pattern defining the device usage to the INDAC Compiler, bits may be ORed to give a combination of the following meanings: XXXX 4000 Allocated buffer required 2000 "G ET" device 1000 "SEND" device 0400 Multiplexed device with channel assignments 0200 May reference a FORMAT statement 6XX1 The device code. OOXX Where XX is the number of device control words to follow, or 0 if there are no control words: TEXT 'control word' Where the control word is the text to appear in a control line statement, for example: X1000, GAIN 2, etc. XXXX Where XXX is the octal value for the control word just defined. (The TEXT and XXXX codes are repeated until the number of control words specified above are completed.) The logical description of the sample I/O handler follows: IllOGICAL DESCRIPTION OF MODULE 1 I ~.~ I' til' P J: R 0 F J IDEFPHNG AN TEXT ·\/'T·Dr:VjCE~ E ~~ T k Y P (, I i\' T S I.-,i I T H I (\ ~'I 0 [) lJ L F HANOLFf< FNTkY POINT li\]A[v,E THAT COl"PIL.U( ',:JILL r(t(;Ubi'Jl/~ I-C~ ~NTkY POINT WITHIN MODULE Ql !?0vl(;1 IRFLATIVE 6361 IIOT CODE FeR DEVICE IBIT PATTEkN FOk: "GET" DEVICE I i\l (' C (l t\JT k 0 L 7.5.3.3 Module Body - When the header information required by GENDAC to define the module is complete, the code of the module itself can be included. 7-14 7.5.3.3.1 Module Title Where x has the following meaning: *CODE X o code of standard (*NEWMOD X) module follows code of call-up (*CALMOD X) module follows TEXT 'module name' Gives the name of the module. If a call-up module has been referenced by a *F IXUP X prior to this point, the code for the module is loaded, if the module has not been referenced, GENDAC skips to the next *ENDGRP separator and continues from there. Details on preparing the code for a module are given in Chapter 3. 7.5.3.3.2 Fixup Declarations - G ENDAC allows the use of relocatable code for modules. Such code cannot be completely defined at assembly time, because the final location of the code is unknown. In this sense, GENDAC operates as a linking loader, providing links within and between modules. The basic link mechanism is the "FIXUP". A FIXUP is a declaration made before the actual body of code as follows: *FIXUP X Where X is the index to the following FIXUP definition TEXT 'AAAA' TEXT 'AAAA' Where AAAA is the name of an entry point of this or a previously loaded module and may take the following forms: AAAA Absolute reference AAAA-. Displacement reference -AAAA Negative absolute reference -AAAA-. Negative displacement reference 0-. Null displacement FIXUP definition Repeat this declaration for each F IXUP needed in this module. GENDAC saves the text declaration stated and assigns a number to the saved text according to *FIXUP X. This saved text, with its assigned number (X), is now a F IXUP. F IXUPs are called for within the actual code of the module as follows: FIELD X word At the Field call, GENDAC uses the assigned FIELD asan index to retrieve the saved FIXUP text. The saved text is evaluated at the location in core, where the word following the FIELD call will be placed. The evaluated text is arithmetically added to the word following the FIELD call (normally the following word is zero). In most cases, the absolute reference format is used. The special cases are provided for generating relocatable, vector displacement code. FIXUP declarations are limited to 8 (0-7) for each single module. A new module can use the same FIXUP index numbers again, because all saved text is deleted at the end of each modu Ie. The actual code of the sample I/O handler follows: 7-15 TEXT ' [[V1Y] , *275 CALL SETUP CALL DATA JtvP SKP /INITIALIZE THE DATA ROUTINE Norl:OR SYSOUT ADDk DCA 6362 i'lO~/OR LAST, , DCA 1 ADDk J(Y,p DEV2 /GET THE ADDRESS OF THE DATA /END OF DATA LIST /INTEGER kETUI- //EGUATES FOR GENDAC GROUP =7 60(1 OLDMOD=? 61(1 NEltJMOD =7 620 ENTRY=7 64~' CODE=?650 FIXUP=?660 ENDGRP=7777 TEXT 'BCDSHF SUBROUTINE TAPE' *GROUP TEXT 'BCDSHF' TEXT 'BCD SHIFT SUBROUTINE' *NEWMOD /NEW-MODULE~DISK-RESIDENT /ONE ENTRY POINT IDISK-RESIDENT SUBROUTINE TEXT 'BCDSHF' 2 IMODULE ENTRY POINT (MUST HAVE TWO WORDS OF .ZEkOS) TEXT 'BCDSHF' 1 *ENTRY 6 *CODE *2(-J0 o ITWO LEADING WORDS OF ZEROS REQUIRED I LE /FOR ALL EXTERNAL SUBROUTINES OR FUNCTIONS IGET THE VALUE FOR THE FIRST ARGUMENT OF THE ICALL ON THE ARITHMETIC STACK o 1 IS ALPHA- • 1ST ORE THE VALUE INTERNAL TO THE SUBROUTINE GBIN /ENTER BINARY MODE TAD ALPHA CLL RTR RTR DCA ALPHA /PERFORM THE BDC SHIFT INTERP /RETURN TO THE VECTOR MODE ILOAD THE ADJUSTED VALUE ON THE IL ALPHA -. IARITHMETIC STACK ISTORE THE VALUE ON THE STACK INTO ISE 2 /THE SECOND ARGUMENT OF THE CALL IRETURN FROM THE SUBROUTINE, BYPASSING RETE 2 ITHE 2 ARGUMENTS OF THE CALL ALPHA, 0 *ENDGRP 7.6.3 !/O Handler 7.6.3.1 I/O Handler Operation - The compiler generates the following vector code for an I/O request: where XXX is an index to the handler 5XXX )control driver pointer )format driver pointer 4000 - GET; 0000 - SEND indicator nr. data list words data list 7-19 7.6.3.1.1 The Control Driver Table - The control driver table contains the information supplied through the .EQUIPMENT statement device-control line, and the starting channel of each item in the data list. The Executive contains subroutines available to the user for extracting information from this table automatically. 7.6.3.1.2 The Format Driver Table - The format driver table contains information supplied through a .FORMAT or .HEADER statement. The processing of this table is reserved for the Teletypes and high-speed punch. This table is not available to the user. 7.6.3.1.3 Data Information and Calls - The remainder of the I/O call is processed by Executive subroutines through the "CALL" statements as shown in Table 7-4. NOTE The AC must be cleared before issuing a CALL. Table 7-4 CALL Statements Function ESUP CALL CALL SETUP The first CALL in an I/O handler provides the initial setup and linkage to the I/O tables. Returns with the LI N K set to 1 for a GET request and 0 for a SE ND request. AC set to O. CALL ALOCAT Returns with the base address of a page of FIELD 1 core. Used to obtain a page of buffer for dynamically allocated core. Not generally used. CALL DATA Used to obtain addresses from the data list. Returns with the address of the data item in the AC at: a b c a. no more data address b. request for integer variable c. request for real variable If the data item specified is an array, then consecutive DATA requests return with the consecutive addresses of the array requested, until the array is expired. The DATA routine then looks for additional data list items, until the list is expired. CALL 10SUB a b Request for the subroutine (if any) specified in the device control line to operate on the data supplied. A return is made at: a. subroutine did execute b. no subroutine requested CALL CHANEL Returns with the channel number in the AC. This is the channel associated with the last address supplied by the DATA routine. CALL DEVRET The I/O handler is finished. This is a return to the Executive in vector mode to continue processing the compiled program. 7.6.3. i.4 Executive Page Zero Parameters - Table 7-5 is a list of eXecutiVe paiameteis. 7-20 Table 7-5 Executive Parameters I Field l:cation ESUP Name I Uoo u ADDR Loaded with the address supplied by OAT A for use by the subroutine called through 10SUB. o VALUE Loaded by the I/O handler with information derived from, or being sent to the I/O device. The processing subroutine (if any) loads VALUE from the data list (after processing) or takes VALUE, processes it, and stores it into the data list. The method of operation depends on whether the device is an input or output peripheral. o 10CTRL After SETUP, this parameter contains the bit configuration, specified by the device control line, required to properly service the device (gain control, resolution, initializing requests, etc.). o STATUS This parameter is available for liD devices to communicate with language-level code. The parameter is retrievable by GET (STATUS) IX where IX contains whatever value STATUS was set to. 7.6.3.1.5 Interrupting Devices - A complete cross-reference listing of devices supported by DEC is included in the G ENDAC library. For an analysis of interrupt processing, see the ADC handler included in the program listing (tag "ADCI" to "AFX = ."). 7.6.3.2 A Typical I/O Handler - A typical I/O handler (0 IGOUT) is presented below, showing the use of the I/O calls and parameters: !ii350 (1351 0352 0353 0354 (fj355 0356 (1)357 0360 v)361 0362 0363 036Lj (1365 0366 (1367 0370 (71 371 0372 '1350 '-1'-165 0001 '-1465 0002 5374 7410 4510 311 7 4465 0004 5365 1517 3461 4L\65 C(l 0(Z'J 3 6366 73fil0 1461 6365 0373 5352 3374 0375 0(-1v~ 4465 5 IIDIGITAL OUTPUT OEVICE HANDLER -5 YS TEi"J LEVEL *35121 DIGa .. CALL ILINK BIT INDICATES DIRECTION SETUP I OF TRANSFER:"0 -OUTPUT;"}"-INPUT D IG02 .. .CALL DATA IGET ADDRESS ANIJ TYPE OF ITEl"j JMP DrGe4 INO MOkE DATA ITEMS SKP S YSOUT IERROR-REAL VAr~ IABLE RE0UEST DCA AD DR ISAVE ADDR FOk SUBkOUTINE CALL CALL ICALL SUBROUTINE-IF ANY REQUESTED IOSUS /SUBROUTINE CALLED=AND EXECUTED D IG03 Jt'1P TAD I ADDR /SUBROUTINE DID NOT EXECUTE .. I HAI'JDLEK ~·JUST STORE THE VALUE DCA I VALUE DI(303 .. CALL CHANEL IGET CHANNEL ASSIGNED TO ITEf"; 6366 ISELECT CHANNEL CLA CLL. TAD I VALUE 6365 ISEND VALUE TO DIGITAL OUTPUT 11'KTE: THIS DEVICE CLEARS THE AC AFTER SENDING THE ITE(,;;; I THE AC r'lUST BE CLEAR BEFORE ISSUING A "CALL" Jr--iP DIG02 IGET NEXT DATA ITEi"i t1 DIGOLJ .. CALL DEVkET IDEVICE RETURN EXIT. 7-21 7.7 VECTOR CODE All vectors are processed by the vector interpreter of the Executive and result in the execution of some intrinsic function or library routine of the Executive. The user, coding in assembly-level code, can make use of these routines by entering the vector mode and using these routines himself, perhaps in some combination not available through the Compiler. The following paragraphs describe the characteristics of vector code. 7.7.1 Numeric Formats The internal format of numeric data is shown in Figure 7-3. 11 0 lsi 1 SIGNED BINARY NUMBER INTEGER FORMAT 11 0 WORD 'is 1 EXPONENT 11 0 WORD 21 S 1 ,I 11 0 WORO REAL VARIABLE 1 FLOATING MANTISSA POINT FORMAT 08-0670 Figure 7-3 Internal Format of Numeric Data Integer numbers can be positive or negative (stored as 2's complement) according to the sign (bit 0). Floatingpoint numbers, called "real numbers", can be positive or negative according to their sign and are each assigned three words of storage. Floating-point numbers are carried in normalized form. The exponent is a signed 2's complement quantity in one 12-bit word. The signed mantissa is stored in two 12-bit words, maintaining 23 bits of significance, making a total of three words of storage. Arithmetic expressions are evaluated using a push-down arithmetic stack that grows in ascending locations (in FIE LD 1 of an 8K system) with the current stack pointer (STK), pointing to word 3 of a real number or to the integer number. 7.7.2 Vector Code Example An example of the vector code produced by the compiler to resolve the INDAC statement follows: 7-22 LET I A = I B + I C -I D IL )IB IL )IC ADD IL )ID SUB IS )lA The term ") IB" means the displacement address from the point at which} IS occurs to the actual location of lB. In the PAL-I assembly, this term would be written as "IB-.". The code as written above means the following: 1. Load the integer, the displacement address of which follows, DIB], onto the arithmetic stack. 2. Load the integer, the displacement address of which follows, DIC], onto the arithmetic stack. 3. Take the last two values on the arithmetic stack and perform an integer addition. Replace these two values with the new sum (a single value). 4. Load the integer, the displacement address of which follows [) 10] , onto the arithmetic stack. 5. Take the last two values on the arithmetic stack (the result of adding IB and IC, and the value of ID) and perform an integer subtraction. Replace these two values with the new value. 6. Take the integer value on the arithmetic stack and store it in the location the displacement address of which follows [) IA]. This last action collapses the arithmetic stack. GENDAC provides for displacement fixups to allow vector code modules to interact. Displacement fixups may not be used in disk-resident modules, because a disk-resident module cannot reference another module. For the same reason, fixups cannot refer to a disk-resident module. 7.7.3 Load and Store Instructions Load and store instructions are divided into categories: a. Single-word operations (1-word) b. "Real" variable operations (3-word) Single-word operations are considered integer types. Three-word operations are considered floating types. 0 perations for integer and floating-point instructions take the same argument list, and deal with the arithmetic stack in the same fashion, with the single exception of the number of words handled. 7.7.3.1 Load a Simple Variable ~ Form: IL )IB FL )ALPHA Function: Load the simple variable, whose displacement address follows, on the arithmetic stack. 7-23 7.7.3.2 Store a Simple VariableForm: IS )18 Function: Store the last value on the arithmetic stack into the variable whose displacement address follows. FS )ALPHA 7.7.3.3 Load An Array Element (Indexed Variable) Form: Function: III FLI )IX )18 )IX )ALPHA Load the arithmetic stack with the variable whose index value (displacement address) and base address (displacement) follow. 7.7.3.4 Store An Array ElementForm: lSI )IX )18 Function: Store the last value on the arithmetic stack into the variable whose index value (displacement) and base address (displacement) follow. FSI )IX )ALPHA 7.7.3.5 Load An External ArgumentForm: ILE k Function: This vector is used within an external subroutine to load the arithmetic stack with the kth argument supplied by the subroutine call. Arguments range from 1 to n. FLE k 7.7.3.6 Store into An Externai ArgumentForm: Function: !SE FSE k k Store the last value on the arithmetic stack into the kth argument supplied by the subroutine caiL 7.7.3.7 Load An External Argument, Indexed Form: Function: ILEI )IX FLEI )IX k k Load the arithmetic stack with the kth argument supplied by the subroutine call, indexed by the internal subroutine variable whose address (displacement) is supplied. 7-24 7.7.3.8 Store Into An External Argument, Indexed FSEI )IX k Form: ISEI )IX k Function: Store the last value on the arithmetic stack into the kth argument supplied by the subroutine call, indexed by the internal subroutine variable whose address (displacement) is supplied. 7.7.4 GOTO Statements 7.7.4.1 Unconditional GOTO GOTO I Compiles into: [~ ~ 7.7.4.2 Computed GOTO- Compiles into: CGO )POINTER 1- )11 ... '" ~ If )In )i I+- 7.7.5 I F Statement IF (e 1 ) 0 (e2 ) then S compiles into: evaluate expression e1 ' and leave answer in stack FIF ..I II II II ... .. .. then evaluate expression e2 , ieaving that answer on stack FIF or IF depending on type IF )POINTER if e1 greater than e2 )POINTER if e1 equal to e2 )POINTER if e1 less than e2 generates GOTO statement accord- II CGO II ing to whether S is unconditional GOTO II GOTO or computed GOTO II 7-25 The pointers are set to point to the appended GOTO statement if the relationship is true or to the next source statement if the relationship is false. 7.7.6 DO Statements 7.7.6.1 Internal Subroutine Call DO I Compiles into: 7.7.6.2 External Subroutine Call - Compiles into: 4xxx xxx - index into call driver table )v 1 NOTE: The Call Driver table is NOT available to G ENDAC pointers to the base arguments 7.7.7 Return Statement The RETURN statement compiles into one of two forms, depending on whether it jj.~m routine return. An internal subroutine has the form, RETURN and compiles into: RET An external subroutine return has the form, Return s and compiles into: RETE *count where the count is the number of arguments over which to jump in the return. 7-26 internal or external sub- 7.7.8 Loop Statements 7.7.8.1 FOR StatementFOR i = m, TO m 2 STEP m3 Compiles into: IL )m, IS )i The parameters m 2 and m3 are used in the NEXT statement. If Step m3 does not appear in the statement, m3 is assigned the value 1. 7.7.8.2 NEXT StatementNEXT i Compiles into: NEXT )i )POINTER where m3 and m 2 were defined in the corresponding FOR statement. The pointer is a displacement address to the cell following the corresponding FOR statement. 7.7.9 Arithmetic and Logical Operators This class of vectors has no argument following the vector. The routines supporting the vectors deal only with the arithmetic stack. Within this class there are two types of operations. a. Binary - operate on the last two values of the stack, replacing those values with the single result of the operation. b. Unary - operate on the single, last value of the stack, replacing that value with the result of the operation. 7.7.9.1 Binary Vectors - Table 7-6 is a listing of the binary vectors. Table 7-6 Binary Vectors Integer Floating Function MPY FMPY Multiply DIV FDIV Divide EXP FEXP Exponentiation (continued on next page) 7-27 Table 7-6 (Cont) Binary Vectors Integer Floating Function ADD FADD Addition SUB FSUB Subtraction OR - 12-bit Boolean OR LAND - 12-bit Boolean AND 7.7.9.2 Unary Vectors - Table 7-7 is a listing of the unary vectors. Table 7-7 Unary Vectors Integer Floating Function NOT - 12-bit logical negation NEG FNEG Arithmetical negation FLT - - Integer to floatingpoint conversion FIX Floating-point to integer conversion (truncate) 7.7.10 Special Vectors The vectors described to this point are all normal compiler generations produced in response to some languagelevel statement. I n this paragraph, two vectors are introduced that are not generated by the Compiler; however, they are available for PAL-I coding. Remember that all vectors must appear in FIELD 1 and are processed with the data field set to 1. ESUP Name Purpose GBIN Go-B inary: exit from interpretive mode; enter machine mode at the next instruction in FIE LD 1 with data field set to 1. XTRP Exit from interpretive mode, enter machine mode in f:CLD xxxx o at the instruction whose address follows the XTRP command. Data field set to 1. 7.7.11 Special PAL-I Code Occasionally, the vectors already described are not sufficient to service user needs, and routine must be created to directly interact with the Executive. The following "macro-calls" are provided as equate statements through ESUP to ease communication with the Executive. The commands in Table 7-8 are all machine-mode instructions. Another "macro-call" is available to allow communication for I/O handlers (FIELD 0). The call is "CALL" followed by an argument. Each argument references a subroutine within the Executive that supplies either information or a service. A complete discussion of "CALL" and the available arguments is presented in Paragraph 7.6.3 "I/O Handler". 7-28 Table 7-8 ESUP Commands ESUP Name Purpose INTERP xxxx Command given in FIE LD 1 with data field set to 1, to enter vector mode at the next word. xxxx is interpreted as a vector. GOTERP yyyy Command given in F! E LD 0 with data field set to 1, to enter vector mode in FIE LD 1 at the address specified by yyyy. VECTOR Command given in FIE LD 0 for Executive to continue processing the user program. This is normally the last instruction of any library routine or core-resident function created by a user. ABSGO Command given in FIELD 0 with data field set to 1 to continue operation of the user program (vector mode) at the address specified in location 01008 of FIE LD O. Normally used to simulate the operation of a GOTO ... or a conditional test. SYSOUT Command given in FIELD 0, data field irrelevant, to abort the current SNAP. An error has been detected and no reasonable method of continuing is available. INTRET Used in the interrupt I/O handler to return to the AC and LINK restore routine, exiting from interrupt mode. 7.8 RUNNING GENDAC GENDAC, in conjunction with the DEC-supplied or user-written library tape, is a powerful system configurator (see Chapters 2 and 4). Its main features are as follows: a. Conversational operation - GENDAC requests the option required. If the user is uncertain as to the correct response, he strikes the question mark (?) key. GENDAC then prints an explanation to the user. b. GENDAC links DEC-provided I/O handlers and math functions (sine, log, etc.) into the Executive. c. GENDAC links user-developed I/O handlers, functions, and subroutines into the Executive. Subroutines can be written in INDAC or PAL languages. d. GENDAC places subroutines in the top of the last supplied disk or on the first disk (disk 0) if available. 7-29 APPENDIX A SUMMARY OF INDAC STATEMENTS LEGEND: a = print .string c = i SEC i MIN i HR / HH :MM (AT statement) e = expression (logical or arithmetic) i = integer variable k = constant I = statement label m = control parameter s = subroutine name t = tag u = device name v = variable name SeN = control names for device A.l EXECUTABLE STATEMENTS I. ASSIGNMENT STATEMENTS LET v = e II. CONTROL STATEMENTS 1. GOTO Statements GOTO I GOTO (11' 12 , ... , In), i 2. I F Statement IF (e 1 ) 0 (e2 )THEN S 0= Relational Operator S= GOTO I or S = GOTO (11,1 2 " , 3. " In)' i DO Statements DO I DO S (v 1 , v2 , ••• , vn ) DO PHASE #t PRIORITY k DO SNAP #t PRIORITY INTERRUPT DO SNAP #t PRIORITY k A-1 4. R ETU R N Statement RETURN RETURN s 5. Program Contro I Statements EXIT #t PRIORITY k EXIT THEN DO PHASE #t PRIORITY k EXIT THEN DO SNAP 6_ Loop Statement FOR i = m 1 TO m 2 or FOR i = m 1 TO m 2 STEP m3 NEXT i 7. TIMER Statement TIMER (STOP, it) TIMER (START, It) III. INPUT/OUTPUT STATEMENTS 1. GET (u, it) list or GET (u) list 2. SEND (u, it) list or SEND (u) list IV. ACTIVITY STATEMENTS 1. #t 1 DO SNAP #t2 EVERY c PRIORITY k 2. #t 1 DO SNAP #t2 DELAY c PRIORITY k 3. #t 1 DO PHASE #t2 DELAY c PRIORITY k 4. #t 1 DO SNAP #t2 AT c PRIORITY k 5. #t 1 DO PHASE #t2 AT c PRIORITY k A.2 NON-EXECUTABLE STATEMENTS I. SPECIFICATION STATEMENTS -j. .EQUiPMENT t*u (device code) tCHAN (m,n) ....... (multiplexer channels) tit SCN 1 ' SCN 2 , II. ••• SCN n (control information) ALLOCATION STATEMENTS 1. .STORAGE v1 ' v2 ' 2. #t ,FORMAT 3. #t .HEADER ... , vn A-2 III. PROGRAM UNIT SEGMENTATION STATEMENTS 1. #t .PHASE 2. #t .SNAP 3. .SUBROUTINE s IV. COMPILER DIRECTIVE STATEMENTS 1. .ACTION 2. .PROCESS 3. .END A-3 APPENDIX B EXAMPLE PROGRAM This program shows the technique of making an array available to a subroutine . . ARRAY PASSING EXAMPLE .sTORAGE II #1 .PHASE #10 DO SNAP #20 EVERY 30 SEC PRIORITY 2 .ACTION TIMER (START, #10) #20 .SNAP .STORAGE IK (1, 10)/1,2,3,4,5,6,7,8,9,0/,A(1,3) #21 .FORMAT XX.XX XX.XX XX.XX .PROCESS LET I = II DO SUB (IK, I, A) SEND (TTY, #21) A(1), A(2), A(3) EXIT .SUBROUTINE SUB (IDUM, IDM, DUM) .PROCESS LET IA = IDM LET IB = IA +3 FOR 1= IA TO IB LET DUM(I) = IDUM( I) NEXT I RETURN SUB .END B-1 APPENDIX C USING THE DISK MONITOR SYSTEM C.l EDITOR COMMAND SUMMARY Command Format Meaning READ R) Read incoming text and append to buffer until a form feed is encountered. APPEND A) Append incoming text to any already in the buffer until a form feed is encountered. L) List the entire buffer. LIST nL) m,nL) PROCEED P) nP) m,nP) List the line n. List lines m through n. Proceed and output the entire contents of the buffer and return to command mode. Output line n, followed by a form feed. Output lines m through n, followed by a form feed. TRAILER T) Punch four inches of trailer. NEXT N) Punch the entire buffer and a form feed; kill the buffer and read next page. nN) KILL DELETE K) nD) m,nD) INSERT CHANGE I) GET Delete line n. Delete lines m through n. Insert before line one all text until a form feed is encountered. Insert before line n until a form feed is encountered. nC) Delete line n and replace it with any number of lines from the keyboard until a form feed is encountered. m,n$kM) G) nG) SEARCH Ki II the buffer. nl) m,nC) MOVE Repeat the above sequence n times. S) nS) m,nS) Delete lines m through n, replace from keyboard as above until form feed is encountered. Move and insert lines m through n before line k. Get and list the next line beginning with a tag. Get and list the next line after line n which begins with a tag. Search the entire buffer for the character specified (but not echoed) after the carriage return; allow modification when found. Search line n, as above, allow modification. Search lines m through n, allow modification. (continued on next page) C-1 Command Format END FILE E) Meaning Process the entire file (perform enough N EXT commands to pass the remaining input to the output file) and create an end-of-file indication; legal only for output to the system device. If the lowspeed paper tape reader is used for input while performing an E command, the paper tape reader will eventually run out of tape, and at this point typing a form feed wiii aiiow the command to be completed. C.2 EDITOR KEY FUNCTION SUMMARY ) (carriage return) Text mode: Enter the line in the text buffer. Command mode: Execute the command. (back arrow) Text mode: Cancel the entire line of text and continue typing on same line. Command mode: Cancel command. \ (rubout) Text mode: Delete from right to left one character for each rubout typed (is not in effect during a READ command). Command mode: Delete entire command. FORM FEED / Text mode: End of input, return to command mode. (period) Command mode: Current line counter used as argument alone or in combination with + or - and a number. (slash) Command mode: Value equal to number of last line in buffer and used as argument. (line feed) Text mode: Used in SEARCH command to insert a CR/LF into the line being searched. Command mode: List the next line. > (right angle bracket) Command mode: List the next line: < (left angle bracket) Command mode: List the previous line. (equal sign) Command mode: Used in conjunction with. and / to obtain their value (.=0027). (colon) Command mode: Lower case character, same function as =. (tabulation) Text mode: On output is interpreted as a tab-rubout combination. C.3 ERROR MESSAGES As an input command string is being typed, Monitor recognizes any incorrect syntax and responds with one of the error messages in the following table. Message Meaning ? Illegal syntax or miscellaneous error condition D Directory on the systems device is full E Too many inputs or outputs were entered No such inputs s System I/O failure C-2 APPENDIX D INDAC COMPILER ERROR MESSAGES Error Message Meaning 1 In correct representation for statement TAG. 2 Incorrect representation for statement LAB E L. 3 This statement is not syntactically complete. The compiler needs more information. 4 Unrecognizable statement verb. 5 While scanning this IF statement, the Compiler could not find or recognize a relational operator (EO, NE, GR, GE, LS, LE) or the THEN conjunctive. 6 The assignment variable (to the left of the equal sign) is not recognizable as a variable name; or, this variable is a dimensional array and must be subscripted. 8 The expressions in an IF statement cannot be real and integer (or logical). They must be of the same mode. A mixed mode of integer/logical is permitted, however. 9 The GOTO in this IF statement is missing or unrecognizable. 10 There is a subscripted variable in this statement whose subscript is bad. It is either (1) unrecognizable (2) a real constant or (3) the integer constant used as a subscript exceeds the declared size of the array. 11 The equal sign is missing or misplaced in this LET statement. 12 This arithmetic expression is not syntactically complete; the Compiler expects more information. Generally this means that an operand is missing following some operator. Occasionally, this condition is caused by some previously detected error in the same expression. 13 More than one unary minus in a row encountered while scanning this expression (for example, --A is not permitted, while - (-A) is O.KJ. 14 There is a constant in this statement that is improperly written. 15 Only integer constants are permitted as exponents or within exponential expressions. 16 Mixed mode expressions are not permitted. Real and integer (logical) variables cannot be intermixed in one expression. 20 Illegal operator in arithmetic expression. 21 Illegal operator in logical expression. 22 23 Right parenthesis encountered adjacent to left parenthesis. Extra left parenthesis (or parentheses) encountered. 24 Statement labels can only be used within the PROCESS section of a SNAP unit. 25 A logical expression cannot be equated to a real assignment variable. 26 Mixed mode expressions are not permitted. Arithmetic and logical operators cannot be intermixed in the same expression. 28 Unrecognizable label encountered during processing of a computed GOTO statement. (continued on next page) 0-1 Error Message Meaning 29 Missing or misplaced comma within a computed GOTO statement. 30 Missing or misplaced right parenthesis within a computed GOTO statement. 31 The transfer variable in a computed GOTO statement may only be (1) an unsubscripted integer variable or (2) an integer variable subscripted by an integer constant. 32 Priority verb missing, mispelled or not found in expected sequence. This error may be due to untagged activity statement not in activity section. 33 Array sizes must be declared by integer constants only. 34 Syntactial error in EXIT statement. 35 Time declaration in AT statement must be positive integer constants of form: HH:MM with HH less than 24, and MM less than 60. 36 Missing or unrecognizable DELAY or EVERY in an activity statement. 37 The time declaration in an activity statement must consist of (1) an integer constant or an unsubscripted integer variable or an integer variable subscripted by an integer constant (2) which must be followed by the contractions SEC, MIN, or HR. 38 Priority level stated is invalid. Level must be integer constant, between limits 1 to 11. 39 Variable name has been used more than once in STORAGE statements in this or parent program unit. 40 This tag has been previously defined, or this label has been previously defined within this SNAP. 41 The first character of a variable name must be alphabetic. 42 Could not make sense out of what to DO. Probably unrecognizable characters. Subroutine names must begin with alphabetic character. 43 Illegal FORMAT statement. 44 This statement is not permitted at PHASE level. .FORMAT, .HEADER, and .STORAGE are not permitted at PHASE level. 45 Error in declared FO RMAT statement. 46 This statement must have a tag reference appended to it for other statements to reference. 48 Subroutine names must begin with an alphabetic character. 49 This symbolic device name does not exist in this INDAC 8 System. 50 The ACTION section can only appear in a PHASE unit, 51 Dot statements (for example, .FORMAT) are not permitted within executable code in the PROCESS section of a SNAP unit. 52 The word STOP, or START is missing, misspelled, misplaced, or otherwise unrecognizable. 53 Same as 52, except first character of the description word is not even alphabetic. 54 Missing comma in this statement. 55 This timer statement refers to an activity statement that was never declared. 56 A timer statement can only reference an activity statement. 57 Missing right parenthesis in this statement. (continued on next page) 0-2 Error Message Meaning 59 PRIORITY INTERRUPT is misspelied, misplaced or occurs more than once in ACTiON section. Only one PRIORITY INTERRUPT per PHASE is permitted. 60 The .ACTION statement can only occur once within a PHASE program unit. 61 This statement can only appear in the ACTION section of a PHASE program unit. 62 DO PHASE may not appear as a freestanding statement. DO PHASE may be used only in activity or EXIT statements. 63 DO SNAP out of order. "00 SNAP process sections. 65 Activity statements may only appear immediately following the .PHASE statement and before the .ACTION statement. 66 This activity statement is incomplete. 67 The .PHASE statement is out of sequence. Generally this error occurs when a .PHASE follows a .PHASE without an intervening SNAP program unit. 68 The .SNAP statement is out of sequence. Generally this error occurs when a .SNAP erroneously follows a SUB ROUTINE unit or appears in the system unit before a .PHASE statement occurs. 69 Only one .I NTE R RUPT device list is permitted during compilation. 70 The .1 NTE R RUPT statement is out of sequence. It may appear only at system level. 71 The .SUBROUTINE statement is out of sequence. This error generally is due to no SNAP unit associated with the preceding PHASE unit. 76 Either (1) an executable statement cannot have a tag reference appended to it or (2) executable statements can only occur in the PROCESS section (with some minor exceptions in the ACTION section). 78 The first character of a device symbolic name must be alphabetic. 80 This subroutine name has been used before, either it appears in the subroutine library or the user has declared it twice in two SUBROUTINE statements. 82 The tag reference for this PHASE or SNAP has been used before. 84 Missing left parenthesis in this statement. 85 The .PROCESS statement may only appear only in a SNAP or SUB ROUTI NE program unit. 86 Subroutine size is exceeded. The compiler code for a subroutine cannot exceed 128 words. 87 While generating compiled code for the preceding program unit, an undefined label or tag has been found. The user evidently referred to it but never defined it (for example, GOTO 1~O, but statement label 100 never occurred within the unit). 88 The number of digits specified exceeds the format statement limit. Total width may not be greater than 15 digits, only the first six digits output are significant. 90 The line containing .HEADER must be blank following .HEADER. The header line(s) can only appear in the line{s) following. 91 There is an extraneous decimal point in this .FORMAT statement. 92 The system tables not on system - either (PZ>, (j F), (SO) or 06 (XS> pointed to nonsubroutine block (discovered at REPLACE? -V) 07 "I mpossible" system errors 10 HSR time-out 11 B Library tape contains garbage (continued on next page) G-1 Table G-1 (Cont) Numbered GENDAC Error Messages NN Notes 12 C Meaning EDT, *, FIELD found when code expected - following cases distinguishable by values dependent on assembly: TEXT, length (*761N), length (*762N, *763N), # entry points, ReI. addr. of e.p., device usage code, lOT, #ctl. wrds, Ctl. wrd. value. 13 A FIE LD follows tape leader 14 B long name of *7660 group missing 15 A *761N, *762N, *763N missing 16 *7610, *7630 illegal 17 modtyp = 5 illegal 20 B FIELD after *761N, *762N, *763N missing 21 A FIELD after *761N, *762N, *763N notOor 1 22 B module origin requirement after *761 N, & 762N, *763N missing 23 A length of call-up module> 2008 24 A length 0 or too big 25 A # entry points 0 or too big 26 B missing control-origin after # entry points 27 B missing *7650 30 A # control words 0 or too big 31 A more control words than declared 32 A FIE LD in place of control word or control-origin at end of control words 33 *7647 illegal 34 *7641 not associated with *763N 35 entyp incompatible 'v'"ith modtyp or two *7641 or *7642 in one module 36 A Core-res. function entry point invalid 37 A I/O device handler entry point invalid 40 A lOT invalid 41 *7651 name not in (**) 42 *7651 name refers to *7640 not *7641 or occurs twice on one tape 43 B Missing *766N or actual origin of module code 44 Illegal syntax in *766N TEXT 45 Displacement fixups illegal in disk-resident module 46 47 B Missing control-origin after *7777 separator (EaT is legal) Manual repositioning of tape associated with liN" response did not leave tape on a *7777 separator G-2 Table G-2 Unnumbered GENDAC Error Messages Error ? Description Not an error message - indicates GENDAC awaiting keyboard input (printing of previous message was suppressed) Type '7' to discover. ? Keyboard input not understood - (or illegal) - try again tc User aborted run with CT R LIC from keyboard NO SUCH FILE No file by that name exists of type S if OPT=S or of type B if OPT=B SUBROUTINE FI LE INVALID File specified does not have proper format for INDAC compiler output of a single subroutine SUBROUTINE EXCEEDS ONE PAGE Self-explanatory AAAA ALREADY IN (BB) Name specified (only four characters printed) exists in specified system table - in general: logical error in constructing.or loading library tape(s) - may need to regenerate system from scratch. FIXUP ILLEGAL Reference to disk-resident module in a *766N FIXUP UNDEFINED AAA BBBB *766N did not appear for this "FIELD" .AAAA = index of fixup (last digit of *766N) BBBB = value of IIICI" for word to be fixed up AAAA EXCEEDS ALLOCATED AREA Module code lies outside declared module length TURN ON LSR LSR time-out has occurred - if caused by jam, turn off until jam fixed, if caused by moving switch to stop, no data lost; if caused by moving switch to free, or if tape sprocket holes ripped, must restart system generation. TURN OFF LSR GENDAC is returning to disk monitor - follow instructions! CHECKSUM ERROR AAAA If AAAA changes or message does not readout on repeating entire system generation process, then hardware trouble with paper tape reader or punch which produced library tape. If AAAA reoccurs, then bad copy of library tape (probably punch error). DISK READ/WRITE ERROR Hardware trouble with disk CANNOT CONTINUE Self-explanatory ***SYSTEM BASE ALTERED!*** Base of I NDAC program area in core has been altered by GENDAC due to addition of core-resident code. AIIINDAC main programs must be recompiled to incorporate this change. USE 8K (XXXX) A library tape option valid only for 8K I NDAC system has been used when K=4 (AA> MISSING OR INVALID Self-explanatory (IF) FULL Too many core-resident functions have been defined (limit is eleven) or (I F) is bad. CANNOT ALLOCATE CORE Either no room left in valid area for type of module now being allocated or (CM) is bad. G-3 APPENDIX H EXECUTIVE COMMAND DECODER OPERATION H.1 OPERATOR COMMANDS Attach to Command mode if echo successful. If no echo or if ?, Command mode is not permitted. CTRL/A All other commands active only in Command mode. CTRL/C Return to Monitor mode CTRL/D Initiate "RUN" command CTRL/U Delete entire line (Start line over) CTRL/P Release Teletype from Command mode back to Operator mode CTRL/V Value changes to be made in following modes C Inspect and open clock for preset HH:MM:SS O,D,E Inspect and open location for modification in Octal, Decimal, Exponential Notation RUBOUT Delete and echo last character in line; if none, no echo H.2 COMMAND DECODER ERROR MESSAGES BA Bad Address: The address requested is not within the defined system storage area EP Error in Phase: The phase requested cannot be found ES Error in Syntax: The input line cannot be resolved or the arithmetic information is not correct for the mode of operation. ? Cannot resolve command. H-1 APPENDIX I THE GENDAC LIBRARY The GENDAC library supplied with the INDAC software kit contains a library of I/O handlers and mathematical functions; they are: 1. I/O Handlers KEYS TTY PART OF EXECUTIVE STATUS PRIORITY CLOCK UDCE (UDC) UDCP (UDC) ADC (AF01, AF02, AF03, AFC-8, AD01) AF04 DAC (AA01 A, AA50) TTY2 TTY3 TTY4 PTP 2. Mathematical Functions SIN COS ATAN LOG EXP PART OF {SORT EXECUTIVE 3. Sample Call for Functions LET A = SORT (8) 1-1 APPENDIX J SYSTEM COMMUNICATION TABLES Table J-1 lists and describes the Systems Communication Tables. Table J-1 System Communication Tables Name Located In Save Address 0 Used By- Content Compiler Page zero of eventual run-time system including various system communication parameters used by SPUT, GENDAC and the Compiler. 400-777 Compiler Device handler names and pointers; legal .EQUIPMENT statement control words. SGEN 1 1600 Compiler Subroutine names and pointers; function names and (/ F) indexes. Intrinsic Functions (I F) Executive 7000 Compiler Vectors to operators and functions. Core Map (CM) Executive 200 GENDAC Defines the areas of Executive core available to core-resident modules. (**) GENDAC 2 GENDAC Allocation data for call-up modules and entry points used for fixup purposes alone. Page Zero Activ ity, 3-47 table, 4-2, 5-20, 7-2, J-1, K-1 Control option, 3-30, 3-40 table, 4-2, 5-20, 7-1, J-1, K-1 FORMAT, 3-17, 3-22 table, 4-2, 5-20, 7-2, J-1 HEADER, 3-17, 3-22 table, 4-2, 4-6, 5-2, 7-2, J-1 PHASE, 3-42 table, 4-2, 5-20, 7-1, J-1 SNAP, 3-43 <**> table, 4-2, 7-3, J-1 ° Testing, 3-1 Time of day, 3-17 Timers, 3-49 Delay (DELAY), 3-48, 3-49 Interval (EVERY), 3-47, 3-49 Time of day (AT), 3-48, 3-49 Titles, 3-17, 3-22 Trailer, 2-2,4-3, 7-5 TRANSFER request, 3-57 TTY, 3-17, 3-59 TTY 2,3-59 TTY 3, 3-59 TTY 4, 3-59 Index-7 I NDAC 8/2 HANDBOOK DEC-I N-G RZA-D READER'S COMMENTS Digital Equipment Corporation maintains a continuous effort to improve the quality and usefulness of its publications. To do this effectively we need user feedback - your critical evaluation of this manual. Please comment on this manual's completeness, accuracy, organization, usability, and readability. Did you find errors in this manual? How can this manual be improved? DEC also strives to keep its customers informed of current DEC software and publications. Thus, the following periodically distributed publications are available upon request. Please check the appropriate boxes for a current issue of the publication(s) desired. o Software Manual Update, a quarterly collection of revisions to current software manuals. o User's Bookshelf, a bibliography of current software manuals. o Program Library Price List, a list of currently available software programs and manuals. Please describe your position. Name _ _ _ _ _ _ _ _ _ _ _ _ __ Organization _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ __ Street _ _ _ _ _ _ _ _ _ _ _ _ __ Department City _ _ _ _ _ _ _ _ _ _ State ______________ Zip or Country _ _ _ _ _ _ __ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Fold Here - - - - - - - - - - - - - - - - - - - - - - Do Not Tear - Fold Here and Staple - - - - - - - - - - - - - FIRST CLASS PERMIT NO. 33 MAYNARD, MASS. BUSINESS REPLY MAIL NO POSTAGE STAMP NECESSARY IF MAILED IN THE UNITED STAn~S Postage will be paid by: mamaama Digital Equipment Corporation Technical Documentation Department 146 Main Street Maynard, Massachusetts 01754 -
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c041 52.342996, 2008/05/07-21:37:19 Create Date : 2015:11:03 11:05:56-08:00 Modify Date : 2015:11:03 10:16:31-07:00 Metadata Date : 2015:11:03 10:16:31-07:00 Producer : Adobe Acrobat 9.0 Paper Capture Plug-in Format : application/pdf Document ID : uuid:6e101219-8ab4-a541-afbe-d550f4b55706 Instance ID : uuid:cb71b71d-2deb-5e44-89fb-f61b855dadb3 Page Layout : SinglePage Page Mode : UseOutlines Page Count : 214EXIF Metadata provided by EXIF.tools