Copyright © 1973, by the author(s). All rights reserved.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission. FASBOL — 6000

,a A SN0B0L4 FOR THE CDC 6000 SERIES

J*

by

I. Richard Strauss, Jr.

Memorandum No. ERL-M401

August 1973

Jt

ELECTRONICS RESEARCH LABORATORY

College of Engineering University of California, Berkeley 94720 ,A t1> v • • FAS30L — 6000 A S?T030L4 COMPILER FOR THE CDC 6000 SERIES

*y I. Richard Strauss, Jr.

August, 1973

Submitted in partial fulfillment of the requirements for the LJ&ster of Science in Electrical Engineering and Conputer Sciences University of California, Berkeley, California

•X ACKN0;7LEDGE2£HT

The FASBOL - oOOO compiler described herein is the culmination of a year and six month's work during which time I received assistance from several, sources. Professor 7/. D. Maurer suggested the. project topic and provided guidance during the entire period. I received financial assistance as his Research Assistant under NSF Grant GJ-31612. I am indebted to Dr. Paul Santos who designed and implemented the first FASBOL compiler, on which the design of FASBOL - 6000 is largely based. He also helped me to understand the internal workings of his compiler and gave me suggestions for my own. Paul lieJones of the University Computer Center staff, one of the implementors of CAL SNOBOL, assisted me in comprehending the implemen tation of CAL SNOBOL and offered suggestions based on practical exper ience. Gene Dronek, also of the University Computer Center staff, provided guidance through the maze of the SCOPE operating system and with C0I.1PASS, version 2. And finally I would like to thank the CDC64OO (machine A) at the . University Computer Center with whom I spent many a long night. TABLE OF CONTENTS

CHAPTER PAGE

Introduction

Language Description and Use

2.1.1 SN0B014 features not implemented 2.1.2 SN0B0L4 features implemented differently 2.1.5 Additions to SN0B0L4

2.2 Differences with CAL SNOBOL 2.3 Running a FASBOL - 6000 program

The FASBOL - 6000 Compiler and Runtime System 1-0

3.1 The FASBOL - 6000 Compiler 10

3.2 The FASBOL - 6000 Runtime System 11

Descriptor Formats 16

Stack Formats 21

Further Developments and Improvements 22

4.1 Compiler 22

4.2 The Runtime System 23

REFERENCES

APPENDICES

A. Listing of the FASBOL - 6000 compiler

B. List of Runtime Routines

C. Sample Programs 1 •

CHAPTER 1

Introduction The SNOBOL programing language (1) T/as developed and first implemented at the Bell Telephone Laboratories, Inc. in New Jersey. It was intially . conceived as a string-astipulation language. The initial implementation was on an IBH 7094. The language was further developed at * and evolved into SN030L3 (2,3) and SN0B0L4 (4,5)- It grew to encompass not only string-manipulation but also many nonnuneric features not found in other programing languages. The implementors of SI-T0B0L4 developed a reasonably machine independent set of macros for S?*03C14 compilation which were consequently implemented on many different computers. Today SM030L4 is a widely used and disseminated language (6). Some of the aachines on which it has been implemented are the IBH System/360, TJNIVAC 1103, GE 635, CDC 360.0, CDC 6CQC series, PDP-10, -SIGMA. 5/6/7/8/9, XDS 940, RCA SPECTRA 70, and ATLAS 2. Until recently all SN030L4 implementations shared two features: they were interpreters rather than and their speed of execution of source programs was very slow compared to other programming languages such as or COBOL. In 1969 a proprietary package for the IBi.I S/36O called SPITBCL (7) was released. It appears to be an incore system which compiles much of the SNOBOL source program as an absolute program and then immediately executes it. Complex pattern matches and string con catenations are apparently executed interpretively. Details of the internal workings of the SPIT30L con-oiler are unavailable. It is known to be ten to twenty time3 faster than the Bell Labs , a oig- r~* nificant increase. In 1969 Paul J. Santos, Jr. began work on a pure compiler-for 3N030L4. » This system, which ic known as FASBOL, compiles all features of the SIT0B0L4 language including patterns. The resulting object program can then be executed. Subprogram3 written in FASBOL, FORTRAN or assombly language can be linked with FASBOL main programs. In addition, object programs can be segmented into overlay structures.• The first FASBOL compiler (8) was written for the TJNIVAC 1103 and was operational in October of 1971. It implemented SN030L4, version 2 (4). The second FASBOL compiler, FASBOL II (9), ^s also written by Dr. Santos. It was implemented for the PDF-10 and was operational in August, 1972. It re flected the 3N030L4 language of version 5 (5). These two systems proved conclusively that SIT030L4 programs could be compiled with up to two orders of magnitude increase in execution speed over interpreters. '" The first interpreter for the CDC 6000 series was implemented at the Institute for Defense Analyses at Princeton University from the 3ell *** Labs macros (10). Its chief drawback was,.of course, its slow execution speed. It also required a large amount of core (60-70K) for execution. In 1963 an interpreter for SN030L4 was developed at the Computer Center of the University of California, Berkeley by Charles Siraonyi and Paul Mc Jones (11). Thi3 interpreter io known as CAL STT030L. CAL SNOBOL is written in COMPASS (the for the CDC 6000 series). The S1I030L source program is translated into 60 bit micro instructions, each of which contains the address of the routine that executes the in struction. The micro code is then executed interpretively. It features very fast compilation speed (on the order of 15,000 lines per minute) and execution speed which is several times faster than the IDA implemen tation. It does not, however, implement all of SN030L4, version 2. It is well suited for its purpose which is to process a large number of student jobs at the University Computer Center; It became apparent that there were some uses for which GAL SNOBOL was not well suited. Professor W.' D. Maurer and some of his graduate students in the Department of Electrical Engineering and Computer Sciences at the Berkeley campus of the University of California were writing large SNC30L4 programs in the areas of program verification and semantic de- ** scriptions of programming languages. These often required'several min utes of CPU time to execute on the CDC 64OO using CAL STT030L. In'addition, •% problems with the garbage collection scheme in CAL SN030L prevented some of them from running at all. With this in mind, work was begun by the author in 1972 on an im plementation of FAS30L for the CDC 6000 series based or: the design of Dr. Santos. This system, which is now known as FASBOL - 6000, consists of a compiler written in FASBOL - 6000 of some 1200 source statements. The compiler accepts FA330L - 6000 source programs and produces COMPASS assembly code. This code may then be assailed, linked with the 7AS30L - 6000 runtime routines.and executed. FASBOL - 6000 is a superset of SN030L4, version 2 and CAL sriOBOL with a few elements missing from each. A complete description of the language and how to use the compiler is given in chapter 2. The FA3B0L - 6000 runtime system comprises approxi mately 100 written in COMPASS totalling 50C0 source lines. A description of the internal workings of the compiler and runtime systems is given in chapter 3. The compiler was initially bootstrapped using CAL 3:T030L and is now capable of compiling itself. In fact it has now gone through four generations of self-compilation. As a test of con sistency the current version was used to compile itself. The generated code was saved and then executed to once again compile the source of the compiler. The two object files were then compared. They were identical. The compiler i3 currently being re-written to take advantage of certain- SN030L4 features unavailable in CAL SX030L (principally the REPLACE function *nd the $ operator). This should afford * two to three times increase in compilation speed, but of course will not affect the execution speed. At the moment programs compiled by FASBOL - 6000 execute at •.. approximately two or three times as fast as CAL SNOBOL. There *.r<= several optimizations-known to the author which can increase this to ultir.ctely four or five times as fast as CAL 5F030L. These will be discussed in

dhapter 4. .

A 4

CHAPTER 2 2. Language Description and Use Most SN0B0L4 (version 2) and CAL SNOBOL programs will run with no changes under FASBOL - 6000. Familiarity with SN0B0L4 and CAL SN030L is assumed. Only language differences will be described here.

2.1.1 SN0B0L4 features not implemented A complete list of unimplemented features is given in table 1. These are for the most part necessitated by the differences between a compiler and an interpreter. Their inclusion would result in a bulkier and less efficient runtime library.

