Digital PDFs
Documents
Guest
Register
Log In
DEC-08-AJB
December 1969
117 pages
Original
3.3MB
view
download
Document:
dec-08-ajbb-d
Order Number:
DEC-08-AJB
Revision:
Pages:
117
Original Filename:
https://svn.so-much-stuff.com/svn/trunk/pdp8/src/dec/dec-08-ajb/dec-08-ajbb-d.pdf
OCR Text
Digital Equipment Corporation Maynard, Massachusetts ADVANCED FOCAL TECHNICAL SPECIFICATIONS D EC-08-AJBB-D L ADVANCED FOCAL TECHNICAL SPECI FICATIONS For additional copies order No. DEC-08-AJBB-DL from Program Library, Digital Equipment Corporation I Maynard I Mass. DIGITAL EQUIPMENT CORPORATION Price: $5.00 0 MAYNARD J MASSACHUSETTS 1st Printing Apri I 1969 Copyright © 1969 by Digital Equipment Corporation The following are registered trademarks of Digital Equipment Corporation, Nbynard, Massachusetts: PDP FOCAL COMPUTER LAB DEC FLIP CHIP DIGITAL ii CONTENTS Page CHAPTER 1 INTRODUCTION CHAPTER 2 COMMANDS 2. 1 2-1 Type, Ask 2.1.1 Literals 2-1 2.1.2 Numerical Input Formats 2-1 2.1.3 Alphanumeric Input Formats 2-1 2.1.4 Speci a I Characters 2-2 2.1 .5 Print Positions 2-2 2.1.6 Symbol Tab Ie 2-2 2.1.7 Output Formats 2-3 2.1.8 Term i nators 2-3 2.1.9 Off-Line Data Tapes (c.f., Section 4.5.3) 2-3 2.1.10 Corrections 2-3 2.1.11 Roundoff 2-3 2..2 DO 2-4 2.3 Editing and Text Manipulation Facilities 2-4 2.3.1 Command- Input 2-4 2.3.2 ERASE 2-5 2.3.3 MODIFY 2-5 2.4 FOR 2-6 2.5 IF 2-6 2.6 GOTO 2-7 2.7 RETURN 2-7 2.8 QUIT 2-7 2.9 COMMENT 2-7 2. 10 CONTINUE 2-7 2.11 SET 2-7 2.12 High-Speed Reader 2-8 2.12.1 General 2-8 2.12.2 Other Rules 2-8 2.13 2-10 The Functions iii CONTENTS (Cont) Page 2.13.1 General 2-10 2.13.2 Analog to Digital 2-10 2.13.3 Extended Functions 2-11 2.13.4 Random Numbers 2-11 2.13.5 Standard Functions 2-11 2. 13.6 Using the Arctangent 2-12 2.13.7 Boolean Functions 2-13 2.13.8 FNEW - A User Functions 2-13 2.14 2-13 The Li brary Command 2.14.1 L-Command For Single User System 2-13 2. 14.2 LIBRA Command Specifications for Multi-User Systems 2-14 2.14.3 DF32 FOCAL FILE STRUCTURE 2-15 2.15 Write 2-16 CHAPTER 3 FOCAL USAGE 3.1 Requirements 3-1 3.2 Loadi ng Procedure 3-1 3.3 Initial Dialogue 3-1 3.4 Operation 3-1 3.4.1 Restart Procedure 3-1 3.4.2 Keyboard Error Recovery 3-2 3.4.3 Parentheses 3-2 3.4.4 Trace Feature 3-2 3.4.5 Variables, Functions and Numbers 3-2 3.4.6 Error Di agnosti cs 3-2 3.4.7 Arithmetic Priorities 3-3 3.4.8 ASCII data 3-3 3.4.9 Indirect Commands 3-3 3.5 Saving Focal Programs 3-4 3.5.1 Paper Tape 3-4 3.5.2 LINC Tape 3-4 3.5.3 Disk Monitor System 3-4 3.5.4 Disk System and Extended Functions 3-5 iv CONTENTS (Cont) Page 3.5.5 Di sk System and Extended Memory 3-6 3.5.6 For 4-user FOCAL SAVE command, see Section 4.6.6 3-7 3.5.7 EAE Patch for FOCAL, 1969 3-7 CHAPTER 4 PROGRAM SPECIFICATIONS 4.1 Machine Requirements 4-1 4.2 Design Specifications 4-1 4.2.1 Design Goals 4-1 4.2.2 Input 4-1 4.2.2.1 Input Format 4-1 4.2.2.2 Character Set 4-1 4.2.3 Output 4-2 4.2.3.1 Output Format 4-2 4.2.3.2 The Input/Output and Interrupt Processor 4-2 4.2.4 Organization 4-3 4.2.4.1 Arithmetic Package 4-3 4.2.4.2 Storage 4-3 4.3 Hardware Errors 4-4 4.4 Internal Environment 4-4 4.4.1 Adding a User's Function; FNEW(Z) 4-4 4.4.2 Internal Subroutine Conventions 4-6 4.4.2.1 Calling Sequences 4-6- 4.4.2.2 Subroutine Organization 4-7 4.4.3 Character Sorti ng 4-7 4.4.4 Language 4-8 4.5 4-9 Notes 4.5.1 Core Uti lization 4-9 4.5.2 Extended Functions 4-9 4.5.3 Error Pri ntouts 4-10 4.5.4 No Interrupts 4-10 4.5.5 Operating HS Reader Without Interrupts 4-10 4.5.6 Non- Typing of Program Tapes During Loading 4-10 4.5.7 Explanation of NAGSW (Not Allor Group Switch) 4-10 v CONTENTS (Cont) Page 4.5.S 4-11 Data Inaccuracies 4-11 4.5.9 4.5.10 4.6 Estimating the Lenght of User's Program 4-11 4-12 FOCA L Systems 4.6.1 FOCAL Systems Assembly 4-14 4.6.2 FOCAL Binary Paper Tapes 4-15 4.6.3 FOCAL Listings 4-15 4.7 4-15 FOCAL Segments 4.7.1 8K Single User Overlay - SK 4-15 4.7.2 Extended Precision Overlay - 4Word 4-15 4.7.2.1 4.7.3 Double Precision Multiply in Four-Word FOCAL 4-16 4-16 Four User Overlay - QUAD 4.7.3.1 Four User Loading and Operating Procedure 4-16 4.7.3.2 Swapping 4-17 4.7.3.3 Workload and Timing 4-17 4.7.3.4 Special Controls 4-17 4.7.3.5 Dialogue 4-17 4.7.4 4.S Graphics for Circles and Lines - CLIN 4-18 4-22 FOCAL Demonstrations 4.S.1 One-Line Function Plotting 4-22 4.S.2 How to Demonstrate FOCAL's Power Quickly 4-23 4.9 4-23 FOCAL Versus BASIC CHAPTER 5 ADDITIONAL FOCAL APPLICATIONS 5.1 FOCAL for the LAB-S 5-1 5.1.1 Standard 5-1 5.1.2 Additionsl (Possible) FOCAL Functions for AX-OS 5-1 5.2 5-3 F NEW for Data Arrays 5.2.1 Storage Requirements 5-3 5.2.2 Usage 5-3 5.2.2.1 Loading 5-3 5.2.2.2 Ca II i ng Sequence 5-4 5.2.3 5-4 Recursive Calling vi CONTENTS (Cont) Page 5.2.4 Restr ict ions 5-4 5.2.5 Description 5-4 5.3 Dynamic Interrupt Processing via FOCAL, 1969 5-5 5.4 Simultaneous Equations' Solutions 5-6 5.5 Fast Fourier Transforms Programs 5-6 5.6 Travel Voucher to Expense Voucher Conversion Program 5-8 5.7 Twins Demo 5-10 APPENDIX A FOCAL COMMAND SUMMARY APPENDIX B ERROR DIAG NOSTICS APPENDIX C EXPLANATION OF NEW INSTRUCTIONS APPENDIX D FOCAL CORE LAYOUT APPENDIX E SYMBOL TABLE AND OTHER TABLES/LISTS APPENDIX F FOCAL SYNTAX APPENDIX G ILLUSTRA TIO NS ILLUSTRA TIO NS 4-1 Figure 4-1 4-8 D-1 FOCAL Core Layout Dynamic Storage D-4 G- 1 (Sheet 1) Arithmetic Evaluation G-l G- 1 (Sheet 2) Arithmetic Evaluation G-2 G- 1 (Sheet 3) Arithmetic Evaluation G-3 G-l (Sheet 4) Arithmetic Evaluation (Analysis of Functions) G-4 G-2 Command/Input G-5 G-3 Main Control and Transfer G-6 G-4 DO Command G-7 G-5 (Sheet 1) Input/Output Commands G-8 G-5 (Sheet 2) Input/Output Commands G-9 vii ILLUSTRATIONS (Cont) Page G-6 Iteration Control G-10 G-7 Conditional Branch Command G-ll G-8 Character Editing G-12 G-9 (Sheet 1) ERASE and Delete G-13 G-9 (Sheet 2) ERASE and Delete G-14 G-10 (Sheet 1) Interrupt Hand ler G-15 G- 10 (Sheet 2) Interrupt Hand ler G-16 G-ll Variable Look-up and Enter G-17 G-12 Character Unpacking G-18 G-13 IIFINDLNIJ Routine G-19 TABLES 4-1 FOCAL Source Segments 4-13 4-2 Allowable FOCAL Systems 4-13 4-3 Variations for FOCAL Systems 4-14 8-1 Error Diagnostics of FOCAL, 1969 B-1 C-1 New Instructions C-3 D-1 FOCAL Core Layout Usage D-1 D-2 Detai led FOCAL Core Layout D-2 F-1 Syntax in Backus Norma I Form F-1 F-2 FOCA L Commands in French F-2 viii CHAPTER 1 INTRODUCTION FOCAL t is a service program for the PDP-8 family of computers, designed to help scientists, engineers, and students solve numerical problems. The FOCALT.M·language is used as a tool in a conversational mode; that is, the user creates his problem step by step, while sitting at the computer; when the steps of the problem have been completed, they can be executed and the results checked. Steps can be quickly changed, added or deleted. One great advantage of a computer is that once a problem has been formulated, the machine can be made to repeat the same steps in the calculation over and over again. Until now, the job of generating the program was costly, time-consuming, and generally required the talents of a specialist called a programmer. For many modest jobs of computation, a person unfamil iar with computers and programming would use a desk calculator or slide rule to avoid the delays, expense, and bothersome detail of setting up his problem so that the programmer could understand it. FOCAL circumvents these difficulties by providing a set of simplified techniques that permit the user to communicate directly with the computer. The user has the advantages of the computer put at his disposal without the requirement that he master the intricacies of machine language programming, since the FOCAL language consists of imperative English statements in standard mathematical notation. FOCAL is flexible; commands may be abbreviated, and some may be concatenated within the same line. Each input string or line containing one or more commands is terminated by a carriage return • A great deal of power has also been put into the editing properties of the command language. Normally, deletions, replacements, and insertions are taken care of by the line number which indicates the replacement or repositioning of lines. If single characters are to be changed within a FOCAL command line, it is not necessary to retype the entire string. The changes may be executed by using the MODIFY command. Thus, complex command strings may be modified quite easily. In operation, the program indicates that it is ready to receive input by typing an asterisk. On-line command/input may be either direct (to be executed immediately) or indirect (to be stored and executed later) commands. An example of a direct command is *TYPE = 5*5*5, 1 (User) 125.000* (PDP-8) The final asterisk indicates that FOCAL is ready for its next command. All commands may be given in immediate mode (see Appendix A). t£ormulating 9n-Line Salculations in ~Igebraic !:.anguage (or FORmula CALculator) T.M·Trademark of the Digital Equipment Corporation, Maynard, Mass. 1-1 Text input requires that a numerical digit, in the form ab .cd and within a range of 1 .01 to 31 .99, follow the *. The number to the left of the period is called the group number. The nonzero number to the right is called the specific line or step number. While keying in command/input strings, the rubout key and the left arrow may be used to delete single characters or to kill the entire line, respectively. Since the command decoder is table driven, FOCAL can be modified by a small binary tape to understand foreign languages commands. (See Appendix F-2) FOCAL is written especially for the educational and engineering markets and is intended to be used as a problem solving tool. It gives quick and concise reinforcement, minimizes turnaround time, and provides an unambiguous printed record. FOCAL is also an extremely flexible, high accuracy, high resol ution, general-purpose desk calculator and demonstration program. This document describes the language, operating procedures for Disk Monitor and FOCAL; use of High Speed reader; addition of user function FNEW; and many other details of interest. Symbol tables, lists, and flow-charts are included. There are also descriptions of the lO-digit overlay, 4 user overlay, and the complete graphics function. 1-2 CHAPTER 2 COMMANDS 2. 1 TYPE, ASK The TYPE and the ASK statements are used for output and input of literals, alphanumeric calculations, and formats. The simplest form of the TYPE statement is a command (e.g., TYPE A *1 .4). This will cause the program to type =, evaluate the expression, and type out the result. Several expressions of this kind may be typed from the same statement if the expressions are each ended by commas. The ASK statement is similar to the TYPE statement in form, but only single variable names can be used instead of expressions, and the user types in the values. 2.1.1 Literals For output of literals, the user may enclose characters in quotation marks. The carriage return will automatically generate closing quotation marks. The bell may only be inserted during initial input, not via the MODIFY command. 2.1.2 Numerical Input Formats Keyboard responses to ASK inputs may a• have lead i ng spaces b. be preceded by + or - sign if desired or required c. be in any fixed point or floating point format d. be terminated by any terminating character, carriage return, or ALTMODE. It is recommanded, however, that the space be adopted as the conventional and general purpose input terminator. The AL TMODE is a special nonprinting terminator that may be used to synchronize the program with external events. For example, to insert special paper in the teletype before executing the program, type Ask Ai GO and RETURN, then load the paper, and hit ALTMODE. The value of the variable used remains unchanged. 2.1.3 Alphanumeric Input Formats Input data that is in response to an ASK command may take any format, may be signed or unsigned, and must be terminated by a legitimate terminating character (space, CR, comma, I, etc.). This means that alphabetic input may also be accepted by an ASK input command (see 3.4.9). This is done by a simple hash-coding technique so that the program can recognize keyboard responses by a single comparison. See example under the IF command for an illustration of how to program the 2-1 recognition of the user reply "WAIT". This is possible because the leading zero causes a character string to be interpreted as a number. (e.g., *TYPE OANSWER = 0.26130E+22*). Any literal word containing the letter "E" twice in one input will cause the ASK statement to be terminated as the program interprets this letter as an exponent. 2.1.4 Special Characters The exclamation point (!), percent (%), dollar sign ($), and the number sign (#) may be used next to quotation marks or by themselves. They cannot be used to terminate alphanumeric expressions. They may be used in either TYPE or ASK commands. The TYPE statement precedes its numerical typeouts with an equal sign (=) before beginning the output conversation process. The ASK statement types a colon (:) when it is ready to receive keyboard data. To type an expression before its results, the user may enclose the expression in question marks. This is a special use of the trace feature. *TYPE ?A *5.2? A *5.2=+ 10.40 * 2.1.5 Print Positions Carriage returns are not automatically supplied at the termination of a typeout. To supply carriage returns within a TYPE or ASK statement, the exclamation mark (!) is used. This is similar to the use of the slash in FORTRAN format statements. Occasionally, it is desirable to return the carriage and type out again on the same line without giving a line feed. A number sign (#) returns the print mechanism to the left hand margin but does not feed the paper forward. This feature may be used to plot another variable along the same coordinate. 2.1.6 Symbol Table TYPE. $ (dollar sign) causes the contents of the symbol table to be typed out with the current values of all variables created. The symbol table is typed with subscripts and values in chronological order. The routine then returns as though a carriage return had been encountered in the TYPE statement, thereby terminating the TYPE command. Both the TYPE and the ASK statements may be followed by a semicolon (;) and other commands, unless a $ is in the string. 2-2 2.1.7 Output Formats The output format may be changed within a TYPE statement by %X. YY, where X and YY are positive integers less than 31. X is equal to the total number of digits to be output and YY is equal to the number of digits to the right of the decimal point. During output, leading zeroes are typed as spaces. If the number is larger than the field width indicates, FOCAL wi II convert to E format. E format is also specified by % alone. (Floatingpoint decimal: ±O.XXXXXXXE±Y, where E means "10 to the Yth power".) The current output format is retained unti I expl i citly changed. If a number is too large for the current format, the E format is used temporarily. 2.1.8 Terminators In the ASK statement, arguments are scanned by the GETARG Recursive Routine and may therefore be terminated by any legitimate terminating character (e.g., space, comma, *, etc.). In the TYPE statement, arguments are scanned by the EVAL Recursive Routine and must therefore be terminated by comma, semicolon, or carriage return. In either the TYPE or ASK statement, command arguments may be preceded by format control characters # ! ". Example: *ASK?A B C ? A :5, B :6 C :7) * All commands except WRITE, RETURN, MODIFY, QUIT and ERASE may be combined on the same line if separated by a semicolon. 2. 1 .9 Off-Line Data Tapes (c.f., Section 4.5.3) To prepare data tapes off-line, type the data word, the terminating space, and the "here-is" key. Use backspace and rubout to remove characters off-I i ne . 2. 1 .10 Corrections For editing input to an ASK command before the input has been terminated, the left arrow ( +-) is used. 2.1.11 Roundoff Numbers to be typed out are rounded-off to the last significant digit to be printed (i .e., the rightmost digit of the requested format) or to the sixth significant digit, whichever is smaller. 2-3 2.2 DO The DO command is used chiefly to form subroutines from single lines, groups of lines, or from the entire text buffer. Thus, the instruction DO 3.3makes a subroutine of line 3.3. For a single line subroutine, control wi" be returned when the end of the I ine is encountered or when the I ine is otherwise terminated (e.g., by a RETURN statement, or in the case of TYPE, with the $). One of the most useful features of a command language of this type is the ability to form subroutines out of entire groups. Thus, the statement DO 5 calls all of group 5 as a subroutine beginning with the first group 5 line number. Control wi II then proceed through the group numbers going from smaller to larger. A return or an exit is generated from this type of subroutine by using the word RETURN, or by encountering the end of that group, or by transferring control out of the group via a GOTO or IF command. Simi larly, the entire text buffer may be used as a recursive subroutine by simply using DO or DO ALL. The DO statement may be concatenated with other legitimate commands by terminating it with a semicolon. Thus, a single I ine may contain a number of subroutine caUs. In this way, several forms of complex subroutine groupings may be tested from the console. The number of DO commands which may be nested linearly or recursively is limited only by the amount of core storage remaining after inclusion of the text buffer and the variable storage. NOTE When a GOTO or IF statement is executed within a DO subroutine, control is transferred immediately to the object line of the GOTO command; that line will be executed and return made to the DO processor. If the next line number is within the group (if this is a group subroutine), it will be executed. If, however, a line number outside of that group is about to be executed, then a return will be made from the DO subroutine and if any of the DO command line remains, it will be processed. 2.3 EDITING AND TEXT MANIPULATION FACILITIES 2.3. 1 Command-Input A line number which has already been used and is reused in a new input will cause the new input to replace the line that previously had that number. Insertions are made at the appropriate point in a numerically-ordered string of lines. For example, line number 1 .01 (the smallest line number) will be inserted in front of (or above) line number 1 .1. The largest line number is 15.99. 2-4 2.3.2 ERASE Removal of a single line may be made by using the ERASE command. For example, ERASE 2.2 will cause line 2.2 to be deleted. No error comment will be given if that line number does not exist. The command ERASE 3 or 3.0 will cause all of group 3 to be erased. To delete all of the text, one must type the words ERASE ALL. ERASE, used alone, has the function of merely removing the variables. This may also be thought of as initializing the values of the variables to zero. To examine a single line, type WRITE followed by the line number. For example, WRITE 3.3 will cause line 3.3 to be typed out with its I ine number on the Teletype. WRITE 4.0 wi II cause all of group four to be written on the Teletype. WRITE ALL will cause all of the text to be printed on the Teletype, left justified, with title and line numbers in numerical order. 2.3.3 MODIFY When only a few characters of a particular line must be replaced, the MODIFY command is used to avoid replacing the entire line. For example, to change characters in line 5.41, type MODIFY 5.41. This command is terminated by a carriage return, and the program waits for the user to type that character at which he wishes to make changes or additions. The program will then type out the contents of that line until the search character is typed. (The search character is not echoed when it is first keyed in by the user.) The program will now accept input. At this point, the user has seven options: a. type in new characters in addition to the ones that have already been typed out; b. type a form-feed; this will cause the search to proceed to the next occurrence, if any, of the search character; c. type a bell which allows him to change the search character just as he did when first beginning to use the MODIFY command; d. use the rubout key to delete characters going to the left; e. type a left arrow to delete the line over to the left margin; f. type a carriage return to terminate the line at that point and move the text to the right; g. type line-feed to save the remainder of the line. The ERASE ALL and MODIFY commands are generally used only in immediate mode, as these commands return to command mode upon completion. The reason for this is that internal pointers may be changed by these commands. During command/input, the left arrow wi II delete the line numbers as well as the text. During the MODIFY command typing the left arrow will not delete the line number. When the rubout key is struck, a backslash (\) is typed for each character that is deleted. 2-5 NOTE Any modifications to the text will cause the variables to be deleted as if an ERASE command had been given. This is caused by the organization of the data structure. It is justified by the principle that a change of program probably means a change of variables as well. 2.4 FOR This command is used for convenience in setting up program loops and iterations. The general format is: FOR A = B, C, D;---. The index A is initial ized to the value B, then the command string following the semicolon is executed at least once. When the carriage return is encountered, the value of A is incremented by C and compared to the value of D. If A is less than or equal to D, then the command string after the semicolon is executed again. This process is repeated until A is greater than D. Naturally, A must be a single variable; but B, C, and D may all be expressions, variables, or numbers. The computations involved in the FOR statement are done in floating point arithmetic. If comma and the value C are omitted, then it is assumed that the increment is one. For example: SET B = 3; FOR I = 0, 10; TYPE Btl, ! (po'Aer of 3) 2.5 IF To provide transfer of control after a comparison, we have adopted the IF statement format from FORTRAN. The normal form of the IF statement contains the word IF, followed by a space, a parenthesized expression, and three line numbers separated from each other by commas. The program will GOTO the first line number if the expression is less than zero, the second line number if the statement has a value of zero, and the third I ine number if the value of the expression is greater than zero. Alternative forms of the IF command are obtained by replacing the comma between the line numbers by a semicolon. In this case, if the condition is met which would normally cause the program to transfer to a line number past that position, then the remainder of the line will be executed. Example: ASK REPLY IF (REPLY-OWAIT)6.4, 5.01; RETURN IF (REPLY - OYES) 6.3, 5.02; 6.3 2-6 NOTE The IF command could occasionally fail to take the = 0 branch due to internal computation and truncation errors. 2.6 GOTO This command causes control of the program to be transferred to the indicated line number. A specific line number must be given as the argument of the GOTO command. If command is initially handed to the program by means of an immediately executed GO, control will proceed from low numbered lines to higher numbered lines as is usual in a computer program. Control will be returned to command mode upon encountering a QUIT command, the end of the text, or a RETURN at the top level. The operation of the GOTO is slightly more complicated when used in conjunction with a FOR or a DO statement. Its operation is perfectly straightforward when used with any other statement. 2.7 RETURN The RETURN command is used to exit from DO subroutines. It is implemented internally by setting the current program counter to zero. When this situation is encountered by the DO statement it exits. (Refer to the DO command, Section 3.2.). 2.8 QUIT A QUIT causes the program to return immediately to command/input mode, type *, and wait. 2.9 COMMENT Beginning a command string with the letter C will cause the remainder of that line to be ignored so that comments may be inserted into the program. 2. 10 CONTINUE This word is used to indicate dummy lines. For example, it might be used to replace a line referenced elsewhere without changing those references to that line number. 2. 11 SET The SET command for arithmetic substitution is used for setting the value of a variable equal to the result of an expression. The SET statement may contain function calls, variable names, and 2-7 numerical literals on the right hand side of the equal sign. All of the usual arithmetic operations plus exponentiation, may be used with these operands. The priority of the operators is a standard system: +-/* t. These, however, may be superseded by the use of parenthetical expressions. The SET statement may be terminated by either a carriage return or a semicolon, in which case it may be followed by additional commands. For example: SET AA=B(5+<6+CONST>*AlPHA/ [5/BETA]);GOTO 3.2 2.12 HIGH-SPEED READER 2.12.1 General The asterisk (*) is also used as a flip-flop control over the selection of the input device to be used by a FOCAL program. (See the examples that follow.) An out-of-tape condition will return to low-speed reader input and change the status of the * flip-flop. An error condition, however, does not change that * flip-flop (see notes below). For example, typing: :* ~ will read in a program tape or a series of immediate commands. **;ASK ABCDZ will fill AB with data from tape. If tape is empty, control will return to command mode. *1 .1*; FOR 1=1, 5; ASK AX(I) *00 1.1 If the tape contains fewer than 5 pieces of data, then remaining items are taken from keyboard. (See c below.) 2.12.2 Other Rules a. * as a command may be concatenated with other processes [JMP (PROC): (e.g., 01.30*; ASK A, B;*) b. If an out-of-tape condition is encountered while reading commands, then the input device is switched to keyboard and all is returned to normal. (This occurs when the user has no reader.) It is equivalent to receipt of a left arrow. [JMP (IBAR)]. c. If an out-of-tape condition occurs while executing an ASK command, then FOCAL responds as if the end of the command line (carriage return) has been reached. [ISZ PDlXR; POP J] Thus, :*; ASK A,B,C,D produces:::(out of tape on C): and the user is back to normal mode. 2-8 However, *ERASE ~*; for 1=1, 20; ASK A(I); TYPE I, ! . :=1.0000 : = 2.0000 * : = 3.0000 : (out of tape for 1=4) : (now accepting from keyboard) 123, = 5.0000 : 345, = 6.0000 : ?01 .00 (Control-C typed) * TYPE $ I@ (00) = 7.0000 A@ (01) = (data from tape) A @ (02) = (data from tape) A @ (03) = (data from tape) A @ (04) = .0000 A @ (05) = 123.0000 A @ (06) = 345.000 d. When an error occurs from the reader (illegal command, etc.), the code will be typed out and input device control returned to the low-speed device. However, the device flip-flop (HSPSW) will still indicate that the reader is active. Consequently, it will be necessary to give two asterisks before the reader will be activated again. ** *****?12.83 (Buffer full) ** ** (reader now active again). e. It is necessary to have a fairly long timing loop to detect the out-of-tape condition (slow readers, reatart delays, etc .). As a result, the user of a PDP-8/s may encounter long delays if there is no high speed reader or when the reader is out of tape. However, the initial dialogue makes a correction for this when an 8/5 is being used. f. Since the reader operates with the interrupt on, one may use Control-C to return at once to keyboard input mode. A manual interrupt via Control-C (?01 .00) or a console restart (?OO.OO) gives the same effect. g. All commands, including "*" may be executed in immediate mode from the high speed reader. This has several beneficial results: (1) Program tapes may be composed that are self-protecting and self-starting ERASE ALL (protection) 01.10 ASK "Power of 2?"REPLY (input indirect program) 01.30 TYPE 2 REPLY, !, GOTO 1 . 1 (etc) (starting) GOTO 1.1 (data) 5, 3, 1 This particular program is an infinite loop and must be stopped by a Control-C from the keyboard. 2-9 (2) Programs may chain themselves together. ERASE ALL 3.4 TYPE IINUMBER 111!! !; ASK A 3.5 * (indirect command) *; GO (device restored to low speed and program started) The printout from this tape will be: ** ****** (START READER) NUMBER 1 (Three I ines accepted) (Erase processed) : (waiting for keyboard input») (user) (execution of 3.5 * at this point wi" reactivate the high speed reader). (3) Immediate mode commands on the tape allow maximum storage for variables. (4) If the interrupts are disabled by the patches shown in Section 4.5.3, then two tapes may be merged from both high- and low-speed readers by a resident FOCAL program. 2.13 THE FUNCTIONS 2.13.1 General The functions are provided to give extended arithmetic capabilities and the potential for expansion to additional input/output devi ces. There are basically three types of functions. The first group contains integer parts, sign part, square root, fractional, and absolute value functions. The second group has the input/output for scope and analog/digital converter functions. The third group has extended arithmetic computations of trigonometric and exponential functions. A function call consists of no more than four letters beginning with the letter F and followed by a parenthetical expression (e.g., FSGN (A-B *2». This expression is evaluated before transferring to the function process itself. 2. 13.2 Analog to Digital a. Input T~e function FADC(X) is used to take a ra:lding from an analog-to-digital converter. The value of the function is a 12-bit integer reading. The argument "X II is the channel member (AX08) in decimal. Additional version of the ADC function could be designed to provide for synchronization by a c lock or other means. (c. f., Chapter 5) *SET A=FADC () *5 2-10 b. Output The scope function FDIS (expression, expression) is used to set and display an X-V coordinate on a Model 34 Scope and scope interface. The value returned for each of these functions is the integer part of the second expression. *SET Z = FDIS(X,X43/50) 2.13.3 Extended Functions The extended arithmetic functions (FEXP, FLOG, FATN, FCOS, FSIN) are retained at the option of the user. They consume approximately 800 characters of text storage area. These arithmetic functions are adapted from the extended arithmetic functions of the three-word, floating point package. 2.13.4 Random Numbers A simple random number generator is provided in the basic package as FRANO! An expanded version could incorporate the random number generator from the DECUS library. Functions for other devices are provided as overlay tapes (see Appendix H). 2. 13.5 Standard Functions a. Trigonometric Functions All arguments are in radians FSIN () - the sine functions FCOS ( ) - the cosine function FATN ( ) - the arctangent From these functions, the user may compute all other trigonometric functions. (See FOCAL User1s Manual) b. Logarithmic Functions FLOG ( ) - log to the base e or Naperian base FEXP () - e to the pov..e r c. Arithmetic Functions FSQT () - the square root FSGN ( ) - one (1) with the sign of the argument FABS () - the absolute value FITR () - the next smaller integer part maximum of 1024 LOG (ARG) = LOGe (ARG) *LOG (e) 10 10 LOG (e) = 0.434295 10 LOGe (10) = 2.30258 e = 2.71828 where: 1 degree = .0174533 radians 1 rod ian = 57 • 2958 degrees 2-11 2.13.6 Using The Arctangent An arctan function cycles between + IT/2 and - IT/2. Thus, to get a correct range for 0-2lT radians from the expression FATN(y/X), we must use the signs of X and Y. X Y FATN(X/y) + + O-PI/2 + PI/,2 - PI PI - 3*PI/2 3 *PI/,2 - PI *2 + = = :: = = = = = = = = = :: = = = = = :: = = :: = = I i..j OEX l\ 0.0f)= 1.00= 0.96= 0.83= ~j. 62= 121.36= 0.07= 0.23= 0.51= 121.74= 0.91= 0.99= 0.99=- {j. 30= 0.60= (1).90= 1.20= 1.5')= 1.80=2.110=2.40=2."10=3.100=3.30=3.60=3.910=4.20=4.510=4.80= 5.10= 5.40= 5.70= 6.00= 6.30= 6.60= 6.90= C-FOCAL ~ v).90=- 0.73=0.49=0.21=0.09=0.38=0.64=0.84=0.96=1.00= 0.95= 0.82= Y 0. {1V;= 0.3f,= 0.57= 0.78= ~l. 93= 1.0fi= 0.97=0.86=(;).68=0.43=0.14=0.16= 121.44= 0.69= 0.87= 0.98= 1 .00=0.93=0.77=0.55=0.28=0.02= 121.31= 0.58= FUNCTION (7;.000(1nr = 0. 300~}0~i = = = = = = = = (/'.600000 0.900000 1.20e,000 1.50vHJ00 1.3.4] 6CO 1. e41 M"~ ~).741595 0.441595 0.141595 (1.158403 0.4584'-"2 0.758402 1.05840C;' 1.3584f:ie, 1.483200 1.1832vH:, 0.883196 ~j. 583195 0.283198 0.0168~'2 121.316803 0.616800 :: em'it-' LJ T E [) P.0CilfHiW0 fl. ~00000 P.6Ci'i!('P00 ~l. 900f10~ 1 • 2lil000~! 1.5011'0(110 ] • R0f,~Hi)fl 2. 1 ~~Ci'l000 2.40f'0(i1C7' 2.70000'" 3.00v'lIif\(ij = = = = = = = = = = = = 3.300t7·0fi 3. 60C?""j0 3.9f':fI 00V 4.2~000(7: 4.500000 4.80000P 5. 100f7,00 5.400000 ~h 7f,0~HH) 6. 0000f'o~ 0.016802 0.316803 0.616800 8/68 01.05 T !!!!" INDEX X Y FliNCTION 01.10 FOR I=0~.3~7J TYPE !~%4.02~IJD 2 01.20 TYPE !!!!J~RITE ALL 01.30 QUIT COMPUTED 02.10 ~ET Y=FSINC!)J SET X=FCOS(I) 02.20 TYPE X~Y~%8.06~rATNCY/<X+IE-10»J DO 13J TYPE .. 13.10 IF CX)13.3~13.2.13.3 13.20 S~T X=lE-100 13.30 S~T TH=FATN(FABS<Y/X» 13.~0 SET PI=3.141596 13.50 IF (Y) 13.61 IF (X) 13.7J RETURN 13.60 IF C~) 13.8JSET TH=PI+PI-THJ RETURN 13.70 SET TH=PI-THJ RETURN 13.80 SET TH=PI+THJ RETURN • 2-12 .. THJ 2.13.7 Boolean Functions TRUE is +1 FALSE is -1 *D 15 A B =-1=-1 =-1= 1 = 1=-1 = 1= 1 AND =-1 = =-1 = =-1 = = 1 OR -1 1 1 1 NOR 1:::: 1= 1:::: -1:::: XOR 1 -1 -1 1 CARRY ::::-1::::-1 SUM ::::-1:::: 1 =-1= 1 = 1=-1 XOR is A*B NOR is FSGN(-A-B) OR is FSGN(A+B) AND is FSGN(A+B-1) NOT(A) is -A The result of adding A and B is CARRY = FSGN(A+B-1) SUM = -A*B * *WRITE 15 15.05 TYPE II A B AND OR NOR XOR CARRY SUM" ! 15.10FORA=-1,2,1;FORB=-1,2,1;TYPEA,B," "DO 15.2 15.15 QUIT 15.20 TYPE FSGN(A+B-l),FSGN(A+B),FSGN(-A-B),A*B," "FSGN(A+B-1),-A*B,! * 2. 13.8 FNEW - A User Function This function name may be used to call a machine language routine for any reason. (See Section 4.4. 1) 2.14 THE LIBRARY COMMAND The form and usage of this mass storage command will vary with the computer and FOCAL system used. (c. f • , 4.6) 2.14.1 L-Command For Single User System The command may be given in either direct or indirect mode. Execution of this command first causes the octal typeout of the contents of four FOCAL pointers: CFRS, BUFR, LASTV, and BOTTOM, respectively. The second action is to type out whatever characters follow the ilL II to serve as operating instructions for the user. The third action is to turn off the interrupts and transfer to the Disk Monitor or a-Library System by jumping to 7600. 2-13 The four octal numbers represent: a. the start of text buffer, b. the end of text buffer, c. the end of the variable list, d. the bottom of the push-down list. These command features will permit optimum usage of available disk storage and be compatible with the Disk Monitor. After debugging a program, a typical user will execute ERASE and LIB. (This causes Band C to be equa lin the 4K system.) He will then save the program and restart or call another program. (See Section 3.4.12) Manual Chaining may also be done. For example, when a program reaches line 12.3, it may need to call another routine (as in a series of teaching programs, demos, or math subroutines). The user, however, must be given instructions on how to proceed: 12.30LlB .CALL LES2 For example, execution of 12.3 may produce: 3206 3345 3401 4407 .CALL LES2 .CALL LES2 . START [User types thi s] * In the 8K Version, the text and variables are stored independently. For this reason, the 8K version can have different programs operating on the same data. (See Section 3.4. 14) 2. 14.2 LIBRA Command Specifications for Multi-User Systems* Four modifiers of the LIBRARY command are implemented to allow automatic program storage, retrieval, and management in multi -user FOCAL. This extension to the FOCAL system is implemented under the segment name LIBRA and requires at least an 8K PDP-8 with one DF32. The LIBRARY command and its variations are: a. To save a program on disk, LI BRA SAVE name ~ Where IJ name 1/ is a 1 to 4 character identifier and) is described in the FOCAL language specifications. *Not completed 2-14 Errors: (1) A program with an identical name has been found in the directory list (2) Name missing from command (3) Disk I/O error (non-recoverable) b. To call a program on disk, LIBRA CALL name ~ Errors: (1) No such program on directory list (2) Name missing from command (3) Disk I/O error (non-recoverable) c. To delete a program from disk, LIBRA DELETE name ~ Errors: d. (1) No such program name in directory list (2) Name missing from command (3) Disk I/O error To list the directory LIBRA LIST ) Errors: (1) Disk I/O error NOTE This command will destroy any program by an effective IIERASE ALL II. The directory is printed ten across for as many lines as necessary. 2.14.3 DF32 FOCAL FILE STRUCTURE Programs are stored in blocks 1600 words long. This allows 36 blocks of storage on one S DF32 and a directory of 512 words or 256 entries. This directory is sufficient for the maximum DF32 configuration allowable on a PDP-S. l. Disk 36 blocks 2. Disk 72 blocks 3. Disk 110 blocks 4. 146 blocks Disk 2-15 The directory is a linear list with a maximum size of 512 words (with 2 words/entry). Word position in the list corresponds to the block position on the disk. The blocks begin at location lOOOS from the end of the directory and extend in increments of 1600 to the end of the disk. The end of the list is an S entry of ones. Unused blocks are indicated by entries of all zeroes. The LIBRARY functions swap users in the multiple user system. This diminishes the total number of blocks by the maximum number of allowed users. A disk program is required to clear the directory, and to set the maximum number of blocks available. 2. 15 WRITE The WRITE command is used to list the entire indirect program (WRITE ALL or W), specified groups, or single lines. When all text is printed, a leader-identifier is given at the top of the listing. This identifies which major version is being used for the particular indirect program. (FOCAL, 1969; SK FOCAL @ 1969; 4-word @ 1969). NOTE The WRITE command disables the trace. 2-16 CHAPTER 3 FOCAL USAGE 3. 1 REQ UIREMENTS Any 4K PDP-8 family computer with Teletype may be used with FOCAL: PDP-5, PDP-8, PDP-8/S, PDP-8II, PDP-8/L, LAB-8, LINC-8, TSS-8, PDP-12. 3.2 LOADING PROCEDURE a. The RIM or Read-In-Mode Loader must be in memory. (See RIM Loader Manual for a thorough discussion.) b. The RIM Loader is used to load the Binary Loader. (See Binary Loader Manual for a comp Iete descri pt ion • ) c. The Binary Loader is used to load FOCAL. d. Upon halting, press the CONTINUE key, since the program is loaded in two sections. e. Place 200, the starting address of FOCAL, into the Switch Register when the complete tape has been loaded. 3.3 f. Press the LOAD ADDRESS key. g. Press the START key. h. The initial dialogue will begin. INITIAL DIALOGUE The program will identify the DEC 12-bit computer you are using and make appropriate corrections to itself. If the user determines that extra space is required, the program will permit rejection of extended functions. FOCAL is ready for commands when it types *. 3.4 OPERATION 3.4.1 Restart Procedure There are two methods to restart the system. Method 1 - Type the character control/C at any time; (FOCAL acknowledges this by typing ?01.00). Method 2 - a. b. c. d. e. Put 200 into the Switch Register Press the STOP key Press the LOAD ADDRESS key Press the START key The program will then type ?OO.OO indicating a manual restart, and an asterisk indicating it is ready to receive input. 3-1 3.4.2 Keyboard Error Recovery If an error is made while typing commands to FOCAL, one of the following methods may be used to recover: a. Use the RUBOUT key on the teletype keyboard to erase the preceding character. The RUBOUT key echoes \ for each character removed. b. Use the MODIFY command, with the modify control characters, to search the command string for any character in error and alter or delete that character. 3.4.3 c. Use Left Arrow to delete over to the left margin. d. Use Left Arrow to delete input data. Parentheses The following parenthetical pairs may be used in any alphanumeric expression: parentheses, angle brackets « », and square brackets ( [ ] ). The program checks to see whether the proper matching terminator has been used at the correct level. Use of these terminators in different configurations provides additional clarity in reading alphanumeric expressions. 3.4.4 Trace Feature A trace feature may be used to detect errors, follow program control, and create special formats. To implement the trace feature, insert a question mark into a command string at any point. Each succeeding character will then be typed out as it is interpreted until another question mark is encountered or until the program returns to command-input mode. 3.4.5 Variables, Functions and Numbers A variable name consists of one or two alphanumeric characters, of which the first must be a letter. The second character may be A-Z, 0-9, II, I . Additional characters are ignored. Function names are easily distinguished from variable names because they start with the letter F. A number always begins with a digit 0-9. 3.4.6 Error Diagnostics Programming errors are indicated by an error diagnostic. The printout is in the form ?XX.XX@ GG.SS. The first number is a specific error number derived from the core address of the error call. The GG.SS is the number of the line, if any, of the text which contains the error. The error diagnostic printouts are intended to be efficient yet informative and expl icit. Used in conjunction with the trace feature, these wi" pinpoint errors precisely. (See Appendix B). 3-2 Example: *00 2.35? SET A=5/C + ?28. 72 (Divide by zero, C=O) * 3.4.7 Arithmetic Priorities * / +Operations of equal priority are executed from left to right (e.g., T 2 t3 t2=64 not 512). 3.4.8 ASCII data ASCII input of A-Z has the values of 1-26 per digit per letter respectively, thus, *ASK A; TYPE A :Z=26.00 *A A; T A :AZ = 36.00 This is also true for internal numerical constants I ike ONO, DYES, etc. (See the IF command for an example of this feature.) The technique may also be used to create a kind of associative memory: 3.4.9 *ASK :DICK A; ASK GRADE (A) ~ : 95 *ASK :DICK A;TYPE GR(A») =95 Indirect Commands If a Teletype I ine is prefixed by a line number, that line is not executed immediately, but is stored for later execution. Line numbers must be in the range 1.01 to 31.99. The numbers 0.0, 1.00,2.00,3, etc., are illegal line numbers and are used to indicate the entire group. The number to the left of the point is called the group number; the number to the right is called the step number. Execution of indirect commands is begun by an immediate GOTO of DO command. The GOTO command causes FOCAL to start the program by executing the command at a specified line number (e.g., GOTO 1 .3). The GO command causes FOCAL to go to the lowest numbered line to begin executing the program and continues until it runs out of program text. FOCAL can automatically cross group boundaries. 3-3 3.5 SAVING FOCAL PROGRAMS 3 .5. 1 Paper Tape To save a FOCAL symbolic text, type WRITE ALL, turn on the punch, type @ marks for leader-trailer, and type carriage return. When all of the program has been typed out, type additional @ marks for more leader-trailer, turn off the punch, and continue your conversation with the computer. (To save a FOCAL binary program, see Appendix C.l .) 3.5.2 LINC Tape (see Section 2. 14. 1; TCOl via 8-LIBRARY SYSTEM; PDP-12) On LINC tape, load FOCAL program as follows: a. Load FOCAL binary tape, execute Initial dialog, and call UPDATE. NAME: START SA (OCTAL): 200 MEM LOCATIONS: <4600, 7577 >; b. Call UPDATE again. NAME: FOCAL SA (OCTAL): (none) MEM LOCATIONS: < 0, c. 3377 >; Call ing Sequence: FOCAL START * d. Write the desired FOCAL routine. e. Give an ilL II command. Four octal numbers will be printed, and control will return to the Library System. UPDATE NAME: (user's choice) SA (OCTAL): (none) MEM LOCATIONS: < 0 > < (A), (B) >; Where "(A)" and II (B) II mean the first and second octal numbers. f. To call a program: FOCAL (user's choice) START * 3.5.3 Disk Monitor System (see Section 2. 14. 1) a. Build the Disk System. 3-4 b. Load FOCAL into field zero. (If the computer has 8K, use the binary loader in field 1.) Alternate procedure: Use PIP to place the binary on disk. Then, use LOAD on the disk file. (This procedure is faster for a teletype, but uses more disk space.) c. Load Address 200, START, and complete the initial dialogue. d. Load Address 7600 and START. e. Initial ize the disk as follows: . SAVE .SAVE f. START!4600-7577;200 FOCAL! 0-3377; Run FOCAL . . ) FOCAL .) START (Create Program) g. Save program; return to disk Monitor by giving an L command . . SAVE (name);O, (A) - (B) h. [note saving page zero] Run a program (after doing either step f or g) • . FOCAL) .CALL (name) ) . START) [I inefeed wi II not occur] *(FOCAL ready) Steps g and h may be repeated. 3.5.4 Disk System and Extended Functions To cope with configurations involving deletion of extended functions, proceed as follows: a. Load FOCAL and start at 7600; .SAVE START!4600-7577;200 .SAVE INIT:0,3200-4577; [note saving page zero] .CALL INIT • START [Dialogue, answer YES] *L .SAVE FOCAL !0-3377; b. To reinitialize a system without some extended functions, type .FOCAL .CALL INIT • START [Dialogue, answer NO, YES, i.e., keep sine and cosine] *L .SAVE STNY!5200-7577;200 3-5 c. To create a system without any extended functions, type .FOCAL .CALL INIT • START [Dialogue, answer NO, NO] *L .SAVE STNN !5400-7577;200 d. Be sure to use the correct START command with each user program. (1) [to use no exponential function version] .FOCAL .CALL NEXP .STNY * (2) or [to use no cosine function version] .FOCAL .CALL NCOS .STNN * 3.5.5 Disk System and Extended Memory (see section 2. 14. 1) Follow these operations to set up an 8K version of FOCAL on the disk: [Bui Id Disk System] [Load FOCAL] [Start at 200] [Dialogue, answer questions.] *L ) 0100 (A) 0121 (B) 3217 (C) XXXX (D) .SAVE ST8K! (D) -7577;200 .SAVE FCL81 0 - 3177; .SAVE NUL8: 10100; 10113 The SAVE command for a finished 8K FOCAL program is .SAVECODE:1(A) - l(B); 10113 where (A) and (B) are the first and second four digit numbers typed out by the L-command. These are the field one bounds of the program text. The value of (D) will depend on the functions retained. 3-6 The variables, however, are in field zero. To save a set of data, type: .SAVE DAT8:0;3200-(C); [note saving page zero, field zero] To set up a null program with a particular data set, type: .FCL8 .CALL DAT8 .CALL NUL8 .ST8K 3.5.6 For 4-user FOCAL SAVE command, see Section 4.6.6. 3.5.7 EAE Patch for FOCAL, 1969 7203 7204 7205 7206 7207 7210 7211 7212 3206 1256 7425 o 3253 7501 3255 5227 DCA TAD MQL .+3 MP2 MUY o DCA MQA DCA SNP MP5 MP3 .+15 3-7 CHAPTER 4 PROGRAM SPECIFICATIONS 4.1 MACHINE REQUIREMENTS The minimum hardware configuration necessary to run this program is a 4K PDP-8 family computer with ASR-33. Scope, an additional 4K memory, and high-speed reader and punch are available options. Additional PT08s are added for extra users. 4.2 DESIGN SPECIFICATIONS 4.2. 1 Design Goals FOCAL is a conversational language and operating system for a basic PDP-B. It is designed to faci litate on-I ine editing and execution of symbol ic programs. (For BNF description, see Appendix F.) 4.2.2 Input The keyboard, low-speed reader, or high-speed reader may be used for input of program text and for commands to be executed immediately. Keyboard input is double buffered. 4.2.2. 1 Input Format - See description of the commands in Chapter 2 for format information. 4.2.2.2 Character Set - Input and output characters are in ASCII teletype code. Interpretive opera- tions are also done internally in expanded ASCII. The text buffer is packed two characters to a word as follows. = represented as: prints as number 300 = not packed = ignored: @ 301 - 336 = 01 - 36: A-Z 337 = not packed - edit control, kill line: 240 - 276 = 40 - 76: symbols = 37: ? 277 340 - 376 = 7740 - 7776 (extended codes): non-printing 377 = not packed - edit control, delete preceding character; if a character is deleted, \ (backslash) is typed. 200 = not packed - ignored: Ieader-trailer 210 - 237 = 7701 - 7737: control characters 000 = not packed - ignored: blank tape. 4- 4-1 4.2.3 Output 4.2.3. 1 Output Format - See the TYPE and WRITE statements for format of output. The output character set is the same as that for input. 4.2.3 .2 The Input/Output and Interrupt Processor - The purpose of the interrupt hand Ier and the I/O buffers is to permit input and output to proceed asynchronously with calculations. This allows an optimal use of the computer time. When the interrupt handler finds that the teletype output flag has been raised, it clears that flag and looks to see whether there are any additional characters in the te Ietype output buffer to be pri nted • If there are, it takes the next character from the buffer, pri nts it, clears that location in the buffer, and moves the pointers. Separate pointers are maintained for both the interrupt processor and for the program output subroutine (XOUTL). If the interrupt handler finds that there are no more characters to be output on the Teletype, it will clear the teletype inprogress-switch (TELSW). If the interrupt handler does output another character, it sets TELSW to a nonzero value. When the program desires to place characters in the buffer for the interrupt processor to print, it makes a call to XOUTL. This routine first checks to see if TELSW has been set. If TELSW is zero, no further interrupts are expected by the interrupt processor, and the output routine immediate Iy types the character itself and sets TELSW to a nonzero value. Otherwise, if the interrupt processor is in motion, then the output routine places the character into the buffer and increments the pointer. If there is no room in the buffer for additional characters, the low-speed output routine waits until room is available. The keyboard input processors are similar in organization to the output routines except that no in-progress-switch is needed and the input is only double buffered. Another advantage of the interrupt system is that it enables the user to stop program loops from the keyboard by typing Control C. The recovery routine will then reset the I/O pointers, type out the message code ?01.00, and return to command mode. Manual restart via the console switches also goes to the recovery routine, resets the pointers, and types out message code ?OO.OO. In fact I all error diagnosti cs go to the recovery routine. Error printing is withheld until prior printing is complete. Otherwise, on occasion, a full buffer could be dumped and the error message could be printed as many as 16 characters before it should have otherwise occurred. This would be misleading when using the trace mode to discover specific errors within a character string. The recovery routine may also be called by the interrupt processor if it discovers that there is no more room in the keyboard buffer. For example, this could occur if the user continues to type on the keyboard while the program is making computations. Physical evidence of the error is indicated by failure of the computer to echo characters as the user types. 4-2 NOTE This error could also occur when reading a paper tape program into the text buffer via the low-speed reader. If the output hardware is slower than the input hardware, more text is read in than is being read out of the buffer, resulting in failure of the program to empty the reader buffer as quickly as it is being fj lied up, since the program synchronizes the reading of the characters with sending them into the buffers. In other words, the program synchronizes its side of the I/O buffers, but the interrupt side of the I/O buffers proceeds at a rate determined by the hardware. To prevent this type of error with long input tapes, which were prepared off-line, carriage returns may be followed by some blank tape whi ch is i gnored by the input routines, thereby giving the output routine time to catch up. This is essentially a hardware problem since the program is unable to stop the low-speed reader. 4.2.4 Organization 4.2.4.1 Arithmetic Package - The arithmetic is done in the floating point system. The three-word floating point package allows six digits of accuracy plus the extended functions. The program wi" eventually use four words as an option. The exponential range is approximately ten to the six hundredth. Internal accuracy during computations is 6.924 decimal digits. The four-word floating point system creates ten digits of accuracy, including roundoff. It does, however, require more storage for variables and for push-down list data. 4.2.4.2 Storage - The major components of the program occupy locations 1-3200. The remaining storage 3200 - 4600 is used for text storage, variable storage, and push-down storage, in that order. The text occupies approximately two characters per register. The variables occupy either five or six locations per variable depending on whether the three- or four-word option is utilized. Remaining storage is allocated to the push-down list. Overflow wi" occur only when one of these lists exceeds the remaining storage. This could happen in the case of complex programs which have multiple levels or recursive subroutine calls. The push-down list contains three kinds of data. One of these is a single location for push-jump and pop-jump operations. The content of the accumulator is also pushed into the same list in a single register. The third type of push-down storage is floating point storage (see Appendix D). 4-3 Thi s important storage allocation scheme permits flexibi I ity in the trade off of text size, number of variables, and complexity of the program, rather than restricting the user to a fixed number of statements or characters, or to a fixed number of subroutine calls, or to a limited number of variables. 4.3 HARDWARE ERRORS The 8/S wi II halt at location EXIT +6 if a parity error occurs. 4.4 INTERNAL ENVIRONMENT 4.4.1 Adding a User's Function;FNEW(Z) (c.f., Section 5.2) The FOCAL system was designed to be easily interfaced for new hardware such as LAS-8, multiplexed ADCs real-time clocks, or to software such as a nonlinear function. The information given below, the symbol table, the various lists, and a core layout are intended to be sufficient for all required modifications and patches. This symbolic approach ensures greater flexibility and compatibility with DEC modifications to FOCAL, other user's routines, and assembly via PAL III on a PDP-8. Example: Suppose we had a scope routine to display characters at a given point on a scope. We will call this routine from FOCAL as function by FNEW (X, Y I SHOW). Here X and Yare expressions to be used as display coordinates for the start of SHOW. a. First, patch the function branch table. *FNTABF + 15 XFNEW b. When control arrives at XFNEW, the X has already been evaluated. XFNEW, JMS INTEGER DXL CLA c. Now, test for the possibi lity of another argument. TAD TAD SZA JMP d. /make 12 bit integer in AC /set X - coor. CHAR MCOMMA CLA EFUN3I Move past the separating comma. GETC SPNOR 4-4 /no more e. Evaluate the second argument. /this FNEW is /not recursive PUSHJ EVAL INTEGER /set Y and intensify JMS DYS;CLA SPNOR TAD TAD SZA JMP f. CHAR MCOMMA CLA EFUN31 Now, pick up the single letters for display until the end of the function is reached. DCHR, GETC TAD TAD SNA JMP CHAR MRPAR CLA EFUN31 Char. display routine called here; (for Tektronics Y002, it is simply PRINTC) DCHR JMP g. Definitions from the symbol table are available in Appendix E. Summary: a. User defined functions must leave their value, if any, in FLAC and return by a JMP I EFUN3I. b. The contents of FLAC is converted to an integer in FLAC and in the AC by a JMS I INTEGER. c. The floating point arithmetic interpreter is entered by JMS I 7. (FOCAL uses its own version of the floating point package.) d. The address of the user's function is placed by him in the FNTABF list. e. Location BOTTOM contains the address of the last location to be used for storage. If BOTTOM is made to contain 4277, for example, then the user has from 4300 to 4577 for storage of the function processor. The user should achieve his function implementations using the information given here and in the symbol table without using the actual listing so that changes made by different users may be compatible and so that they may also be relocated easily should any changes be made by DEC. (see Section 4.5.1 for Core Uti lization List) f. The argument following the function name is evaluated and left in FLAC before control is transferred to the particular function handler. Since evaluation is terminated by either a comma (,) or a right parenthesis, a special function could have more than one argument. Only in the case of multiple arguments does a user need to worry about saving his working machine language storage for a possible recursive use of his function. The contents 4-5 of the AC are saved by PUSHA and restored by POP A for this purpose. If there is another argument, it may be evaluated by PUSHJ; EVAL. Doing a PUSHJ; EVAL-l is equivalent to GETC;PUSHJ;EVAL. 4.4.2 Internal Subroutine Conventions 4.4.2. 1 Call ing Sequences - The (AC)=O unless it contains information for the subroutines. Upon returns (AC)=O unless it contains data. There are six types of routines and subroutines used in the implementation of this program: a. Normal subroutines called by an effective SUBRl JMS which contain zero at their entry point SUBR 1,0 and a return by a SUBRl JMP b. New instructions called by PRNTLN /(to print a line number) and usually defined by PRNTLN = JMS I. XPRNT where XPRNT is the entry point for a normal subroutine. These new instructions may have multiple returns/multiple arguments: SORTJ LIST6-1 INLIST -LIST 6 /call; /data list minus one; /increment to branch table /return if CHAR is not in LIST6 These new instruction subroutines often have implied arguments, e.g., GETC, READC, PACKC, TESTC, and SORTC all use the variable CHAR as their argument. The new instructions SORTJ and PRINTC use CHAR only if the AC is zero. If the AC is nonzero, then that value is used. Still others use only the AC for their argument: RTL6, TSTLPR, PUSHA, and TSTGRP, (see Appendix G). c. Recursive routines called by PUSHJ EVAL /call /address /return where the address contains the first instruction of the routine. The return address is kept in the push-down list, and exit is made by use of /exit subroutine. POPJ 4-6 Such routines may call each other or themselves in any sequence and/or recursively by saving data on the push-down list. Others are EVAL, PROCESS, PROC, and GETVAR. d. Command processor routines to handle specific command formats are called by SORT J /go to command COMLST-l COMGO-COMLST ERROR 3 /i Ilegal command The individual command routines use only new instructions and recursive routines. They may exit in one of three possible ways: (1) POP J - if C . R. is encountered or (2) transfer to another command routine or (3) transfer to START e. Floating point groups of interpretive instructions similar to the following format: /enter floati ng interpreter (i .e., JAS 17) FI NT FGET FMPY FLARG PT1 EPUT FLARG FXIT /Ieave floating interpreter f. Main processor modules to handle text input and keyboard commands. This routine could be IIl0cked-out II by an instructor to protect and execute a stored or immediate command program repeated Iy • IBAR, INPUT X Similarly, selected commands are easily deleted by the instructor by placing zero in the appropriate locations in COMLST. Line number input and explicit replacements are IIshort circuited II by GONE+ 11, error 3 4.4.2.2 Subroutine Organization - Figure 4-1 illustrates the internal use of various subroutines. (c. f., Flow Charts in Appendix G). 4.4.3 Character Sorting If a program must contend with a number of different characters (or 11-bit items) each of which can initiate different responses, simply look up the address of the action that corresponds to a given symbol or bit pattern. If the symbols do not form a continuum, the programmer must find the most efficient method for determining the corresponding address. The method used in FOCAL is the table sort and branch. This method uses a subroutine to match up an input character with one member of a list of characters. The call to the subroutine is followed by 4-7 a. the address minus one of the list and b. the difference between that I ist and a second list. The latter list contains the corresponding addresses. Thus, if a match is found in the first list, the difference is added to the address of that match to compute the address in the second list which contains the name of the action to be performed. c. The next instruction to be executed if a match is not found. In addition to being simple and concise, although more time consuming than other methods, this technique has another advantage that is especially useful in a pop-a: the tables may be placed at page boundaries to take up the slack that often occurs at the end of a page. This results in a more effi c ient use of ava i Iab Ie core storage. d. COMMAND ROUTINES COMMAND AND Q. Figure 4-1 4.4.4 language The program is written in PAL III with floating point commands, as well as program-defined commands, implemented as subroutine calls. (see Appendix G) The program must be assembled using PAllO. 4-8 4.5 NOTES 4.5.1 Core Utilization NAMES IOBUF: COMEIN: FRST: BEGIN: FEXP: ARTN: FCOS: TGO: DECONV: FLOUTP: THISD: FLINTP: HREAD: FPNT: MP4: XSQRT: LIBRARY: XRTD: Storage of text is 4.5.2 PLACE SEGMENT 0- 15, 17-166 167-175 176-2572 2573-2577 2600-2724 2725-3117 3120 3140 3206 4420-4577 4430-4577 4620-4776 5000-5166 5200-5345 5400-5577 5600-5773 6000-6157 6160-6176 6200-6317 6320-6377 6400-7177 7200-7377 7400-7502 7503-7556 7557-7576 FOCAL (4K) 8K FOCAL (4K) 8K (Interrupt Handler) FOCAL (4K) (I/O Buffer) (Command Buffer) (Text Buffer) (Initialization) CLIN (Extended Functions) [11 free] [32 free] [ 0 free] [ 4 free] (Output Conversion) 8K (Input Conversion) (High Speed Reader) (floating interpreter) [none free] [FSQT( ) and format buffer] (Single user L command) 8K 3200-4577 3200-5177 3200-5377 14 functions 11 functions 9 functions Extended Functions Extended Functions may be reinitialized by loading in the second part of main program tape. Functions are normally deleted by answering the questions asked when FOCAL is initiated. However, they may also be erased by changing location 0035 to 5377, and locations 401 through 0405 to 2725. Retaining the extended functions allows approximately 1200 characters of text or 170 variables (or any combination in the ratio of 7 characters to one variable). Deleting the extended functions allows approximately 1800 characters or 250 variables. 4-9 4.5.3 Error Pri ntouts Errors and ?01.00 ?OO.OO ?11.35 Because these errors are time dependent, they may be followed by nonexistant or false I ine number. 4.5.4 No Interrupts To read data tapes without running the risk of Keyboard-Input-Buffer overflow (?11.35), it is necessary to remove the interrupt. This action means that Control-C wi II not work. To run FOCAL without interrupts, change: Loc/From To 63/2676 64/2666 2732/6001 2762/6046 1353 2413 5336 7000 The high-speed punch will now run in parallel with the low-speed punch! To run the high speed punch at top speed change: 6021 1356/6041 4.5.5 Operating HS Reader Without Interrupts To run the high-speed reader without interrupts, make the above patches plus two more: 6011 7410 6324/1037 6325/7700 4.5.6 Non- Typing of Program Tapes During Loading The "echo" feature for the ASR-33 may be suppressed by changing location 2163 to 7000 (from 4551). This will cause only asterisks to be typed as the tape is read. There will not be line feeds or carriage returns. (c.f., 4.7.3.4 for multi-user system) Any output commands w ill be typed out in the usua I manner, as will di agnosti cs, answers, etc. Entri es from the keyboard wi II not be typed. 4.5.7 Explanation of NAGSW (Not All or Group Switch) Since LINENO may be modified, a record is needed of whether a specific line number was given by XX. YY (where XX and YY are nonzero) or whether a group was indicated by XX or XX: or XX .00 or whether II ALL" text was indicated by either zero, less than one, or a non-numeric argument: 4-10 NAGSW = 4000 0000 0001 4001 For one line For a group For all text Error PDP-8 code for testing NAGSW: skip if Or All Group -- SMA SZA ONE SMA ALL -- SPA SNA SNA SMA SZA SPA SZA SZA GROUP 4.5.8 One Data Inaccuracies 8 The logical conclusion from the inequality 10 < 227 is that the user can represent 8-digit decimal floating-point numbers accurately by 27-bit floating-point numbers. However, 28 significant bits are needed to represent some 8-digit numbers accurately. In general, we can show that if q 1 lOP < 2 - , then q significant bits are always enough for p-digit decimal accuracy. Finally, we can define a compact 27-bit floating-point representation that will give 28 significant bits, for numbers of practi cal importance. 1 In FOCAL, 23 bits are used giving 6.9 digit accuracy. 4.5.9 Eliminating = and: in I/O Formats Leading equal signs and colons in I/O formats are omitted by making the following patch: 4.5.10 Loc/From To 1216/4551 6002/4551 7600 /: 7600 /= Estimating the Length of Userls Program FOCAL requires five words for each identifier stored in the symbol table and one word for each two characters of stored program. This may be calculated by where c 5s + 2" • 1.01 = Iength of user IS program s = Number of identifiers defined c = Number of characters in indirect program If the total program area or symbol table area becomes too large, FOCAL types an error message. 1Goldberg, B. 118-Digit Accuracy II , Communications of the ACM Vol. 10, No. 2, February, 1967 4-11 FOCAL occupies core locations 1-3300 and 4600 _7576 ' This leaves approximately S S S 70010 locations for the user's program (indirect program, identifiers, and push-down list). The extended functions occupy locations 4600-5377. If the user decides not to retain the extended functions at load-ti me, there wi" be space left for approximately 110° characters for the user's program. 10 The L-command may be used to indicate how much core is avai lable for the user. 4.6 FOCAL SYSTEMS FOCAL systems are designed to take advantage of as many PDP-S configurations as possible. With this in mind, the system source language is divided into segments which, when loaded together, fit the needs of a user and his particular configuration. Thus, when a user changes his configuration or requirements, he does not need to secure an entirely new FOCAL tape but on Iy to load a new segment corresponding to the change in his configuration. The scheme used a Iso has the advantage of simple maintenance, since changes are made to one source file for all possible systems and in some cases re-assembly of other segments is not needed. Two source segments create a FOCAL system for a 4K PDP-S. Others are used to create a FOCAL system with (1) ten digit arithmetic, (2) SK memory, and (3) circular and linear graphics. The segments of the FOCAL system and their functions are listed in Table 4-1. The ASCII source segments FOCAL .ASC and FLOAT .ASC must be assembled with all configurations and the resulting binary segment, FOCAL.BIN, when loaded makes a one user FOCAL system for a 4K PDP-S. The segment INIT .ASC is assembled alone, but when INIT. BIN is loaded with FOCAL. BIN into field zero it gives you the initial dialog. If the extended functions are to be retained, it is not necessary to load INIT at all. All corrections for machine type will be made anyway. After FOCAL is started and/or the dialog is completed the user may proceed to load other binary segments. If a user has an SK PDP-S and wants to create a large program with extended precision arithmetic, he need only load FOCAL.BIN, start, and then load 4WORD.BIN, and BK.BIN as indicated in Table 4-2. If he wants to share his PDP-S with three other people, he just loads FOCAL. BIN and QUAD. BIN into field one and start. Intra-references between segments is handled by small multiple assemblies, rather than a large assembly with conditionals for each possible system. For example, to obtain a binary copy of the segment QUAD.BIN, use PALlO to assemble, QUAD.ASC, FOCAL.ASC, FLOAT.ASC. This assembly produces only the listing and binary files for QUAD which end with the PSEUDO-op's "XLIST" and "NOPUNCH ". Tables 4-2 and 4-3 give the allowable combinations of the binary segments to produce legal configurations of the FOCAL system. 4-12 Table 4-1 FOCAL System Source Segments Function ASCII Segment Name Description FOCAL* The interpreter & TTY I/O driver. FLOAT* Modified Floating Point Package. 4WORD Extended precision overlay to FLOAT (give 10 digits). (4.6.5) SK Allows one user to take advantage of an SK PDP-S. (4.6.4) QUAD Allows multiple users (up to 4) to use FOCAL or SK PDP-So (4.6.6) LIBRA t Allows multiple users (up to 7) to run and save FOCAL programs on an SK PDP-S with disk. (2. 14.2) CLIN The user may have a scope to interact with FOCAL. (5.S) PENT A variation of QUAD allowing five (5) users. INIT The symbolic source for the initial dialog program. *These two segments must be assembled and loaded together for all configurations. They are separated for editing convenience. tNot yet implemented. Table 4-2 Allowable FOCAL Systems 1 - Must be loaded into field one o - Must be loaded into field zero Y - Command may be used if disk system is built N - Command is illegal * - Command different Binary Segment FOCAL INIT (optional) 4WORD SK Allowed Combinations & Subsets are indicated by entries in vertical columns o0 0 1 1 1 1 0 o 0 0 o0 1 1 0 0 0 LI BRA (non -SiS) o1 CLIN (optional) LIBRARY COMMAND (for disk monitor) 4-13 4K SK/PT08s 0 0 SK/PT08s/DF32 1 Graphics Terminal YYYY N N * * FOCAL is always loaded first in the proper field. 4K SK o0 0 0 QUAD or PENT (non-SiS) Minimum Hardware Required DF32 Table 4-3 Variations for FOCAL Systems Any combination of these three sets (2*2*4=16), a. 8K overlay 4K b. Disk Monitor No Disk c. No Dialogue No ext. functions SINe, COSine only All ext. functions or QUAD four-user system or PENT five-user system (PENT is obtained by a modified assembly of QUAD; see listing) may be used with CLIN graphics (4) 4WORD overlay Neither Both These are formed from only six sections of binary tapes. The CLIN graphics function can be used for numerical control. 4K FOCAL can be run on the following DEC computers: 5, 8, 8/S, 8/1, 8/L, LI NC -8, LAB-8, TSS-8, PDP-12. 4.6.1 a. Load FOCAL & INIT b. do initial dialogue c. load any or all of 4WORD, 8K, CLIN. d. restart and use FOCAL Systems Assembly a• Systems programs * tC .RUN T PAL 10 *FOCAL. BIN ,FOCAL .LST"'FOCAL .ZZL,FLOAT .ZZL *QUAD.BIN,QUAD.LST+QUAD.ZZL,FOCAL .ZZL,FLOAT .ZZL b. Initial dialogue * tC .RUN T PAL 10 *INIT .BIN,INIT .LST"'INIT .ZZL * c. Overlay routines .R PAL 10 *4WORD.BIN,4WORD • LST"'4WORD .ZZL,FOCAL .ZZL,FLOAT .ZZL *8K .BIN,8K • LST"'8K .ZZL,FOCAL.ZZL,FLOAT .ZZL *CLIN .BIN,CLIN • LST+-CLIN .ZZL,FOCAL .ZZL,FLOAT .ZZL * 4-14 4.6.2 FOCAL Bi nary Paper Tapes .AS DSK D DSK ASSIGNED .AS PTP PTP ASSIGNED .R PIP *PTP: -II D:Q UAD . BI N *PTP: -/ID:4WORD. BIN ,8K. BIN ,CLIN. BIN *PTP: -/ID:FOCAL. BIN, INIT . BIN tC 4.6.3 FOCAL Listings *LPT :-D:Q UAD. LST ,4WORD .LST ,8K. LST ,CLIN. LST ,INIT • LST ,FOCAL. LST *TTY:-/L DTAa: 58: FREE BLOCKS LEFT FOCAL .ZZL FLOAT .ZZL QUAD .ZZL 4WORD .ZZL 8K .ZZL CLIN .ZZL INIT .ZZL PAL 10 .SAV JR36 JR46 4.7 FOCAL SEGMENTS 4.7.1 8K Single User Overlay - 8K To increase the size of program, the 8K overlay uses the upper 4K for storage of the user's source text. The maximum number of variables does not change as they are sti II stored in the lower 8K. Load the overlay after doing the initial dialogue with the 4K version. 4.7.2 Extended Precision Overlay - 4Word This overlay provides FOCAL with 10-digit accuracy when the 10th digit goes to enable. The overlay increases the number of words needed to store a number from three words to four words. The number of variables that may be stored is decreased accordingly. Load the overlay after doing the initial dialogue with the 4K version. 4-15 4.7.2. 1 Double Precision Multiply in Four-Word FOCAL To multiply two numbers, the product of which is greater than ten digits and yet retain the least significant figures, use a double precision operation. For example, to multiply: M = 20243974 by N = 69732824 let MO = the 1st 4 digits of M and let M1 = the 2nd 4 digits of M. Similarly, NO and N1 are the left and right halves of N. Note the correction of an input error in the high order part of N. *W C-4WORD@1!69 14. 10 14.20 14.30 14.40 14.50 14.60 14.70 14.80 14.90 14.99 *GO AS K !, MO ,M 1 , .. *" NO I N 1 , ! SET A=MO*NO SET B=-NO*M1 + MO*N 1 SET C=M1 *N1 SET Z=FITR(C*lE-4) SET C=C-Z*lE4 SET B=B+Z SET Z=FITR(B*lE-4) SET B=B-Z *1 E4 TYPE ! %8 ,A+Z, 0/04 ,B,C,! :2024 :3974 * :6928+6973 :2824 = 14116694= 7600= 2576 * 4.7.3 Four User Overlay - QUAD QUAD allows an 8K PDP-8/I, -8/l with up to four teletypes to time-share FOCAL. In effect, each user has the equivalent of a 4K PDP-8 or PDP-12 with FOCAL. The QUAD overlay is located in the lower 4K, and the FOCAL interpreter is located in the upper 4K. Users are traded for one of three other users in the lower 4K. Swapping of users is based upon I/O waits and checkpoints in the FOCAL interpreter. 4.7.3. 1 Four User loading and Operating Procedure a. load 1st binary part into field one. (FOCAL.BIN) b. load 2nd binary part into field one. (QUAD .BIN) 4-16 c• Load address 7600 and START • SAVE F4UB!0-2177,3000,3600,5400;200 .SAVE F4UA!0-13220, 14600-17577; (Any errors made here may require reloading field zero.) d. (Calling Sequence) .F4UA .F4UB (If any problem occurs hit stop, record the PC and restart at 200 or reload.) 4.7.3.2 Swapping - At certain points in the FOCAL program it is a pure procedure. If swapping occurs at these times, then only 1K of impure data needs to be saved instead of 4K. This factor of four considerably improves system performance. Such a point is called a checkpoint. Each time an operating program reaches a checkpoint the executive routine checks to see whether another user should be swapped in at that time. This check is also made if the operating program goes into a state of waiting for input-output, except for output duri ng use of trace. 4.7.3.3 Workload and Timing a. Swapping is done on a demand (I/O wait) and a cooperative (checkpoint) basis. Therefore, no clock is needed. Not having a clock reduces system overhead by about ten percent. b. Fully asynchronous I/O is backed up by large (over 16 characters) and uniform (easy to process) character buffers. Serial to parallel conversion of the bit stream is done in external hardware by PT08 line controllers. This reduces system load by 18 to 30 percent. c. If each of eight user programs takes less than 100-17 msec to generate one 8-digit output string, then the system is barely output bound and no delay will be observed in response times. The 17 msec is average access time to the disk, and one TTY character takes 100 msec to be typed. 4.7.3.4 Special Controls - A control-R character (TAPE) suppresses echo of input tapes except for the line-feed. A control-T (NOT-TAPE) or Control-C restores the echo of input characters. It is a good practice to punch a Control-R at the beginning of all off-line tapes. An alternative is simply to type Control-R manually before setting the low speed reader to RUN. 4.7.3.5 Dialogue - There is no initial dialogue with QUAD. 4-17 4.7.4 Ic£ L I \j ... Graphics for Circles and Lines - CLIN :; RAP'" I CS u VERLAY F 0 k Foe AL , t 2 K PAL 10 16:01 ICLIN • GRAPHICS OVERLAY FOR FOCAL.t~K IFINITE DIFFERENCE EQUATION OF A CIRCLE • FOR FOCAL 11 6 ,2 S p=X~X0;S Q=Y-Y0;s R=FSQT(Qt2~pt2) 11 6 ,3 S ~=FNEW(6,3*R*C,P,Q,X0,Y0,S/R) 116~4 S X0=X;S Y~=Y ILl NEAR DIFFERENCE EQUATION OF A LINE 11"1 0 16'21S 2=FNEw(R,P/R,Q/R,X0,Y0,~)JD 1 6 ,4 6057 6053 6067 DXS=6057 DxL=6053 DyS=6067 0035 21035 4437 0407 214217 4440 4440 444~ 444 4442 4443 4444 4445 4446 4447 4450 4451 44:S2 4453 4454 4455 44,6 4457 4460 4461 4462 4463 4464 4465 4466 4467 4410 4453 712140 33 4 2 1340 3010 1117 3316 4537 1612 112144 1341 3044 4453 FCIN, JMS I INTEGER CMA DCA R TAD XXP DCA AXIN TAO M5 DCA CT PuSHJ TAD EXP TAD LP DCA EXP JMS I INTEGER 7200 CL.A leJ"~ TAD P13 DCA I AXIN 3410 1045 3410 1046 34.1.0 2316 5241 1046 7640 5343 TAD HORD DCA I AXIN TAD LORD DCA I AXIN 1St CT JMP GETA TAD LORD slA CL,.A .JMP XFC I R 4-18 ISAvE THE POINT COUNT 1ST ART DATA POINTERS IFOR 5 MORE ITEMS ICOMPUTE EACH ARG, IFOUR FIXED POINT RESULTS ISAVE UNNORHALllED FORM ITEST FOR END Or DATA ITEST FOR CIRCLE OR LINE ICLl\j - :;Ht'P-418S OVE.RLAy FOR FOCAL.,tt~ 4471 447~ 71)0 4474 4475 4476 4477 45 '0 45 -"1 457;2 3331 70J4 447 45~3 4:>:i4 4:> '~5 4:>,J6 ±33 __ 32 XFLIN, PAL1~ 13 -~0 1322 60">3 33-50 71 '1[1 13!14 1326 g 1(6317)- FOR lAB-8 TAD Y01 TAD DCA RAL TAD TAD :~334 7:1 ~'4 01 Y01 Y00 45~7 :1.333 45 u~ 13~5 4~11 DCA Y00 4:>13 6067 3333 23t.2 1St R 4514 5~71 Ji'1P XF\.lN 4:>:1.5 ?5,)5 JMP I EFLJN31 4512 14-MAR 6 9 16:01 PAGE 2 IvECTOR PLOT ALGORITHM elL TAD X0 1 TAD Pi !.leA X01 qAL TAD Xv)0 TAD P0 DXl DCA X00 Cll 3 V133 00 DYS 1(63 0 7) ... FOR LAB-A I1I11 ITO DISPLAY A POINT X,Y; SET 2=FDIs<x,Y) ITO DRA~ lINE X0,Y0 TO X,y: 00 17 ITU 5[T X0,y0=X,Y: no A,4 ITO ERASE SCREEN : TYP~ "(ERASE CODE)" ITO RESET PRINT ORIGIN: TYPE "(RESrT CODE)" ITO DRAw A CIRCLt ABOuT X0,Y0 STARTING AT X,Y lAND GOING COUNTtRClOCKWISE FOR FRACTION IOF A CIRCLE ALPHA SET S=+liSET C=ALPHAJD016 ITO GO CLOCK~ISE: SET S=~lJDO 16 IGROUPS lb AND 17 CREATE OR USE THE VARIABLES S. IS MAy BE REPLACED By A 1 IF DESIRED. IX'Y'X0,Y~,l,R,C'P,Q,K,AND 4-19 leLI\] - :;RAP~I:;S OVE.F<LAY FOR CT, FOCALt~iZK 4~16 007:,2' 4517 ~00(ij (-1 (II 4520 Z0~:'I0 0 4521 4522 4523 0tL~0 PP. (71 2102'0 Pel, 0 00:~f3 Pl, VI 4524 2!;~ ?l0 QQ, QeI, 0 30Z,0 45?6 00J(1I Ql, 4527 3013 4?31 00 0~~ XX, X0J, X01, 1.3 ~530 0021 il 45~2 ;))013 yy 13 4533 4534 ~~2l~)0 :1020 Y00, Y01, 0 0 457)5 21100 KK. 0 4536 ~0Z0 0 4537 00,10 21 4~25 4540 452~ 45~1 3014 4542 ~0l0 PAL1~ V133 14-MAR .. 69 16:01 PAGE 3 0 0 (I) 0 XXP, LP, 14 R, eJ PP-1 ITO USE AN X~Y PLOTTER, CLIN IS NOT NEEDEDJ SIMPLy lAUD TH£ FOLLOWING LINES TO GROUPS 16 AND 17 I 11 6 ,25 S K=s/R 116.30 ~ 1=0,6.3*R*C;S P=P-Q*K;S Q=Q.P.KJS ~=FDlS(X0+P.Y0+Q) /17,10 D 16,2;F I=0,RIS X0=X0+P/R;S Y0=Y0+Q/RJS ~=rOIS(X0,Y0) 11 7 ,20 0 16,4 /THE l'£RATION PARAMETER "I" MAY BE TAKEN IN GREATER INCREMENTS ISGALE rACTOR IS ALSO CHANGED; I.E. I 'l'1~ DO 16'2JSET K=4/R 7 ,15 rOR I=0,4,RIS X0=X0+K*P;S Y0: Y0+Q*KJS l=roIS(X0,Y0) 11 4-20 I' THE 14-MAR-69 16101. PAGE 4 4543 4544 4545 4546 4547 4550 4531 4552 4,53 4554 4555 4487 xrCIR, ~324 4335 6316 21321 2316 6321 1327 002' iZ: 4453 6057 1(6317) - FOR LAS-8 Fl~T 1CLEARS AC 4563 442}7 0321 4335 1324 6324 1332 45~4 Z0Z0 4565 4556 4567 60r,7 7230 FG T PP FMUL t<K FAOD QO FPUT QO F'AOD YY FXIT JMS I INTEGER OYS CLA 4570 4571 4572 2342 5343 5535 lSi! R JMP XFCIR JMP I EFUN31 4556 4557 4560 4561 4'~2 4453 46210 ~0211 IC(RCLE ALGORITHM FINT FGET QO FMUL KK FPUT CT FGET PP FSUB CT FPUT PP FADO XX FXIT JMS I INTEGER DXS NOPUNCH PAGE FIELD 1 XLIST 4-21 1(63~7) - FOR LASeS 4.8 FOCAL DEMONSTRATIONS 4.8.1 One-Line Function Plotting This example demonstrates the use of FOCAL to present, in graphic form, some given function over a range of values. In this example, the function used is - lx y = 30 + 15(SIN(x»e . with x ranging from a to 15 in increments of .5. This damped sine wave has many physi ca I applications, especially in electronics and mechanics (for example, in designing shock absorbers for automobiles) . In the actual coding of the example, the variables I and J were used in place of x and y, respectively; any two variables could have been used. The single line 08.01 contains a set of nested loops for I and J. The J loop types spaces horizontally for the y coordinate of the function; the I loop prints the * symbol and the carriage return and line feeds for the x coordinate. The function itself is used as the upper limit of the J loop showing the power of FOCAL commands. The technique illustrated by this example can be used to plot any desired function. Although the * symbol was used here, any lega I FOCAL character is acceptable. 08.01 F I=O,.5,15;T "*",!; F J=O,30+15*FSIN(I)*FEXP <-.l*I);T II II * * *DO 8.01 * * * * * * * * * * * * * * * * * * * -lC * * * * -lC -lC * * * * * 4-22 4.8.2 How To Demonstrate FOCAL's Power Quickly a. Load the program and start at 200. b. Explain that the initial dialogue gives you options. c. Try some other response like MAYBE ) . d. Now answer YES J • e. The preceeding has demonstrated the interactive capabi lities of the language and the compromises that it permits. f. In a 4K machine (4096 words) FOCAL gives the user 15 functions and uses only 3K, leaving enough room to so Ive up to 6th order simultaneous equations. g. The asterisk (*) means that FOCAL can now respond to your commands. h. The basic command is TYPE: 5 t 2 + FSQT (5) ) *TYPE i. Now compute 5 factorial: *SET ALPHA=l *FOR 1=1, 5; SET ALPHA=ALPH *1 i. The answer is ready when the next asterisk is typed out: Then type *TYPE ALPHA for the answer. k. Now if you are usi ng a PDP-8 or -8/1, demonstrate a large number: *SET *FOR A=l 1=1, 300; SET A=A *1 some time later *TYPE A = 0.395 I. 615 Now generate a plot via a stored program: *1.1 FOR Y=O, .5, 15; TYPE! ; D02 *1.2 QUIT *2.1 FOR X=O, 12+10*FSIN(Y); TYPE *2.2 TYPE" * .. *GO m. 4.9 .. .. Now use the MODIFY Command to change 10* to FEXP ty/6) * and try again. FOCAL Versus BASIC FOCAL is superior to BASIC, not only in terms of computing power and ease of use, but also in maximum use of the memory space, which is so often limited in small computer systems. 4-23 FOCAL contains all the power of BASIC, and in addition provides the following capabi lities: a. Control of the output format (i .e., precise figure location on a page and graphi ca I representation) ; b. An "immediate ll mode, a !lowing the system to operate as a desk calculator and to execute simple problems without writing a program; c. The capability of executing individual IIstored program" statements in the immediate mode for debugging and verification; d. Bui It-in symbolic editor capable of searching program statements for specified characters and inserting and deleting characters within a statement, thereby eliminating the retyping of the entire program statement; e. Multiple statements may be grouped on each line for more logical ordering of the program; f. True multiple level re-entrant subroutining capabilities; g. A trace feature which types out selected segments of a program (as the program is executed) to pin point exactly where a program error occurred; h. Commands may be abbreviated to one letter; this eliminates wasted typing time when writing a program and- increases the available storage space for use by additional program statements; i. Programs may be saved on disk and chained together; i· Point plot displays, vector displays, X, Y plotters, and analog to digital converters may be operated by FOCAL; this capability can be used in an on-line, real-time fashion; k. FOCAL SYSTEMS a Ilow use of severa I hardware configurations: 8K, 10 digit, di splay, and mu Iti -user. 4-24 CHAPTER 5 ADDITIONAL FOCAL APPLICATIONS 5. 1 FOCAL FOR TH E LAB-8 5. 1 . 1 Standard Two commands have been added to FOCAL to implement the A to D converter and the osci 1I0scope display on the AX08. a. A to D Command: FADC{N) where N is the channel number in decimal. The command: SET Z = FADC(28) gives the variable Z a value of octal channel 34 depending on the position of the upper righthand potentiometer. The other 3 knobs are channels 29, 30 and 31. A subroutine in FOCAL to read the A to D in volts is as follows: 15.1 ASK CHAN;C-O, 1,2,3 15.2 SET X=FADC{28+CH) 15.3 IF (X-256)15.Y, 15.4;SET X=X-4096 15.4 SET X=X/255 The input variable is CH for values of a to 3, and the output variable is X with values ±/volt. b. Display Command: The display command has been modified to use only one statement to define X and Y . SET Z = FDIS{X, Y). will display a point on the oscilloscope screen defined by points X and Y. X can range between 0-511 and Y from -255 to +255. The variable Z is a dummy. (It is given the value of the integer part of Y .). (c. f., Section 5.8 for circle and sector algorithms.) CAUTION Since the ADC of the AX08 hardware is an integral part of the display logic, using both display and A and D, may result in splatter of the Y direction of the oscilloscope screen. 5.1.2 Additional (Possible) FOCAL Functions for AX-08 FADC (n): Converts (decimal) channel n. Returns result of conversion. FDIS (x,y): Loads display X and Y; intensifies point. 5-1 FTIM (n): Delays n RC clock pulses (n < 4096) Returns # of 100 !JS increments since last used. Xtal c lock interrupt is enabled. Interrupt servicing for Xtal clock as follows: SKXK JMP OTHERS CLXK ISF TIME + 1 JMP .+3 ISF TIME NOP ION JMP I 0 Clock flag servicing will tie up 20% of processor time. When FTIM is called, do the following sequence: XTIME, TAD (1002) /enable Xtal clock, start RC clock OTEN get n SNA JMP XTIME CMA lAC DCA RCNTR CLRK SKRK JMP .-1 ISZ RCNTR RMP .-4 PUT TIME, TIME +1 in FLAC DCA TIME DCA TIME +1 return to FOCAL FN EW (a, b, c) a = 0: Turn on relays indicated by b (b < 7) Turn off relays indicated by c (c 7) as follows: - < get b RAL; RTL AND {70 OTEN get c RTL; RAL AND {70 CMA ZTEN CLA return to FOCAL a = 1: lIand II external register with mask b: mask (octal) c: ignored 5-2 Get characters of b interpret as octal # DCA XMASK XRIN AND MASK XRCL CMA JAC TAD MASK SNA CLA lAC store in F LAC return to FOCAL a = 2: "orll external register with mask b: mask (octal) c: ignored get characters of b interpret as octal # DCA XMASK XRIN AND MASK XRCL SZA CLA lAC store in FLAC return to FOCAL 5.2 FNEW FOR DATA ARRAYS* A new function for 8-K FOCAL is available which uses field one to store data arrays in floating double precision, single precision, and signed integer format. This facility is added to FOCAL via the function call FNEW. The function may be called recursively to any level, and all of the features of FOCAL are retained. In addition an ERASE or ERASE ALL command will not wipe out the array. Hence, variables may be stored for use in successive programs. 5.2. 1 Storage Requirements Fits into unused locations in floating point package 5.2.2 Usage 5.2.2. 1 Loading - Load after FOCAL has been loaded into the machine (and the initial dialogue is executed). Load the first part of the overlay using the Big Loader. If a single precision floating array is desired press CONTINUE. A patch should now be read in to allow a 1980 element array in *Originated by University of Georgia, program not supported by DEC. 5-3 single precision floating point. If an integer array (maximum number = 3047) is desired press CONTINUE. A patch will now be read in to allow a 3965 element signed integer array. Restart FOCAL at 200. 5.2.2.2 Calling Sequence - To store a variable Z as array element J: * S X=FNEW (J,Z) or * 4.3 S X=FNEW (J,Z) In addition, X will be set equal to Z. To call the array element K and set Z equal to this element: * S Z=FNEW(K) i.e., if there is only one argument the instruction is interpreted as a "GET". If there are two arguments it is interpreted as a "PUTII. 5.2.3 Recursive Call ing The function FNEW may be called recursively at any level. viz. * S Z=FNEW [J, FNEW(J+10)J sets Z=FNEW(J+10) and stores FNEW(J+10) in array element J. * 3.2 S Z=FDIS (J*1000) , FDIS(FNEW(J)*NORM) the arguments may be any arithmetic expression. The following are valid: 2 * S Z=FNEW (J*10-3, FEXP(X )*V) * S Z=FNEW (J,FNEW (K)*FEXP(FNEW(L») 5.2.4 Restri cti ons Double precision floating: 0< J < 1320 (23 bits of significance) Single precision floating: 0< J < 1979 (11 bits of significance) Integer Array: 0< J < 3965 (11 bits of significance) I Z I < 2047 5.2.5 Description The function FNEW protects the binary loader in upper core. The function checks to see if J is too large, but does not check to see if Z is larger than 2047 in the integer array case (c. f., array overlay). The user, of course, may subdivide this array into any number of smaller arrays, keeping track of his own indices. 5-4 5.3 DYNAMIC INTERRUPT PROCESSING VIA FOCAL, 1969 This simple patch allows real-time interrupts to initiate execution of a specific FOCAL subroutine (e.g. Group 31) which gains control (i.e., D031) when an interrupt occurs from an external device. The FOCAL subroutine could sample various channels of the A/D converter, set a few constants, then turn off the interrupt, and return to the main FOCAL program. The main FOCAL program will carry out the analysis or output of data during the time between these external device interrupts. The external device could even be an animal and the time between interrupts will be asynchronous and long (between 1 and 1000 seconds), or the external device will be a clock, in which case the time between interrupts will probably not be less than 100 ms or greater than 1 sec. /patch to interrupt processor (tag assignments from symbol table) *EXIT /replaces H. S. Reader* IOTl /skip if device JMP.+3 NOP /"HINBUF" is cleared *PCl JMP I 175 /checkpoint in main program / valid for 8K, also *167 DIPCHK /Dynamic Interrupt Check *HINBUF 1 /initialized to non-zero *HREAD DIPCHK, TAD HINBUF SZA CLA POPJ TAD PC /save FOCAL register PUSHA TAD SPCLN /(your group #) DCA LINENO DCA NAGSW ISZ HINBUF PUSHJ DO+l POPA DCA PC POPJ SPCLN, 7600 /(group 31) The routine in group 31 returns control by "RETURN II. This feature does not operate unti I main program is started. It will operate during execution of a direct command. 5-5 5.4 SIMULTANEOUS EQUATIONS· SOLUTIONS This program will work with a set of simultaneous linear equations (in 4K. FOCAL 6 equations is the limit) and output the solutions. To do this the program requests a value liLli, the number of equations and variables to be processed. The program then requests the coefficients and constants for each equation, in a matrix like format. The solution values are typed out in a column with the names "X(O)" through IIX(L -1) II. The program is available through DEC US. 5.5 FAST FOURIER TRANSFORMS PROGRAMS The FAST FOURIER TRANSFORMS Program is designed to accept samples of a complex wave pattern as input and, through a FOURIER analysis, describe its component sine and cosine waves in terms of amplitudes and frequencies. The user inputs a number IIN", which must be a power of two, (in 4K. FOCAL, "4" is the limit) and which describes the number of samples to be used in the analysis. Next the samples, which are wave height measurements taken at regular intervals, are requested. Output is in the form of two columns (side by side), the left of which describes the cosine wave components whi Ie right hand column describes the sine wave components. It should be noted that because the number of samples is always a power of two, the number of complex multiplications is cut drastically. For this reason computation time is also greatly reduced. NOTE In order to use this program, the extra extended function FX(A, B) must be loaded into memory via the BIN loader. FAST FOURIER TRANSFORMS W C-FOCAL.,1968 01.08 A "POWER OF 2 II ,NU 01. 10 S N=2 t NU;S TP=2*3. 14159/N 01.18 S S=N/2:, L=l;S Q=5-1;S H=l-NU 01.20 F IlO,N-1;A !;A !,XR(I);S XI(I)=O 01 .22 S SR=XR(Qt-S)+XR(Q);S XR(Q+S)=XR(Q)-XR(Q+S);S XR(Q)=5R 01.24 I (Q) 1.26, 1. 26;S Q=Q-1;G 1.22 01.26 I (L-NU) 1 .28,1 .54,1.28 01.28 S L=L+l;S S=5/2;S H=H+1;S P=N-l;S Z=1/(2t(-H» 01.32 S C=l 01.34 S U=FITR(P*Z);S K=FX(NU,U)*TP 01.36 S CO=FCOS(K);S SN=FSIN(K) 01.38 S GR=CO*XR(P)+SN*XI(P);S GI=CO*XI(P)-SN*XR(P) 5-6 01.405 Q=P-5;5 5R=GR+XR(Q);5 51=GI+XI(Q);5 XR (Q)=XR(Q)-GR 01.42 5 XI(Q)=XI(Q)-GI;5 XR(P)=SR:, XI(P)=SI 01.46 5 P=P-1; I (-FAB5 [C-5J) 1.48; I (P-5+1) 1.52,1.26,1.52 01.48 5 C=C+1;G 1.34 01 .52 5 P=P-5;G 1 .32 01.54 F 1=O,N-1;5 K=FX(NU,I);T !,%3.2,2*XR(K)/N, II ",2*XI(K)/N * *C-TRAN5FORM OF INTERFERENCE PATTERN FORMED BY MIXING A 5INE *C-WAVE OF AMPLITUDE 1 .0 AND A C051NE WAVE OF AMPLITUDE 1 .5 * *GO POWER OF 2 :3 : 1.5 :1.768 :1 :-.353 :-1 .5 :-1 .768 :-1 : .353 ++0.00 =+1 .50 =+0.00 =+0.00 =+0.00 =+0.00 =+0.00 =+1 .50 =+0.00 =-1 .00 =+0.00 =-0.00 =+0.00 =+0.00 =+0.00 =+-1 .00* * /FNEW(u,v) for FFT *BOTTOM 4377 *FNTABF+1Y XFX *4400 XFX, JM5 I INTEGER Dca U PU5HJ EVAl-1 JM5 I INTEGER CIA DCA T2 DCA lORD/low order TAD U Cll RAR DCA U TAD lORD RAl DCA lORD 15Z T2 JMP .-7 JMP I EFUN31 5-7 5.6 TRAVEL VOUCHER TO EXPENSE VOUCHER CONVERSION PROGRAM Though FOCAL is not a business oriented language the use of FOCAL in business applications is not impossible. Such a use is seen in the TRAVEL VOUCHER TO EXPENSE VOUCHER CONVERSION program with which the user may ease the task of reporting his expenses after a business trip. Working from the input of the number of the days using the expense account and the categorized input of the expenses encountered (all amounts must be entered in terms of cents rather than dollars) during that period, the computer tallies and itemizes a. the dai Iy expenses and b. the totals of the expenses over the entire period. The data, thus summarized, are very easily transcribed onto an employee expense voucher. TRAVEL VOUCHER TO EXPENSE VOUCHER CONVERSION PROGRAM C-FOCAL., 1969 T !! "EXPENSE ACCOUNTER (fYPE ALL AMOUNTS IN PENNIES)" 01.01 ERASE 01.05 ASK 0/06.02,! "HOW MANY DAYS?" DAYS,! 01 .10 IF (DAYS) 1.1,1.1; FOR 1=1 ,DAYS; DO 5 01.20 01.40T !! II THE TRIP TOTALS ARE";F I=1,30;T II II 01.41T "GRAND"! SET LO=LTi SET ME=ET 01.60 SET OJ=OT; SET MI=MT; DO 7 01.70 TYPE II $"!!!!!! 01.80 01. 90G 1.05 05.10 05.20 05.30 05.40 05.50 05.60 05.70 05.73 05.75 05.76A 05.77A 05.85 05.90 05.91 05.92 05.93 05.94 05.95 05.96 ASK !! IIBRKFST II B1 ASK "LUNCH II B2 ASK "DINNER II B3 AS K 115 NACKs II B4 ASK IIMILEs TRAVELED? IIB5; SET B5=B5*9; TYPE II $ B5/100; DO 6 ASK "HOTEL II B6 ASK "OTHER II B7 ASK IITELc II B8 A ! "TAXI IIC1 ! IIPARKN IIC2 ! IITOLL "C3 ASK! IIMISC. II B9 TYPE ! liTHE DAILY TOTALS ARE II ! SET LO=B6; SET ME=B 1+B2+B3+B4 SET OJ=B5+C1; SET MI=B9+B8+B7+c2+C3 TYPE IIDAY NO .11; DO 7.1 TYPE !Ok3,I,1I II; DO 7.2; DO 7.3 SET LT=LT+LOi SET ET=ET+ME SET OT=OT+OJi SET MT=MT+MI 5-8 06.10 ASK II MISC. TRAV. ? IIB6; SET B5=B5+86 07. lOT II LODGING MEALS OTHER TRAV. MISC. TOTAL 07.15 T ! 07.20T %8.02, LO/100,1I IIME/100,1I IIOJ/100," IMI/lOO," 07.30 T (LO+ME+OJ+MI)/100 * * *G EXPENSE ACCOUNTER (TYPE ALL AMOUNTS IN PENNIES) HOW MANY DAYS? :2 BRKFST : 150 LUNCH :170 DINNER :645 SNACKS :35 MILES TRAVELED ? :36 $ =+ 3.24 MISC. TRAV. HOTEL:1400 OTHER :0 TELE :40 TAXI :0 PARKN :250 TOLL :0 MISC. :0 THE DAILY TOTALS ARE DAY NO. LODGING =+ 1 =+ 14.00 ?:O MEALS OTHERTRAV. =+ 10 .00 =+ 3 .24 =+ MISC 2 .90 =+ TOTAL 30. 14 BRKFST :98 LUNCH :192 DINNER :650 SNACKS :30 MILES TRAVELED ? :23 $=+ 2.07 MISC.TRAV.?:O HOTEL:1400 OTHER :398 TELE :285 :0 TAXI PARKN :250 TOLL :0 MISC. :0 THE DAILY TOTALS ARE DAY NO. LODGING MEALS OTHER TRAV. MISC =+ 9.33 =+ 2 =+ 14.00 =+ 9.70 2.07 =+ =+ THE TRIP TOTALS ARE LODGING =+ 28.00 =+ GRAND TOTAL =+ 65.24 $ MEALS 19.70 OTHER TRAV. =+ =+ 5.31 5-9 MISC 12.23 TOTAL 35.10 5.7 TWINS DEMO The TWINS DEMO Program is an interesting experiment in the applications of plotHng with a visual scope display unit. It must be noted that several functions must be loaded into memory before this program will operate. This program is an integral part of curve fitting. The Twins Demo requires V68/I Control with Tektronix 611 Scope. (i.e., 340 control) TWINS DEMO W C-FOCAL., 1969 01.055 01.105 01.70F 01 .75 01.805 A=FDI5 () + FDX5 () + FNEW(2) + FNEW (256) A=.2;5 5W=19 T=O, .05,6.284;5 T2=T+3.14159/4;DO 1.8;DO 15 G 2.1 R=4*FSIN(T) +4;5 X=8+R*FCOS(T2);S Y=32+R*FSIN(T2) 02.10 F Y=28.5,A,32;S K=( (Y-30.5)/1.5) t 2;5 X=9-(K*K-K);DO 15 03.10 F X=7.4,A, 10 .5;5 Y=26.5-( (X-9) t2)/2;DO 15 04.10 5 X=10.5;F Y=17,2*A,24.8;DO 15 05.10 F X=7 .2*A,8;5 Y=22-7*(X-7); DO 15 06.10 F X=10.5 ,A, 15;5 Y=26-F50T(5*(X-10) );DO 15 07.10 F 07.20 F X=l1 .5 ,A, 14 .5;D 8.5 X=14.5, .2*A, 15;D 8.5 08.10 F X=3,A,4.6;DO 8.4 08.20 F X=11 ,A, 12;DO 8.4 08.30 G 9.1 08.40 5 K=X-7;5 Y=12+(K *K)/4;DO 15 08.505 Y-21-F5QT(6.25-(X-12.5) t2);D 15 08.605 Y=(X-7) t2-1;D 15 08.705 X-5+F5IN (3. 14159*(Y -12);7);D 15 09.10 F Y=O,2*A,16;5 X=12-( (Y-8) t2)/64;DO 15 10.10 F X=2,A,4.5;5 K=X-3;5 Y=K *(K *( .47*K- .5)+ 1 .03)+26;DO 15 11.10F 11 .20 F X=2, (.2*A),2 .85;D 8.6 X=4.7,.2*A,6;D 8.6 12.10F Y=4.5,2*A,12;D 8.7 12.20F Y =15 ,2 * A ,25; D 8.7 13.10F X=5 . 3, . 3 *A ,6; 5 Y=-7 * (X -6) ; DO 15 14.10F 14.20F 14.30R Y=12,2*A,24;5 K=( (Y-15.5}/1l) t2;5 X=5.5+12.5*(K*K-K);DO 15 Y=4,2*A,12;S K=Y-8.5;5 X=8.1-F5QT(27-K*K);DO 15 NOTE Group 15 must be supplied to scale X, Y and call appropriate display for the device. (c.f., Section 5.8) 5-10 APPENDIX A FOCAL COMMAND SUMMARY Command Abbr Example of Form Explanation TYPE T TYPE FSQT (AL t 3+ FSQT (B) ) Evaluates expression, types out =, and result in current output format. TYPE IITEXT STRING II! Types text. Use! to generate carriage return line feed. WRITE ALL FOCA L pri nts the entire i ndi rect program. WRITE 1 FOCAL types out all group 1 lines. WRITE 1 .1 FOCAL prints line 1 • 1 I F (X) 1 .2, 1. 3 , 1. 4; Where X is identifier or expression. w WRITE IF Control is transferred to the first, second, or third line number if (X) is less than, equal to, or greater than zero respectively. If the semicolon is encountered prematurely then the remainder of the line is executed. MODIFY M MODIFY 1.15 Enab les editi ng of characters on line 1.15 The next character typed becomes the search character. FOCAL wi II position itself after the search character; then the user may a. type new text, or b. form-feed to go to the next occ urrence, or c. bell to change the search character, or d. rubout to de lete backwards, or e. left arrow to ki II backwards, or f. carriage return to end the line, or g. line-feed to save the rest of the line. QUIT Q Q un or * or contro I-C Returns contro I to user. RETUR~'~ R RETURN Terminates DO subroutines SET S SET A = 5/B * SCALE(3) Substitution statement ASK A ASK ALPHA (I + 2 * J) FOCAL types a colon for each variable; the user types a value to define each variable. A-1 Command Abbr Example of Form Explanation If a line begins with the letter C, the remainder of the line will be ignored. COMMENT C C - compute area CONTINUE C C - ignore temporari Iy DO D DO 4.14 Execute line 4. 14; return DO 4 Execute all group 4 lines I return when group is expanded or when a RETURN is encountered. DO ALL Execute entire indirect text as a subrouti ne . ERASE Erases the symbol table. ERASE 2 Erases a II group 2 Ii nes . ERASE 2.1 Deletes line 2. 1 . ERASE ALL Deletes all user text. ERASE E FOR F FOR I = x/Y IZ; TYPE I The command string following the semicolon is executed for each value; X/Y ,Z are constants, variables, or expressions. x=initial value of I, Y =value added to I unti I I is greater than z. y is assumed = 1 if omitted. GO G GO Starts indirect program at lowest numbered line number. GOTO G GOTO 3.4 Starts indirect program at line 3.4 C - The Fourteen (14) Functions are FSQT FABS FSGN FITR FRAN FEXP FSIN FLOG FDIS FADC FNEW FX ) - Square Root ) - Absolute Value ) - Sign Part of the Expression ( ) - Integer Part of the Expression ( ) - A Noise Generator ( ) - Natura I Base to the Power ( ) and - FCOS ( ) I FATN ( - Trig Functions ( ) - Naperian Log - Scope Functions (X/Y) ( ) - Analog to Digital Input Function ( ) - User Functi on ( ) - Extra User Function ( ( ( A-2 APPENDIX B ERROR DIAGNOSTICS* Table B-1 Error Diagnostics of FOCAL, 1969 Location Code 0250 0316 0340 0351 0362 0440 0464 0517 0605 0634 1047 1064 1074 1147 1260 1406 1466 1626 1646 1755 1764 2057 2213 2551 2643 5042 5644 6543 7111 7405 ?01.00 ?01.40 ?01.78 ?01. 96 ?01.: 5 ?01.; 4 ?02.32 ?02.52 ?02.79 ?03.05 ?03.28 ?04.34 ?04.52 ?04.60 ?04.: 3 ?05.48 ?06.06 ?06.54 ?07.22 ?07.38 ?07.:9 ?07.;6 ?08.47 ?09.11 ?10.:5 ?11.35 ?20.34 ?23.36 ?26.99 ?28.73 ?30.05 ?31.<7 ?OO.OO Meaning Manual Start given from console. Interrupt from keyboard vi a contro I-C. Illegal step or line number used. Group number is too large. Double periods found in a line number. Line number is too large. Group zero is an illegal line number. Nonexistant Group referenced by 100 I. Nonexistant line referenced by 1001. Storage was filled by push-down list. Nonexistant line used after IGOTO I or lIP. Illegal command used. Left of II =II in error in IFOR I or 'SET'. Excess right terminators encountered. Illegal terminator in 'FOR ' command. Missing argument in Display command. Bad argument to 'MODIFY I . Illegal use of function or number. Storage is fj lied by variab les . Operator missing in expression or double IE'. No operator used before parenthesis. No argument given after function call. Illegal function name or double operators used. Parenthesis do not match. Bad argument in 'ERASE ' . Storage was fi lied by text. Input buffer has overflowed. Logarithm of zero requested. Literal number is too large. t Power is too large or negative. Di vi si on by zero requested. Imaginary square roots required. Illegal character, unavai lable command, or unavai lable functi on used. *The above diagnostics apply only to the version of FOCAL, 1969, issued on tape DEC-08-AJAE-B B-1 B.1 OBTAINING ERROR CODES VIA ODT36 To obtain error codes via ODT36, proceed as follows: a. Start 0 DT at 3600. b. User types underlined letters: to) (change, from, 4320/1357 1275 (I i ne feed) 4321/4745 3067 (I i ne feed) (UNENO) 4322/1675 4552 (I i ne feed) (PRNTlN) 4323/4246 7000 (carriage return) 1355 (C .R.) 63/2676 c. (OUTDEV, OUTl) then M 7777 7777 (line feed) 4273/0001 4400 (C . R.) 4565W (ERROR 2) Calling addresses and error codes wi II be printed here. The first two and last error codes (00.00,01 .00 ,31 . <7) are always the same. B-2 APPENDIX C EXPLANATION OF NEW INSTRUCTIONS C .1 NEW INSTRUCTIONS (see Table C-1) C.1.1 Push Down Li st Instructi ons The user1s push down list begins at the start of the floating point package and grows up toward the last variable. The initial value of the push down list pointer is contained in location "BOITOM". The pointer is kept in an auto-index labeled "PDLXR". The instructions used to manage the list are given below: C.1.2 PUSHA places the contents of the AC onto the list as the current entry POPA adds the current entry of the push down I ist to the AC, PUSHF saves a group of data, normally a floating point entry. This instruction is followed by a pointer to a 3 word (or 4 word) group of data. These 3 or 4 words are placed on the push down list as the current entry. POPF restores a 3 or 4 word group of data from the current entry on the push down list according to the pointer which follows the instruction. The location "MFLT" contains either -3 or -4 and determines the number of words affected by "PUSH F" and "POPF". PUSHJ calls subroutine which is pointed to by the word following the instruction. The return address is placed on the push down list as the current entry. POPJ the current entry is used as a return address from a subroutine. Character Handling Instructions These instructions are used to pick-up, save, and print characters for processing by FOCAL. Characters are fetched from the user's storage area or from the ASR-33 input buffer. Character conversion between 8 and 6 bits and the trace feature are handled by these routines. PRINTC is used to print a character. If the AC is zero upon entry then the character in "CHAR" is printed. If the AC is non-zero, then the contents of the AC is printed. READC Reads a character from the user's input buffer (AS R-33 input) and echos a II characters except line feeds and rubouts. The character is placed into "CHAR". PACKC places the 8-bit character in "CHAR" into the user1s storage area. If the character is a rubout the previ ous character is de leted from the user's area and a backslash is echoed via "PRINTC". The character is C-1 converted into 6-bit code. The auto index "AXIN" and the flip-flop "XCTIN" are pointers to the user1s storage area. C.l.3 GETC this instruction fetches the next character from the right or left side of the word pointed to by "AXOUT" and "XCT II and places it into "CHAR". If a question mark character is detected the dump switch "DMPSW" is flipped. If the dump switch is on then the character in "CHAR" is printed via "PRINTC". SPNOR Blanks and leading zeroes are ignored by repeated calls to "GETC II . Character Testing Routines These guide the interpreter through the source text. They are testing routines used through- out FOCAL in interpreting the program and in other instances. SORTC the character in "CHAR II is classified according to an ASCII list which is pointed to by the location following the instruction. If the character is found in the list an exit is made to the location following the list pointer. If no character is found exit is made to the second location following the list pointer. If the character was found in the list then "SORTCN" contains the position relative to zero in the list searched. The list is terminated by a negative word. SORTJ the character in "CHAR" or in the AC is classified according to a list as per IISORTC II . If the character is found in the ASCII list, then a jump to an address is made from a second list. The second list is pointed to by the 2nd location following call. If the character is not found then exit is made as per IISORTC". "S0RTCN" is not changed, however. TESTC this instruction fetches the next non-space and classifies it as a terminator, number, function, or letter. The instruction then skips zero, one, two or three cells accordingly. "CHAR II is classified according to whether it is a period TESTN {no skip}, number {skip two}, or other {skip one}. If "CHAR" is a number then its binary value is in IISORTCN". TSTLPR C.l.4 This instruction skips the next instruction if the AC contains a left parenthesis. Line Number Handling Instructions This group is used in manipulating line data and line numbers. C-2 TSTGRP PRNTLN If the group of the line number in the AC is equal to the group on the line in "LINENO II the next instruction is skipped. the coded line in "LINENO II is printed as a decimal fraction with group number and the step number separated by a decimal point. GETLN JlSPNOR Ii is called and a line number is built in JlLINENO Ii via calls to IIGETC IJ • IINAGSW II is set to indicate whether the line number was a group, line, or "ALLII designator. FINDLN the line number coded in IlLINENO Ii is searched for in the user's text area. If the line is found, -the autoindex IIAXOUT" and IIXCT II are set to point to the line's text and an instruction is skipped. If the line is not found, the pointer "AXOUT" is set to point to the next higher line and no instructions are skipped. "THISLN" points to the line found on the next larger line and "LASTLN" points to the previous/less line. ENDLN "ENDLN" links the line in the user's storage area to the rest of his text. It uses the result of the "FINDLNII instruction to accomplish this. The new end of the user's buffer is set-up in IIAXINII. This command is used for insertion of new text, reconnecting after a deletion, and reconnecti on after Modify. Table C-1 New Instructi ons PUSHJ = JMS I . XPUSHJ POPA = TAD I POLXR POPJ = JMP I . XPUPJ PUSHA = JMS I . XPUSHA PUSHF = JMS I . PD2 POPF = JMS I . PD3 GETC = JMS I . UTRA PACKC = JMS I . PACBUF SORT J = JMS I . SORTB /NUMERICAL LIST -1 /ADDRESS LIST - NUMERICAL LIST /RECURSIVE SUBROUTINE CALL /RESTORE AC /SUBROUTINE RETURN /SAVE AC /SAVE GROUP OF DATA /RESTORE GROUP /UNPACK A CHARACTER /PACK A CHARACTER /SORT AND BRANCH ON AC OR CHAR C-3 Table C-1 (Cont) New Instructi ons SORTC = JMS I . XSORTC PRINTC = JMS I . OUT READC = JMS I . CHIN PRNTLN = JMS I . XPRNT GETLN = JMS I . XGETLN FINDLN = JMS I . XFIND ENDLN = JMS I L XENDLN RTL6 = JMS I. XRTL6 SPNOR = JMS I. . XSPNOR TESTN = JMS I . XTESTN TSTLPR = JMS I • LPRTST TSTGRP = JMS I • GRPTST TESTC = JMS I . XTESTC ERROR2 = JMS I . ERROR3 = JMS I . ERROR4 = JMS I . ERR2 /SORT CHAR /PRINT AC OR CHAR /READ ASR-33 INTO CHAR AND PRINT IT /PRINT C (LINENO) /UNPACK AND FORM A LINENUMBER /SEARCH FOR A GIVEN LINE /INSERT LINE POINTERS /ROTATE LEFT SIX /IGNORE SPACE AND LEADING ZEROS /PERIOD: OTHER: NUMBER /SKIP IS 5 < SORTCN < 11 (I . E. AN L-PAR) /SKIP IF G(AC) = G (LINENO) /fERM; NUMBER; FUNCTION; LETTER /EXCESS SOMETHING ERROR /MISCELLANEOUS ERROR /FORMAT ERROR C-4 APPENDIX D FOCAL CORE LAYOUT Table D-1 Foca I Core Layout-Usage What Mnemonics ZERO START FOCAL PROPER BUFBEG BUFFER AREA BEGIN INITIAL DIALOGUE FEXP (BET 2+ 3) ARTN EXTENDED FUNCTIONS (FLAG 3 +1) FCOS (FLOA+ll) } (TEMPO + 1) DECONV (I NFIX +5) FLOUTP (OUTOG+4) FLINTP } (P43+l) FPNT I ACMINS (RAR1+1) DNORM (BUFFER + BINARY (RIM) OUTPUT CONVERSION INPUT OUTPUT ROUTINES I FLOATING-POINT INTERPRETER 10)} LOADERS D-1 Table D-2 Detailed FOCAL Core Layout Miscellaneous Numbers Floating-Point Working Area Constants New Instruction Pointers Variables START Command/Input Line Read Routi ne 'DO' Routi ne Push -POP Routi nes 'GOTO' and 'WRITE' and Misc. 'IF', "SET", 'FOR'andMisc. 'ASK', 'TYPE', 'MODIFY' "GETARG II - Recursive Routine "SPNOR", "TESTN", "POPJ" 'RETRUN' "EVAL" - Recursive Routine OPNEXT - read operator ARGNXT - read operand ETERM - evaluate terminator FLOP - floating operations called ENUM - number processor EFUN - function processor ELPAR - left parens processor EFUN3 - function returns "DELETE" - Recursive Routine DO K - group de lete DONE - garbage collection "FINDLN" - Normal Routine Find exact match or next larger 'ERASE' command processor "GETC II - unpack text and trace "ENDLN", "PRNTLN" I/O Subrouti nes Interrupt Processor ERROR Processor "PACKC" - pack text Rubout routi ne D-2 Table D-2 (Cont) *3120 T E X T *4400 - I/O Buffer Command Buffer Text Buffer Begins Once-On Iy Code SELF-START / V A R I A B L E S CLEAR ALL FLAGS TYPE MESSAGE /. . "/ P u S H D 0 W N L I S T *3600 ODT -JR (for X-FUN) *4600 ODT -JR (for dialogue) Floating Point Routines (c.f., Section 4.5.2) *4600 *5400 *6400 *7600 Extended Functions I/O Controller Interpreter Binary Loader or 8-SYS LIB Bootstrap or Disk Monitor Bootstrap Rim Loader *7756 End of Field Zero Field One Command Extended Text Storage Buffer D-3 FOCAL CORE LAYOUT 0000 -------------------------PAGE FOCAL # S ZERO A 8 C D 77 15 N A T EXP S FREE PUSH A PUSH J PUSH F 4600 r-----------~----------~ EXTENDED FUNCTIONS 5400 I------------------------~ FLOATING -POINT PACKAGE LOADERS 7777 Figure D-1 FOCAL Core Layout Dynamic Storage D-4 APPENDIX E SYMBOL TABLE AND OTHER TABLES/LISTS E. 1 SYMBOL TABLE If:"OCAL.~lM PALl" A ABSOL ABSOL2 A8S0L3 ABSOLV AC1H AC1L AC~ I ~'S 7375 5571 ACTI~;G ~7r1 ACTlr:f\J ACTI\lE ACTVP ADn 442e ~"'45 6751 6153 ~Z41 ;1042 6673 V5l5 1121-APR ... 69 9F'XX QMOVE BOTTOM BUI='BEG RUF'F"ER AUF'R RUF'RS BurRSP RurST C 19138 4556 1255 PAGE 121 OU80lV DUBLAD OUMLN2 r.OMLST 31·0 32e!6 1163 0714 COMMF"N ~614 E 5037 1147 3045 5531 0047 CON1 CaNTIN CONTIIJ r:STAQ CTABS EBEL.L ECALL ECCR ECHO ECHOLS Erop ErUN Ef"UN2 EF'UN3 EF'UN31 ELPAR END END;I ENOLN ENOT ENUM [OUT EP7 EPAA EPAR2 EA' ERASE ERe [AL ERR2 EAROR2 EARORJ ERROR4 ERROR5 ERT [AV ERVX ESCA ETERM ETERM1 ETERM2 ETEAMN EVAL [Xl EXASt( EXCMCK EXCHE EXCHEC EXGO EXGON Exn EXIT1 CO~EtN COME"'U ~035 CO~GO 3217 7470 "'060 13"'~ Vl~37 C1~k'J 1?!0~6 M 1143 C140 C144 C2k'l0 2554 DATUM DA TU~1A DCONP DCONT ~061 614~ ~123 ADrH~ Ll041(1 ADn~E 6673 C2e0~~ Ql065 AF' ALF'l ALF"2 AI.F"l! ALG,\; AUGN ALI ~T ALlSTP 4677 4760 4763 4755 6570 C260 C3 C5 C7 C9 CCR CDF' CDF'l CEXl CEXP CF" CF'RS CF"RSX CHAR CHARt-I CHIN "1113 DCOU~IT 5346 5342 5336 5332 0017 70"'1t!J 6211 651114 6503 4705 "'133 :"1137 0066 C11026 2155 1'1153 ["lOTJP OEBGS\rI nECK IjECKP AI.PH~ AMCU~,'T AReAlG ARCRTN ARGNXT ARTr-.; As~rT ASK ATE:l ATfS ATLIST ATSw Axlfll AXOUT ~623 1372 ;,,,72 1436 6722 4732 5024 1723 5fiH'Iil 6665 120.2 4465 4513 157e ~0r;6 :"010 ~1i317 ~ ~~46 ~ACK ~ASER 5503 RASES BASEx QOUMP 1540 8EGI~ BEI.I.X RENO BETl ~ET2 BETA BETl Rf:" Rf:"X ~616 ~617 0071 4371 ~5:54 4442 4771 4774 0010 4766 47e2 4557 CHKC~T CHKCON CHRT CIA CIF' CIF'l CLA CI.CU Cl.F' Cl.l. CMA CML CNTR CNTRLC CNTRI.X CNTRM CNTRT COOET COL COMBOT COM8UF DECO~J OE CO~,IV OECP OECR DELETE Of:" nGRp OGRP1 1'1 G r:lIGIT DIGITS 0lV1 DIV2 rJlVlne: OLISTP 1~52 6133 7041 6202 6212 7200 7421 "'016 7111'121 711140 7020 0057 1'1324 "'331 0024 0032 11'0.4 12'5 11'226 nMDO~'E OMPSW OMUI.T OMUl.T4 ONORM ONUMFIR DO ~Ol< "O~E DOONE DOUBLE OPCVPT OPN OPT OSAV£: DTABLE DT5T ~1~2 E-l ~11l16 0225 0353 0041 7102 7252 6303 Pl411 6143 0004 0026 ~HI.0 OJ101 5627 5601ll 5533 5521 .565 .,10 0425 "'4·1 5543 5113 "'1/J2'6 5754 6757 '1'1ll 0101ll 1063 !'J1QJ0 '1ll"'4 7036 '335 5714 0.21ll 2111 2121 0463 11'121 6302 631!l' 614' 564fIJ 0070 56'7 DVJ 7261 5133 2012 7261 "'0.2 ~512 1601 2630 0454 1624 00'6 17.3 1754 2017 0136 1763 111134 6243 .556 0135 1732 ",4,. 0121'2 1710 1765 4555 22214 2225 2222 2726 .566 4'66 4566 2725 2214 2217 2237 2'32 1647 1627 1655 1644 1613 "'040 2662 1037 111172 2615 1007 1215 26'6 '8~4 IfOCAL.ti1M PALl,' 5556 612"1'0 6465 65C1!5 231.3 2165 1041 53!12 rx~()n 2657 7044 rX~Er'\ ~XS;.jp 10"APR .. 69 F'LOUT F"l.OUTP F"LPT F'LSU F'L TO"1[ F"LTXR F"LTXR2 F"l.TtER F"M12 F'NF.:G F'NOR F'NPT F'NTAPF" EXIT? rXIT3 [XITJ [XP rxpRTN EXpR~. F'XPR\T rXRD rXPEAD V515 7363 2661 ?6~e: 1ra6~ 100" 1.~14 261"5 11354 1142 EXTR F' r CO~\j T t?k?)43 F'NTA~L 1171 rc"'S 5221~ F'OP rO!JT PU F'PACl F'PNT F"PRNT F'RST F'RSTX F'SIN F'X IT G8L GECALL F'CnU";T r£ND3 F'E)(P C:;535 ?2fo.7 46?~ ron ?~~eI F'G1"2 rG03 F'G(,4 F'G'.'l5 !'Ir.01 F'IG04 r I "'C~ 6idl1 fl027 ~ 1 ~!DL N ~ I t\D~: F' P.'F I 1'-1 F'lNKP F' I NPlJ T r 1"IT f"l S \oj r p( F'lXM F'LAC F'LAO F'LAGl rLAG? F'LARG F'LARGP F'Lf'l1J F'LEX rLr.T F'LIMIT F'LINTP F'LIST1 F'LIST2 F'L~Y "LOG FLOP "034 "010 fo.221 6261 1065 4555 2246 1131 1133 1131 442'7 ?!052 6724 6753 ~1044 65C"6 5162 4725 2030 0125 7Ul7 6515 6467 HJ75 62210 "'517 "'574 6563 5040 1674 GE~D GERR GETl G£TJ GETAqG r;ETC GETL'" GETSr.N GETVAR GEXIT GF'NOi GINC GLIST GO GOCR GOt\'[ GOTO GRPTST GS1 GS2 GS3 GS" GSERCH GTEM GlfRR IolIN8UF" IolI.T 19138 PAGE 121.1 24~5 10101.0 HOLOT 401.0(' 1-40RD HRE,V' 21014 \.IREA~2 12"~15 24~7 7414 HSGO HSP 1-4SPS\.: HSPX IoISR IojSWI TC 1-4T5T 133 tAC ISAR tBUFI 64~0 18UF"'" ~1~5 tECALI. IF' 1037 1013 1035 1025 6142 ';163 10~0 4554 ~374 ~13ri:l 5465 32"'6 3215 tF1 IF'3 52215 f210C110 IGNO~ 4466 I G~'OQE IL.IST IN INBUF' tNOEV INnRrT INF'l)( I NI TL INITL4 tNLIST I NOR~' INPUT tNPUTX INSUR 146~ 2334 "'34~ 233rli 2345 14Ql3 4545 4554 1045 1407 "352 15~5 ~070 INTE~E 1371 5021 (21451 C!'232 "'603 Pl744 1437 1461 1441 1454 1426 Pl021 e362 02137 7402 INTRPM ~316 2414 7001 ?l212 ;)1"'6 ~217 ~447 "'711 5513 0",34 "'064 6463 24"'1 3001 3011 2510 63~1 ~756 '11211 "'036 0",53 02"'1 INTR~T 26~3 to~ur 3120 6002 60!l11 ClI111 1041 I OF' ION 101)( IPART I RET~" ITABLE tTER1 JUMP 1(5 KEY KEY)( E-2 "'036 1276 1277 00"5 6321 6324 6364 t'l273 6315 6361 0273 6343 ~227 6573 7471 6462 5525 :3321 Ql447 KINT KRB KSF" KSF'l KSr2 KSF'3 KSF'4 Ll L2 L3 L4 L8A L8AX L8AY L8B LASTI.N I.ASTOP LASTV LeON LG2E LIBRAR LINENO L1ST3 LlST6 LIST1 LISTGO LlSTI. LlSTP L.OG2 LOG5 LOG6 LOG7 LOG8 LOOKUP LOOPCIl1 LORD LP? I.PRTST M100 Mltl1PT 1'111 M12 1'1137 1'1140 1'1144 M2 MUJ 1'1200 M20M M240 M240M M260 2625 60:36 60:51 64~1 6421 6441 6461 5126 5131 5134 5131 4550 4553 4552 45~1 0025 0055 0031 "311 4113 75~3 ~067 0071 0012 ~074 1370 0023 1165 5157 5142 5145 5150 5153 45'1 6431 (11046 1556 2035 0101 6147 0121 2413 2357 2556 6137 0111 0105 UJ64 13056 ~114 3146 1526 IF"OCAL.irM ""271 "14 ~4pi PAL1;1 1527 6141 2356 '14V1M "14"1 ~057 ~5 0120 1162 ""77 M,8REAK . . C20'" l103 26"'2 :'446 ~COM 1136 ~CR ?i116 ~6'" ~"61 V515 10-APR .. 69 NEGP NEWU ~EXT0 NEXTU Nl.l NL,2 NL,2000 NL,3777 "JL4000 'lL5777 NL7775 NL,7776 "'CRM ~063 NOEC~O "'0 "lOP . . fLT '5526 01343 1135 C'l6f{l2 ell] ""IF" 726~ MDEeK MEQ ~f ~INE 5662 "1INSKI v'~51 MINUS2 . ., I tJUSA MINUSE 7153 7:112 Mlf\JUSi 5663 MLISTP MOD t-COOIF"Y '1:077 ~OVE15 MOVE2f£' MP1 ~P11 MP177 MP2 MP3 tA p4 I"'P5 '4p6 "'Pf:R MPLUS MQ MQA MRO MSPACE "'ULDIV MULT MUL TUl MULT2 MULTV MX MiERD NAGSIrJ 63"-1 ~JORF" NORM NORM~ ~JOUSRS NOX NOX1 NOX2 01 02 04 05 06 5215 1256 1232 1243 7254 C'l575 OBun OBuro OF'rOrc DM12 ONDECK ~445 ONE: 1256 7255 72"'''' 7253 7210 (11115 5664 "'1335 7501 "'444 5665 1101 6566 5667 5715 DOUT OP OPM p.IS OPNEXT 4752 0533 01367 ~065 OBUF"~ OPTA~L OPTR~ OPTRI OPTRO OPUT OTIoIE~ OUT OUTA OUTCR OUTOEV DUToe; DUTL OUT X OVER1 OVf:R2 19138 4724 0frH2 1146 1145 73~1 1326 1332 13513 1330 7352 7346 7344 0465 7 ~H:~ 0 6513 6567 7147 01373 6675 6711 6704 437", 4561 H12 4563 4564 "'104 "'103 QlUJ2 4422 5530 4421 4716 4544 3115 6565 1622 1731 2663 2665 2664 5532 0215 2465 5536 2416 0063 6154 1354 24'5 "'''43 0047 E-3 j:!AGE 121-2 P ~"aJ0 "10 ~"53 P100 P100'" 1'13 1'14 P14" P17 P177 P17M 1'2 1'20 p2e13~ 1'27 1'217 P2M 1'3 1'337 1'37 1'377 1'4 p4~ 1'40130 1'43 P6771 P1 1'7"''''''' P7~76 P160(,! P7' P770P1 1'7740 P1150 P1157 P77M PAl PACBUF' PACKC PAC:K~T PACX PALG PARITY pART~S PC PCl "CHECK pCIoIK PCl(l "CM "02 P03 "DL.X~ 0342 POP POPS POP5X ~046 popel 0005 ?I706 0532 PEQ PER PI 01~7 1'12 PlOT PL.CE PL.S PM2000 PNTR pop A POPF' POPJ PpTEN PRINTC PRINTO PRNT PRNT2 PRNT8 PRNTI PRNTL,N PROC PROCES PSIN PTl pTeH PTE:N PTEST PUSHA pUSHF' PUSHJ R6 RAL RANO RAR RARl RAR2 ROIV READC RECOVR RECOVX REMAIN REPT RESOL. RESOL,3 RESOL.5 RESOL.V RESTAR RESTOR e106 02154 4566 0055 e37J 675" (H1" ~7~7 2034 0075 0062 2553 0060 25152 "'124 6310 010' " 4565 "'047 0764 0104 "122 0101 P'372 .,,76J 1lI,,51 004' 2524 25"'2 45046 "'027 2530 5261 21302 2047 0022 0614 5245 05UJ 2535 01211 0534 0554 "I1l13 4562 4510 4463 4567 6135 0102 5312 5036 '316 5536 6026 1144 00:51 1413 4544 5541 6144 4551 7550 2442 3114 7527 6132 4553 0611 ~610 0165 "'030 0126 6275 1457 4542 4543 4540 5441 7004 15:50 71Zll0 6571 65'2 0152 4552 2140 2761 5712 61.6 6152 7316 6304 11'3 ",rU3 0304 IF'OCAL.llM RESTP RESUME QET PALl"' 6377 2623 ~452 V515 10"AoR·69 SNL SQPTQ SQRTC 19:38 742il TEST~ 1314 4550 (7'0';4 4547 TEXP TE,)(T\ TEXT'" 4561 ?744 1610 2'015 TEXT~ ~017 751~ 743~ TEXTPM TGI) THTR TH I SU1I THIsnp TINTQ TLtS T TL.IST2 TLIST3 TLS TPr'" TQUQT fRAO TRr:l TRC2 ~~p!0 TS~ ~ETRN 1.563 SORTer-.. RETURN PEVIT 5536 7146 RF'e 6014 RMF" PNn2 ROOTGO POT 6244 5527 7461 2557 6151 6012 6011 7\?lV'lb 4557 7012 3017'4 SQRTJ SPA SPECIA SPL SPLAT 3051 SP~.'OQ 456~ ~Qro·'-.!1 SQP~r'l 7467 1465 e261 1363 ?l177 5064 RQU~~ RR~ PSF' RTL RTL6 RTR PU81 RUA2 RUB3 PUB4 PUP5 RUB IT SAC SAOR SAVAC SAVE SAVLI< seAR SCHAR SCONT SCOU~' T SET SETW SETwt SEX 744i 26{'1~ 3751 TAQL~ 26eJl TAGl TASt< TASK4 Ter TCRLF TCRLF2 TQUMP T£LSW TELS 'JJl TELSt.J2 3~3it 3~37 3041 2555 o",33 61~k:l 1302 1273 12710 5534 1041 "'527 "'023 134irO 13"'6 1312 7124 2'050 0343 2662 "'411 2636 7410 Pl034 75Q!0 6136 61tH 6134 1450 SMP SMSP SNA ~~6il Si!A SlL T T1 T1? T2 T211 T3 3~42 SrOUNO $GOT SIGN SIGNF' SILENT S 11'! SKP SL.K SMA SMtN START STARTL STARTV 70~'" 1517 e'74~ Sl~G SR~L~T 6777 SU8S s£~c SINGLE SRF"T' TELS~.3 T£LS'.!4 TELsw5 TE"'l TEMP TEMPu TEMPT TEMPX TpJ TENPT TE~H1S TEST~ T(ST4 TESTA TESTC PAGE 121-3 "'~32 44?6 V'l1il11 2624 C!'033 6464 6723 12"'4 1253 ()0 4 2 1251 1246 TSr:1 TS~2 Tsr3 lsr4 TSTGr.P TSTL"'R TTY TTvpr Twl') TWOPT TYPE 1241 14"0 14~4 2317 6046 t:044 1232 fl573 1163 1164 6041 6411 6431 ~451 6411 4563 4562 01322 er347 4721 53"'6 12~3 USER"Q IJSERTS 121~ uTr dT1 IJTRA UTX VAL WALL 2276 237'5 2214 2316 Ql032 ?J664 "'0"3 UN~E"'K 0,316 i?'275 ;'216 "'277 ?l3"'''' UPAR ~3"'1 ~024 1226 "633 {'!066 01041 TvoE~ 3052 5156 4726 "1:125 011327 e.074 54(110 12'57 111023 '...JOROS r;H630 wRtT~ ~635 6271 6152 1770 6736 1366 ;.oJT(ST2 V'653 wTEST~ 7667 X 5322 5035 4615 2656 ~322 4564 E-4 wx Xl X2 XA ~613 XABS XACTIO XADC x8 X8UF XCOM XCT XCTI\I XOECK XOELEl XOYS XENOLN XF' XF'lNI1 XGETLN X133 XIN XI NPIJT XINT XKEY xOUTL XPOPJ XPR XPR2 XPRNT XPRNTI XPUSIoIA XPUSIoIJ XR10 XR11 XR12 XR13 xRAN XRAR2 XRSTAR XRT XRT2 XRTL6 XSGN XSORTC XSPNOR XS02 XSQR XSQRT XT3 XTDU"'lP XTESTC XTESTN XTTX XTTY XXTTY XYl 2014 ~643 1.343 2655 t'l516 0620 11020 "'062 2'600 2062 1142 2360 4560 2242 113V!2 2666 631716 5666 1160 ~412 2676 1565 11362 1064 2425 11313 ~477 ~521 etfH0 el011 ~012 ~013 1553 7365 V'l312 (71011 02112 ,,413 21310 ~721 1517 4676 5326 7400 1.'l717 ~535 1(17910 1533 r;t727 "'7121 0742 2451 PAl-HI IF'OCAl-.llM lERO 19'38 V515 6520 ERRORS DETECTED' 0 RUN-TIMEI 32 SECONDS 61( CORE USED E-5 PAGE 121-4 E.2 OTHER TABLES AND LISTS ILlsT OF FUNCTION ADJHESSES, (NAMES ARE IN "FNTABL") 0373 ~3 73 ,1374 ,1375 ~376 J377 t$~~ !~4?!0 1344 214'1 J4!.J2 50:)0 114713 50410 1.14'4 Z415 5205 J4~6 :'410 1411 7400 2725 2725 2725 1)437 FI\JTABF=, 2014 2010 1161 XA8S XSGN XINT XDYS XRAN XAOC ARTN FEXP FLOG FSIN FCgS XSCRT 4620 52210 IAHS ISGN IITR lOIS IRAN lADe IATN IEXP ILOG ISIN leas IS T o 71~6 eLL RTL ~414 7006 ;'4 t 5 7006 RTL RTl ~416 5612 JMP I XRTL6 0775 0776 0777 0775 0323 0306 0311 0304 COMLST=, 323 306 311 03~7 3"'4 307 10212 0303 303 1~2J3 0301 301 1004 0324 !2I314 °3 0 5 324 t0~7 ~10 1011 1e12 1~13 314 3/{)5 ~~i~ ~i~ 0321 321 322 0322 0212 "'SQUARE ROOT ~USER DEFINEO rUNCTIONS IROTATE AC LEFT SIX"", "RTL6" ~10J0 1 fli1 6 '!!'TRIG FUNCTIONS ERROR5 ERROR5 1\412 10Z5 -EXPONENTIAL FUNCTIONS INEW leOM IX ERROR5 )41,3 1';1('10 10211 -ABSOLUTE VALUE' -SIGN PART "'INTEGER PART -DISPLAY AND INTENSlrY -RANDOM NUMBER ~READ ANALOG TO DIGITAL CONVERTER 212 !E.NbLISH ... FRENCH ICoMMAND DECODING LIST !SET ,., ORG~NI~E IFOR QUA 0 IIF - SI 100 - PAIl IGOTO "" VA ICoMMENT~ COMMENTE IASK "'" OEMANDE ITYPE .. TAPE ILIBRARY. ENTREPOSE IERASE "" BIF"F'E IwRITE INSeRIS IMODIF'Y ... MaDIPIE IQUIT .. ARRETE IRETURN ~ RETQURNE !(ASTERISK):EXPANDABLE COMMAND - E-6 1164 1165 1160 1167 117~~ 1171 1172 1173 ll74 1175 1176 :1.177 1164 1042 1(42 1Vi 14 0417 0604 0615 1203 1204 7503 2204 0636 1257 12~0 el177 12?1 12212 1563 6361 2165 2165 2160 2167 2170 2171 2172 2173 2174 2175 2176 2177 22:3kl 22211 22212 2203 2533 COMGO:, ICOMMANO ROUTINE ADORESSES SET FOR If DO GOTO COMMENT ASK TYPE LIBRARY ERASE WRITE F'NTAB L =, MODIFY START RETRN HSPX IRE TURN TO COMMAND MODE VIA 'QUIT' 2533 lABS 265~ 2650 2636 2565 2636 2565 2630 2517 2572 2624 2625 2654 2575 2702 2631 2567 263~ 2!)17 2572 2624 2625 2654 2575 2702 2631 2567 0330 I(REF'ERENCED) 0330 IACTIVATE THE HIGH SPEED READER ISGN IITR lOIS IRAN lADe IATN IEXP Il.OG ISIN ICOS ISQT INEW ICOM IX E-7 ILIST OF' COOED rUNCilON NAMES IQUAD - ~U~TI-JSER SYSTEM WITH FOCAL.~rK PAL10 V133 14'-MAR-69 15149 /CONTROL TABLE.: :3 354 ~355 2'356 0357 0360 21361 21362 ~363 21364 21365 21366 el367 ~370 0371 21372 0373 0~74 21 75 0376 0377 iJ4~r2l iJ4~1 214212 214213 04?J4 2I42J5 04~6 04217 21410 21411 0412 21413 0 451 21355 0456 21333 0326 0333 21333 0333 0456 0333 21333 21467 0333 0467 2J453 0333 ~333 ~~~~ 21345 21333 21351 "333 21333 ~333 21456 ~~~~ 21451 0451 21451 0456 21453 IL,T. IGNORE CTABS:. ECHO CNTRLX C,\jTRLC CNTRLX CNTRLX CNTRLX ECHO CNTRLX CNTRl,.X NOECHQ CNTRLX NOECHQ ItA-HOME ItB IC~END OF' M.ESSAGE ID IE IF IG '" BELL. IH II IJ ... LF. IK IL -FF, 1M -C,R, IN ... GOeR CNTRLX CNTRLX CNTRLX CNTRL,X /0 IP /0 SILENT IR-TAPE CNTRLX TTvPE CNTRL.X CNTRLX CNTRLX ECHO CNTRLX CNTRLX IGNORE IGNORE IGNORE ECHO GOCR IS .. (7((J00) - FOR DEBUGGING IT-NOT TApE IU IV IW -E.O,MEDIA IX-ERASE IY Ii Ie 1\ I) IUPAR ILEPTARaGQRO E-8 4WQRD (10 DIGIT) OVERLAY FOR FOCAL.2~K PAL10 14 WQRO (10 DIGIT) OVERLAY FOR 2'004 21012 21vi 52 14-MARa69 15,54 FOCAL,~tK WORUS=4 OI(';IT5=12 005C2 0000 21(,71 7 0 0k:'70 eJ116 0006 0116 7774 3210 3210 Zl355 3211 6427 3212 1722 3213 214~('I 5526 5527 5526 7766 0013 5310 5J14 5320 5310 3755 5314 3755 5320 3755 wORDS+2 *MFLT -WORDS *FRST+2 TEXT @C-4wORD(il -DIGITS IEXTENDED LENGTH OF OUTpUT FORMAT OIGITS+l/RN02 *TW OP I+2 *pIOT+2 *PTEN+2 62 77 6402 7410 *FPN T+ 2 64212 654~i *lERO+20 70"" 6736 0043 *TE5T2 654121 6736 7036 7125 7~72 7036 3275 7105 ICORRECT CONSTANTS 3755 3755 6143 7765 6277 31 46 6143 3755 *pI+2 -OIGITS-l ICONSTANT ONE SKP 100 NOT CLEAR OVERFLOw WORDS NOP 43 7~72 DCA OATUM",5 *MULOIV+4 NOP *OMDONE+7 7000 NOP 7000 E-9 4WORO (10 lJJGIT) UvE.RLAY FOR FQCAL.ttK PAL.10 7260 7 2 60 7271 7272 7273 7274 727~ 7276 7277 73;'0 73~1 7322 73713 73214 73715 73216 737J7 7310 7311 7312 7313 7314 7315 7316 7317 7320 7321 *D v 3+2 TAD OVERl TAD OVER2 DCA MP5 3047 1256 3046 7200 CL.A 1254 7004 3254 12 ~H.' 7004 TAD MPl RAL DCA MPl TAD MP4 1042 1046 32,6 70 /1 4 1045 1041 742;:: 5312 3045 125.s ~22HJ 1335 15:54 -43 RAL TAD TAO DCA RAL TAD TAD SNL JMP DCA TAD DCA TAD DCA 70~j4 14-MAR-69 *MIF 77 35 7271 1(143 1047 3253 V133 AC1\.. l.ORD ICOMBINE ONE POSITION AND ~1P2 ISAVE RESULT HORD AC1H IADD OVERFLOW ISKIP IF OVERFLO~ ,+6 HORD MP5 OVER2 MP2 LORD RAL DCA ~1P4 TAD DNORM NOPUNCH FIELD 1 XLIST E-10 IUPOATE FLAC ICLEAR ACCUMULATOR ISAVE OVERFLOW SITS CIRCULARLY IHK OVE~LAY FJR FJCAL.2lK 18K V133 PAL10 OVE~LAY FOR 14-MAR-69 15:57 PAGE 1 FOCAL.~~K ITEXT IS IN FIELD 1; VARIABLES AND POL ARE IN FIELD 0 I.SAVE ST8 K !(D)-7577;200 I.SAVE FCL8:0-3377i I,SAVE NULd:1010~il~113 I,SAVE NAM~:10100-(B);1011J 62lJ1 COF=6201 ~010 T=l e1 ~0210 P:0 ~0~0 Flt:.LlJ 31210 21022 LINEr2l=lfl10 *pC " 21022 21020 *LASTV 21031 0031 32216 21060 *BUFR 21126 21131 *COM8UF 2JJ50 2)131 0010 2132 '';'132 31210 £1134 Z,134 21166 2l1S7 21170 21171 21172 21173 21174 ~126 3166 2565 6160 6173 75":>7 7564 2572 ~1212l 0 COMEOUT LINEl 10 *CFRS LINE~ *ENOT *1 6 6 OpC, OTHIS, OP T1, DXRT, OAXIN, LINE1 ROT+5 THISD PT1D XRTD AXIND OAX~UT' AX Ur D OLI , OL 88 9 IPC ITHISLN IPTl I(TAD XRT) I(DCA I AXIf\J) I(TAD I AX ur) ILINK FOR RK L"COMMAND E-ll PALl£?) V133 14-MAR-69 15:57 111111111////1/11///1//11//1//111/1/1///111 ~'l001 FIELD 1 2hu00 *0000 ~01J0 ~1 f~ 00 ~H)~l ~1000 ~ 2l0~2 210i2l0 210213 ~)000 iH:J 2'4 7l0~~ J02J5 5051 IlERO PC 0 ~0216 ~060 " "5"'51 BUFR 2l0~7 0126 LINE! lJl210 8 1 00 ~0el0 2112'2 211213 211214 211215 0355 7013 42106 1703 0114 2i12;16 £l1217 "lie. :?Jl11 l?112 t1113 {l114 21115 21116 ~117 ~120 0121 lJ122 21123 ?J124 0125 *LINEf2I J000 2Jl~l 0 eJ TEXT GlC~8K FOCAL @l 4121012) 6171 6671 7715 6171 6671 7715 62211 ST8K. 1ST ART 8K USER FILE AT T""'IS ADDRESS TAD 7 DCA I 6 elF p 1~eJ7 3406 6202 5525 6002 1406 3007 6203 5525 7600 0126 cor p DLIB8, JMP I RLIB IOF TAD I 6 DCA 7 RLl~, LINE1:. elF CDF P JMP I ,+1 IRE TURN To DISK MONITOR, 7600 ~02l0 eJ021f2J ITOUMP DATA 0 0000 00021 o NOPUNCH XLIST E-12 APPENDIX F FOCAL SYNTAX Table F-l Syntax in Backus Norma I Form < i mmedi ate command> : : = < program statement> C . R. <indirect command>: : = <line # > <program statement> C. R. <line # >: : = <group no. >. <line no. > <group no. >: : = 1-31 < line no. > : : = 01-99 11-9 < program statement> : : = <command> I <command> <space> <arguments> I <command string> J <program statement >; <program statement> <command>: : = WRITE <arguments>: : = ALL I DO I ERASE I GO I GOTO I < line # > I <group no. > <command string>: : = <type statement> I < Library statement> I <Ask statement> I <If statement> <Modify statement> I <Set statement> <For statement> QUIT RETURN I COMMENT I I I CONTINUE <Set statement>: ::::! SET <space> <variable> = <expression> <For statement>: : = FOR <space> <variable> = <expression >, <expression >, <expression >; <program statement> I FOR <space> <variable> = <expression >, <expression >; <program statement> <If statement>: : = IF <space> <subscript> <line # >; I IF <space> <subscript> <line # >, <line # >; 1 IF <space> <subscript> <line # >, <line # >, <line # > <Ask statement> : : = ASK <space> <Ask arguments> <Ask arguments> : : = <operand >, <Ask arguments> I I I ! <Ask arguments> # <Ask arguments> % <format code >, <Ask arguments> 1\ <character string> II <Ask arguments> <operand> <space> <format code>: : = <line # > I<null> I I$ I <null> I <group no. > < library statement>: : = LIBRARY <space> < Library Command> <space> <file NAME> '<Library Command>: : = CALLI SAVE I DELETE I LIST F-1 I <character string>: : = <nul I > I <character> <character string> <character>: : = a-z \ <digit> I <specia I symbo Is > <digit>: : = 1-9\ 0 <terminator> : : = <space> 1 ' \ ; \ C. R. <not space>: : = <nul I > I <character> I :\ @ <special symbols>: : = & \ I I [200] I <null > < leader-trai ler >: : = @ <Fi Ie name>: : = <character string> I <data list>: : = <variable> <variable >, <data list> <Type statement>: : = TYPE <space> <Type arguments> <Type Arguments>: : = <Ask arguments> I <expression >\ <Type arguments >, <Type arguments> <Modify statement>: : = MODIFY <space> <line # > This command is then followed by keyboard input characters defined as <search character> plus <null> <character string> 1 <control character> <character string> <control characters> I I <control charcter >: : = [bel I] <search character >1 [form] \ [fine-feed] C.R. 1 I ['l'C] I +- I [rub-out] <Variable>:: = <letter >\ <Ietter><character>\ <Variable> <subscript> <Subscript> : : = <left paren > <expression> <right paren > <operand>: : =<variable > I <constant >\ <subscript> I <function> I( I [ <left paren >: : = < <right paren >: : = > ) I ] <expression> : : = <unary> <operand> 1 <operand> I <expression> <operator> <expression> <unary>: : = +\ - <operator>: : = t I* I / I +I- <Function>: : = F <function code> <subscript> <function code>: : = SIN· I COS SQT I ADC ABS I SGN LOG I ATN I EXP DIS I ITR I RAN I NEW I NOTE Spaces are ignored except when required. F-2 Table F-2 FOCAL Commands In French Commandments Francais Pour Le Calculateur Electronique "IGOR" Eng lish French Letter 1. SET ORGANIZE 0 2. FOR QUAND Q 3. IF 51 5 4. DO FAIS F 5. GOTO VA V 6. COMMENT COMMENTE C 7. ASK DEMANDE D B. TYPE TAPE T 9. LIBRARY ENTREPOSE E 10. ERASE BIFFE B 1l. WRITE INSCRIS I 12. MODIFY MODIFIE M 13. QUIT ARRETE A 14. RETURN RETOURNE R CE N'EST PAS PARFAIT MAIS "IGOR" EST INTELLIGENT IL COMPRENDRA NOTE "IGOR" refers to PDP-B!I F-3 APPENDIX G ILLUSTRA TIO NS EVAL-1 EVAL T ETERM1 N ENUM F EFUN Figure G-l (Sheet 1) Arithmetic Evaluation G-l Figure G-l (Sheet 2) Arithmetic Evaluation G-2 EPAR ENUM EPAR2 OPNEXT ARGNXT ELPAR ERROR4 _----_T ELPAR ENUM EPAR2 N _----_F EFUN _----_v OPNEXT-2 Analysis of Operands Analysis of Sub-Expressions and Constants Figure G-l (Sheet 3) G-3 Arithmetic Evaluation EFUN ASSEMBLE CODE NAME FNTABL FNTABF r EFUN2 ERROR4 LIST OF CODED NAMES ARG ::::> FLARG (PT1) ::::> FLARG CHAR = RPAR. COMMA OR C. R. LIST OF FUNCTION ADDRESSES l TYPICAL FUNCTION FUNCTION RETURN VIA EFUN31 ERROR4 ILLEGAL NAME OPNEXT Figure G-l (Sheet 4) Arithmetic Evaluation (Analysis of Functions) G-4 OR START INITIAL DIALOG 200 START ON LINE COMMAND PC-O DNPSW=' IBAR START WAIT FOR INPUT IGNOR ASR33 IGNOR+4 G'I > OJ LIST 6 - ( IBAR ) L.F. ( IGNOR+4 ) F.F. BELL C.R. GZERR ( IGNOR+4 ) ( IGNOR ) ( IRETN ) NO INPUTX SRETN Figure G-2 Command/Input GOTO MANUAL RESTART VIA LOC 200 ERROR2 START PROCESS PROC BRANCH OR COMMAND CHARACTER GO TO NEXT TERMINATOR ERROR2 Figure G-3 Main Control and Transfer G-6 DO CONTINUE DATA IS SAVED ONE NOT THERE ERROR2 OK DGRP SAVE NAGSW DCHAR LlNEND PC ., (PC) DCONT DCONT Figure G-4 DO Command G-7 ASK TYPE REMEMBER WHICH COMMAND THIS IS AL 1ST TASK TINTR ) ( TQUOT ) ( TCRLF ) # ( TCRLF2 ) $ ( TDUMP ) SP ( TASK4 ) ( TASK4 ) ( PROCESS ) ( PC1 ) C.R. Figure G-5 (Sheet 1) ATLIST ( 0/0 Input/Output Commands G-8 TYPE 2 TYPE Figure G-5 (Sheet 2) Input/Output Commands G-9 FI NCR FLiSTl ( FINCR ) ( PROCESS ) ( PCl ) ERROR4 FLIST2 TLiST ill TLiST G) I 0 ERROR4 ld READ THE LIM IT FCONT Figure G-6 Iteration Control IF' GOTO TUST lJ Figure G-7 lUST ( IF' ) ( PROCESS ) ( PCI ) Conditional Branch Command G-ll MODIFY READ A LINE NUMBER SBAR RESTART INPUT POINTERS SFOUND ERROR2 NO SRNLST LlST6 YES SGOT SBAR ) L2 ) SCONT ) SCONT+ 1 ) CARRIAGE - RETURN ( SRETN ) SEARCH CHARACTER ( SGOT ) ( FORM- FEED ( BELL ( LINE-FEED ( SCONT (i) I N SCONT+ 1 SCHAR LlST3 R LISTGO (....._ _ 5 R_E_T_N_J) @ Figure G-8 Character Editing ERV ERASE ERL ERRORS RESET TEXT POI NTS ERV RESET VAR I ABLE LI ST Figure G-9 (Sheet 1) ERASE and Delete G-l3 ERL ENTRY DELETE NO ADD ONE Figure G-9 (Sheet 2) ERASE and De lete G-14 (,-_ _ I N_T_R_PT _ _) - TINT RECOVR SAVE ERROR NUMBER TURN ON TELSW SAVE I NPUT DATA TI NT EX IT CLEAR FLAGS EX IT Figure G-10 (Sheet 1) G-15 Interrupt Hand ler START XOUTL ENTRY ~~--~ EXIT XOUTL XI33 TYPE CHARACTER AND ~--~~ START PROGRESS ENTRY Figure G-10 (Sheet 2) G-16 Interrupt Handler EXIT XOUTL GETARG ERROR4 ) GETVAR GFNOl ~::":""'---I~ GSI ADD THE VARI ABLE NAME AND SUBSCRIPT GFND1 ERROR3 G'I > -'" RESTORE NAME GSl YES Fiqure G-ll Variable Look-up and Enter UTRA GET1 ENTRY UTRA+1 GET3 UT2 200 300 -376 -276 EXTR UTX G) UTa I (X) UTX YES CHAR=277 EXIT UTRA Figure G-12 Character Unpacking UTa "FINDLN" FIND A PART ICUL AR LINE FOR A GIVEN LI NENUMBER OR GROUP "FINDLN~ FINDN ERROR2 FINDN Figure G-13 "FINDLN" Routine G-19 ROUTINE ADVANCED FOCAL TECHNICAL SPECIFICAnONS DEC·08·AJBB·DL 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'! Please explain, giving page numbers. _ _ _ _ _ _ _ _ _ _ _ __ DEC also strives to keep its customers informed on current DEC software and publications. Thus, the following periodically distributed publications are available upon request. Please check the publication(s) desired. o Digital Software News for the PDP-8 Family, contains current information on software problems, programming notes, new and revised software and manuals. o PDP-8/1 Software Manual o PDP-8/1 User's Bookshelf, Update, contains addendal errata sheets for updating software manuals. contains a bibliography of current and forthcoming software manuals. 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 STATES Postage will be paid by: mamaama Digital Equipment Corporation Software Information Services 146 Main Street, Bldg. 3-5 Maynard, Massachusetts 01754 Digital Equipment Corporation Maynard, Massachusetts printed in U.S.A. mamaala
Home
Privacy and Data
Site structure and layout ©2025 Majenko Technologies