2.1.2 SN0B0L4 features implemented differently Unary . returns a value of type NAME, never a type STRING. Indirection (unary S) applied to a value of type NAME returns the same value. LET if N = .ApOj , then $N = $N + 1 is equivalent to A[1C3 .= A [10-1 + 1

but executes faster. The second argument to the primitive functions INPUT() and OUTPUTQ is a string representing a file name rather than a number. The third argument to the primitive function OUTPUTQ is a carriage control char acter rather than a FORTRAN FORMAT string. This prefix character (which may be the null string) is added to the front of each record on output A for the associated variable. The. optional fourth argument to 0UTPUT() is the record length (if omitted 132 is assumed) in characters. The -' . initial i/O association are: 0UTPUT(f OUTPUTf, f OUTPUT?/? % 132) INPUTft INPUTt,t INPUTf, 72) The file name elements of these two associations can be overridden by control card specifications (see section 2«3)« TABLE 1

SN0B0L4 (version 2) Features Not Implemented

1. (), CODE() and direct GOTOs.

2. Datatypes CODE and EXPRESSION. 3. Non-literal protypes for DEFINE() and DATA(). 4. All features, functions and keywords dealing with tracing except for y\ STNTRACE (see section 2.1.3)*

5. Predefined VALUE() field. 6. Redefinition, OPSYN() or APPLY() of primitive functions, fields and pattern variables.

7. Two features of QUICKSCAN mode a. Continual comparision of the number of characters remaining in the subject string against the number of characters required. b. Assumption that unevaluated expressions must match at least one character. (This implies that left-recursive pattern definitions will loop forever.) 8. The keywords AABORT, A ABEND, AARB, ABAL, ADUMP, AFAIL, AFENCE, A REM,A SUCCEED. 9. The primitive functions CLEAR() and BACKSPACE(). The 6000 series character set requires the following changes:

36O 6000 <•> tf3 ? rv @ ^ I V or // Er A t : or /

2.1.3 Additions to SN0B0L4 The following compiler directives have been added: -CODE, -N0C0DE turn on and off the listing of object code between

statements. The initial mode is off.

-SPACE N spaces N (or 1 if missing) lines in the source listing.

-NEWSTNO N resets the statement number to any value (n) greater

than zero.

-EJECT causes a page eject in the source listing and object file.

The following primitive functions have been added:

(a) REALCH (CLASS) like BREAK() but ignores break characters inside substrings delimited by £ or f

(b) NSPAN(CLASS) equivalent to SPAN()v NULL

(c) SUBSTR(STRING, INTEGER1, INTEGER2) equivalent to pattern match

STRING TAB(IMTEGERI) LEN(lNTEGER2) . VAL

but much faster and less space consuming. (d) DUPL(STRING, INTEGER) returns the STRING formed by duplicating the STRING argument the INTEGER number of times.

(e) L PAD(STRING, LEN, PADCHR) returns the STRING formed by padding STRING on the left with PADCHR characters to a length of LEN. If STRING is already too long, it is returned unchanged; if PADCHR has more than one character only the first is used. If "y * the third argument is null, blanks are used.

(f) RPAD(STRING, LEN, PADCHR) pads to the right.

(g) The following CAL SNOBOL primitive functions are implemented: endgroup() alphabet() e0i() fnclevel() e0rlevel() maxlngth() anchor() . stcount() if() stlimit()

(h) TheASTNTRACE keyword when not equal to zero causes the current statement number to be printed before execution of the state ment. ASTNTRACE is initially zero.

2.2 Differences with CAL SNOBOL The primitive functions TYPE(), NEXTVAR(), COMPILEQ, and FREEZE() are unimplemented. Only C»U are allowed for array brackets; (/,/) are not allowed. ITEM() and PROTOTYPE() are implemented as in SN0B0L4. '*' FASBOL - 6000 contains additions to CAL SNOBOL too numerous to mention but which can be inferred from sections 2.1.1, 2.1.2, 2.1.3 and (12).

2.3 Running a FASBOL - 6000 program Assuming that the files FASBOL and FASLIB exist as COMMON files and have been so declared or exist as permanent files and have been ATTACHed the following control cards will compile.and execute a FASBOL - 6000 program:

RFL,65000,» 65K is the current minirum to com- pile. The fieldlength is auto matically increased if needed. This figure should come down in

future versions.

FLGO,FASBOL,INFIL,OUTFIL,BUFSIZ,HASHWID. where INFIL is the name of the source file (INPUT is the default). OUTFIL is the name of the listing file (OUTPUT is the default). BUFSIZ is the size of i/o buffers in octal (should be a multiple of 100 octal + 1). 201 is the default, HASHWID is the width (in octal) of

the hash code. The bucket table is then two to the power HASHWID words long. (The default is 6). For example,'. FLGO,FASBOL,SOURCE,,1001. will compile a program from the file SOURCE, with listing to the

file OUTPUT. Buffer size is 1001 (octal) and hash code width is 6.

X,COMPASS,1=ASM,S=0,L=0. Assembles the object program (which the compiler generates as the file ASM) using COMPASS, version 2.4 which is much faster than COMPASS, version 1.2. Omitting the L=0 option will provide a listing of the object code (at a price of increased assembly time).

CLDR, LIB=FASLIB, NOMAP, G0= INFILE, OUTFILE, BUFSIZ, HASHWID.'

loads and executes the assembled program. The NOMAP option sup- presses the load map. The GO parameters provide optional con trol of (a) the initial associations of the variables INPUT, OUTPUT, (b) the l/O buffer size and (c) the

hash code width. • The defaults

are the same as for the FASBOL card. For example, if the parameters

GO=DATA, ,,4. '•'. are used, references to the var

iable INPUT will cause a record to

be read from the file DATA and the hash bucket table will be 16 words long.

i*. 10

CHAPTER 3

3. The FASBOL - 6000 Compiler and Runtime System

At> mentioned before, the design of the FASBOL - 6000 compiler is based on the design of Dr. Santos' original FASBOL compiler. The implementation design is significantly differentr of course, since it runs on the CDC 6000 series under the SCOPE operating system rather than the I'NIVAC 1108 under the EXEC II operating system. In addition, the design of several elements of the compiler and runtime is completely different. These are explained in sections 3*1 and 3*2.

3.1 The FASBOL - 6000 Compiler The FASBOL - 6000 compiler is a FASBOL - 6000 program which accepts programs written in FASBOL - 6000 and produces COMPASS object code. Writing the compiler in FAS30L - 6000 proved a significant saving in effort. Approximately 90^ of the coding effort involved the runtime library (which is written in COMPASS). Probably over 95?o of the time spent debugging the system involved the runtime library. In addition coding the compiler in FASBOL - 6000 provided a mechanism to check out the library and demonstrates that FASBOL - 6000 is a useful language for compiler implementation. The syntax of SN0B0L4 and hence of FASBOL - 6000 is such that it lends itself for the most part to ad hoc techniques for parsing. The exception is the parsing of expressions..Dr. Santos' FASBOL compiler uses a table-driven operator precedence scheme for such parsing. The FASBOL - 6000 parser is a straight-forward finite state machine with a single pushdown store which drivos recursively defined semantic routines. The machine has 6 states, 3 input types, 5 stack entry types and 13 action routines. The code generator emits codecs it is generated. The FASBOL compiler generates a code tree v/hich is later walked to produce the final code. As in FASBOL, patterns are compiled as two separate sec tic.:,-, of code. One section is the code to evaluate the pattern parameters before pattern is done. The other section is a re-entrant 11 which corresponds to the pattern during the execution of a pattern match. The rest of FASBOL - 6000 is compiled as a call on an appropriate library routine.

3.2 The FASBOL - 6000 Runtime System The FASBOL - 6000 runtime library consists of some 100 subroutines written in COMPASS. Only those routines which are actually needed during execution are linked with the generated code for the user's program. If the entire library were linked together it would total only 12k (octal) or 5k (decimal). As long as programs don't generate the need for additional storage they can execute in a relatively small field

length. The CDC 6000 series is not the ideal computer for running SN030L4 programs. The essential operations in SN030L4 are on strings of char acters rather than numbers. The CDC machines have the justifiable reputation for being number crunchers. They are not character addressable as are the IBM S/36O machines. In fact the 6000 series have no character operations at all. Strings in FASBOL - 6000 are stored in blocks packed 10 characters to a word. To access a particular character it is necessary to get the proper word into a register, form; a mask and do a mask oper ation, usually followed by a shift. Often compilers have internal tables with several fields packed into one word for space economy.- It is not possible in one instruction to access a field which comprises a portion of one computer word. Once again a load, mask and shift or perhaps a load, shift, shift is required. Suppose there is an internal table where each word of the table consists of four 15 bit signed fields. Suppose further that one wants to put in register X6 the value of the second of these fields of the word which is in register X5, without destroying X5. The following code would be necessary:

BX6 X5 LX6 15 AX6 45

The fact that three instructions are required along with the necessity 12 of remembering the values 15 and 45 lends itself to error, as well as making the code fairly undescipherable. It is for this reason that the author developed a series of macros which permit the one-line symbolic manipulation of partial words. This includes register to storage, storage to register, and register to register operations. These oper ations are used only in the runtime library, not in the generated code. The basic element of this macro system is the FDEF (an acronym for field definition). The form of the FDEF is

NAME FDEF SBIT,LBITS,WORD,SIGN

where

SBIT is the starting bit of the field (0 is the leftmost bit, 59 is the rightmost). LBITS is the length of the field in bits.

WORD is the base word address of the field (if any). SIGN is 1 if the field is signed; 0 or missing if unsigned.

For example, the fields in the following word

12- a • 6

-L y>^c ~&>4i\&> 3>SiAPf 3>s4<\pi

defined as.

DSSTYP FDEF 0,4,0,1

DSSAND FDEF 12,12,0,1

DS3APP FDEF 24,18,0,1

DSSAPE FDEF 42,18,0,1

The FDEF of an entire word is 0,60,0,1. There are seven operations, defined by the use of an elaborate 13

macro structure, which operate on FDEF'd fields. They generate the optimal code for each operation. The macro DEFINE appears at the start of each routine in the library. This sets the values for X.MASKS,X.VOLS, and X.STORS which are used by some of the operations. The default values are XO, X5 and X7, respectively. The operations themselves are

(a) LD XR,FDEF+OFFSET

which loads a field into an X register, where OFFSET and the base address of the FDEF are combined in determining the actual address. OFFSETAregisterA-constant or A constant or zero or missing. OFFSET can also be BRtBR, XR+BR or AR-BR if the base address is zero.

(b) ST XR,FDEF+OFFSET

which stores the rightmost LBITS of the X register into the FDEF field of the addressed word. The original value of XR as well as the rest of the addressed word are preserved.

(c) SD XR,FDEF+OFFSET

which acts like ST except that the XR is destroyed (but not the rest of the addressed word.)

(d) GXR1 XR2,FDEF

J». which "gets" the field defined by FDEF from XR2 and right justifies

it into XR1.

(e) SP XR,FDEF

which takes a field which is right justified in XR and "shifts it into place'', i.e. shifts it left 60-SB ITS-LBITS or generates no code if

SBITS+LBITS =60.

(f) TXR1 XR2,FDEF 14

Y/hich rotates XR2 to XR1 so that FDEF is right justified (works only for 18 bit fields - otherwise generates an error)

(h) LJ XR,FDEF which left justifies the FDEF

This system has the additional benefit of allowing easily implemented changes to field definitions. To change the size or arrangement of fields it. is merely necessary to change the appropriate FDEFs and re-assemble the routines! No searching through listings for references to non-symbolic fields. Note, too, that FDEF'd fields show up in the cross reference listing. In FORTRAN a location is assigned at compile time to each variable in the program. A reference to the variable consists at runtime of a load,of the value of the variable from the location. This is not possible in SN0B0I4 since the variables are not dedicated to a particular TYPE. So although a location is assigned at compile time to all natural variables in FASBOL - 6000, a reference consists at run time of a load .-.r ;.:•;«:.•: from the location of the current descriptor for the variable. This descriptor contains a field which gives its TYPE and (generally) a pointer to the current value. Integers, however have their value in the descriptor. Also strings of less than 8 char acters have their value in the descriptor. Longer strings have a des criptor which points to the first word of. the block where the value is packed ten characters per word. During pattern matches, the subject string is unpacked one character per word. Array descriptors contain pointers to the dope vectors as well as the element descriptor block. Diagrams for each descriptor format are given at the end of this section. The names of fields given in the diagrams are the FDEF names for the

field. The runtime routines have a consistent set of register conventions. B3,A3,X3,B4,A4, and X4 are dedicated to use by the pattern matching routines. Register B7 is used as a constant one throughout the library. Routines called from inline code may use any non-dedicated registers. 15

Second level routines (those called by the routines called by inline code) have a restricted set of registers they may use which varies with the routine. Input to primary routines uses the ES stack and register X1. The 1st through n - 1st arguments are stacked on ES. The last argument, is in X1. The output from routines is in XS(and sometimes X7). The runtime library consists of routines which execute certain- elements of the FASBOL - 6000 source language(primary routines) and of routines which perform functions invisible to the user (secondary routines). The free storage system employs the use count/release stack mechanism of FASBOL although storage allocation is by the "first fit" method rather than the modified buddy system. The runtime system uses 6 separate stacks. These are the SS,ES,AS, CV,PS, and RS stacks, representing respectively the system, expression, assignment, conditional value, pattern and release stacks. All these stacks have the same structure, which is diagrammed .in the section on system tables.They are of infinite (core limit) size. SS is used to keep track of the function level and the ba.se value of the other stacks at lower function levels. ES is used in expression evaluation, calls to user defined function calls and during pattern matching. RS is used by the free storage mechanism. AS,CY and PS are used only during pattern matching. User defined functions and user defined datatypes operate as in FASBOL. When a function is called a function block is acquired from the pool. Values and system parameters are stored in the block in order to provide for possible re-entry of the function. Only the pointer to the block is saved on the SS stack. 16

4x: il I? '*i-r'iVvi l' S \. 5TRXN& 1600 4t o4 c IrvArc-c^^rs 4 irSf UooTiA^ 9C*CK«) \o j ^s^st-ki jiS^-sPi-

*/ 3 6 48

T"iv\*3>X^C_ "fcsfrryP 1*=4t:sM

SS .\t

• Re^L pet| o 3>5.fryp 3>si£Px

S6>

"iTm-eger Oclc 56 bi-t- 5i'qn«a^ bimiy cn-fce-j.fr TD*>4t/P 17

4 Ll it

huurvLt-»oA

p;W

"bSi Ml>& O I

3

5 tb «2 Jicurt-e I pvtKc/l

I - Xnpar Ait*ck«J

7 i^> v 5 5 i3 H 04- vOcr*S X/(9 A^oc^-m.' .fET

I L 3 13 t* l£

#

. jf # •l% .F i? 44: o-t- cioO > • 0 ' lP\rc(\y • ~-y :dsiT/P 3>S$AN:& ^^iAfrp ^siftPE-

.2

•tt c>v Etewants. ' ^

t \ ewe

** m r i

iS rVofo-t-ype- ^cripTOf

tif^Gsbi) o T)XTWEM^X(3N(m) ">M>Mrt 3>S$fll_>

MSe(0. O Tfrx/hgivreaStvif^ 19

4 JO I?, »i-ryp ".osn-iW ^51iwF isifcPS I>Sii>P'F

3o io

iYPfvi{\W : S6i *+t Tp Ffts^WT

'{id TYPMe

(JA6P\W 4 | FSeh^aia #z

fco

_4.V

>__'Tyf'»4f\M RUk. "~S?.-5~Jil?>•fSirft

^NJ L 20

3« \% R? iA+«iX t O j. ' Pc^fA Wis I O :i£4Ty£' 3>s^?pp

is ij 13

>. •3>?4PNip,.. >3,tea.cJ ^sM.£ J!W.& #>„.JI)cos.-.c.i pi.ox :^_.l.. ^4 ?.

0>TAfcO

^ESTflfcX :

(fAxD xp FASi PtF

, (succe&>) yp Fflsi Prs 21

<:> Xo c K. \r o r m a~x:

/S * i> To? o-f- "D -HicK Po;n+er i r_o i\e_r P-vr Uics'd

-&• uoovA tt \

Stac£ fi/pclC

*±tsf 13 Pc.Ator -to Tbf "3- 0 4_c-t- Cu tr«*vt fihck.

^

uAsr 6locjc

(\iexT Biccic 22

4» Further Developments and Improvements

4.1 Compiler As mentioned in the introduction the compiler is currently "being re- • written to make it faster. These changes will also decrease the field > length required for the compiler to compile itself. The compiler current ly requires 117K (octal) to compile. Since the maximum field length allowed at the University Computer Center during normal operations is 120K the first priority is to make the field length requirements smaller. The first contemplated improvement is the recognition of declarations for (a) specifying that the current program being compiled is a main program or subprogram or (b) naming external FORTRAN and FASBOL - 6000 subroutines. This would allow the compiler to be broken up into three or four subroutines and a main program which calls each successively. Then using CLDR an overlay structure could be established which would allow the compiler to run in a smaller field length. (An educated guess - 45K minimum and perhaps 70K for self-compilation.) This (and other changes to the compiler will be relatively easy to implement since the compiler is written in FASBOL - 6000. The second planned development is a mechanism to allow the user to purge symbols from the runtime symbol table which are not referenced indirectly ( with the unary %operator). This change along with an anticipated reorganization of the way the compiler stores information about variables and literals should save about 7K (octal). The next anticipated improvement is the compile-time recognition of pa tter/i structures, i.e., the pattern structure TAB(*P) ANYft+-/*t) NSPAN(f f) @P could be compiled as one pattern with four parameters. Presently it is compiled as the of four patterns. The techniques for this change are currently known but their implementation will require extra code in the compiler and hence extra field length, which is currently unavailable. This change alone should give a significant improvement in execution speed as well as savings in space since runtime concatenation of patterns is fairly slow and requires additional layers of pattern structure which also causes the resultant pattern to be larger and slower. 23

The fourth improvement in line is the implementation of dedicated variables. Variables in SN0B0L4 can be one of several TYPEs at run time and their TYPE can change during the execution. This fact requires the runtime system to do a TYPE check every time it deals with a var iable. This is of course a convenient and powerful feature, but one that is seldom used for most variables. If the programmer"specifies to the compiler which variables' TYPEs are constant throughout the execution, much more efficient code can be generated in some cases. Specifically FORTRM-like code can be generated for dedicated arithmetic expressions yielding up to one hundred times increase in execution speed. Once again these techniques are known and await only more usable field length. Further developments include having the compiler produce relocatable binary rather than COMPASS object code. This would save the assembly phase which actually takes longer than the compilation phase. Eventually • the compiler could be re-written in COMPASS or SYMPL to speed up the compilation time and reduce the field length requirements.

4-2 The runtime system. The runtime system is fairly solid at this point. The only planned change other than future bug-fixing has to do with the register con ventions, AO is at present not used at all by the runtime library. In addition registers A3, X3, and B3 could be put to better use. At present these registers are used to hold information about the current pattern during pattern matching and a flag to indicate to the pattern matching mechanism that all further restarts will fail so that the match can be aborted in QUICKSCAN mode. If these are placed in core instead of reg isters, a memory reference will be required every time their value is needed, but the registers A3, X3, and B3 would be freed up for other use, namely for stack operations. I. E. A3 and X3 could be dedicated to use by the ES stack and AO an

asynchronous. This would save the CP time spent waiting for the PP to recognize a CIO call. It would, however, add a great deal of complex ity to the l/O mechanism.

"> REFERENCES

1. Farber, D. J., Griswold, R. E., and Polonsky, I. P., "SNOBOL, A String Manipulation Language," Journal of the ACM, 11, J_ (1964)*

2. ..., ..., and ..., "The SN0B0L3 ," Bell System Technical Journal, 45, §. 0966).

3. Forte, A., SN0B0L3 Primer, The M.I.T. Press, (1967).

4. Griswold, R. E., Poage, J. F., and Polonsky, I. P., The SNOB014 Programming Language, Prentice-Hall, (1968), (First Edition).

5. ..., ..., and ..., The SNOB0L4 Programming Language, Prentice-Hall (1971), (Second Edition).

6. Shapiro, M. D., "A Bibliography of SNOBOL Publications," SIGPLAN Notices of the ACM, 4, H» (1969), PP. 41-48.

7. Dewar, B. K., and Belcher, K., "SPITBOL," SIGPLAN Notices of the ACM, 4, II, (1969), PP. 33-35.

8. Santos, P. J., FASBOL, A SNOBOL Compiler, Ph.D. Thesis, University of California, Berkeley, also Memorandum No. ERL - M314, Electronics Research -Laboratory, University of California, Berkeley, December 1971

9. Santos, P. J., FASBOL II, A SNOB0L4 Compiler for the PDP-10, Mem orandum No. ERL - M348, Electronics Research Laboratory, University of California, Berkeley, August, 1972.

10. Gaines, R. S., Preliminary Report on the SN0B0L4 Programming Language Revised to Conform to the CDC 6600 Implementation, Institute for Defense Analyses, March, 1968.

11. CAL SNOBOL, Code LO, Computer Center, University of California, Berkeley, April, 1971« (no author given). A?fEUD2)L

(j .. 1

>. FASBQL COMPILER VFR 0.2 03/30/73 13:2 3:53

FIRST L-X»CUTABLr S7USMti\7

STTIM = TIM£() • 2 c = t = t 3 S = f ; ♦ .• « Q = t: ♦ 'I 5 aANCHOR = 1 6 0£FIN£( t0Pi=N0B{9) t ) . 7 OfFI Nc(fINISYM(0)*) 8 05FINr(*SPCLIN(PAR) M 9 Ot=FIi\Jt:( tPRTLIN(^ARM) 10 OEFINF(tcJ^CT(O)♦) 11 Or. NlItGiTSA(O)t) 12 05F IN"(tPUTCUT(PAPJ U 13 DSFIN'-f ( tLA3EL(LAB) t ) 14 D5FINi?( ♦VAR(PAP,p.~G)t ) 15 Or:FIN£ (*VAR\'M{PAR) M 16 bCFIN£-(tFUNC(FUN, *fcG) t) 17 DCFI^P(fFUNCNAMctFUNfREG)*) 18 OcFINrt ttPx?,iVSG(»AA) M 19 DBF IN-E ( t F,N!C ( P1, °2, P3 , P4 ) NM 20 D? FINi (+WOP.DS(P) I, JTT 21 OcFI!-]£{tCONSrA.NT.(C0N) t) .22 Q£FIN£(*>70.P() f) 23 DfcFINE(*PUSH(D,IN?)t) 24 Di£FINF{*PCP(D) t ) _25_ 0 EF INb <*? AP A «1 ( 5 NO ) * ) "26 DEFINE(*CALL (ROUTT) ~~ :— 27 DC?INr (tCALLKRCU)♦) 28 OEFIN-(f^XPR-£SSION( )S7ACK,STATtfN£X7STAT£,VARI,ALT\UV,INOH 29 DC-F INc( ♦OUMP(STR) M 30 OcPl.Nc( tGOTGP(LAB) t) 31 DirINF(*NFl*LiB(C) H 32 O^FIM:f (♦,\c.XTLAP(D) t) 33 D'=FIN£(fG.cX(D) t) *34 OcFINc(^GlTLIN.(C) * ) 35 DSFINC (♦'JS3(S7R ) ♦) 36 l^ikt («>FNC&LNM(0) t ) \37 DflFINf; (♦PDF(PAR)f ) :38 0 SI - IN i ( * FI ::L3 ( FUrn 39 D cF I ft £ f t VALU -: ( P. iG) VA?.H t ) 40 DiFINf(tNA>c(REG)t) . 41, DcFINt:( +PA7VAP( )* ) 't2 0A7A( ♦F0A7A{TY?5N.1»LAST)*) DA7A(fVAn10(COM,7 YP)t) 44" PCPKM.t t ( t NSP/NU tl 45 PCP^MT MSPAK(t *) Mt 46 LNQ 10000 47 MU'-IS^R (ANY( t+-+ ) v .\»ULL) SPAN( *012345d789* ) 46 SP3 SPA,\(t H 49 NSP MS PANIC* *) 5U~ LIS7SR = 1 51 = *MAINf 52" gIagno 0 53 ID-MP7 ANY ( ♦ 4 BC 0£ F Gh IJ KL W~P QP $ 7UV WXYZ M 53 NSPAN(tABC Dc FGH iJKLMiv3PQ*S7UVWXYZ0123456789-?. .+ ) 54 SP7 t t 55 SPS- t t 56 SPIO t 57 BX1X6 SP1 U *BX1 X6t 58 BX6X1 SP1 0 43X6 . XI* 59 US5GO 7 t US'E GQ70t 60 US£AS7 t US 5 *t 61 AS>1FLG 1 62 a$7L1:4I7 = 1 000000 63 CM • ARR AY(*100Jl/11001,l/3t) 64 FX AFP AY(500) 65 IM0cN7 t A 66 SEMIP7 RFA LC H (*; ♦) 67 IN7GP7 N SP AN(tOt) SPAN(*0123456739*) 4 n7gj:r 68 p.EAL MUM b~R *.t N$.?AN{ t0123456789t ) 69 NX7LIN G~7 LIN () 70 LIS7. tC It .71 UNLIS7 ♦ C. 2t 72 NCCCDt tc. 3t 73 CCOC ♦ c 4t 74 = j-:c7. tc. 5* 75 FAIL. ♦C 6t 76 NCFAIL. tC. 7t 77 MGCROSS. tc 8t 78 CRDSSPEF tc • 9t 79 NOASM. tc lOt 80_ LISTASM. tc lit 81 SPACE . tc. 12t 62 NEWS7N0. tc 13t 83 SNAP. tc 14t 84 CSNAP. *c 15* 85 ?X c t XFA SS* 86 JP1 f J Pt SP8 £X 87 JP = t J PI 88 SA61 tSA 6t SP7 EX 89 SA6 SP1 0 $ A61 90 RJ * R Jt SP8 LX 91 P7F t NZ B1,=XF4SSP7F* 92 P7S t JP = XFVStPTSt

IM7IAI.IZA7IQN OF FSPD-V FjR EXPRESSICN Rl?CCGNI7ICU

93 NSF AP.RAY ( t3t6t ) 94 NSF[1,1] 2 __95 NSFC-1 ,2 1 2 96' NSF[1,3] = 2 97 NSP(2,2] = 3 98 NSF[3,2] = 4 99 NSF[1,4] = 5 100 NSPfl,51 = 5 1(31_ NSF[1,6 ] = 5 Td2 NSK2,5f = 6 103 N'S^C3,5 1 = 104 NAF ARRAY(*6,3,5t ) 105 NAF [-1,1,1] = tAlt 106 NAF[2, 1,1] = tA3t 107 NAFC2,2,1] = tA2t 108 NAF[2,1,21 = tA4* 109_ *[A=C2,2,2] = tA2t 110 NAF[2,1,3) tA5* 111 NAF[2,2,31 tA7* 112 NAFC 3,1,3] tAlt 113 iNAFI2, 1,4] tA5t 114 NAFf2,2,4] tAdt 115 .NAF[3,1 ,43 tAlt 116 r"Ar[2,3'fl]" tA8t 117 *A<=C2,3,2] *A9t 118 NAFC2,3,31 tAlOt 119 NAF[2,3,4] tAlOt 120 NAF[4,1,5] tAlt 121 NAF[5,1,5 1 tA3* 122 NAFC5,1,2J = tA4* 123 NAP[5,1,3] = *A5t 124 NAFC6,1,31 = tAlt 125 NArC5,l,4] = tA5t 126 MAFf6,l,41 = tAlt 127 NAFC 5,2, 5] = tA2t 128 MAFC 5,2,2] tA2t 129 NAF[5,2,3] ♦A7t 130 MAFC5,2,4] tA6t 131 NAFf5,3,5] tAllt 132 NAFC5,3,2] tA12t 133 NAFC 5,3,3 J *A13t 134. NAF[5,3,41 = tA13t 135 $(*+*) • tAADt 136 $(*-*) tASBt 137 $(f*t ) tAMLt 138 $(♦/♦) tAOVt

PROCESSING ScQUZNCE

INI7lALIZc SYMBOL' 7ABLLS

139 INISYM.O

OPcN SOURCE. AND GBJ-C7 FILFS

140 OP-MOBO (PRfiCPH)

£X:CU7ABL£ S7A7;i*EN'7 PHAS

* Er.N'J AC7IGN PHAS'".

ENO PF-CCliSSIMG 141 frNOMSG ' IF(SPCLIN(6) PRTLINtt *TQTAL COMPILATION TIM:".* 0 141 . ilK:i)'~ STTIM t.NlS., * DiAGNG ♦ F**OR DIAGNOSTICS**) IJIfCTO) 141 . :(cND) * OF-ZNGB FUNCTION

* 142 CPENGB OUTPUT( tPUTt » tASM* ) 143 OUTPUT { *PAGiHt f*GUTPUT*f tl* ) 144 PAGi = *FASBOL COMPILER VER 0.2 t DATilO t t CLOCK!) 145 SPCLIM(2) 146 PUTC'UTtSPlO ♦ I DENT ♦ PROG) 147 PUT OUT (SP 10 tlrNTRY ♦ PROG) 14 8 PUTCUT(S?10 ♦EXT FA SSFFN,FA S*SFf«', FASSrN'D*) -i 149 . PUT0UT(SP10 *r-x*f FASiCSAP » F£$$ I uv i FASSrFRt ) 150 PUTOUKPRGG • BSS Of) 151 PUTG!JT(SP10 tSBl PLIST*) 152 CALL(tILZt) :(RETURN) * PR3CPH FUNCTION

* 153 PP.GCPH C = TP.IM(G£TSA( )) :F!NOEND) 154 DIFFFR(C) :S(LAbL)

* MAIN'STATEMENT LOOP

155 STLOCP C = TRIf-'.(GFTSA( )) :F(MGENO) 156 OIFFER(C) :F(STLOOP) * *. PSOCF.SS LABEL

•- • 157 LABI. LAB 158 C (MOTAN'Ytt ♦) (BREAK!* M v R ~AB(0)) ). LAB = 159 L = LABEL(LAB) :F(LA0L1) 160 DIt=r£R(LAB, tcNDM :FC-nDA)

161 PUTOUTtL ♦ BSS Of) - lt-2 LABL1 DIFFcR(C) :F(STLOOP) 163 GOTO FAILGOT

. ,..,.„, 164 SUCGOT 165 C REALCH(ttf) . BGDYS *:* = :F(B0HY) 166 C PGPftMT = :F(GGT02) * UNCONDITIONAL GOTO 167 SUCGOT = G.EX() :F(3ADG0T) -* 168 FAILGOT . = SUCGOT :(G0TC7) 169 G0T02 C tS(* NSPAN(* *) = :F(0OT03) Jj SUCCESS GOTO %. 170 SUCGOT = G.fXt) :F(3ACG07) 171 C PCPP.MT NSPANt t f) = :F(BACGOT) 172 OIFrcR(C) :F(GCT08) 173 GOTO3 C »F( * !SiSPAN( ♦ ♦)' - :F(3ADGCi) * FAtLUrf GOTO 174 FAILGOT = G.i:X{ ) :r(8AC30T) 175 IC^MTCSUCGOT) :F(Gf.T37) 176 C PCPRMT ^SPAN(t *) = :F(BAOGOT) 177 DIFFt-P(C) :F(-;(T08) 178 DIFFSfMSUCGOT) :F(GrT02)S(B/DGOT) AS'SU!• F AT izNOAFT "R t ) ♦ 179 G0T0.7 0 PCPR'mT *°0S(0) :F-(3A0G0T) 180 GO TO 8 'RIMtBQOYS) 181 DIFFPF(C) F(.ST/TEND) 132 BODY FAILGOT IUHNT(FAILGGT) N5XTLAB!) 183 PUT0UT(S?10 *S31 FAILGOT) 184 •PUT0UT!SP10 ♦S32 STNO) 135 CALL! *STGt)

186 I NO I P. = 187 C SPAN! * *) = F!SYNTAX) 188 C ROALCH!t=t) F(^AVCH) 189 NAMS(6) 190 ACPI C SPAN!* t) = Ft SYNTAX) 191 C ♦ =» = F(^ATRsPL) 192 PUT0UT(SA6 *ACPM 193 EXPRESSION!) 194 I DENT(C) :F(SYNTAX) 195 ASSIGN CALL!tASGM 196 STATEND DIFFER!SUCGOT) PUTGUT(SP10 tJP t SUCGOT) KSTLOOP) 197 MATCH VALUF(l) 198 SUB1 DIFFLMC) F(ST/.TfriiD) 199 CALL! *LL:S*) 200 EXPRESSION!) 201 •PUT0UT-!8X6X1) 202 PATNUM = PATNUM + • 1 203 PUT0UT!SP10 tSAfc U* PAT.'iUM t+ i t) 204 PUTGUT(SP10 tSA3 D* PATNUM) 205 CALL!tMTPt) 206 CALL!*MCV!*) 207 USE(♦DATA*) 208 PUTnUTttDf PATNUM VFD 30/1,30/K* PATNUM ♦-!*) 209 PUTOUT!* BSSZ 1*) 210 USl: !♦**)■ 211 USt!*SU3t) 212 PUT OUT (tR* PATNUM ♦ SA1 Dt PATNUM *+l*) 213 CALL!tPTPM 214 PUTCUTl* NZ B1, = XFAS$-!TF*) 215 P'JTOUT!* JP =XFAS*MTS*) 216 US*!t*t) : (STATcND) 217 MATRtPL PUT0UTU3X1X6) 218 CALL! tSRSM 219 EXPRESSION! ) 220 C HS? * = t fyjCp = :F!SYNTAX) 221 PUTOJT!BX6X1) 222 PATNUM = PATNUM + 1 223 ?U'OUT!SP10 *SAf D* PATNUM ? + l M 224 PUT0UT!?P10 *SA3 D> PATNUM) 225 CALL!*MTP*) 226 CALL!*SSJ*) _227_ EXPRESSION!) 228 CALL!tMTRt) 229 US'ittOATA.t) 230 PUr0U7!tn» PmTNU* t VFD iU/1,30/?.* PATHiJM t-l + ) 231 PUTOUT!* BSSZ 1*) 232 USE I***) _233_ US-!tSUSt) 234 PUT OUT I tKt- PATNU'-' ♦ SA1 0* PATNUtV tflt) J35_ ALL!tPTPt) 236 PUTOUT!A NZ B1,=XPAS$MTF*) 237 PUTCUT!* =XFASSyTS*) 238 US:(t*t) :(S7JTEND) 239 DUMP OUTPUT = STR = * SSTR !RETURN)

G.EX FUNCTION - PARSES G070*S

240 G.EX C ICENPT . GOT = :F!G. EX2) 241 G.EX1 G.EX = GOTOP!GOT) : !RcT U.-M) 242 G.EX2 C *$t = :P!F ^ cTUR N) r,nT 243 C !(•*♦ BREaK!t**) tt+ ) ! *t* BREa K! * *) 2_43_ *♦*)).= :S! G. EX1) 244 PUTJUT ( USEGOT) 245 G.E X = NEWLAB!) 246 PUTOUT! G. EX * BSS on 247 EXP RESS 10 NO :Ft FRETURN) 248 PUTOUT! SP 10 *SA2 =XFAS$L3Nt) 249 CAL L! *S Y*.-i •) 250 PUTOUT! SP 0 ♦ SB X6t ) 251 PUTCUT! SP 0 *JP Bl* ) 252 PUTOU T{US AS T.) :(RETURN) * NE WLA FUNCTION 253 NEWLAB LNO LNO 1 254 NEWLAB fLl NO :(RETURN) NE XTL AB FUNCTION 255 NEXTLAB NEX TLABI NEW LAB!) 256 NEXTLAB NEX TLABI. :(RcTURN) 257 GOTOP GOT OP OIF PER(*!LAB *$L1»)) $(LA3 t'RlM I S( P urn) 258 GOT OP Olf FER!S(LAB ttL2*)) MLA3 t$L2t) :$(R URN) 259 GOTOF MEW LA3!) ML A 8 * GO rc P LAb NUM- LAB i\'U A + 1 St* L* L ABI !UM ) = L AB :! RETURN)

VALUE FUNCTION

263 VALUE ♦St S(I NOV) 2*4 t + * StV^LUL) 265 t-t S(.NEGV) 266 t ( t S(EXPV) 267_ t.» StNAW) 268 C MKEYHV) 269 C ICENPT $ VARN = S(V/PV) 270 C ANY(t*t -**) i- 01 L = S!LI TV) 271 C NUMBER * CON = S!INTV) 271 F(NULL) 272_ I NOV VALUE!1) "273 CALL!'*rv"Vt) -2 74 FIN6 RR = 6 275 FIN NE(RP,PEG) F! RE TURN) 276 PUTOUTtSP10 *BX REG SP7 tXt RF) tRETURN) 277 NEGV VALUE (1) 278 CALL! ♦ANG M (FINM 279" XPV EXPRESSION!) 280 _C__ NS^ANtt ♦) *)♦ = iFt'JM^AL) 231 FIN1 . RR =1 :(FIN) . 232 NA MV N AM E { R E G) :( RE T URN ) 283 KEYWV C IDENPT S KEY ~ :F(KEYERR) 284 KEY . = T. (KEY t.*) 285 ' DIFFEF.(KEY) :F(KEYERP) 286 PUTOUT(t ' SB1 t KEY *Bt) 2 87 CALL ( *FKfc*.) :(PIN6) 288 VARV C t(t = :S(FUNV) 289 C t[t = :S(APV) 290 VAR(VARN,1) 291 CALL(tVALt) :{FIN6) _2? 2 LITV C BREAK !DEL) $ CON DEL = :F(MO?QCT) ?9~3 CONV C INDEX = 1 294 LE(REG,5) :F!OUTPL) 295 PUT0UT!SP10 tSA* REG SP7 CONSTANT!CON)) MRETLPN) 296 OUTRL PUTOUT!SP10 *SA1 • CONSTANT!CON)) :!FIN1) 297 INTV C ♦ .* SPAN(t0123456789M $ RPT = :F(CCNV) 298 ' CON = CON t.t PPT : tC^.NV) 299 NULLV VALUE!1) 300 PUTOUT (SP10 tBXt REG SP7 tXU-XOM KkFTuRN) 301 FUMV FUNC! VAPN,REG) : {RETURN) 302 ARV PUTOUT (SP 10 tS3.1 t PA.FAM! t]t)) 303 VAR!VARN,2) 304 PUTOUT! SP1Q *SA2 X2 !) 305 CAlL!tRARt) ' 306 NAM6 LS(PEG,5) :F(OUTRA) 307 PUTUUTtSPIO *SA* ^EG SP7 4X6t) :(R~TUEfj) 308 nUTRA PUT0UT!SP10 -tSAl X61 ) :(FIN1) Or

' * • NAME FUNCTION * ;; ~~ ; 309 NAME C tSt = :S!INCN) 310 C tAf = :S!KCYN) 311 C IDENPT $ NAM = :F!NL.NAMF) 312 C *!* = zS(FUNM) 313 C t [ * = :S(APN) 314 VAR(,NA«,REG) : (R-'URN) 315 FUNN ' FUNCNAME(NAM,REG) :(R-TUPN) 316 INDN VALUE(1) 317 CALL(MVNt) :(FIN6) 318 KEYN C IDENPT S K = :F!KEYEPR) 319 KEY . = MK ♦.♦) 320 DIFFER (KEY) '. :F(KEYERR) 321 K = E *14000400000000J000 4 LP^C (Ki Y,2 »t0* ) tr. 322 LE(REG,5) :FIKNCUTF) 323 PUTOUT!t SA* REG t t K) :(RETURN) 324 KNOUTP PUTOUT t* SA1 t K) :{FInj 1} 325 ARN PUTCUT!SP10 *SB1 1 PARAMtHM) 326 VAR(N*M,2) 327 PUT0UT!3P10 *SA2 X2♦) 328 CALLttRARt) :(FIN6) * EXPRESSION FUNCTION

329 EXPRESSION STATE = 1 330 STACK = _331 EXPL-rQP • IND = 332 0 °E9 =1 333 C SPB = 334 DIFFERtC) F!EXPE^ D) 335 COLLAR C *$* = SUNOR) 336 'C • M* = S!PA KEN) .331 C t * ♦ = StCONl) 338 *** = S!CCN2) 339 NUMBER . X-ON = SICCN6) 340 tAf = S!Kr YE) 341 t. t = S!EXPNANE) 342 IDENPT . VARI = F(OP ) 343 Mt = S!EXPFUNC) 344 L = tVARI8* !NEXTACT ) 345 VARIB C t[* = S(EXPAF.RY) 346 VAR!VARI,1) 347 ID-NT!PVI ) F(VFSl) 348 C4LL1!*VALU 349 VRB1 PVI 350 TEST IND GT!IND) :F!PATAS'"ST) 351 CALL1 ! *IVVM 352 IND = IND - 1 : (TESTINO) 353 °P C ANY! t*•-*/♦) $ 0PTOR t t = :F!ALT) 354 OPER = Z :(NEXTACT) 355 ALT C fv * = :S(ALT1) 356 C t// f =: :F!EXPENO) 357 ALT1 OPER =3 356 NEXTACT NEXTSTATE = NSFCOPER,STATEJ 359 ACT = OIFF^RfNEXTSrATE) NAFfSTATE, OPER,TOP(STACK)I 359 _360_ :Ft SYNTAX) STATE = OIFFER(ACT) NEXTSTATL :S($ACT)F!5YS~RR) 361 INDR IND = INU + 1 362 C SP3 = :(DOLLAR) 363 PAREN L = *PAREN1* :(NEXTACT) 364 PARE-N1 EXPRESSION! ) 365 C SPB = 366 C * )* = :F!MISPAR )S!TiSTI\'Q) 367 C0N1 ♦*♦ C BREAK!t*t) . CON = :F!;iISQUCTE)E!00';3) 368 C0N2 C BREAK!***) . CON *4* = :F!MISQUOTE) 369 C0N3 C INDEX = 1 370 C0N3A L = *CQN4» :!NEXTACT) 371 C0N4 PUTOUTtSPlO tSAl t CONSTANT(CON) ) MTESTINO) _372_ C0N6 CINDEX = 2 373 C t.t NSPAN!• 0123456739*) * CO = : Ft C0N3A.) 374 C INDEX = 3 375 *.♦ CON = CON CO (CQN3A) 376 EXPAR-Y PUTOUTtSPlO tSBl ♦ PaRAM!*]*)) 377 V."R(VARI,2) _378_ PUTOUTtSPlO *SA2 X2t) 3 79 CALL!*RAN*) ~ 380 PUTOUTtSPlO tSAl X6 ♦ ) !TESTING) 301 EXPFUNC OlfFcPtStVARI *?,F3t) ) S(NULRET) 382 L = t£XPFJNC2* (NEXTACT) 383 NULRET FUNG!VAR!,1) 284_ ID-NT!IMD) S!EXPLOCPJF!SYNTAX I 3 85 EXPFUNC2 FU-iC! VA-U ,1) !7-STIND) 386 EXPNA = *EXNAM2* :(MEXTAC" ) 387 L-XMAN2 NAME! I) :(TESTING) 388 EXPEND E0(STATE,1) rStNULL) 389 IF(N-(STATE,3). NE'tSTA E,4) NE(STATE,6) ) :F(SYNrAX) 390 • GT(STATE,3) :FtEXENLCuP)St$!*AL* 390 :P()J) _391_ AL3 392 AL4 CC = POP!) 393 AL4A CAl LISCC) 394 AL2 CC = ^OPO FUL5) 39 5 PUTOUT!BX1X6) 396 CC *Ct = F!AL4A) 397 CALL! tLESt ) 398 PUTOUTtSPlO •SB1 c * CC) 399 CALL! tCNCt ) (AL.5A) 400 AL5 PUT0UT(BX6X1) 401 AL5A V = POPO F(SYSERR) 402 V LEN! 1) REM $ V 403 V = V + 1 404 PUT0UT(SP10 *SA6 D4 ALTNU.M t + t V) 405 USE(tALT*) 406 PUTOUTtSPlO tSAl D* ALTNUM *+* V) 40 7 CALLt tPTPt) 408 PUTOUTtSPlO *NZ Bl,FL* ALTNUM) 409 ALTP ALTP +• 1 410 PUTOUTtSPlO *SX1 A* ALTP) 411 PUTOUTtSPlO *JP CP* ALTNUM) 412 PUTOUT(tAt ALTP * SA1 D* ALTNUM t+* V) 413 PUTGUTIGX6X1) 414 PUTOUTtSPlO *AX6 56* ) 415 PUTOUTtSPlO *SX6 X6-5t) 416 PUT GU T tSPIO *NZ X6,FLt ALTNUM) 417 CAL Lt * RPTt) 418 PUT OUT (SPIO tNZ B1,FL* ALTNUM) 41.9 PUT OUT tSPIO *SX1 At ALTP) 420 USE AT*) 421 PUTOUTttFL* ALTNUM RJ *UES*) 422 PUT OUT(PTF) 423 PUT OUT If?.5* ALTNUM RJ t UE S * ) 424 PUTOUTtSPIO *SB1 X6*; 425 PUTOUTtSPlO tJP Bl*) 426 PUT OUTttPt ALTNUM * VFD 4/5,56/D* ALTNUM) •V2_L USE t * * * ) 428 USE (tO ATA* ) 429 PUT OUT !*u* ALTNUM *• VFD 30/* V *,30/R* ALTNUM) 430 PUTOUT (SP10 tBSSZ * V) 431 USE (** t) 432. PUTout (*CP* ALTNUM RJ tLiSt) /+!3 PUTOUT (SPIO *SB3 BO*) 434 PUT GUT (PTS) 435 US- !** *) '436 PUT OUT (SPIO *S;U P* ALTNUM) 437 POP !) : S(SYj\TAX)FU. ETUSf-J) 43 8 EXENLCOP OP = POP(STACK) : F(^lTUPN) 439_ OP *C* = :StC/T) 440 CALL1(SOP) :trXuNLGOP) 441 CAT CALL! *LFS* ) ^42 PUTOUTtSPlO *SB1 OP) 443 CALL1!*CNCt) 444 POP(STACK) :F(?ETUPN)S!SYSERR) 445 NULL PUTOUTtSPlO *BX1 Xl-Xlt ) :(RETURN)' 446 KEYE 'C • IDENPT K = :F(KEYERR) 447 KEY - $(K ) 448 L .= OIFFcR(K.iY) tKEYR* :F(KEYEPE )S (fit-XT ACT ) 449 KEYR PUTOUT(* SB1 t KEY tB*) 450 CALL1(*FKW*) :(TESTING) 451 PATASTST C SPiN!* ♦) ANY(t$.t) S PAS SPAN!* t) = :F(L:XPLOCP) 452 PATNUM = PATNUM + 1 453 PUT0UT(BX6X1) 454 PUTOUTtSPlO *SA6 D* PATNUM t«-lM 455 PUTOUTtSPlO tSAl Pt PATNUM) 45 6 USE(♦DATA*) 457 PUTOUT(tDt PATNUM VFD 30/1,30/R* PATNUM) 458 PUTOUTtSPlO *BSS"Z It ) 459 USE!t*t ) 460 USE(*PATt) 461 PUTOUTttP* PATNUM t VFD 4/5,56/D* PATNUM) 462 PUTOUTt*FL* PATNUM P.J *UA S*) 463 PUTQUTtPTF) 464 USE!***) 465 US.„-(*SUBt) 466 PUTOUT(fR* PATNUM JP RS PATNUM) 467 CALLt*LCA*) 468 PUTOUTtSPlO *SA1 Dt PATNUM * + lt) 469 CALL! *PTP*) • 470 PUTOUTtSPlO *NZ Bl,FLt PATNUM) ALL USEt tPAT*) 472 RM " *RCA* 473 RN = I DENT{PAS,*$♦) tRIAt 474 PUTOUT(*P$* PATNUM * SA 1 Dt PATNUM * + lt) 475 PUT0UT!BX6X1) 476 PUTOUTtSPlO *>X6 56♦) 477 PUTOUTtSPlO tSX6 X6-5*) 478 PUTOUTtSPlO *NZt SPfi *X6,t [X tPTFt) 479 CALL!RN) 480 PUTOUTtSPlO *SA1 D* PATNUM *+l*) 481 CALL! *?.PT* ) 482 USE(t#t ) 463 NA*E<2) • 484 RN = *CPA* 485 RN = I DENT(PAS,tS*) !PA 466 CALL(RN) 487 PUTOUT(JP *PTS *) 488 USE(***) : (EXPLOOP) 489 Al :( i>L) 490 A2 CALL(*LES*) "~ 491 PUSH!STACK,OPTOR) : (EXPLGUP) 492 A3 CC = 1 : (A4A) 493 A 4 CC = POPt'STACK) 494 CC *Ct = 495^ A4A C ULt tLESt ) "491 PUSH(STACK,tC* CC + 1) !*L) 497 A5 OP = POPtSTACK)

498 CALL! (SO*) . 499 A5LOOP CC = POP(STACK) : F ! A 3 ) 500 CC *C* = :S(A4A) • 501 CALLKSCC) : (A5L00P) 502 A6 OP • = PGP(STACK) 503 CALL Ii$uP) : IA 2 ) 504 A7 OPTOP ANY!t+-t) . :S(A6)FU2) 505 A8 PUT0UT(BX6X1) • ■»»♦ 506 A8A V = I

- 507 PATNUM = PATNUM + 1 508 ALTNUM = PATNUM 509 •4i—— . PUTOUT(SPIO *SA6 Dt ALTNUM *+* V) ^ 510 USE!*ALT*) • 511 PUTOUT!*Rt ALTNUM * JP RS* ALTNUM) 512 CALL!*LCSt) 513 A8B PUTOUTtSPlO tSAl D* ALTNUM *•*-* V) 514 CALL!tPTPt) 515 PUTOUTtSPlO *NZ Bl,*+-5t) 516 ALTP = ALTP ¥ 1 517 PUTOUTtSPlO tSXl. At ALTP) 518 •PUTOUTtSPlO *JP CP* ALTNUM) . 519 PUTOUTt*At ALTP ♦ S Al Dt ALTNUM t+t V) 520 CALLt *PRT*) 521 PUTOUTtSPlO *MZ Bl,*+2*) 522 PUTOUTtSPlO *SX1 A* ALTP) 523 PUTOUTtSPlO tJP CP* ALTNUM) 524 CALLt tPCP.M 525 PUSH!,*v* yj 526 USE!t**) . : (EXPLQOF) 527 A9 __.-, CC . = POP!) 528 CC LEM!1) REM $ CC . 529 A9A CALLt *LE5*) 530 PUTOUTtSPlO *S31 * CC) 531 CALLt *CNCt) : (A8A) 532 A10 OP = POP!) 533 - CALL($OP) 534 A10L00P y i- CC = °OPt) :F(A8A) 535 PUT0UT!BX1X6) 536 CC *C* = :S(A9A) 537 CALLt SCO :{A10L00P) •# 538 All PUTOUT!BX6X1) 539 AHA —__— V = OOP!) 540 V LcNU) REM $ V . 541 -» V = V + 1 542 PUTOUTtSPlO *SA6 D* ALTNUM *+* V) 543 U5E!*ALT*) : (A8B) 544 A12 CC = 3OPt) 545 CC LEN(l) REM $ CC "546A12A CALL(*Li*S*) 547 PUTOUTtSPlO *S31 t CC) 548 CALLt tCNC*) : (A11A) 54.9 A13 OP = POP!) 550 CALL!SOP) 551 A13LC0P CC . = °CP[) :F!AHA) 552 purnu.f«yiya \ 553 CC *C* = :S(A12A) 554 CALLt SCO :(A13L0GP)

PARAM FUNCTION

555 PAR AM c SPB = 556 PAR AM = 1 557 PALOOP EXPRESS It; ': t) 558 C *,* = :S(COMMA) 559 C END = :F(FUNCEPR)S(;:,ETUr N) " 560 COMMA CALLt *LL:S t) 561 PAR AM _ PARAM + 1 562 C SP3 = :(PALOOP)

TOP, POP, PUSH FUNCTIONS

563 TOP TOP = 1 564 STACK BREAK!*,*) .T :F(RETURN) 565 T tct :S(TCP2) 566 T ANY!t+-t) :S(T0E>3) 567 T tv* :S(T0P5) 568 TOP = 4 :(RETURN) 569 T0P2 TCP = 2 :(RETURN) 570 T0P3 TOP = 3 : (RETURN) - 571 T0P5 TOP = 5 : tRETURN) 572 PUSH STACK = INP *,* STACK (RETURN) 573 POP STACK BREAK!*,*) S POP LEN(l) = :F!FRETURN)S!r.iTU"N)

CALL, CALLl FUNCTIONS *

574 CALL PUTOUT!* RJ =X.PAS$* ROU) : (RETURN) 575 CALLl PUiCUTI* RJ =XFAS$t ROU) 576 PUTOUT!BX1X6) : (RETURN) * LABEL FUNCTION

577 LABEL DIFFER!LAB) : FU.Afc.EL5) , 578 ID-Ni (StLAB *$L1*)) :F{OUP!AB) 579 C INDEX = 1 580 StLAB tL$3*) = CONSTANTtLAB) 581 LABEL = OIFFERtSUAB *

PDF FUNCTION

596 POP PCF • = OIFFERtStPAR *SF*)) i(PAR *$F*) :S(kETURN) _597 F'lCNUM - IDFNTtStPAR *T>FD*)) FNCNUM 4- 1 :C(FDFNC0N,I:) 598 St*F* FNCNUM) = PAR 599 St PAP tSEtj ^ *F* FNCNUM 600 PDF = f F * FNCNUM :tRETURN)

VAR FUNCTION

601 VAR VA = .StPAR *SV*) 602 DIFFER tSVA) FtVAR2) 603 VO = VR[$V4] 6 04 IDENTtTY?(VD)) FtSTYP(VD)) 605 VARI VL = tV* SVA 606 VARI.5 LEtREG,5) FtVOUTR) "607" PUTOUTtSPlO *SA* REG SP7 VL) tRETURN) 608 VOUTR PUTOUTtSPlO *SA1 t VL) t F I N 1) 609 VAR2 VARNUtM VARNUM +• 1 610 C INDEX 1 611 VR[ VARNUM ] = VARIDtCONSTANTtPAR),) FtVAP2MNY) 612 SVA VARNUM (VAR 1) 6 13 VAR3 PATVARt ) 614 PVI. = 1 615 PUTOUTttRt PATNUM JPl tPTF*) 616 CALLt*REM*) . 617 PUTOUTtPTS) • 618 USE t **♦) !VAR 1.5) 619 VAR4 P.ATVAR!) ~ 620 PUTOUTttR* PATNUM * JP =XFASSPTFt) 621 PUTOUTt* JP =XFASSPTFt) 622 VARPF PUTOUT(t USE -t) !VAR1.5) 623 VAR5 PATVARt) 624 PUTOUTt *Rt PATNUM t J? =XfrA S SMTA *) 625 PUTOUTtPTS) tVAEP-) 626 VAR6 PATVAPt) 627 PUTGUT(*R* PUNUM t JP =XFASSMTA*) 628 PUTOUTt* JP =XFASSMTA*) (VARPF) 629 VAR7 PATVARt) _630^ PUTOU T{t R* pa T'NUM * SB2 * +2 * ) 631 PU'iOUTt* JP =XnT35ABP*T 632 PUTOUT(t SE2 * + !*) 633 PUTOUTt* JP =XFA5SAbSM 634 ^UTCUTtPTF) 635 PUTOUTtPTS) (VARPF) I 36_ VAR3 ?AT VA P < ) 6*37 PIJTC,UT t AP. *P ATMUM RJ "*TjCPT*T 638 C;iLL< *EAL*) 639 PUTOUTtPTF) 640 CALLt *LCR*) 641 VAK3.1 PUTOUTt* SB 3 BO* ) 642 PUTOUTtPTS) tVAPPF) 643 VAR9 PUOUT(*P* PATNUM > jp fS * PATNU'-M 644 j~jUJL_(_*JLC R *_) 64 5 PUTOUTtPTS) 6 46 PUTCUTtt USE *•) 647 PUTOUTt * USE PaT*) 648 PUTOUTt*RS* PATNUM *RJ =XFASSRCR*) :tVAR3.1)

VARNM FUNCTION

649 VARNM VA = .St PAR * W *)

•*• 6 50 DIFFER(SVA) :F!VN2) 651 VD = VPCSVA1 652 IDENTtTYPtVD)) :Ft SYNTAX) 6 53 VNL VAkNN' = *V* SVA —v :tRETURN) 654 VN2 VARNUM = VARNUM + 1 655 C INDEX = 1 656 VRCVARNUM] = VARIOtCONSTANT(OAR),) :F(VAR2MNY) 657 SVA = VARNUM : !VN1)

. PATVAR FUNCTION

658 PATVAR PATNUM = PATNUM + 1 659 VL = *P* PATNUM 660 PUTOUTt* USE DATA*) 661 PUTOUTttCt PATNUM * VFD* SD7 *30/0,30/5* PATNUM) 662 USEt***) 663 USEttPAT*) 664 PUTOUT(tP* PATNUM t VFD* SD7 *4/5,56/Dt PATNUM) 66 5 USrr(**t ) 666 USE!♦SUB*) :(RETURN)

CONSTANT FUNCTION

667 CONSTANT CONS = .$(CCM *SCt CINDEX) ^68' CONSTANT = DIFFER (SCGNS) SCONS :StRETURN) 669 CCNNUM = CONNU A + 1 670 CN[CUNNUM,1] = CON :F!C0N2MNY) 671 CNCCCNNUM,2] = CINDEX 672 SCONS = *C* CJNNUM 673 CONSTANT = *C* C3NNUM : (RETURN)

FUNC FUNCTION

6 74 FUNG DIFFERU(FUM *SF2*)) :F(PRDEF) 675 GTtStFUN *SF2*),4)" :St M *F.* StFUN *i^2*)) ) 676 F = StFUN *S?2*) 677 FUNC2 X = PARAM! *) *) 6 78 EQ!X,F) S(FUNCOUT) 679 GT(XtF) St SYNTAX) 6 80 "0!F,l) S(FU\

PROG DEFINED FUf«C U"LT 686 PRDEF IDE NTtStFUN *$FC*)) :F(FDFEF) 637 PUTOUTtSP 10 *SX2 * PARAMt *) *)) 688 PUT OUT{*+ SB2 * + lt) 689 PUTOUTtSP 10 *JP * PDF(FUN) ) :tFIN6) 690 FDREF ECt PARAM! *>t),1) :F(rDRcFERR) t91 PUT 3U"* !SP 10 *SB1 R?* 10000 + 5-(FUN *S=C*)) 692 CAL L!tFOT ») : (N^.M6) 693 F.10 USE (tFNCB LKt) 694 FNO = FNCBLNMO 695 PUT GUT(*F C* FNO * SB1 FB* FNO) 6 96 PUT OUTtJP *CFN*) 697 NAR G = 0 J*— 698 •NLV = 1 699 C (t * i. v * * * ) $ OEL = :F(DEFBAD) 700 c • IDENPT S FNAME = " :F(OEFBAD) 701 c t (* = :F(Dt F3AD) 702 c IDENPT . ARG = iF(LV) 703 ARGLOGP PUTOUTtSPlO tVFD 60/* VARNMtARG)) 704 NARG = NARG + 1 705 C *,* = :C(LV) 706 C IDENPT . ARG = :S!ARGLG0P)F(DEF3AC) 707 LV c. t)* = :F(DEFBAD) 708 c IDENPT . LVR = :FtSTLA6) 709 LVLOGP PUTOUTtSPlO fVFD 60/* VARNMtLVR)) 710 NLV = NLV + 1 711 C Uf = :F(STLAB) 712 c IDENPT . LVR = :S(LVLOOP)F(DEF3A0) 713 STLAB c DEL = :F(Dr-P3AP) 714 c SP3 = 715 STLB = FNAME' 716 *,* = :F(DLFEND) 717 SP3 = 718 !*** v ***) $ OEL IDENPT S STLB DEL = :F(DEFRAO) 719 DEFEND SP3 = 720 *>* = :F(DEFBAO) 721 PUT0UT(SP10 *VFD 60/* VARiNM(FN^WP) ) 722 NTOT = NARG + NLV 723 PUTOUTttFBt FNO t VFD 12/* NTOT t,18/PLIST,12/* NTOT 723 t,18/0t) 724 PUTOUTtSPlO *VFD 13/* NARG *,24/t NLV t,18/0t) 725 USEt***) 726 PUTOUTt* SX2 FCt FNO) 727 PUfOUTtSPlO *SX1 t GOTUP(STLB) ) 728 PUTOUTtSPlO *SB1 * POFt-NAME)) 729 CALLttD^Nt) : tRETURN) 730 F.5 Li(PA RAM!*)*) ,1) :FtPAR2MNY) 731 CAlL(tMSIt) 73^ PUTOUTtSPlO *NG* SP3 *X6,» -X *ERR+2*) T33- PATNUM = PATNUM + 1 : 734 PUTOU T(SP 10 *S i 6 Dt P AT NU ' * U *) 735 PUTOUTtSPlO *SA1 P* PATJIJV.) 736 USEt* DATA*) 737 P U"OUT t *0 * PATr;uM * V FD 3 0/1,30/R* PATNUM') 738_ PUTOUTtSPlO *BS3Z 1* ) 739 u s.: t * * *) : ~~~ 740 USEt *PAT*) 741 "PUT0UT(*P* PATNUM t VFD 4/5,5c/D* PATNUM) 742 USE!***) 743 USE!-SUB*) 744 PUTOUT!tR* PATNUM JPl *PTF* ) 745 PUTOUTtSPlO *SA1 A3+1*) 746 "lD"MTtFUN,*POS* ) : S t c . 6 ) 747 IDl;Nt (FUfv,*KPOS*) :StF.7) 748 CALL (S (FUN- *SF1*) ) 749 PUTOUTtPTF) *• 750 PUTOUTtPTS) 751 USEt***) : tFIND 752 F.6 PUTOUTt* SA2 * EX *SBJ+1*) 753 PUTCUT(* AX2 48*) ' 754 PUTOUTt* IXL X2-X1*) 755 F.7 PUTOUTt* SB1 XI*) 756 PU'OUTt* cQ B1,B4,* EX *PTS* ) 757 PUTOUTtJP *?TF*) 758 PUTOUT(UScAST) itFiri) 759 F.8 LEtPARAMl♦)♦),1) :FtPAR2Mi Y) 760 BTABNO = BTABNO + 1 761 PUTOUTtSPlO *SB1 K* BTAB NO) 762 CALLt *BKTt) 763 USE(♦BREAK*) • 764 PUTOUT(*K* BTABNO * BSSZ 2*) 765 US£(t*t) 766 F.85 PATNUM = PATNU'1 + 1 767 PUTOUTtSPlO *SA6 D* PATNUM *+ l*) 76 8 PUTOUTtSPlO *SA1 P* PAT IUM) 769 USE!*DATA*) \ 770 PUTOUT(*0* PATNUM ♦ VFD ' 30/1,30/R* PATNUM) 771 PUTOUT(SPIO *BS5Z 1*) 7.72 USE (*•**) 773 USE!tPAT*) 774 PUTOUTt*P* PATNUM t VFD • 4/5,56/Dt PATNUM) 775 USEt***) 776 USE(*SUB*) • 777 PUTOUT(*R* PaTNUM JPl *PTC*) 778 PUTOUTtSPlO *SA1 A3+1*) 779 CALLt StFUN *SFl*)) 780 PUTOUTtPTF) 781 PUTOUTtPTS) e. 782 USEt***) I (FIND 78 3 F.9 C • ANYtt** ***) $ DEL IQENPi ii NAM *( * = :FtbYiTAX) 784 TYPENG = LhtTYPEN0,510 ) TYiPENO + I :F(TYP2MNY) 785 PUTOUTtSPlO *SB1 * POFCNAM) ) 786 PUTOUTtSPlO *SX2 T* 100 00 ^ TYPE^C) 787 CALLt *DOTt) 788 USEt*D.'T*t) 739 PU i OU7 (*T ♦ 1,}000 *- T YP E NO *" SLU * + !*) " 790 PUTOUTtJP *GOT*) . 791 PUTOUTtSPlO *VFD 4/6,10/* TYPi NO *, 10/NF* TYPING

791 . * ,36/NF* TYPENO). 792 CINDrr.X = 1 793 FXNO = r-x-JC + 1 •794 F Xf FX NO 1 = *3 0 / * CO•

837 PUTOUTt HI BL, h, r PATNUM) 838 PUTOUTt ♦PS* PATNUM * SX1 PR* PATNUM) 339 PUTOUTt f SB3 BO*) 840 PUTOUT( * RJ =XFASSLES*) 841 DUTCUT( * JP AS* °AT.N«j) 842 J'UTOUT^ ♦ PP.* 3. NU -1 SA1 D* PATNUM *+!*) 843 P'UTOUTt RJ =XFASSPRT*) 844 PUTOUTt NZ B1,P=* PATNUM) 845 PUTOUTt JP PS* PATr.U'O 846 PUTOUTt USE*) : tFIND 847 F.16 PUTOUTt SBl 7*) 848 pyjjlirn RJ =XFASSFKw*) : t FI»: 6) 849 F.17 "i. o t pa y\\ M! *)♦),!) :F(PAh2MNY) t h.8!>) 850 PUT0UT(BX6X1) : 851 F.13 p = PARAM(*) *) F(PAR2MNY) 852 LE(P,3) : F(c.182) 853 P. 131 P ' * LT(P,3) P + 1 : 854 PUTOUTt* RJ = XFASt>LES*) 855 PUTOUTt* BX1 Xl-Xl*) ' (F.181) 356 F.182 BTVBNC = BTABNO + 1 857 PUTOUTt* SX6 K* BTABNO) 858 PUTOUTt* USE EREAK*) * ^ 8 59 PUTOUTI*K* BTABNO * BSSZ 3*) ; 860 PUTOUTt* USE*) 861 PUTOUTt* RJ =XFASSRPL*) : tFIN6) *

5r FIELD FUNCTION

862 FIELD IDENTtStFD *1>F*)) : FtcDFNCONF) 863 FDN = StFD *$FD*) 864 FDNUM = IDENT(FDN) FDNUM *- 1 : StNEWFD) 865 F = PLDCFONI 866 TYPENOtF) = fYP'ENjtF) + 1 867 LASTtF) = FDATAtTYPENO,LAST!F)) 868 FIELD = *F0* 10*000 + FDN : (RETURN)

869 NcWFD . itFD t$FD*) = FDNUM - 870 FLOrr-DNUM) = FDATAtl,FDATA(TYPEN0,O) ) : F(FD2MNY) 871 FIELD = *FD* 10000 + FDNUM : (RETURN) .* * FUNCNAME FUNCTION * 872 FUNC NAME I CENTt*tFUN *$FD*) ) : F(FONAME) 873 FUNCtFUN,REG) ' (RETURN) 874 FDNAFE EG(PARAM(t)*),1) : F(FDREFERR) 875 PUT OUT ISF10 *SB1 FO* 10000 + $(FUN t$FO*) ) 8-76 CALLt tFDTt) : (FIN6) * PUTOUT FUNCTION * •877 PUT3UT PUT = DIFFER!ASMFLG) PAR 678 OUTPUT = DIFFERtLISTOB) INDENT PAR : (RETURN) * ERROR MESSAGES

*. 879 SYNTAX FRRMSGt*SYNTAX ERROR IN STATEMENT*) :(STLOOP) 880 FEATURE ERRMSGttFEATJRE NJT YET IMPLEMENTED*) .(STLCOP) 831 MISQUOTE ERRMSGttMISSING RIGHT QUOTE*) : (STLOCP) -. ' 882 DUPLA8 ERRMSGt^DUPLICATE LABEL IGNORED*) • J:tSTL COP) " 883 BADGCT ERRMSGt*SYNTAX ER AND FUNCTION NAMES CCNFLIC"f*) : (STLCOP) 892 VAR2MNY ERRMSGt*INTERr;AL TABLE UV ERFL OW/ TOO l-.'-t'A( VARIAtiLLS*) MSTLt. ER 892 . ) . ; 893 C0N2MNY ERRMSGt*INTERNAL TABLE OVERFLOW/ TOO MANY CONSTANTS*) MSTLOCf 893 .) 894 FDREFCRR ERFMSGt*MCRE THAN ONE PARAMETER TO A FIELD REFERENCE*) 894 . :(STLOOP) 895 DEF3AD ERRMSG(^SYNTAX ERROR IN A DEFINE FUNCTION*) MSTLOGP) 896 PAR2MNY ERF •15G!*TOO MANY PARAMETERS TO A BUILT-IN RJKCT K'N* ) *)*<> • . : (STLOOP) 897 TYP2MNY E RRMSG (*INTERNAL TABLE OVERFLOW/ TOO MANY PRCGP A'-M^-CEF TNN I -D 897 .ATATYPES*) MSTLOrp) 898 DATABAD ERRMSG(*SYNTAX ERROR IN A DATA FUNCTION*) . :(STLOOP) 399 FD2MNY EF.P^SG (*I MTERHAL TABLE OVERFLOW/ TOO (MANY FIELDS*) MSTIOOP) 900 FX2MNY ERRMSG (*I NTERNA L TABLE OVERFLOW/ TOO MANY CONSTANTS EVER 8 CHA 900 .RASTERS LONG-*) :(STLOOP) 901 ERRMSG OUTPUT = ♦ ***** * PAR * ****** 902 DIAGNO = DI AC-NO +- 1 :(RETURN) * * GETSA FUNCTION

903 GETSA EG(MSLI) — :F!GETSA2) 904 GETSA1 CURLIN = DIFFER(NXTLIN) NXTLIN :F(FRETUR.N) 905 LINNUM = LINNUM + 1 906 NXTLIN = GETLIN!) :S!GLTSA2) 907 NXTLIN ______CHECK FOR COMMENT OR CONTROL 908 GETSA2 -CURLIN ANY!*-**) $ STR1 iTTG^TSAS) 909 (E'.MMSLI) PUTOUT!** * CURLIN) MS(LISTSS) PRTL IN (LP AD! L?NNUM,6 909 . ,*0*) INDENT INDENT CURLIN)) * COM-MENT 9*0 DIFFERtSTRl,***) :F!GETSA1) "* • CONTROL 911 INTGFR. 912 CURLIN LFiM(l) NSPANtt *) S >AN( *ABCCEFGHlJKLMNDPgRSTUVE'XYZ» 912 . ) $ STR1 NSPANtt *) FENCE tPPOStO) v JMTGPT NSPANt* *) RPOStO)) 912 * :FtGETSA4) 913 STP1 = StSTRl t.*) 91* IDENTtSTRl) :F(tSTRl) 915 GETSA4 ERRMSGt*BAD CONTROL LINE*) (GETSAD * LIST 916 Cl LISTSR = 1 tGETSA1) UNLIST 917 C.2 LISTSR =0 (GETSAi) * .NECODE .913 C.3 TITTOB" tGETSAl) * CODE 919 C#4 LISTOB = 1 tGETSAI) *>» EJECT 920 C.5 EJECTt) tGETSAl) FAIL 921 C.6 NGFAIL tGETSAl) * NOPA IL c:ZZ C.7 NCFAIL = t = XFAS$Ek»<>ll * tGETSAl) NOCKOSS 923 C.3 CRSFLG = 0 tGETSAl) * CROSEREF "924 C.9 "CRSFLG" _ 925 •CRSIND = L :tGETSAl) * NOASM 926 CIO ASMFLG = 1 :tGETSAl) * LIS TA SM 927 C.ll ASMFLG = 2 : (GET SAD * '- . SPACE'N _923_ C.12 INTGEP = IDENTtINTGER) 1 929 5PCLiN(INTGE\) : tGETSAl) * NE^/STNO N • - 930 C.13 NEtINTGER) :F(GETSA4) 931 MAXSTN = GT t STNO,MAXSTN) S TNG 932 STNO = INTGER - 1 :tGETSAl)

_.! _9 33_ C. 14 INTGER = IDENTtINTGER) 0 9 34 PUTOUTt* SX6* INTGER) 935 PUTOUT(SA6 *SNC*) :tGETSAl) * CSN'AP N 936 C.15 CCMSNAPtlNTGER) :tGETSAl) * . NEXT STATEMENT 937 GETSA5 STNO = STNO + 1 9 38 tEQt.MSLI) PUTOUTt*- * CURLIN) NEtLISTS^) PRTLINt 938 . LPADtLINNUM,6,*0*) INDENT LPAC(STNC,5,* ♦) ** CURLIN)) 939 GETSA6 CURLIN REALCHtf;*) :FtGETSA7) 940 (GETSA CURLIN) SEMIPT $ STRl :F(GETSA7) * MULTI-STATEMENT LINE 941 MSLI =1 942 CURLIN STRl *; * = 943 GETSA = PUTOUTD* t) GETSA STRl : (RETURN) 944 GETSA7 GETSA = GETSA CURLIN * CONTINUATION CHECK 945 NXTLIN ANY(*.+*) REM £ CURLIN :F(GETSA3) _94__ LINNUM - LINNUM •*- 1 947 (PUTOUTt** * NXTLIN) NEtLISTSR) PSTLINtLPADtLINNUM,6,*0♦) 947 . INDENT LPAD(STN0,5,* t) * ♦ NXTLIN)) 948 NXTLIN =GETLIN() :S(GFTSA6) 949 NXTLIN = :(G'iTSA6) 950 GETSA8 MSLI = PUTOUTt** *) 0 :(RETURN) * * EACTPH FUNCTION

951 ENDA 952 EACTPH BNUM = 10000 953 P = FXNO 95_4_ PUTOUTtJP *END*) "95 5 N = 10000 956 CLOOP N = LTtN,CONNUM) N + 1 :FtCCNOUT) " 957 A = CN[N,I ] :! i(♦CL ♦ CNC N,2 1) ) 958 CL2 PUvOUT!*C* N * VFO 4/2,56/* A) :tCLOCP) 959 CL3 PUTOUTt*C* N ♦ VFO 4/1,56/FL* N) 96 0 PUTUUTttRL* N * DAT/i * A) :{CLCOP) 961 CL1 M = SlZEt A) 962 CONOTNG GTtM,8) :SL2*D LU22 PUTOUT(USEAST) 1023 PUTOUT!* VFO 30/* StLAB *Li3*) *,30/LL* T« ) MILOOP) 1024 LOUT PUTOUTtSPlO *END * PROG) 1025 REWIND!*ASM*) 1026 SPCLIN12) . 1027 OUTPUT = VARNUM - IQOOQ * VAMABLcS ENCDUNTERED* 102 8 OUTPUT = CCT'-W'IUM - 10000 * CONSTANTS SEEN* 1029 OUTPUT = P * FIXS MADE* 1029 :(ENDMSG) SPCLIN, PRTLTN, GETLIN FUNCTIONS-

*> 1C30 SPCLIN N = PAR TO31 SPCLIN1 = GT!N,0) N - 1 :F(R"TURN) 1032 OUTP'UT : tSPCLIND 1033 PRTL IN OUTPUT = PAR : tRETURN) 1034 GETLIN GETLIN = INPUT :S tRETURN )FtFR*TU-rv) * INISYM FUNCTIGN

1035 INISYM CCNNUM = 10000 1036 LA6MUM = 10000 1037 $t*END$L2*) = *FAS$nND* 1038 $(*RETURNSL2*) = *FAS$SFNt 103 9 M*FRETURN$L2*) = tFASSFFNt 1040 it*NRETURNSL2t) - tFASSSFN* 1041 VARNUM = 10002 1042 VR = ARRAYt*9994/10500t) 1043 VR[ 9994] - VAF. IDt ,*VAR4t ) 1044 VR[99951 = VA-RIOt ,*VA~5* ) .1045 VRL9996] = VAPID!,*VAR6t) 1046 VRC99971 .VARID!,*VAR7*) 1047 VR[9998] VARID! ,tVAR8t) 1048 VRC9999] VAR ID! ,*VAR9*) 1049 FAIL$V 9994 1050 FENCc$V 9995 105_1_ ABORTSV 9996 T6 52 AR3SV =9997 1053 BALT.V = 9998 10 54 SUCCEFD$V - 9999 1055 VP.l 10000] = VAFIf) (, *VAF3* )' 1056 ${*REM$V*) = 10000 105J_ CINDEX =1 T6 53 VR[ 10001 ] = VAPID(CONSTANT!* OUTPUT*), ) 1059 VRf 100021 A = VARID(CONSTANT!* INPUT*) ,) 1060 fncnum = 10000 1061 FNBNUM = 10000 1062 St *OUTPUT$V*) - 10001 1063_ 5!*INPU7W*) = 10002 Tu64 PATNUM 10000 1065- BTABNO luOOO 1066 ALTP 10000 1067 STFCOUNT. 1 1068 LAS TNG. 2 I0d9_ STNO. 3 10 7GT FNCLEVEL. = 4 1071 STCOUNT. = 5 1072 RTNTYPE. = 6 1073 ALPHABET. = 7 1074 ABEND. = 10 1075 ANCHOR. =11 10 76 FULLSCAN. = 12 • 1077 MAXLNGTH* '= 13 10 78 STL I MIT. = 14 1079 SPECIAL. = 15 1080 FLO = AP-AYUOO) T' 1081 FNC!*TRIiV*f *Tfcf.-f ,D - 1082 FNC !*ARRAY* , *C-AR*,2) 1083 F\C(tI DENT*,*IDT*,2,D '*'( 1084 •FNC!*DIFFL:w*, *DIF*,2, 1) * 108 5 FNC(*LT*, tL^P*^, 1) 1086 FNC(*LE*,*LEP*,2,D 1087 FNC!*GT*,*GTP*,2,1) 1088 FNC ( *GE*, *C-?*,2, 1) 1089 FNC!*EC*,*_Q?*t2,1) 1090 FNC!*NE*,*NEP*,2,1) 1091 FNCttSIZE*,*SIZ*,I) 1092 FNC ! ♦ REWI ND*, tREW ♦-, 1,1)

1093 FNC!*DEFINE*,*DFN*,10) • 1094 FNCt+LEN*, *LEN*,5) 1095 FNC!*TAB*,*TAE*,5) . 1096 FNCttP.TAB* , *RTB*,5) 1097 FNCt*PPOS*,,5) 1093 FNC!*PCS*,,5) 1099 F,sC!*SPANt, *SPNt,3) 1100 FNC!*3F.EAKt,*BRK*,8) 1101 FNC!*ANYt,*ANY*,8) 1102 F NC ! * NOT r

1103 FNC (♦ NSPANt ,*NSP* ,3) . 1104 FNC ttP.cALCH* ♦ *PCH* ,3) 1105 F NC!♦OUTPUT *,*OTP *,4,1) 1106 FNC(*INPUT*,*INP*,3,1) 1107 FNC!*LPADt,»LPD*,3) 1108 FNC(*TPAD*,*RPD*,3) 1109 FNC!*IF*,,11,1) 1.110 FNC(*DATA*r *0DT*,9) 1111 FNCUCCMSNAP^^CS'-3*, 1,1) 1112 FNC!*TIME*,*TME*,D >• 1113 FNC(*CLOCK*,*CLK*,1) 1114 FNC t* ANCHOR*, ,12, 1) 1115 FNC(♦DETACH*,*DTt,1,1) * V U16 FNCttEOI*,*E0I*,1,1) 1117 . FNCDENOGRGUP*, *EGR*,2,1) 1118 FNC! *c0:'* ,*EOR*.l, 1) 1119 • FNCt* FNCLEVEL* , ,13 ) . 1120 cNCt ♦VAXLNGTH*,H,14) 1121 FNO(tSTCCUNT*,5,14) 1122. FNC<*STLIM1T»,12,14) 1123 FNr (*APBNL*, ,15) 1124" FNCt* ALPHABET*,,16) 1125 FNC!t P E ALSTR* , ♦PL 3*,17) 1126 FNC t * BREAKSTR*,*BST*,17) 1127 FNC(*REPLACE*,*RPL*,18) 1128 FNC(*SUBSTF>*,*SBS*,3) (RETURN) 1129 FNC(tDATEt,tDTEt,1)

FNC FUNCTION

1130 FNC ${Pl t$Fl*) = P2 1131 $(P1 t$F3t). = P4 1132 $(P1 t*F2t) = P3 (RETURN)

* EJECT, GOBBLE FUNCTIONS *. 1133 EJEC PAGE = (RETURN)

WORDS, USE FUNCTIONS

1134 WORDS I = P / 10 1135 J = P-(I * 10) 1136 I = NE(J,0 )I + 1 1137 WORDS = I (RETURN) 1138 USE PUTOUT(SP10 *.USE t STR) (RETURN)

* . NGEND I.E. NO END CARD * 1139 NOEND DIFFcP.(NEXTLABL) - F(ENDA) 1140 PUTOUT (NEXTLABL "t EGU FASlENDt) (ENDA) AffEMVZX 3X

f0 '

Ltst of Ku^TtMC- l\o«t.vC v\es Fi_I3l.2C PROCESSING LIBRARY FROM BIN AT 12:45:53 30 AUG 73 OPTIONS j ~. - COMMON MAP

PROGRAM LENGTH INDEX DATE TIME PROCESSOR

FASsSFJS "000065 '" 0 0 0 0 0 0 01" ~26 "AUG" 73 "1* 0/T0 4- ~CMP274Ar FAS5INP 000054 00000003 26 AUG 73 14 38 35 CMP2#4A0 FASSREW 000021 00000005 12 AUG 73 17 14 42 CM=2.4A0 FASfc.PD 000024 00000006 12 AUG 73 22 0* 37 CMP2.4A0 FASS3AL 000015 00000007 25 JUM 73 00 5b 32 CMP2,4A0 FAS$CSP 000003 00000010 25 JUM 73 00 55 33 CMP2.4A0 FAS*RP_' ooonr "ooooooir 18 AUG" 73 23 2 b 09 -CMP2.-4A0" FAS$59R 001015 0 0 0 0 0 013 24 JUNJ 73 23 04 41 CMP2#4A0 FASS^C-M 000004 00000014 24 JUM 73 23 04 20 CMP2.4A0 FASSCLK 000013 00000015 31 MAY 73 19 53: 19 CM32.4A0 FAS5TMP" ( 000016 00000016 31 MAY 73 19 53 21 CMP2.4A0 FAS$DTP 000114 000n0017 19 AUG 73 13 25 43 CMP2.4A0 FASSCSR- "000017- oooooo2r ~04 OU^-73 ~22 4b T2" -CMP2t4"AT}~ FASSRCH 0 000025 00000022 24 JUM 73 23 04 34 CMP2.4A0 FAS^SR 000037 00000023 25 APR 73 IS 35 00 CMP2.3A0 • FASSDAT 000076 000 0 0 024 24 JUM 73 23 04 01 CMP2.4A0 FASSASR 000037 ( 00000026 25 APR 73 16 32 24 CM=>2.3A0 FAS5CVR 000037 00000027 25 APR 73 15 32 53 CMP2.3A0 DUMPIES- •"•0000 rr ""000 0 0030" "T2" vov-70 -xz 32T32* -CMOTTTA' o r> n r% o rs r> /"•> o /-•% /--\ /^\ O

Xl> »»>>»I>J>J>X> *> £>J>l>*»J>3>3>J»>J>I>>l>5>3>t>J>J>3>>l»J>J>J>J>X>J>J>t> J>2> X> J> J> J>j> J> X> (/) (/>(/>;/> in ui t/» in in m in l/> uo tncoi/j m in in t/> c/> uo i/> en (/? uo ;/>_*> oo c/* in tn on i/jt/ic/iinminini/j go i/> in 4D

n ! '• I I o , ! !. I in ooooooooooooooooooooooooooooooooaooooooooooooooooooooooooooooooooooooooooooooo ooooooooooooooa ooooooo OOOOOOOOOOOOOOOOOOOOOOOOOOOO»-*OO0Ot--»0Oi-»0O00OOO0000OO00OO0OOO>-*OOOO00O»-*OO0OOO0O0>-,0 OOOOOOOOOOOOOOOOOOOOOO WWOUlHUlONOJf\jWI\)l\)i\)a*HOWOOUIO|\jWHywot\)(M«JO*'H'(\)o UHOOIMO U->IOU)H U^HO ^♦—vnroou>ui.^^^^vn^rou)Q^^in4>vnu>rorowi«jo^fv io.ro vn o ro w -^ ' i I ' I '

JU I oooooooooooooooooooooooooooooooooooooooo OO OOOOOOOOOOQOO© oooooooooooooooooooooooooooooooo o oo oo ooooo oo oooooooooooooooooooooooooooo OOOOOOOOOOOOO o oooooooo OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO O O O •Z>-^> OO O OO OO'O'OO OO O'OOiO o o oo o OOOOOOOOOOOOOOO 3 O 3 O O O O O O O O OOOOOOOOOOO i^^^^^^^^^^^^^^^^*—«-,,-i ro w w ^ M •- t--ooooo -sj-^-g-^->i-^-vio^oNa,'OxoNunvnvnLnuivn-P' <> *• ^-f- u_ w w wwtvjty ro ro ro *-* •— ry>»-»o o vn ro o ^ .p* ro >-• o ~g in -p* uj ro *-* o oun-^rv)*-* -j jji -p- u> h- o o> •P* UJ r\) »-* -^ o> (jl l\> — o 0* -P» U) >- O. O* -p* ftf h- i !

ru u» r\> ro ro ro rvi ro o o ro ro ro ro =v v ro ?v ro ro aj u> ro ro rvi ro ro ro ro ro *-• ro ro ro ro ro "\3 i\i ro i\) ro "Oi\j ro ro .\) •-• •-• ro ro vn >— in vn -p* -p* vn in -p« -p-in -p* -p*-p* -P-uivn-P'Ln-p'-j>'>---p*ai *• -p*in in .p- o> i\j>•^Lnvnvn-^mun-P-vr^aivri ui*- *• vo^j o1*- 1 I I i i i c > J> *> J> X> <_C C-C-J>JP-C_ JC- C_C- _CCJ> C c_ JO i> c_ J> *» t_JOJ>J>C_J>J>C P»C_J>JS>J>C-C_P>*»3>C> 13 J> "Ode TJCCCCXT3C -DCOCT3 CCX 13 c c c 23 < Xi x- ._: _r ,u J3 (DC!x»-i:_t 4. z. xs Xi <£ x> _: _r -< .£ ;c ^: tn o ! i -J -J -g -J -4 «>| ^J ^1 -4 >l >ISI ^^-^-"j-J-j-^-^-g^j-^-j -J -vl ->j ->l ^4 ->l->l U) U5 Ui U> u) U> GO OJ U> OJ U> GJ UJUUUUUUUiUJU Oo UJ 'JU UlUi u UJ W U OJ W UJ U) W OJ U W '_ OJ UJ U U> _l U) OJ i I i j i— h- ro ro — »— »-«i-fi-»rv)fv>roroH-»-« ro «-** ro ro t— ro *- ro ro »-• •—• ro •— J? -jh-.*—.— ro>— h-» ro •-• ro ^-* »-* •- rvj iv m •-• h> i\j or- »o it u^ cr ir> u> uj u> cooler w cr uu <. u; ^ _j ol) cr _* Ui -P" -^ UJU>o,|.cruiO,'cr>U)irt»;crios o* w w uj u> -*-x u ...... » .. .. — — .. .- .. ». .» — .. _j vn OJ wo u/h* *- wo oo o u> uioojoo it o u> oo u»a;oo»--o u;u»u;o oj uio u>o u>u; u-' o o ro ro oo vn -p* in vr-p- *> IT- in cr cr in -p- ^^^u^vn^ui"^-^-^-^^ J> *" ^ -J>•!>(? 4 ^>^--P-^> 4>*"*'-P'*'-P>UlUiU)^*- vn vr. od ^ .i •...... — -4 — .. .. - ^ „. .. .. airour?^in^^fv)oorvi^^4>>-Ps«-,»-,-isH«uiUiou>o u> U) vn un ro ^ r\> ro •»>•>u)uj ro u> u) *— ro —• in in un —• *— *-J> _-• UJO O* -^ IV 'JO U^ Ol UI U) O *• fW^WIVOMUHJIiXJWO wo •f>u)o%-P,u>rv)c> rJ>-sj»-«uiu>--J->jcr» u»»-» ouiui s yi o iv

I o o o o o r> o n o o o o o o o o o o cS o c> o o o o o o o o oo o o o r> o o o o o o o o n o o o ci rSo _r_:_:3i^ z z zl __ i _: ^ _c s^:3__:_: _:_:_: ^s__ 3:^3:2_i23:3:3__ <:_:i:7:_: ssssss-ss s ss rorv.v-AJrorororxjivro.Ajrorororovrvrofvrvrvroror^l)UU«B1JUTIUlJDTJ'0OT)li'0I)U'Uy'D'O\)t)UTJ'BV'0OIJliUl)Dll'UV'UllU0llOU'0B()iJ • i • • ••••,*• • • • •[ I • o •.••.. :• UJ^tAJUJ^-^l^UJ^^UJ^^^^UJW^UJ^^^^W^^CUCO^ ooooooo ooooo oo o oooooooooooooooooooooooooooo ooooo qo ArfGHDtY. £i±

Z> citv p<-C:. trot rix^s

\. FASt?DL COMPILER VER 0*2 08/25773 13:37146

000001 000002 TOPOLOGICAL! SORT 000003 MAPS A PARTIAL ORDERING OF OBJECTS IMTO A LINEAR ORDERING •tfO000*_ 000005 STTIME s TIMEO 000006 PAIR = 3REAK(t f 000056 » 000057 • ERASE RELATIONS 000058 * r 000059 29 T6 IDENT(S) lS(T7) % 000050 '30 Y a COJNT(XfSUC(R) 3) * 000061 31 COUNT(XTSUC"(3) 3) = GMYtl) Y - 1 :S(T6A) f 000062 32 COUNT (X [SUC (3) 1) a 0 000053 • u>_ 000054 .»• IF COUNT IS ZE*0 ADD ITEM TO QUEUE. r 000055 •• 000056 33 COUNT(XCR3) a SUC(?) [ 000067 34 R = SUC(P) ( 000068 35 T6A P = MEXT(P) MTf>) 000059 * 000070 ♦ REMOVE rROM 3JEUE. /"<• 000072000071 36 T7» • F = C0JNT(X[F3) *.,t-»

(

ftTOTAL COMPILATION TIMEI5637 MS.. 0 ERROR DIAGNOSTICS* (

G

(

(

C (

THE RELATIONS ARE UETTE3S BINARY<3INARY0P»BLAN»KS<3INARY0P. UNQALPHABET

c

c

c

I'._- ;—__

i .. ;'

( - 13.1'*.39 OR/30/7*3 HUTPUT

FA Sn/U COMPILEQ VEF 0.2 03/30/73 13:13:21

ooooo i ***********************************************************************

000002 * *3 000003 THIS PPOGRAM COMPUTES AND PRINTS A TABLE OF N FACTORIAL * 00 000_4. FQ? VALUES OF M FROM 1 THROUGH AN UPPER LI"IT tNX». *_ 00C0O5 000006 IT DEMONSTRATES A METHOD OF MANIPULATING NUMBERS WHICH ARE * ^ 000007 TOO LARGE FCR THE COMPUTER, AS STRINGS GF CHARACTERS. THE * /* 000003- COMMAS IN THE PRINTED VALUES ARE OPTIONAL, ADDED FOR READING * 000009 E A SE . * ooq.cijl * 000011 ************************************************************************ c 000012 * 000013 * INITIALIZATION 000014 * . c 00C015 I NX =35 _3Q.0_0.L6_ * 000017 2 M = 1 000018 3 NSE-T = I 000019 4 MUM • = ARRAY(1000) 000020 5 NUMC1] = 1 c 000021 6 FILL = /RRAYl *0/3M JD_0Q0.2___ 7 FlLLfOI - *000* 000023 8 FlLLC 11 = ♦OOt c 000024 9 FILL f 2 1 = tOt 000025 000026 10 OUTPUT = ♦ TABLE OF FACTORIALS FOR 1 THROUGH f .NX 00 002 7 11 OUTPUT _0Q00_2J__ 000029 COMPUTE THE NEXT VALUE FROM THE PREVIOUS ONE. 000030 000031 12 LI I =1 000032 13 L2 Ni'JMl I ] = NUM. I 1 * .N :F(ERR) o 000033 14 I = LT(I,NSET) I * I :S(L2) 000.03A- _L5 I = 1 000035 16 1.3 LT(NUMf11,1000) :S(L4) 000036 17 NIJMX = NUMtl 1 / 1000 :F(ERR) 000037 18 MUMC I + 11 = NUMC I + 11 * NUMX :F(ERR) 00C038 19 NUM[I1 - NUM[II - 1000 * NUMX :F(ERR) © 00003 9 20 L4 I = LT(I,MSET) I + 1 :S(L3) .00004 0... * 000041 * FORM A STRING REPRESENTING THE FACTORIAL. © 000042 * 000043 21 L5 NSET = DIFFER(NUM(NSET + 11) NSET + 1 000044 22 NUMBER •- NUM(NSET1 :F(ERR) 00004 5 2 3 I = GT (NSET,1) NSET - 1 :F(L7) 000046 24 L6 _M U__3fJ» = HUMP.ER *»y FILLf SI ZE(NUVCn) 1 NUMCI1. 000047 25 f = r,T( I, I) I- 1 :S(L6) 000048 000049 OUTPUT A LIME OF THE TABLE O0C050 000.051 26 L7 OUTPUT = N **=* NUMBEP 000052. 27 _[;. = LT(N,,NX) N + 1 :S(Ll)F(END) 000053 £ 000054 * FPROP TERMINATIONTF! 000055 * 000056 28 FR' OUTPUT = N *♦ CANNOT BE COMPUTED BECAUSE OF TABLE OVERFLOW.* 000057 29 OUTPUT - t INCREASE THE SIZE OF ARRAY NUM .♦ 000058 #• 000059 - 30 END

)• 10 VARIABLES ENCOUNTERED _7, 33 CONSTANTS SEEN *•' 5 FIXS MADE

*TOTAL COMPILATION TIME:3500 MS., 0 ERROR DIAGNOSTICS*

Pi TA3LF PF F/CTD^IM.S fV.r 1 THROUGH 35

it=l 2^=2 3t = 6 4»=24 5»__UO. 6^=720 7*=5,040 $♦=40,320 3* = 36 2, 880 10^=3,628,800 IU=3 9,916,_3_00 12 ♦ = 47°, 0 01,600 13«=6,?27,020,800 14»=87, 178,291,200

«/\-