Hardware program simulator

Item Type text; Thesis-Reproduction (electronic)

Authors Navabi, Zainalabedin, 1952-

Publisher The University of Arizona.

Rights Copyright © is held by the author. Digital access to this material is made possible by the University Libraries, University of Arizona. Further transmission, reproduction or presentation (such as public display or performance) of protected items is prohibited except with permission of the author.

Download date 07/10/2021 18:13:39

Link to Item http://hdl.handle.net/10150/347446 HARDWARE PROGRAM SIMULATOR

by

Zainalabedin Navabi

V

A Thesis Submitted to the Faculty of the

DEPARTMENT OF ELECTRICAL ENGINEERING

In Partial Fulfillment of the Requirements For the Degree of

MASTER OF SCIENCE

In the Graduate College

THE UNIVERSITY OF ARIZONA -

1 9 7 8 STATEMENT BY AUTHOR

This thesis has been submitted in partial fulfill­ ment of requirements for an advanced degree at The University of Arizona and is deposited in the University Library to be made available to borrowers under rules of the Library.

Brief quotations from this thesis are allowable without special permission, provided that accurate acknowl­ edgment of source is made. Requests for permission for extended quotation from or reproduction of this manuscript in whole or in part may be granted by the head of the major department or the Dean of the Graduate College when in his judgment the proposed use of the material is in the inter­ ests of scholarship. in all other instances, however, permission must be obtained from the author.

APPROVAL BY "THESIS DIRECTOR

This thesis has been approved on the date shown below:

arc FREDERICK' , HILL Date bfessor of Electrical Engineering ACKNOWLEDGMENTS

The author wishes to express his appreciation to

Dr. . J, Hill for hig guidance and encouragement during

the preparation of this thesis.

I thank my parents.for making everything possible in my career, and for their guidance.

X also wish to thank my wife, Irma Navabi, for her patience and help in writing this thesis. TABLE OF CONTENTS

Page

LIST OF ILLUSTRATIONS ...... vi

LIST OF TABLES ...... viii

ABSTRACT ...... ix

CHAPTER

1. INTRODUCTION . , 1

2. AHPL CONTROL SEQUENCE SYNTAX FOR HPSIM PROGRAM . 4

2.1 Control Sequence BNF Grammar ...... 6 2.2 Major Modifications ...... 6

3. HP SIM INPUT FILE SPECIFICATIONS ...... 9

3.1 AHPL Description File ...... 9 3.1.1 Basic Organization of a Module . . . 12 3.1.2 Symbols and Operators ...... 12 3.1.3 Declarations ...... 13 3.1.4 Standard Functions ...... 15 3.1.5 Locals, Semilocals, and Globals . . 15 3.1.6 Comments ...... 16 3.2 The Communication .Section F i ...... 18

4. DESIGN OF SIMULATOR PASS I . . 19

4.1 The Interpreter Basic Structure ...... 19 4.2 Output of Pass I ...... 19 4.2.1 Reference Table (SRT) .... 20 4.2.2 Quadruple. Table CQTABLE) ...... 2 0 4.2.3 Step and QTABLE Relation Table (SQRTl , , ...... 23 4.2.4 Table of Temporary Symbols (TOTS) . 23 4.2.5 Next Executable Steps Table (NEST) ...... 25 4.3 Interaction Between Phases of Pass-I . 25 4.4 Description of Phases of Pass-I ...... 29 4.4.1 Scanner ...... 29 4.4.2 Symbol-Parser ...... 33 4.4.3 The Symbol-Manager Phase ...... 39 4.4.4 The Main-Parser Phase ...... 41 4.4.5 Semantics P a e ...... 46

iv

TABLE OF CONTENTS— Continued

Page

5. DESIGN OF PASS II OF THE SIMULATOR ...... 4 9

5.1 User I/ Specification . . 49 5„2 Function of the Second Pass ...... 49 5.3 Description of Subprograms of Pass II . . . 50 5.3.1 The Execution Operator Routine (EXEC \ ...... 52 5.3.2 The EXECUTION Routine ...... 58

6. EXAMPLES OF USING HPSIM INTERPRETER ...... 67

6.1 A Digital P h a s e - e e ...... 67 6.2 A Serial Communications Example . 73 6.3 Stack. Controller ...... 77

7. CPU TIME ANALYSIS ...... 83

8. CONCLUSIONS . 85

APPENDIX A. THE HPSIM INTERPRETER SOURCE CODE .... 86

APPENDIX . THE TSP (SYNTAX) TABLE OF THE HPSIM PARSER ...... 242

APPENDIX , HPSIM PROGRAM OPERATION ...... 249

APPENDIX . HPSIM PARAMETER L I M I T S ...... 256

APPENDIX E. HPSIM MODIFICATIONS FOR OTHER MACHINES ...... 257

REFERENCES ...... 259

9 LIST OF ILLUSTRATIONS

Figure Page

2.1 Parsing organization ...... 5

2.2 The BNF grammar ...... ' 7

3.1 Input file organization...... 10

3.2 AHPL description section ...... 11

3.3 Referencing parts of an array ...... 14

3.4 Locals, semilocals, and globals in HPSIM . . . 17

4.1 The SRT table o r a i a t i o n ...... 22

4.2 Pass-I output ...... 26

4.3 Interaction between phases of Pass-I ...... 30

4.4 The scanner phase ...... 31

4.5 The scanning process ...... 34

4.6 Symbol-parser flow c h a r t ...... 38

4.7 Mainyparser routines ...... 4,3

4.8 A portion of TSP 44

5.1 Pass II block diagram ...... 51

5.2 The EXEC program flow chart ...... 53

5.3 Executable productions ...... 59

5.4 Loading the DPM . 62

5.5 LHS bif organization of identifiers in the DPM ‘ . 63

6.1 The digital phase-meter and its front end interface 68

6.2 Phase-meter flow chart ...... 69

yi vii

LIST OF ILLUSTRATIONS— Continued

Figure Page

6.3 Phase-meter AHPL description ...... 70

6.4 The HP SIM output of the phase-meter ...... 71

6.5 HPSIM input file for the interface circuit . . 74

6*6 HPSIM output listing for the interface circuit ...... 76

6.7 Sta,ck. Implementation , ...... 78

6.8 AHPL description of the stack ...... 79

6.9 RAM AHPL sequence ...... 80

6.10 Lines and registers binary values of the stack example ...... 81

6", 11 HP SIM initial information for the stack example 82

7,1 CPU time analysis for HP SIM . . . 84

C.l Running HP SIM/6400 253

C.2 Using HPSIM/10 (Timesharing) ...... 254

C ,3 Running HP SIM/10 batch ...... 255 LIST OF TABLES

Table Page,

2.1 Operators ...... 8

4.1 SET columns, description of contents ..... 21

4.2 TOTS table description . , . 24

4.3 Scanner codes ...... 32

yiii ABSTRACT

The hardware language AHPL was designed for describ­ ing digital systems in a mathematical form. Among other hardware languages AHPL became one of the most popular because of its one-to-one hardware correspondence. HPSIM,.

Hardware Program SIMulator, is a digital system simulation program that uses AHPL as the source code language, and interprets it. The HPSIM program is a two pass interpreter.

The first pass translates the source code into internal table form, and the second pass, the execution pass, executes the translated form of the source code. A complete description on how to use the HPSIM interpreter and a detailed explanation, with the help of flowcharts, is documented. Example programs and a complete listing of the interpreter program is included. CHAPTER 1

INTRODUCTION

Hardware languages constitute a new approach to digital system design. Such languages with their supporting programs can facilitate the application of computer aided design to digital systems.

One supporting program for hardware languages is a simulator. At the functional level, such a program will test the designed digital system, eliminating the designer's need to test and debug his circuit in the laboratory. HPSIM is a program of this sort.

In hardware design languages a high level of detail might include the description of gates with delays associ­ ated, whereas a low level of detail might be description at the block, diagram level, AHPL II, 2], a hardware programing language, strikes a middle ground in descriptive levels. It is a clocked mode register transfer level language (RTL).

The root of AHPL is APL 13]' which is noted for its ability to express very complex operations in compact form. AHPL

inherits this trait, but always constrained by the necessity of a onfe-to-one correspondence with the actual hardware, because of these mentioned advantages, AHPL was chosen to be

simulated by HPSIM (hardware program simulator). HPSIM is written in FORTRAN and has been implemented on the CDC-64 00 as well as the DEC 10. This program is a two pass interpreter, the first pass translates the source code into five executable tables, the second pass will begin executing the tables after the first pass has generated them.

The input to the interpreter is an AHPL description of a circuit followed by data and printout request section.

The output of the HPSIM program is a.list of the binary values at each clock period for any specified terminal or vector. The AHPL which is used as the input to HPSIM is a modified version of AHPL of Reference 2. This modification was necessary since the language AHPL as described in

Reference 2 had some ambiguities and some symbols not available in ASCII. The modifications are very slight though, and the basic syntax of AHPL is unchanged.

The HPSIM source code describes the hardware of the digital system. The. declarations of a HPSIM source code describe the basic elements of the circuit such as counters, adders, registers, bus-lines, etc. The AHPL description, on the other hand, describes the connections between these elements, Together, the declarations and description provide an exact software description Of the required hard­ ware . Normally an initial design of a digital circuit is run on HPSIRl and modified several times before a final design is reached. With final design in hand, building the hardware is just a matter of translating -the AHPL description to hardware. Using AHPL for designing digital

systems and simulating those systems by HPSIM gives designer

a good insight into the system, and corrections and modifi­

cations become as simple as adding, eliminating, or moving

around AHPL statements in the description. Synchronization problems which, can be easily overlooked in hardware design,

can be well taken care of by using HPSIM simulation program.

The. language NODELAY statement that implies branching with­

out activating a flip-flop can be used to reduce the

numbers of circuit clock pulses for doing a certain hardware

job. HPSIM users are able to use MSI implementations in

their design. A number of standard packages (some MSI com­

patible) are now implemented in HPSIM, and the interpreter

allows adding new MSI implementations without any major

change in the structure of the program.

In the following chapters the organization of the

HPSIM input file, the design of the interpreter, several

illustrative examples, and using the program will be dis­

cussed, The Appendices include the HPSIM source code, and

the. syntax table, of the interpreter. CHAPTER 2

AHPL CONTROL SEQUENCE SYNTAX FOR HPSIM PROGRAM

There are several methods of parsing the source

code of an interpreter or a compiler, one of which is a

tabler-directed method with use of a grammar 14] for the

source code language. Comparing this method with an ad-hoc

fashion, the table-directed method insures that all illegal

syntax constructs will be detected and nothing will be over­

looked. Also the computer is able to do the parsing much

faster by a table-directed method. In addition to providing

efficiency in implementation, a grammar summarizes all legal

syntactic constructs to a page or two, and provides a short

and efficient reference for the language user.

The grammar will be expressed in BMP (Backus-normal

formI 14, 5] grammar. This is, of course, one of the

several notations used to describe formal languages.

Declaration and symbol subscription syntax of HPSIM

is checked in an ad-hoc manner, and the syntax of the AHPL

control sequence is checked by a BNP grammar. Figure 2.1

illustrates the AHPL description parsing organization in

HPSIM-.

This partially ad-hoc, partially table-directed method of parsing was chosen, since the AHPL declaration TABLE DIRECTED

PARSER

CONTROL SEQUENCE

Figure 2.1. Parsing organization. has a very simple syntactic construct. Also the fact that

symbol subscripts are always constants enables us to

allocate the symbols and replace them by pointers, and use

pointers for table-directed parsing.

2.1 Control Sequence BNF Grammar

HPSIM uses the BNF grammar of Figure 2.2 for the

control sequence parsing. In this grammar the symbol

"SLRM11' refers to the symbol pointers as shown in Figure 2.1.

Another terminal symbol of this grammar which deserves some explanation is ’’SEQNUMBER." This is the sequence number of

an AHPL step which has been set apart from other integers prior to application of the grammar..

With a general knowledge of BNF grammars all legal

constructs of the HPSIM control sequence can be understood

from Figure 2.2, References 4 and 5 provide a good descrip­

tion for this kind of grammar. Any construct not described

in. Figure 2.2 is illegal and is rejected by the parser.

2.2 Major Modifications

Most of the syntax differences between AHPL of

Reference 2 and the implemented AHPL can be summarized as

punctuation, keyword usage, and symbols. Otherwise

Chapter 5 of Reference 2 has a complete description of all

AHPL syntactic constructs.

HPSIM requires that all the statements be followed by and every step be terminated by a period. The PROM LHS < - RIGHT HAN I' S II' E

1 {CIRCUIT) : {SE0UENCE) end .

n {SEQUENCE) : :« {CLOCK.SEQ) endseouenc {UNCL.SEQ) 3 : :* {SEQUENCE) end {SEQUENCE)

4 {CLOCK.SEQ) SEONUMBER {STEP) 5 . SEONUMBER {STEP) t {CLOCK.SEQ) SEONUMBER {STEP)

7 {STEP) {TIMING) {ACTION) e ° deadend .

10 {TIMING) s:« nodelay ii : 'em-tv'

12 {ACTION) : {RELATION) 1 {BRANCH) . 13 : {RELATION) . 14 ll- {BRANCH) .

15 {RELATION) {BLRM) « {GLRM) 16 {DLRM) <- {GLRM) 17 {CLHS) <« {GLRM) IB {RELATION) i {RELATION)

19 {DLRM) {DLRM) ! {DLRM) 20 {DLRM) . {DLRM) 21 - < {DLRM) ) 22 ii- SLRM

23 {CLHS) ii- {DLRM) » {GLRM) 24 < {CLHS) )

25 {GLRM) ii- {GLRM) I {GLRM) 26 {GLRM) 4 {GLRM) 27 11- {GLRM) 8 {GLRM) 26 ii- {GLRM) t {GLRM) 29 :i- {GLRM) 1 {GLRM) 30 ii- {GLRM) * {GLRM) 31 ii- 1/ {GLRM) 32 ii- 4/ {GLRM) 33 ii- nt {GLRM) 34 11- - {GLRM) 35 ii- INTEGER S INTEGER 36 :i» * < INTEGER i INTEGER ) 37 ii- dcd ( {FUNC.INPUT) ) 36 i :« inc ( {FUNC.INPUT) ) 39 ii- add ( {FUNC.INPUT) ) 40 i.i- busfn ( {FUNC.INPUT) > 41 11 SLRM < {FUNC.INPUT) > 42 ii« \ {NUMBER.STR) \ 43 ii- < {GLRM) ) i :« SLRM

45 {FUNC.INPUT) 11« {GLRM) 46 11- {FUNC.INPUT) i {GLRM)

47 {NUMBER.STR) 11- {NUMBER.STR) r INTEGER 48 ii- INTEGER

49 {UNCL.SE0) t :» {START.STEP) f {ACTION) 50 s i - {START.STEP) .

51 {START.STEP) 11- control res < (NUMBER.STR) )

52 {BRANCH) ii- => < (GLRM) ) / < {NUMBER.STR) 53 => INTEGER 54 -> ( (NUMBER.STR) )

Sviibols enclosed in < >• are the ora»»ar nonterminal swmbols. SvnOols ifi cental letters are aeneral names for a a roue of terminal symbols. Symbols in small letters are the aremmer terminal symbols.

SLRM = Simmle Liner Reaisterr or Memory = [lestinatior. Liner Reaisterr or Memory « General Liner Reaisterr or Memory * Conditional Left Hand Side

Figure 2.2. The BNF grammar. HPSIM system does not allow the AHPL step numbers to be

followed by a period. The keywords used in HPSIM cannot have a blank separator. For example "End Sequence" in

AHPL sequence should be used as "ENDSEQUENCE."

AHPL uses symbols not found on most printers.

Such, symbols are replaced by printable symbols in HPSIM.

Printable operator symbols have been chosen to be closely related to the original AHPL operators, to avoid confusion.

A list of machine readable symbols and their corresponding

AHPL symbols is shown in Table 2.1. This table also lists the available standard functions in HPSIM.

Table 2.1. Operators.

DESCRIPTION SYMBOL HPSIM SYMBOL ! rL T 1 AND A S ! : OR V + ! I AND ALL BITS / V &/ ! i OR ALL BITS v / +/ ! ; XOR © e ! CONDITION * * r ; NOT OVERBAR COL♦ CATENATION S’ ? ! ROW CATENATION ! ! ! TRANSFER ' . .

HPSIM INPUT FILE SPECIFICATIONS

The previous chapter described the syntax of the

AHPL. control sequence; this chapter is dedicated to other details of a module description for HPSIM. It is intended that this chapter be understood in order for the reader to see the reason behind different design algorithms which will be introduced in the next chapter. This chapter will point out how the HPSIM system should be used for simulating a digital system. The HPSIM input file consists of two separate, files, the AHPL description file and the communica­ tion section file. These two files are organized as shown in Figure 3,1, and should be separated by a (.7/8/9) multi­ punch card for the CDC version of HPSIM. On the DEC-10 these two files should be in two separate system files.

3,1. AHPL Description File

The AHPL description file is the main HPSIM input file, and the communication section serves only as data and

I/O information for the first file. Figure 3.2 shows the organization of the AHPL description file input of HPSIM.

9 f------+ ! MODULE # 1 !

! MODULE * 2 ! AHPL DESCRIPTION FILE ! , !

! MODULE # N !

! DEBUG OPTIONS !

! CLOCK LIMIT !

. COMMUNICATION !. EXTERNAL LINES ! FILE ! VALUES . ! ! ASSIGNMENT !

! SUPPRESS SWITCH ! 4— — — — — — — — — ! PRINT REQUESTS ! 4-- —------F

Figure 3.1. Input file organization. .INPUTS

lUTPIITS

BUSES

HODULE f 1 DECLARATIONS

AIIPL STEP 1*1 ^CONNECTION 5 STEP #2 SEQUENCE -> ACTION ^TRANSFER -i$TEP tn BRANCH ^ ^CONDITIONAL

UNCONDITIONAL MODULE I n CONECTION

TRANSFER

Figure 3.2. AHPL description section. 12

3.1.1 Basic Organization of a Module

Each. AHPL module begins with a name card which has

the following forms,

AHPLMODULE: NAME.

This card starts in the first column of each module. The .

rest of the iriodule description is format free, and all

constructs can be broken between lines. Each line can

contain as many as eighty characters.

Following the name card the declaration section, in which all symbols and names are declared, appears.

,i Blank characters are considered as separators, and if there are more than one consecutive blanks, all but one will be rejected and will still be considered as one separator.

3.1.2 Symbols and Operators

The maximum number of characters in a symbol is twenty, from which the right hand ten characters are ignored. For example, EXTRALONGREGl, EXTRAL0NGREG2, and

EXTRALONGR mean the same thing to HPSIM system, since they are different in characters after the tenth character.

Symbol subscripts should be placed in square and superscripts in angular . If one or both are omitted all bits will be assumed. Omission of square brackets has a default of all columns and omission of angular brackets has a default of all rows. For example 13

ROffKlO)I5j in the declaration means. an array of ten rows and five columns. Figure 3.3 indicates how different parts of

ROW should be referred to, in the AHPL sequence.

Every symbol of AHPL sequence is treated as a two dimensional array; vectors as arrays of one row, and flip- flops as arrays of row and one column. For example, the symbols FLIP-FLOP<0;0)10:OJ, FLIP-FLOP<0)10J , and FLIP-FLOP all mean the same if FLIP-FLOP is.declared as a one bit memory.

3.1.3 Declarations

Declarations set the type and number of bits of" each, symbol, and have the general form of,

TYPE: SYMBOL1< Nl )JM1J; SYMBOL2IM2]; .... where type can be MEMORY, INPUTS, OUTPUTS, BUSES, EXINPUTS,

EXBUSES, or CLUNITS. The integer Nj. is the number of rows of symbol^ and Mj. is the number of columns of this symbol.

Either one or both N^. and M^ can be eliminated if the number or rows or columns of symbol^ is one.

A different kind of declaration is labeling, whose format id shown below,

LABELS; PART (N)lMj- FULL < Nl :N2 > JMI:M2J ; ... .

This is used for labeling an often used part of an array as a new syjnbol. This new symbol has the same type as the type of the orginally declared symbol and can be used without 14

!*!*!*!#!*! ! ! ! ! ! !

!#!#!#!_#!#! ! ! ! ! ! !

! * ! * ! * ! * ! * ! ! ! !' ! ! ! I*!*!*!*!*! ! !*!*!*! !

!*!*!*!*!*! ! !*!*!*! !

! *!*!*!»:!* ! ! !*!*!*! ! !*!*!■#!*! * ! ! !*!*!*! ! !*!»!*!»!*! ! ! ! ! ! !

I*!*!*!*!*! ! ! ! ! ! ! !*!*!*!#!*! ! ! ! ! ! !

BOM. OR B0M£lQi£5a EOM<3:6^I:113a

* 1 * # !, ! *i F I % ! * * !

I * ! # * i

* * l * * * ! * # ! — f* * * ! * * # * ! * * i

* * ! * * * * ! * * !

* * ! * t * ! * * i

; * ! * * I 4---1- h ! % ! * * !

! ...... * -! * * ! 4--

EOife3 i6> or EntKZi^roi^n RDML1133 OR RQtt£Q12±-EllZ2

Figure 3. Referencing parts of an array — Boxes- with "*" are the referenced bits. 15 any row or column specification. In the above declaration

PART can be used anywhere in the control sequence to refer to FULL < Nl;N2)JMI;M2J .

3.1.4 Standard Functions

Presently HPSIM.can simulate seven standard functions which, are shown in Table 3.1. Six of these functions have

MSI compatible integrated circuits and all have to be declared. Declarations and subscripting of standard

^functions are no different from those of other variables.

If more than one of the same kind of a standard function is used in a module, all function names of that type must be declared with distinct numerical "suffixes.

For example, if two separate MSI adders are required in a circuit, the declaration has to have the following form:

CLUNITS ; ADD 11 NlJ '(',* X ). ; ADD2 1N2 J (; Z) .

Where.Nl and N2 are the number of bits of ADDERl and

ADDER2 respectively, and W, X, Y, and Z are the operands of the two adders. Note that these operands may or may not be included. A subset of the outputs of any declared standard function can be used in the AHPL sequence if they are subscripted.

3.. 1.5. Locals, Semilocals, and Globals

Declared variables must fall into one of the three classes locals, semilocals, and globals. 16

3.1.5.1. Locals. Local symbols are those that have

to be declared in any module where they are used. Declaring a symbol in more than one module is permitted, and the symbol points to different value locations in different modules« These symbols have to be declared as MEMORY,

ONESHOTS, BUSES, or CLUNITS.

3.1.5.2. Semilocals. Semilocals are those symbols that have to be declared in any module in which they are used, but when redeclared, they point to the same value location. These symbols have to be declared as INPUTS or

OUTPUTS. OUTPUTS can not be declared again as OUTPUTS, but they can be. declared as INPUTS in as many modules as they are used,

3.1.5.3. Globals. Globals are those symbols that can be valued externally and are common between all modules.

They cannot be declared in any more than one module. These are EXINPUTS and EXBUSES,

Figure 3.4 clarifies the above concepts. Note that redeclaration in one module is not allowed for any of the

above three types,

3,1.6 Comments

Comments can be placed anywhere in the program.

They should be enclosed in double quotes, and cannot extend beyond the line limit. OUTPUTS , INPUTS V u '- ' V i M r u n DIJSSFS BUSSES BUSSES BUSSES n --- ■ & a ■ .... . ;; -?------Er OUTPUTS OUTPUTS MIMORY MEMORY MEMORY MEMORY nzi"_u:m m “ r n " n n rru m cm . i in

' P LJ" O M FSHOTS ti'ITW » ONESIIOTS ONESIIOTS t :___ t-J ONESIIOTS INPUTS

Ill U I n cz> | CLUMITS j CLUMITS j CLUMITS J CLUMITS ?} MODIILF/^ { MO[)(JIF/.'n $ — — •—— —r_TL . y a: . 3 5 5 2 — ?T.=^=,T

Figure 3.4. Locals, semilocals, and globals in HPSIM. 18

3.2 The Connnunication Section File

When the AHPL description of a digital system is written in a correct format, the user needs to establish some kind of communication with the HPSIM to specify external inputs and other information that the HPSIM needs to simulate the given digital simulation. . This is done through the communication section file which must accompany the AHPL description. The communication section provides the HPSIM user with control of the external inputs, and specifies the form of output desired. The details of this section are described in Appendix C. CHAPTER 4

DESIGN OF SIMULATOR PASS I

The description of the language for which the interpreter is written was given in the last two chapters.

In this chapter methods and algorithms used for inter­ preting the source code will be explained.

4.1 The Interpreter Basic Structure

HPS'IM does the interpretation of the source code in" two separate passes. The first pass is divided into five major phases r scanner, symbol-parser, symbol-manager, main­ parser, and semantics. This pass reads the input file character by character, assembles symbols, allocates storage for the variables, checks the syntax of the source code, and finally translates it into five tables to be executed in th.e next pass. The second pass has only one major phase which, is the execution. This pass reads the data input, executes the output of the first pass, and outputs the result.

4.2 Output of Pass I

Three completed, and two partially built tables are the outputs of Pass I. The two tables not completed in this pass wiil be completed and altered as.the execution proceeds

19 20 in Pass IX. This section is devoted to description of these five tables. Note that in description of these tables,

"symbol" will be used to refer to identifiers or CLUNITS.

4.2.1 Symbol Reference Table (SRT)

This table will not be altered by Pass II., and will stay unchanged during the execution pass. The row number of this table is the. symbol pointer. The information con­ tained in this table are shown in Table 4.1.

To illustrate the above, let us look at the SRT table which is generated if the three symbols SMALL, BIG, and MEDIUM are declared and used as shown in Figure 4.1a.

The number underneath, each, symbol is the pointer to that symbol which is the row number of SRT that contains the information about that symbol. Figure 4.1b shows how the symbols in the control sequence map into the declared symbols and Figure 4.1c shows the SRT table.

4.2/2 Quadruple Table (QTABLE)

The QTABLE has four columns. All the control sequence operations will be translated into quadruples and placed in this table. First column of this table has the production code (Figure 2.2). Second and third columns have the address of the operators which are the row numbers in the TOTS table. The fourth column has number of rows of the TOTS table that contains information about the result < of operation. Columns two or three will contain zero for 21

Table 4.1. SRT columns, description of contents.

COLUMN NUMBER DESCRIPTION OF CONTENTS

1 NAME OF THE SYMBOL 2 CODE FOR TYPE OF THE SYMBOL 3 TOTAL NUMBER OF BITS IN EACH ROW OF THE SYMBOL AS IT WAS DECLARED 4 TOTAL NUMBER OF BITS IN EACH COLUMN OF THE SYMBOL AS IT WAS DECLARED 5 THE COLUMN NUMBER AT WHICH THE PARTIAL SYMBOL BEGINS IN THE DECLARED SYMBOL 6 THE "COLUMN NUMBER AT WHICH THE PARTIAL SYMBOL ENDS IN THE DECLARED SYMBOL 7 THE ROW NUMBER AT WHICH THE PARTIAL SYMBOL BEGINS IN THE DECLARED SYMBOL.- 8 THE ROW NUMBER AT WHICH THE PARTIAL SYMBOL ENDS IN THE DECLARED SYMBOL. 9 THERE WILL BE A (1) IN THIS COLUMNS IF THE SYMBOL TO WHICH THE SRT ROW BELONGS IS USED WITHOUT SUBSCRIPTS? AND THE DEFAULT CASE IS USED FOR IT. 10 THE BIT NUMBER IN THE SYMBOL-VALUE TABLES IN WHICH THE VALUE OF THE FIRST ELEMENT OF THE SYMBOL WILL BE PLACED. NOTE THAT SYMBOL VALUE-TABLES WILL NOT BE BUILT UNTIL THE EXECUTION TIME. 22

AHPLMODULEtDEMONESTRATION, MEMORY I BIGC4]<6>, BUSES: SMALL [8], INPUTS: MEDIUM C 3 3 <2>♦ 1 BIG[1:3]<4:5> <= MEDIUM 1 . 2 2 BIG<5> <= SMALLC2:5], 3 4

END • a, A partial program

0 12 3 0 1 2

!! !*!*!*! -- 4 1--1-- ! ! ! ! * ! * \ * !

! ! ! MEDIUM

! i i +--- * ! * ! * * ! * ! * BIG Cl:3]<4:5>

01234567

0 ! 0 ! ! !*!*!*!*! ! ! +-- 1 ! SMALLC2:5] 4-- +- 4---

! * ! * ! )# b» Mappings

BIG<5>

ROW * ! COL 1 ! 2 ! 3 ! 4 ! 5 ! 6 ! 7 ! 8 ! 9 ! 10 !

It ! BIG ! 39! 4 ! 6 ! 1 ! 3 ! 4 ! 5 ! 0 ! 1 !

! MEDIUM ! ! 3 ! 2 ! 0 ! 2 ! 0 ! 1 ! 1 ! 7 !

! BIG ! 39! 4 ! 6 ! 0 ! 3 ii • vJ ! 0 ! 13 !

! SMALL II I ! 0 ! 0 ! 0 ! 17 !

(c) SRT table

Figure. 4.1, The SRT table organization. 23 one-operand operations, and column four will contain zero for transfers or connections.

This table will not be altered by Phase II.

4.2.3 Step and QTABLE Relation Table (SORT)

This is the last of the three tables that will not be changed by Phase II of the program. This table has five columns which together show what quadruples in the QTABLE belong to a particular step. Contents of each column is listed below.

Column #1 Module Number

#2 Step Number

#3 QTABLE row number where the quadruples

of the step, specified by columns one and

two, begin in the QTABLE.

#4 QTABLE row number where the quadruples

of the step end.

#5 This column will contain a (1), if the

step carries a NODELAY.

If the number in column three is greater than that in column four, no execution will be done.

4.2.4 Table of Temporary Symbols (TOTS)

Columns two, three, and four of this table may contain four different types of information. The code in column one will indicate what the other three columns 24 contain. The four possible ways that a row of TOTS may be loaded are shown in Table 4.2.

Table 4.2. TOTS table description.

TOTS COL# 1 ! COL# 2 ! COL# 3 ! COL# 4

1 !PRODUCTION NUMBER ! FIRST OPERAND ! SECOND OPERAND

2 o '! o ! INTEGER

3 ! 0 ! 0 (POINTER TO SRT

4 !NUMBER OF COLUMNS !NUMBER OF ROWS (POINTER TO !TO BE FILLED IN (TO BE FILLED IN (SYMBOL-VALUE- (PASS II (PASS II (TABLE TO BE ! ! (FILLED IN PASS ! ! (II — ------

If the first column in a row of TOTS contains a one, the other columns of this table contain the same type of information as columns one to three of QTABLE, except that only productions will go in TOTS that do not have any immediate results, such, as production 19,20,46, and 47

(Figure 2.2). A 2 in column one indicates that column number four has an integer which is the last integer in a

(NUMBER.STR) production., A 3 in column one indicates that the information about the symbol that QTABLE column number two or three have the pointer of, is not in TOTS but it is in SRT, and the pointer to it is given in column four of the same row.. Code four, in column one is used for the result 25

of operations that will not be known until execution time.

In this case columns two, three, and four will be filled as

the execution proceeds.

4.2.5 Next Executable Steps Table (NEST)

When Pass-I is over, the Next Executable Steps

Table only indicates what the starting steps are. Column one shows the module number, column two has the step number, and column three contains a 1 if the step carries a NODELAY.

Initially columns four through eight contain zeros. When executing the steps in this table, the step numbers that each control sequence step directs the control to, will be placed in the zero columns, and each time before the execu­ tion for the next clock begins this table will be renewed with the new active steps.

A short AHPL program (Figure 4.2a) was used as the input to the interpreter, and the tables that Pass-I outputs are shown in Figure 4.2b.

4.3 Interaction Between Phases of Pass-I

The main program of the HPSIM interpreter is called

"CALLER." This program activates Pass-I and after this pass has completed all the necessary execution tables, returns the control to the CALLER program. The CALLER then activates the second pass where the execution will be done. The scanner reads the text character by character, eliminates extra blanks, throws away"the comments, rejects all illegal 26

AHPLMODULE:READROM. MEMORYJCOUNTERCSnJ ARRAY<8>C53. BUSES:ADDRESSC33. OUTPUTS!DATALINESC5 3 ? READY. CLUNITS:INCC83f DCDC83. 1 COUNTERCO J 23 <= \0,0,1\; ARRAY<0> <= C0UNTERC3 J 73♦ 2 ADDRESS = COUNTERCO:23 f DAT ALINES =ARRAY*DCD ( COUNTERCO: 23 > READY = M \ . 3 COUNTER <= INC(COUNTER)j => < (S/COUNTER) , "(S/COUNTER) ) / (1,2). ENDSEOUENCE CONTROLRESET(1). END.

(a) An illustrating example

TABLE OF TEMPORARY SYMBOLS (TOTS)

ROW* CODE PROD 0PND1 0PND2

i: 3 0 0 1 2: 2 0 0 0 3: 1 47 2 0 4: 1 47 3 1 51 3 0 0 2 6: 3 0 0 3 7: 3 0 0 4 8: 3 0 0 5 9: 3 0 0 6 10: 4 0 0 0 ii: 4 0 0 0 12: 3 0 0 8 13: 2 0 0 1 14: 3 0 0 9 is: 4 0 0 0 16: 4 0 0 0 i?: 4 0 0 0 is: 4 0 0 0 19: 4 0 0 0 20 : 2 0 0 1 21: 1 47 20 2 22 : 2 0 0 1

(b) Executable tables

Figure 4.2. Pass-I output. SYMBOL REFERENCE TABLE (SRT)

ROW* SYMB TYPE COLS ROWS CLU CUL RLL RUL DFLT PNTR

i: COUNTER 39 8 1 0 2 0 0 5 1 2 : ARRAY 39 5 8 0 4 0 0 10 9 31 COUNTER 39 8 1 3 7 0 0 5 1 41 ADDRESS 42 3 1 0 2 0 0 1 1 49 31 DATALINES 41 5 1 0 4 0 0 1 52 6 1 ARRAY 39 5 8 0 4 0 7 1 9 71 DCD 57 8 1' 0 7 0 0 1 66 81 READY 41 1 1 0 0 0 0 1 57 91 COUNTER 39 8 1 0 7 0 0 1 1 101 INC 57 8 1 0 7 0 0 1 58

QUADRUPLE TABLE ((STABLE)

ROW* PROD 0PND1 0PND2 RESULT

11 16 1 4 0 21 16 5 6 0 31 15 7 1 0 41 37 7 1 10 51 30 9 10 11 61 15 8 11 0 71 15 12 13 0 31 38 10 14 15 91 16 14 15 0 101 31 0 14 16 111 31 0 14 17 121 33 0 17 13 131 28 16 IS 19 141 52 19 21 0

STEP• (STABLE RELATION TABLE (SORT)

ROW* MOD* STEP* LOW- UP-Q ND

i: 1 1 1 2 0 1 2 3 7 0 3: 3 8 14 0 4 : 1 0 15 14 0

NEXT EXECUTABLE STEPS TABLE (NEST)

ROW* MOD* STEF* ND NEXT1 NEXT2 NEXT3 NEXT 4 NEXTS

1! llOOOOOO

(b) Continued

Figure 4.2.--Continued characters, does a very limited amount of parsing,

assembles the names and numbers, and returns the constructed

symbol.

The symbol-parser receives the output of the

scanner.. If the received symbol, is not a variable, it

passes the symbol to the main parser but if the symbol is a

variable, it checks the syntax of its row and column

specifications and passes the information about the sub­

scripts and the variable to the symbol-manager. If the

received symbol is in the declaration part, additional

information about the type of the symbol will also be

passed to the symbol-manager.

When the symbol-manager receives a symbol it puts

it in the symbol-reference-table and passes control to the

-main-parser. If the received symbol is part of the declara­

tion, it will be placed in the symbol-declaration-table and V control will be passed to the scanner. As long as the

declaration part is not finished, the scanner, symbol-

parser, and the symbol-manager work together to build the

declaration tables.

The main-parser uses the received characters and

symbols for building up grammar productions of the BNF

grammar in Figure 2.2. When it receives all characters of

a certain production, it finds the code for the left-hand-

side, and gives the necessary information to the semantics

routine.. Knowing the LHS, and the information about each 2 9 production, the semantic phase will build all the tables needed for execution. Figure 4.3 shows a summarized flow chart of the interaction between the phases of Pass-I.

4.4 Description of Phases of Pass-I

Having considered the interaction between phases, we now turn our attention to describe the major internal functions of each phase. The coding is not described since the program listing of Appendix A includes sufficient comments that explain the code.

4.4.1 Scanner

The scanner reads one 'line -of -code, breaks it into characters, constructs, tokens, and outputs a token-number and a sub*-token for each, token. Figure 4.4 shows the block diagram of the scanner phase.

The scanning in HPSIM is done in an ad-hoc fashion.

Chapter 3 of Reference 6 describes different scanning methods. Tokens are symbols that appear in the language, token-numbers are numbers that represent the token, and sub-tokens are identification for a group of tokens with the same, token-numbers. The only tokens that have non. zero suh-tokens are names, integers, step-numbers, and combina­ tional logic units. Table 4.3 lists all tokens, with their token-numbers and sub-tokens.

Depending on the program version, characters are read by the scanner in ASCII or CDC display code [7]. To f' START V PASS I

GET

YES E?ID OF PASS I -^ACTIVATE PASS II

SYMBOL PARSER

YES DECLARATION \ PART y VARIABLE

YES

FIND THE LIMITS

PUT IT IN THE PUT IT IN THE DECLARATION DECLARATION TABLE t TABLE FIND POINTER

jnAUI PARSES _ _

BUILD A PRODUCTION

YES

BUILD NECESSARY TABLES

Figure 4.3. Interaction between phases of Pass-I SOURCE CODE SCANNER ROUTINE

KEYFIX ROUTINE

Figure 4.4. The scanner phase. Table 4.3. Scanner codes.

TOKEN SYMBOL TOKEN CODE SUB TOKEN

LETTER A-Z 1 0 DIGIT 0-9 2 0 BACK \ 4 0 AND % 5 0 OR + 6 0 LEFT ANGULAR 7 0 EQUAL 8 0 QUOLON : 9. 0 RIGHT ANGULAR BRACKET 10 0 SLASH / 11 0 CONDITION * 12 0 EXCLUSIVE OR e 13 0 ENCODE $ 14 0 LEFT PARENTHESES < 15 0 RIGHT PARENTHESES ) 16 0 LEFT SQUARE BRACKET c 17 0 RIGHT SQUARE BRACKET ] 18 0 COLUMN CATENATION 19 0 ROW CATENATION i 20 0 SEPARATOR ; 21 0 TERMINATOR 22 0 INVERTOR — 23 0 COMMENT DELIMITER * 24 0 AND REDUCTION 8/ 25 O' OR REDUCTION +/ 26 0 TRANSFER 27 0 BRANCH 28 0 DOUBLE :: 29 0 PROGRAM DELIMITER - 30 0 BLANK CHARACTER 31 0 INTEGERS ALL NUMBERS 35 'THE VALUE STEP NUMBER ALL NUMBERS 36 'THE STEP IDENTIFIER ALPHANUMERICS 37 'THE NAME MODULE BEGINER AHPLMODULE 38 AHPLMODULE MEMORY ELEMENTS MEMORY 39 MEMORY INPUT LINES INPUTS 40 INPUTS OUTPUT LINES OUTPUTS 41 OUTPUTS BI-DIRECTIONAL LINES BUSES 42 BUSES LABELS LABELS 43 LABELS ONE-SHOTS ONESHOTS 44 ONESHOTS EXTERNAL INPUT LINES EXINPUTS 45 EXINPUTS INCREMENTOR INC 46 INC ADDER ADD 47 ADD DECODER DCD 48 DCD INVERTOR NT 49 NT CONTROL RESET CONTROLRESET 50 CONTROLRES DEAD END STEP DEADEND 51 DEADEND NO DELAY NODELAY 52 NODELAY END SEQUENCE ENDSEQUENCE 53 ENDSEQUENC MODULE TERMINATOR END 54 END NULL STEP NULL 55 NULL DECREMENTOR INC 56 DEC COMBINATIONAL UNITS CLUNITS 57 CLUNITS BUS FUNCTION BUSFN 58 BUSFN EXTERNAL BI-DIR. LINES EXBUSES 59 EXBUSES ASSOCIATIVE LOGIC ADD 60 ASSOC COMPARATOR ADD 61 COMPARE PRIORITY FUNCTION LOGIC INC 62 PR I 33 provide for easy modification of the scanner for other computers, the input code is translated to token-number of

Table 4.3, The scanner reads a line of eighty characters, and puts them in a buffer of eighty words (one character per word). It uses the characters in this buffer for f building the tokens, and when the buffer is empty, a new source-code line is read and the buffer will be refilled.

This process will continue until an End-Of-File is en­ countered.

Each time the scanner is called, it pulls enough characters out of its buffer to build a token; then it finds the token-number and the sub-token, and returns them to the called program. The flow chart of Figure 4.5 shows the scanning process from pulling a character out of the buffer to outputing a token-number and a sub-token.

Regular integers are distinguished from step numbers by their token number. This is the only syntactic decision made by the scanner. If an integer follows a period the scanner will output, the token-number for a step-number 36.

Otherwise 35 will be assigned to the token-number which is for regular integers.

4.4.2 Symbo1-Parser

As described earlier the symbol-parser phase does the declaration part and identifies parsing. The inputs to this phase are token-numbers and sub-tokens. If the C START 3

GET CHARACTER

CONDITION

SAVE 2nd CHARACTER

Mf-TOND IT I n«i\ NUNBER GET CHARACTER

BUILD NUfeER U OUTPUT 2 SET CHARACTER

BUILD NAME

SET CHARACTER

OUTPUT 1 OUTPUT 3 CONDITION

NONE LETTER KEX F1Z BLANK OUT THE IDENTIFICATION NUMBER OF CLUS

V ------(CONDITION '>------V “ \ OUTPUT 4 \ N0T roUN° X \ V / / ^ CLU / OUTPUT 5 \

OTHER KEYWORDS

OUTPUT 6

RETURN

(a) Scanning process flow chart

Figure 4.5. The scanning process. 35

Condition 1: Is the current character the beginning part of a multi-character token

Condition 2: Is the current character a number of latter

Condition 3: Is a multi-character token built

Condition 4: Is the name found.in the keyword table, if so is it clu or regular keyword

Output 1: Token-number = the single character token; sub-token = 0

Output 2; Token-number = the double character token; sub-token = 0

Output 3; Token-number = the token-number for integers of step-numbers; sub-token = the value of the number

Output 4: Token-number = symbol token-number (37); sub-token = the name or symbol

Output 5: Token-number = the token-number for that particular clu; sub-token = the name of clu with its identification

Output 6; Token-number = the token-number for that particular keyword; sub-token = 0

(b)_ The scanning processes

Figure 4.5.— Continued 36 corresponding token is not part of declaration or part of a sequence identifier, the input information (token-number and sub-token) will be returned to the calling program.

Otherwise, this phase keeps calling the scanner phase until it receives the following information about a symbol.

FSYM: The name of the symbol or the LHS symbol of

a labeling.

TYPE: The type of the identifier

39 for MEMORY

40 for INPUTS •

41 for OUTPUTS

42 for BUSES

43 for LABELS

44 for ONESHOTS

45 for EXINPUTS

57 for CLUNITS

59 for EXBUSES

RLG: Row length or the number of bits in a row of

the symbol.

CLG: Column length of the number of bits in a

column of the symbol.

RLL: Row lower limit, or the start bit in a row.

RUL? Row upper limit or the end bit in a row.

CLL: Column lower limit or the start bit in a

column.. 37

CUL: Column upper limit or the end bit in a

column.

CODE: Illustrates the general type of the symbol.

CODE = 1 for LABELS

= 2 for LOCAL identifiers

= 3 for an identifier in the sequence

= 4 indicates end of program

= 5 GLOBOL identifiers

r* 6 SEMILOCAL identifiers

UDC; is Cl) if the identifier is to Use its

Default Case.

SSYM: Second symbol or the TRHS symbol for LABLES.

Once the above information has been accumulated, it is. sent to the symbol^manager routine. If Code was anything other than 3, the identifier will be placed in the declara­ tion table and in case of a label, in the label table. If

Code was 3, the symbol-manager will return a pointer which will be used for sub-token, and symbol-parser will return i't to the calling routine.

The flow chart of Figure. 4.6, shows the operation of the symbol parser. As the scanner is called for symbol parameters, the symbol parser routine checks for the syntax of subscripts and superscripts of the identifier.

The output of the symbol parser to the calling program will be the AHPL description without the START

GET TOKEN-NUMB ER

SUB-TOKEN

YES NO SEQUENCE DECLARATION OUTPUT IDENTIFIES TOKEN, SUB

YES CALL SCANNER TO FIND TYPE

CALL SCANNER FOR OTHER

CALL SCANNER FOR OTHER ID E N T IF IE R PARAMETERS

ID E N T IF IE R PARAMETERS

ALL NO RECEIVED NO / ALL .RECEIVED,

YES YES

CALL CALL SYMBOL MANAGER SYMBOL MANAGER

SEND PARAMETERS FIND POINTER

NO OUTPUT END OF TYPE TOKEN POINTER

YES RETURN END x NO ^ OF DECLARATION

YES

RETURN

Figure 4.6. Symbol-parser flow chart. 39

declarations. In the AHPL description all the identifiers

are replaced by a token and a sub-token. The token con­

tains a common code for all identifiers, and the sub-token

is an index into the SRT table. A row of SRT table contains

all information about the number of rows and columns of an

identifier,

4.4.3 The SymboltManager Phase

The main function of symbol-manager routine is building the SRT table, and assigning pointers to the

sequence symbols. The caller program for this phase is the

symbol^-parser from which it receives the information about

the symbol, and a code number with each symbol that

instructs this routine in performing its tasks. Refer to

the previous section for devinition of inputs (outputs of

symbo1-parser) to this routine.

When the code is 1, FSYM has the >label symbol and

S'SYM has the main symbol of the label. The other inputs

describe the size of the label symbol, and row and column boundaries of the main symbol. All this information will be placed in the Label Reference Table (LRT).

Code of 2 identifies the local symbols, in this

case the part of Symbol Declaration Table (SDT) correspond­

ing to the current module is searched and if the symbol is

not found, information about the symbol will be placed in

SDT; if found error will be given. 40

Code of 5 identifies EXINPUTS, EXBUSES, and OUTPUTS which, have, to be declared in only one module, in this case all of the SDT will be searched for the symbol and if it is not found, the information about number of rows and the number of columns of the symbol will be placed in SDT.

Code of 6 identifies INPUTS. In this case all of the SDT will be searched for the symbol. If the symbol is found in one of the previous modules, its dimension will be checked to match, with what is already in SDT, and the.

symbol will then be placed in SDT again for the new module.

This same thing will be done if the symbol is not found at all.. Error messages will be given if declared twice in one module or if the dimensions differ from those declared in other modules.

A code of 3 illustrates that the symbol is a sequence symbol. In this case, a search will be done in

the LRT for the new symbol. If it is found, the original symbol (.right hand side, of Label) will be adopted as the new symbol name, and new boundaries will be calculated. If the symbol is not found in LRT, this step will be skipped. In either case the new symbol or the inputed symbol will be placed in SRT.. Then the SRT row number will be the pointer.

If the symbol is found in SRT, tlie corresponding SRT row number will be the pointer.

When the end of a module description is encountered, pointers to the Symbol-Value-Tables will be assigned to all 41 symbols other than EXINPUTS and EXBUSES. Such a pointer for each symbol locates the value of the first bit of symbol in SVT. The first element of the first symbol in SDT will be assigned a 1 for its pointer to SVT. The total number of bits of this symbol will be calculated and added to the previous SVT pointer. This number will be the SVT pointer for the symbol that appears next in SDT, excluding EXINPUTS and EXBUSES,

If the end of module coincides with the end of program, SVT pointers will be assigned to EXINPUTS and

EXBUSES after this has been done for other symbols. This causes the values of external line bits to be separate from those of other symbols. The SVT pointers will then be transferred to SRT.. Now if a symbol in SRT does not have an

SVT pointer, it indicates that the symbol had not been declared. This is how the program checks for missing declarations.

4.4.4 The Maintparser phase

The grammar of Figure 2.2 is used by the main parser routine for parsing the AHPL control sequence. For this phase all symbols are in a simple form of one- char a c ter T-symbo Is and all row and column specifications are already taken care. of. This phase has an error recovery routinef and in case of syntax errors, the analyzer will not stop but will continue checking the syntax of the rest 42 of the source code. Figure 4.7 shows the subroutines called, by the main-parser.

The inputs to this phase are token-numbers and sub- tokens from the symbol-parser phase. The outputs are the production number and right hand side or productions of the

BHF grammar. Each. RHS element is represented by two numbers.

One describes the general type of the element, and the other describes the value of numbers or the pointer of the identifiers:.. if- the symbol is not a number of an identifier, the second number is zero.

4.4.4,1 Table of Symbol Precedence (TSP). The main-parser routine checks the syntax of the AHPL control sequence of the source code against the BNF grammar of

Figure 2,2. This grammar is programmed as a table called

Table of Symbol Precedence (TSP). This is a two dimensional table. ' Each grammar symbol appears.once as a column heading of this table. All the grammar symbols that can be distinguished by the. place that they appear in grammar ojc by the symbol itself, are assigned separate codes which correspond to the rows of TSP.

if the column symbol of TSP cannot appear on the right of row symbol of this table, the corresponding table entry is zero, if the column symbol can appear on the right of the row symbol, the corresponding table entry is the code number in octal, and will replace the column » PROD TOKEN-NUMBERS #

SUB-TOKENS =ORHS SYMBOLS MAIN PARSER

rORHS VALUES

TABLE OF SYNTAX PRECEDENCE

Figure 4.7. Main-parser routines. 44 symbol. Finally if the column symbol can appear on the right of the row symbol, and the row symbol ends a certain grammar production, the table entry is an Octal 3 followed by the production number in octal.

The BNF grammar with distinguishable codes assigned to symbols is shown in Figure 2.2. For illustration a portion of TSP is shown in Figure 4.8.

GRAMMAR SYMBOL ' ! £ ! + ! — ! / I * i e i (SPECIAL CODE) I i ! i I! i

— ----- — — — ------— ----- — — — .GLRM5 (106) ! 331 ! 331 ! 000 ! 000 j 331 i 331 ! GLRM6 (107) ! 003 i 332 ! 000 ! 000 I 332 ! 332 i GLRM7 (108) ! 003 j 004 I 000 i 000 ! 333 i 333 i

* «■ + *** * * * * +

$ * » * * *

Figure 4.8. A portion of TSP.

This figure indicates that a slash (./) cannot appear on the right of a .GLRM5, s ince the table entry is zero. If an and (&) appears after GLRM5 reduction is to be done. The result of this reduction is production number

25 = 31 (octalb. If OR (.+) appears after GLRM7, it will be considered as part of the RHS with the special code of

4 = 00.4 (pctah).. The complete SPT is in Appendix B. The 45 parsing algorithm that HPSIM uses is explained in Chapter 11 of Reference 8.

4.4.4.2 Parsing. The parser uses two stacks, stack 1 and stack 2. The former is used for symbols and the latter is used for symbol values. The main-parser calls the symbol ^manager for a token-number and a sub-token.

Token-numbers are first translated to the main-parser local code. This code is placed as the column element of TSP while the row of TSP is the previous symbol pushed on the stack 1. If the table entry is zero, the new symbol causes an error; and, therefore, the error routine will be called.

If the. table entry is a number starting with zero, one, or two, the table entry will be pushed on stack 1 and the received sub-token will be pushed on stack 2. If the table entry is a humber starting with three, the TSP column element will be temporarily stored. In this case the two right hand side digits of the table entry represent the LHS production number. This number is used to find the number of elements on the right hand side. Then the two stacks are popped yp as many times as the number of RHS elements.

The production number and all popped up elements will be outputed to the semantics. Then the production number is used as a column element of TSP, and the same process will continue until a column element causes a push in the stacks. Now the original column element will be recalled 46 and again checked with the new row element (top of stack).

The main-parser does not ask the symbol-parser for a new token until a token is either pushed on the stacks or an error message is issued.

4.4.4.3 Error Recovery 19, 10]. Since a table directed method of parsing is used for HPSIM interpretation, an illegal syntax construction at the beginning of a program can blow up the parser, rendering it unable to detect further errors. To prevent this, an error recovery routine (ERROR subroutine) is built in the parser-phase.

When an error occurs, all the stack elements up to a period will be flushed out of the stack, and the symbol- parser will be called and the tokens ignored until a period is received. Then control returns from the ERROR routine, and the parsing process continues. While looking back in the stack if a start marker is found instead of a period, . the symbol-pa.rser will be called until a step-number is received., Then the start marker and step number will be pushed on the stack, and control will return to the main­ parser to continue parsing.

4.4.5 Semantics Phase

The stack elements that are popped up in the main- parser phase, the production number, and a code indicating step number are the inputs to the semantics phase. The output of this phase to the main-parser is a temporary 47 symbol pointer which is the row number of the TOTS table.

In this row the information about the result of the opera­ tion will be placed. When this routine is called to process a step number, the step number and the number of the module containing that step will go into the SQRT table in columns one and two. In column number three of this table the current QTABLE row number will be placed.

This phase will be called for any of the 54 pro­ ductions of the BMP grammar and each production requires a different semantic action. For productions that an opera­ tion such as &, +, or @ is to be done, the two operands will be placed in columns 2 and 3 at the current empty row of

QTABLE, while in column 1 of this table the production number will be placed. Then column 4 will contain the current empty row number of the TOTS table. This row number will be outputed to the main-parser to indicate where the result of operation will be placed. Productions 19, 20,

23, 37, 38, 39, 40, 47, 48, and 53 will require the opera­ tion to be placed in the TOTS table in a similar manner to placing information in the QTABLE. Productions 4, 5, and 6 indicate the end of a numbered step. In this case the last row number of the QTABLE will be placed in column 4 of

SQRT« At this time the current row of SQRT contains the step number, the module number, the beginning quadruple number and the end quadruple number. So at the execution time SQRT ca,n be used to find out what quadruples to 48

execute for a certain step. Production 19 initializes the

NEST table.

This phase will finally generate four of the execu­

tion tables (STABLE, SQRT, NEST, and TOTS). SRT was built

in symbolr-manager phase.. Together these five tables are

sufficient for execution, and they are the major means of

communication between Pass I and Pass II of the HPSIM

interpreter. Note that TOTS and QTABLE only contain pro­ ductions that require some execution. Those grammar pro­ ductions that are only used for the parsing analysis of the

source code will not be represented in the five tables. CHAPTER 5

DESIGN OF PASS II OF THE SIMULATOR

5.1 User I/O Specification

In addition to the AHPL sequence, the required input

to the HPSIM program includes another file which provides

the HPSIM user with control of the external input, and

specifies the form of output desired. This file is called

the HPSIM communication file or the communication section.

T h i s section has a very simple and line oriented syntax as was discussed in Chapter 3,

5.2 Function of the Second Pass

The second pass has one main routine (EXECUTE) and

five execution supporting routines. There is also an

execution operator (EXEC) routine that handles calling of

supporting programs in the proper order. This routine is

called after Pass-I has translated the source code into

five executable tables. The execution of all productions " is done on a bit by bit basis. The intermediate bit result

of eyery operation goes into Qld^Symbol^Value-Table (OSVT).

If the. operation appears on RHS of a transfer or connection

the intermediate result will be placed in OSVT or NEW-SVT

respectively.

49 50

When Pass-II is activated, the external values are

read from the communication section, and placed into a

table for external values. Then the initially active steps will be placed in the NEST table. This procedure is done

only once to initiate the execution. At each clock period

and for each active step in the NEST table, the correspond­

ing Quadruples that are found from the SQRT table are executed using productions of the QTABLE. This process

continues until all active steps are taken care of. Then

the result of the current clock execution is printed out,

the NEST table is renewed with the new active steps, and

the execution begins for the next clock period. Execution

continues until either a complete dead end is reached or

the number of executed periods reaches the limit which was specified by the user. Figure 5.1 shows a block diagram

for Pass-II. This figure together with Figure 4.3 describe

the process of interpretation for HPSIM.

5.3 Description of Subprograms of Pass II

Pass II consists of a main program (EXEC) and many

subprograms, one of which is the execution routine

(EXECUTE). Most of these subprograms perform relatively

simple functions, therefore they need not be described in

detail.. Since they are called by the EXEC routine, their

function will be cited in connection with the execution 51

( START I PASS II

READ BIT VALUE OF EXTERNAL LINES

FIND ACTIVE STEPS

NEST EMPTY • EXECUTABLE ALL QUADRUPLES

PRINT RESULTS

v

Figure 5.1. Pass II block diagram. 52 operator routine. The execution routine is an exception and it will be described in detail.

5.3.1 The Execution Operator Routine (EXEC)

The execution operator routine is called when Pass I has completed translating the source code into the executable tables. It is called only once and stays in control of the entire execution process until the interpreta­ tion is all done, and the HPSIM interpreter stops.

Part of the communication section is read by this routine. It first checks to see if the user lias specified any debug options, next it reads the clock limit, and then it calls the execution supporting subroutines in proper order. The operation of this routine is well explained by the flow chart of Figure 5.2. The supporting subroutines are listed below.

5.'3.1.1 DELETE Subroutine. Syntax analysis of the first pass is done in a table directed method, and the semantic routine that fills the NEST table is called by this routine. This automatic way of building the initial

NEST table causes dummy steps to be placed in the NEST.

When the subroutine DELETE is called, these dummy steps will be eliminated from the NEST.

5.3,1.2 OSB Subroutine. The symbols declared as one-shots along with all other symbols are in the SRT table 53

START )

CALL DELETE

TO DELETE EXTRA STEPS

CALL OSB TO BUILD ONE-SHOT|

CALL INREAD TO READ EX-LINE VALUES

READ, DEBUG, AND

CALL INTRAN TO PUT ONE SET

OF INPUT IN OSUT

CALL NZSR TO FIND NEXT

FIND QTABLE CALL QLINER TO SEPARATE LIMITS FOR THE

QUADRUPLES CURRENT STEP

CALL ORDER TO CALL THE EXECUTION ROUTINE IN PROPER ORDER

CALL OSE TO DECREMENT

THE SHOT DURATION

CALL NSTNEK TO RENEW THE

NEST TABLE

MARX THE STEPS WITH NOD ELAY

Figure 5,2. The EXEC program flow chart. 54

1 CALL ORDER TO CALL

,EXECUTION IN PROPER FIND QTABLE LIMITS i 'ORDER

SET QLINER-ALREADY- CALL QLINER TO

SEPARATE QUADRUPLES

SET QLINER- ALREADY-

CALL INTRAN TO THE

FIND QTABLE LIMITS

CALL QLINER TO SEPARATE QUADRUPLES

Figure 5.2.--Continued 55

at the beginning of Pass II. Since one shots require a

different execution, they have to be separated from others.

This is what the function of the One-Shot-Builder routine

is.

One-shots are pulled out of SRT table and are placed in the One-Shot-Table COST). This table has three columns, which contain the identifiers declared as ONESHOTS, the duration of one-shots, and the pointers to the value table.

5.3.1.3 THREAD Subroutine. This subroutine reads the octal values of the external lines, converts them to binary bits, and puts them in the EXternal-Input-Array

CEXIAl, After completion, this array contains binary bits which will be assigned to the AHPL module external lines at ea.ch. clock period.

5.3.1.4 INTRAN Subroutine. When this subprogram is called, the binary values for each external line corresponding to the current clock period, will be placed in the Old-Symbol-Value-Table COSVT). The execution routine uses the values from this table in all its opera­ tions .

' 5 . 3.T. 5 WESR Subroutine. The Kext-Executable-Steps-

Routine pulls the active steps out of the NEST table.

The ENDSEQUENCE steps will be pulled first, followed by 56

steps with NODELAY and followed by regular sequence steps.

The number zero will be returned for the module number if

all the steps are pulled out of the NEST and the NEST is

empty.

5.3.1.6 QLINER and ORDER Subroutines. The ORDER

subroutine collects the quadruples corresponding to all

concurrent active steps in the CEQ table (Current Executable

Quadruples). These quadruples are distinguished by the module and step number to which they belong. This table will be used by the ORDER subroutine to send the quadruple

for execution in the proper order. Before sending a

quadruple for execution, the ORDER subroutine checks to

see if any of the identifiers that this quadruple uses on

the RHS are used as a LHS identifier in any other quadruple of the current clock period. If not the quadruple will be

sent for execution, otherwise the order of the two quadruples in the CEQ table will be interchanged. A quadruple will be sent for execution only if none of its

RHS appears on LHS of any other concurrent quadruple.

The ORDER subroutine calls the ORTB (Operator,

Right-hand-side Table Builder) , in .order to find RHS and

LHS of a certain quadruple!

5.3.1.7 OSE Subroutine. When this subroutine is

called, it decrements the duration of active one-shots in

the one-shot table which was built by the OSB subroutine. 5.3.1.8 flKTNEW Subroutine. This routine is called when all the steps in the NEST are executed. Columns four to eight of the NEST are reserved for branching labels.

When a step is being executed, the step numbers to which it branches are placed in columns four to eight of NEST on the same row as the executable step. The NSTNEW (NEST NEW) routine then makes a new row of NEST for each of the new labels. When all the old active steps are renewed NSTNEW returns to its calling program which is the EXEC routine.

5.3.1.9 NOTRAN Subroutine.. Before execution of each clock period this routine is called to transfer the contents of New^Symbol-Value-Table to Old-Symbol-Value-

Table. The execution uses the values from the Old-SVT, it places the result of connections in the Old-SVT and result of transfers in the New-SVT. This partitioning of results causes the result of transfers not to be available until the next clock pulse execution, which of course is simula­ tion of flip-flops.

5.3.1.10 OUTPUT Subroutine. When a clock pulse execution is completed this routine is called to print the results. All the values to be printed are obtained from the Old-SVT, The format of the printout is determined by this routine,

If the debug option is requested, the step numbers will be printed by looking them up in the NEST. If the 58

debug option 1 is requested, the TABLE subroutine will be

called which prints all five executable tables at each clock period.

5.3.2 The EXECUTION Routine

As mentioned before, this routine is called by the

ORDER subroutine. The inputs to this routine are the

QTABLE row numbers. The results obtained by executing the quadruples will be placed in the Symbol-Value-Tables; or in

) case of branch quadruples, the NEST table will be loaded with the next steps to be executed.

Each quadruple contains a production number which will be used by the execution routine to accomplish that particular operation. Certain productions listed in the

BNF grammar are non-executable and are only used for the syntax checking. Others form executable quadruples which following syntax analysis will appear in the execution routine. Figure 5.3 shows all executable quadruples.

The execution routine uses PUTBIT and GETBIT sub­ routines for putting the bit result of operations in the

Symbol-Value-Tables, and receiving the bits of operands from the SVT respectively. GETBIT always receives bits from the Old-SVT. The production number along with the bit values are sent to the PUTBIT routine. If a production number is 16, or 17 (transfer), the result is placed in the

New-SVT. If the production is anything else the result will

PROD*

LH LI LI W Ul U U W U U U W t J [ J f-J ( J f j H- t~* 4 > W hJ m. O <1 CO Nl O' LH UH J t-1 O 0 GO SI O LI NJ O- LH 'O CO

+ {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {GLRM} {RELATION} {STEP} -CSTEP> {BRANCH} {GLRM} {GLRM} {RELATION} {RELATION} {BRANCH} {BRANCH} LHS iue .. xctbe productions. Executable 5.3. Figure EXECUTABLE PRODUCTIONS (QUADRUPLES) {GLRM} M R L G { {GLRM} nt f {GLRM} * {GLRM} } M R L G { } M R {GLRM} L G +/ { {GLRM} + ! {GLRM} {GLRM} } @ M R {GLRM} L G { . null uf ( FN.NU} ) {FUNC.INPUT} ( busfn > {FUNC.INPUT} ( INTEGER dcd ( $ GR} {GLRM} & {GLRM} {GLRM} <= {GLRM} {CLHS} <= {GLRM} {DLRM} = {DLRM} . deadend d ( FN.NU} ) {FUNC.INPUT} ( add n < FN.NU} ) {FUNC.INPUT} < inc INTEGER $ INTEGER / {GLRM} &/ : LM {FUNC.INPUT} ( SLRM :: RIGHT INTEGER {UBRSR ) {NUMBER.STR} ( {LM ) < NME.T} ) {NUMBER.STR} < / ) {GLRM} <

HAND r INTEGER

SIDE ) be placed in the Old-SVT, where it remains accessible for execution during the current period.

In the rest of this section, execution of each executable production will be described. It should be noted that if a quadruple contains a value pointer, this pointer is an indirect pointer to OSVT through the TOTS table.

5.3.2.1 Quadruples 8 and 9. The execution does a

RETURN when encountered with quadruple number 8, which is a null step. For Quad #9 a -1 is placed in column four of the

NEST* table. The NESTNEW routine will eliminate any NEST row that has a -1 in its fourth column.

5.3.2.2 Quadruples 15 and 16. The execution routine handles these two quadruples exactly the same, and as jnentroned earlier, the PUTBIT routine takes care of the timing of connections or transfers. The quadruple carries the RHS and LHS pointers. The LHS pointer can point -to a • series of concatenated identifiers. A search in the TOTS table is done to find all the left hand side identifiers, and then their TOTS pointers are placed in the Destination-

Pointer-Matrix. If two symbols are row catenated, their pointers will be placed in one row of DPM, and if they are column catenated, their pointers will be placed in one column of DPM. Loading the DPM is illustrated in Figure 61

5.4b which, illustrates the implementation of the AHPL step of Figure 5.4a.

When DPM is loaded, it appears as a single array to the RHS of the operation. After the size checkings are done each bit of the RHS will be placed in the proper bit of the proper register of the LHS. Figure 5.5b shows the bit organization of the LHS as it appears to the RHS for the transfer shown in Figure 5.5a.

Error messages will be given by the execution routine if the number of rows of two column catenated symbols, e.g., A and B, or.the number of columns of two row catenated symbols, e.g.. A,B and C,D do not match in number.

5 .3 ,2 .,3 Quadruple 17. This quadruple does a transfer into a conditional left hand side. it only contains a pointer for the RHS and one for the LHS. The information in TOTS that the LHS points to contains a pointer to the destination identifiers list and a pointer to the condition vector.

Those destination identifier pointers whose corresponding condition vector bit is zero are pulled out of the list, and the rest stay in the list. From this point on the execution of this quadruple is identical to that of Quad, #16. The control is then passed to Quad. #16 execution. (A,B) ! (C,D,E) ! F C a )

! (A) ! (B) ! ! i

! (C) ! (D) ! (E) ! i

! (F) ! ! ! i

Cb )

Figure 5.4. Loading the DPM. 63

MEM0RY:AC3] <2> f BC43 <2> ;CC1] <3> ;i'[6] <3> f M E 7 3 <5>.

4 (A,B) ! < C f D ) < = M .

(a)

(b)

Figure 5.5. LHS bit organization of identifiers in the DPM. 64

5.3.2.4 AND, OR, EXCLUSIVE-OR Quadruples. The quadruples for these operations contain a first operand pointer, a second operand pointer, and a result pointer.

After checking the sizes of the two operands, one bit of each operand is copied from the OSVT using the GETBIT sub­ routine . The proper operation is done on these binary values, and the result is placed in the OSVT. The OSVT location where the result should be placed is dictated by the result pointer. This procedure continues until all bits of the two operands are processed.

5.3.2.5 Concatenation Ouadruple. The quadruples for catenation operations contain the two operands and the result pointers. The GETBIT subroutine is called for the operand bits in the order that they should be catenated and the received bits will be placed in the OSVT.

5.3.2.6 Conditional RHS Quadruple. The condition

Vector selects the right hand side symbol and places its bits into the OSVT where the result pointer indirectly points to. For this operation only one of condition vector bits can be 1.

5.3.2.7 Quadruples 32 to 35. . For AND-ALL-BITS

COR-ALL^BITS) operation each bit of the operand is received by calling GETBIT. It is then ANDed (ORed) with the 65 previously received bit. When all bits are ANDed (ORed) the final result will be placed in the OSVT.

The NOT operation works in a similar way except that each bit after being inverted will be placed in the OSVT by calling PUTBIT.

5.3.2.8 Encode Quadruple. Since the two operands are always integers the ointers point to the size-integer and the value-integer. The bits of the machine word con­ taining the value-integer are the result of the encode function, and the number of bits of the result are carried by the size-integer. This integer will be placed in the

TOTS table to accompany the pointer to the OSVT where the result will be placed.

5.3.2.9 Decode Function Quadruple. For the execu­ tion of this function, the decimal value of the function argument is calculated (n), and a 1 is placed in the OSVT location which corresponds to the nth location of the function result.

The OSVT pointer is placed in the TOTS table, where the size of the result vector is also placed at. This size is calculated as the number of bits of the argument of the function to the power of two.

5.3.2.10 ADD, INC, and DEC Function Quadruples.

Execution procedure for the ADD function is done in a manner 66 similar to that of binary operators. However, a buffer is used for keeping the carry which will be added to the next two bits.

INC is a sub-function of ADD. An artificial argu­ ment of 1 is used along with the original increment function argument which are added using the ADD function.

For executing the DEC function, the artificial argument of -1 (binary) is used, and addition is performed.

5.3.2.11 BUSFN and User Defined Functions

Quadruples. BUSFN execution branches to that portion of the execution routine which executes the conditional" RHS.

HPSIM Is not able to recognize any user defined function at the present time.

5.3.2.12 Branching. Quadruples 52 to 54 are used for branching. Quad. #52 is a conditional branch. The execution routine portion for this quadruple will check the decision vector bits, and places the labels for which the corresponding decision vector bits are 1 into the NEST table,.

Quadruples 53 and 54 are executed similarly except that all the labels will be placed in the NEST. CHAPTER 6

EXAMPLES OF USING HPSIM INTERPRETER

This chapter is intended to illustrate the useful­

ness and features of the HPSIM language interpreter. This

will be done by simulating three digital systems using HPSIM.

6.1 A Digital Phase-Meter

Before the two signals to be analyzed by a digital

. phase-meter can enter pure digital section of the meter,

they haye to pass through an interface circuit. The inputs

to the interface are the two signals and the outputs are

half waye rectified square waves. The overall phase-meter

block, diagram is shown in Figure 6.1. In our design we

will assume that the inputs are always square waves as

shown by signal 1 and signal 2 in Figure 6.1. The flow

chart of Figure 6.2 illustrates the design procedure-for

the phaser-metey,

Using this flow chart the AHPL description of the

phase-meter is written as shown in Figure 6.3. The circled

numbers in the flow chart correspond to the step numbers of

Figure 6,3. This AHPL description was used as the input to

the HPSIM interpreter. The phase-meter was simulated by

HPSIM and the outputs, are shown in Figure 6.4. START RESET

SIGN

HALF WAVE SCHHIT ■ • RECTIFIER BINARY TRIGGER SIGNAL 1 DIGITAL

■» PHASE PHASE

METER n n HALF WAVE SCHMITH RECTIFIER TRIGGER SIGNAL 2

> READY

Figure 6,1. The digital phase-meter and its front end interface. cn oo START

NO

YES

LOOP UNTIL BOTH SIGNALS ARE ZERO

INCREMENT THE DIFFERENCE REGISTER IF ONE SIGNAL IS 1 AND ANOTHER IS ZERO

INCREMENT THE TOTAL REGISTER IF BOTH SIGNALS ARE 1.

DEVIDE TOTAL NO ARE \ YES BY DIFFERENCE .BOTH FF,1 RESULT IN RATIO

RESET DIFFERENCE SET TOTAL TO 180

DEVIDE TOTAL 180 BY RATIO RESULT IN DIFFERENCE

PHASE DIFFERENCE READY

NO RESET YES

Figure 6,2. Phaset-meter flow chart. a h p l m o d u l e : p h a s e m e t e r . MEMORY:C0UNTC4:5 DIFFERENCECS:» TOTALC8];EXTEND[8];SIGN. e x in p u t s :s t a r t ; s i g n a l i ; signal.2; r e s e t , b u s e s : d ? e ; l . OUTPUTS:ANGLEC8D; NEGATIVE; READY. CUUNITS:ADDC93(DIFFERENCE;TOTAL); INCC43(COUNT); INC2C83(DIFFERENCE); INC3C83(TOTAL); C0MPAREC33.

1 => ("START)/(1). 2 DIFFERENCE <= 8$0; TOTAL <= 8$0; => (SIGNALI + SIGNAL2)/(2)• 21 SIGN <= \1\ * ("SIGNALI S SIGNAL2); => (-(SIGNALI + SIGNAL2) , (SIGNALI 2 SIGNAL2))/(21»12). 3 DIFFERENCE <= INC2(DIFFERENCE); TOTAL <= INC3(T0TAL); => (SIGNALI G SIGNAL2)/(3)• 4 TOTAL <= INC3(T0TAL); => (SIGNALI 2 SIGNAL2)/(4).

'*****)K************DIVIDE 'TOTAL' BY THE 'DIFFERENCE'****************** '*■ ■* ■*■ 5 E,L = COMPAREC1:23 (DIFFERENCE ; EXTEND); '* '*" => (L 2 D , L 2 -D)/(7,8). "* '*■ 6 NODELAY "* ■** EXTEND»TOTAL <= "E 2 ADDCliSK '* •** (7$o ,a d d c o 3(e x t e n d ;-d i f f e r e n c e >); ■* "*■ (ADDC1:83(EXTEND;-DIFFERENCE)) ), '* •*• TOTALCO:63» \i\ ; "* ■*• => (-10/(8). •* "*' 7 EXTEND,TOTAL <= EXTEND:1:73,TOTAL,\0\; '* **■ COUNT <= INC(COUNT); ** '*• =>5. •* **' ■* • **************the RESULT IS IN THE 'TOTAL'REGISTER*******************

8 DIFFERENCE <= 8$180; EXTEND <= 8$0; COUNT <= 4$0,

■ ********* Ei I VIDE CONTENTS OF'DIFFERENCE' BY THAT OF 'TOTAL'*********** "*" '* '*■ 9 E,L = COMPARE C1:23 (TOTAL ; EXTEND); . "* ■*' => (L 2 D , L 2 -10/(11,12). •* '*" 10 NODELAY ■* ■** EXTEND,DIFFERENCE <= ~E 2 ADD[1:83( '* •*• (7$o ,a d d c o 3(e x t e n d ;-t o t a l )); •* ■*• (ADDC1:83(EXTEND;-TOTAL)) ),‘ "* "*" DIFFERENCEC0J63, \1\ ; "* ■*e => (-10/(12). •* "*' 11 EXTEND,DIFFERENCE <= EXTEND:1:73,DIFFERENCE,\0\; '* "*" COUNT <= INC(COUNT); '* '*" => 9 . '* "*" '* *************THE RESULT IS IN THE 'DIFFERENCE' REGISTER****************

12 ANGLE = DIFFERENCE; READY = \1\; => (—RESET , RESET >/(12,l)» ENDSEQUENCE CONTROLRESET(1) ;

D = +/(\1,0,0,0\ G COUNT) ; NEGATIVE = SIGN. END.

Figure 6.3. Phase-meter AHPL description. 71

AHPL MODULE(S) INITIAL INFORMATION DATE: 27-De TIME: 19:04

EXECUTION WILL STOP AFTER 120 CLOCK PULSES

: : : : : e x t e r n a l - l i n e c s ) v a l u e s a r e l i s t e d b e l o w : : : : : BUSEFFECT 150 00100000000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 150 00777777700000007777777000000077777770000000777777700000007777777000000000000000 BUSEFFECT 150 00003777777400000037777774000000377777740000003777777400000037777774000000000000 BUSEFFECT 150 00000000000000000000000000000000000000001000000000000000000000000000000000000000

OUTPUTS: ROW* S T A R T 0 S I G N A L 1 0 S I G N A L 2 0 R E S E T 0 C O U N T 0 DIFFERENCE 0 T O T A L 0 E X T E N D 0 A N G L E 0 N E G A T I V E 0 R E A D Y 0

(a) Initial information

Figure 6.4. The HPSIM output of the phase-meter. AHPL ri.'MCTICN LEVEL SIMULATOR OUTPUT IS LISTED EELGU:

! SIGNAL 1 ' ' SIGNAL: • ■ ' RESET > 1 ■ ! COUNT • ! ! ! I DIFFERENCE !!!! TOTAL ! ! 1 EXTEND ' 1 1 ANGLE 1 !! NEoATIV !‘ !! ! ! '■ 1READY 1 0 0 0 0 0000 00030000 00000000 OOOOOCOO oooooooo 0 0 0 0 0 0 00000000 00000000 00000003 oooooooo 0 0 3 0 0 0 0 00000000 ooooocoo 00000900 09900000 0 0 4 0 0 0 0 00000000 00000000 00000000 oooooooo 0 0 0 0 0 0 00000000 00000000 00000000 oooooooo 0 0 6 0 0 0 0 00000000 00000000 oooooooo oooooooo 0 0 7 0 1 0 0 00000000 00000000 ooooocoo oooooooo 0 0 8 0 1 0 0 00000000 ooooocoo oooooooo oooooooo 0 0 1 1 0 0 nnnooooo 00000000 oooooooo oooooooo 0 0 10 0 1 - oooooooo oooooooo 0 0 0 0000 00000000 OOUUvw.. --"omOOO 0 0 0 0 0 0 0000 00000000 00000000 oooooooo 49 0 1 0 0 0000 00000000 00000000 oooooooo oooooooo 0 0 50 0100 00000000 00000000 oooooooo oooooooo 0 0 51 0 1 0 0 00000001 00000001 oooooooo oooooooo 0 0 52 0 1 0 0 0000 00000010 00000010 oooooooo oooooooo 0 0 53 0 1 0 0 0000 OOOOOOll OOOOOOll oooooooo oooooooo 0 0 54 0 1 0 0 0000 00000100 00000100 oooooooo oooooooo 0 0 0 1 0 0 00000101 00000101 oooooooo oooooooo 0 0 56 0 1 1 0 00000110 00000110 oooooooo oooooooo 0 0 57 0 1 1 c 00000111 00000111 oooooooo oooooooo 0 0 58 0 1 1 0 00000111 00001000 oooooooo oooooooo 0 0 59 0 1 1 0 00000111 00001001 oooooooo oooooooo 0 0 60 5 1 1 0 00000111 00001010 oooooooo oooooooo 0 0 61 0 1 1 0 00000111 00001011 oooooooo oooooooo 0 0 62 0 1 1 0 00000111 00001100 oooooooo oooooooo 0 0 63 0 1 1 0 0000 00000111 00001191 oooooooo oooooooo 0 0 64 0 1 1 0 0000 00000111 00001110 oooooooo oooooooo 0 0 65 0 1 1 0 0000 00000111 00001111 00000009 oooooooo 0 0 66 0 1 1 0 0000 00000111 00010000 oooooooo ooooocoo 0 0 67 0 1 1 0 0000 00000111 00010001 oooooooo oooooooo 0 0 68 0 1 1 0 0000 00000111 00010010 oooooooo oooooooo 0 0 69 0 1 1 0 00000111 00010011 ooooocoo oooooooo 0 0 70 0 0 1 0 0000 00000111 00010100 oooooooo oooooooo 0 0 71 0 0 1 0 0000 00000111 00010101 oooooooo oooooooo 0 0 72 0 0 1 0 0000 00000111 00010101 oooooooo oooooooo 0 0 73 0 0 1 0 0001 00000111 00101010 oooooooo oooooooo 0 0 74 0 0 1 0 0001 00000111 00101010 oooooooo oooooooo 0 0 75 0 0 1 0 0010 00000111 01010100 oooooooo oooooooo 0 0 76 0 0 1 0 0010 00000111 01010100 oooooooo oooooooo 0 0 77 0 0 0 0 0011 00000111 10101000 ooooocoo oooooooo 0 0 79 0 0 0 0 0011 00000111 10101000 oooooooo oooooooo 0 0 79 0 0 0 0 0100 00000111 01010090 00900001 oooooooo 0 0 30 0 0 0 0 0100 00000111 01010000 00000001 oooooooo 0 0 91 0 0 0 0 0101 0C000111 10100000 00000010 oooooooo 0 0 32 0 0 0 0 0101 00000111 10100000 00000010 oooooooo 0 0 33 0 0 0 0 0110 00000111 01000000 00000101 oooooooo 0 0 94 0 0 0 0 0110 00000111 01900000 00000101 oooooooo 0 0 95 0 0 0 0 0111 09000111 10000000 00001010 oooooooo 0 0 96 0 0 0 0 0111 00000111 10000001 OOOOOOll oooooooo 0 0 37 0 0 0 0 1000 00000111 00000010 00090111 oooooooo 0 0 38 0 0 0 0 1000 00000111 OOOOOOll o o o o o o o oo o o oo o oo0 0 8® 0 0 0 0 0000 10110100 OOOOOOll o o o o o o o oo o o oo o oo0 0 90 0 0 0 0 0000 10110100 OOOOOOll o o o o o o o o90000000 0 0 91 0 1 0 0 0001 01101000 OOOOOOll 00000001 90000000 0 0 92 0 1 0 0 0001 01101000 OOOOOOll 00900001 o oo o o o o o0 0 93 0 1 0 0 0010 11010000 OOOOOOll 00000019 00000009 0 0 94 0 1 0 0 0010 11010000 OOOOOOll 00000010 o o o oo o oo0 0 95 0 1 0 0 0011 10190000 00000011 00000101 ooo oo o oo0 0 96 0 1 0 0 0011 10100001 OOOOOOll 00000010 oooooooo 0 0 97 0 1 0 0 0100 01000010 OOOOOOll 00000101 o oo o o o o o0 0 99 0 1 I 0 0100 01000011 OOOOOOll 00000010 oooooooo 0 0 99 0 1 1 0 0101 10009110 OOOOOOll 00000100 oooooooo 0 0 100 0 1 1 0 0131 10000111 OOOOOOll 00000001 03000000 0 0 101 0 1 1 0 0110 00001110 OOOOOOll 00C00011 oooooooo 0 0 102 0 1 1 0 0110 00001111 OOOOOOll oooooooo oooooooo 0 0 103 0 1 1 3 0111 00911110 OOOOOOll oooooooo oooooooo 0 0 104 0 1 1 0 0111 00011110 OOOOOOll ooooocoo ooo oo o oo0 0 105 0 1 1 0 1000 00111100 OOOOOOll oooooooo oooooooo 0 0 106 0 1 1 0 1000 00111130 OOOOOOll oooooooo C0111100 0 1 107 0 1 1 0 1000 00111190 OOOOOOll 00000009 C0111100 0 1 103 3 1 0 1000 30111100 OOOOOOll oooooooo 00111100 c 1 109 0 1 1 0 1000 00111100 90000011 oooooooo 03111100 0 1 110 0 1 1 3 1000 90111100 00009011 oooooooo 00111100 c 1

Registers and lines binary values

Figure 6.4,— Continued 73

Figure 6.4a shows the list of the external inputs

and other initial information which is required for the

HPSIM. The binary values of the circuit lines and registers

for 120 clock pulses are shown in Figure 6.4b. The circuit

is idle until a 1 is received via the START line (clock #9).

After execution of 106 clock pulses the phase angle is

determined which appears on eight ANGLE lines. The READY

line goes to 1 at this clock pulse to indicate that the readout is valid.

6.2 A Serial Communications Example

A printer terminal RS 232 interface is an example which further illustrates the features of the simulator and

compiler. The interface is a receiving terminal for a 10

character/sec asynchronous communications channel. The printerr a, receive only device, has a vector of 8 input data

lines CHARLINE and two control inputs, write and feed. The interface receives serial data on the bb line. Because of - the slow serial data rate, a 2KHz clock has been selected

to drive the interface circuit.

Control inputs include cc_ (data set ready) , ce^

(ring indicator1, and of (received signal detector). The

only control output to the MODEM is cdline (data terminal

ready). Two data registers DATA 18] and CHAREG [8] are

declared in the AHPL description of Figure 6.5 to provide

£or printing a character simultaneously with the serial a h p l m o d u l e : PRinterterminal , e x i n p u t s :BB r CC ? CE ; CF . MEMORY: CHAREGC83 5 DATACS] r CNTC3] : PASS ? CDFLIPFLOP ; TIMER!53 . OUTPUTS:CHARLINEC33 ? FEED ? WRITE f CDLINE . CLUNITS:INC1C53(TIMER)? INC2C33(CNT). 1 CDFLIPFLOP <= \1\ f PASS <= \0\ ? => CCE) /(I) . 2 => ("CC r (CC & ("CF + BB ))) / (1,2) . 3 TIMER <= 5$0 . ' RESET THE TIMER * 4 TIMER <= INC1(TIMER) 5 CNT <= 3$0 i ' WAIT HALF A BIT " => ( +/(TIMER 9 \0,0,1,1,0\) ) / ( 4 ) . 5 TIMER <= 5$0 . * RESET THE TIMER ' 6 TIMER <= INCI(TIMER) t " WAIT ONE BIT " => ( +/ (TIMER (# \1,0,0,0,1\) ) / (6) . 7 DATA <= DATA!1:73 , BB j ’ RECEIVE ONE BIT OF DATA " => ((2/CNT)) / (9) . * SEE IF ALL ARE RECEIVED * S CNT <= INC2(CNT) « * GO FOR THE NEXT BIT * => 5 • 9 CHAREG <= DATA . "PUT COMPLETED DATA INTO REGISTER " * IN CASE OF RETURN.CHARACTER, DISABLE THE WRITE, * SET TO SKIP THE NEXT, " AND FEED THE LINE. * 1C WRITE = "(PASS + (" +/(CHAREG B \1,0,0,0,1,1,0,1\))) ? PASS <= (" +/(CHAREG 0 \1,0,0,0,1,1,0,1\ )) ? FEED - (" +/(CHAREG 0 \1,0,0,0,1,1,0,1\ )) . 11 TIMER <= 5tO . 1 GET TO THE STOP BITS "

* INCREMENT THE TIMER TILL THE MIDDLE OF THE STOP BIT, " THEN GO TO 5TEP*2 FOR THE NEXT CHARACTER. * 12 TIMER <= INCI(TIMER): => ( ( +/(TIMER B \0,1,0,0,ON)) , "< +/(TIMER 0 NO,1,0,0,ON)) ) / (12,2) . ENDSEOUENCE CONTROLRESET(1) : CDLINE = CDFLIPFLOP ? CHAF-LINE = CHAREG . END.

CLOCKLIMII 0480 EXLINES: AIJSEFFECT 0 4 4 0 7 :0o<)000377777700000000000003777777777777777777740000007777777777777777777777700 00001777777400000000000000000003777777777777600000037777777777777777777777777777 BUSEFFECT 0440 17000000000000000000000000000000007777777000007777777777777777777777777777777777 '0000000007777777777777777777777777777777777777777777777777777777777777777777777 BUSEFFECT 0440 17000000000000000000000000000000000777777770000000000000000000007777777777777777 00000000000000000000077777777777777777777777777777777777777777777777777777777777 BUSEFFECT 0440 177 777 777777777777 7777 77 7 "7'7777'7 7777777777 777'7777777777777777777777777777777777 7 Ou>;'.iOOOOOOOO 000 00 0 33 3 *t 3 53 4 2 324 3534 3555 5 55 50000 0000000 77777777777 777 777777 7777777 SUPPRESS: 12 14. 16 1 12 o u t p u t s : p B CC CE l-V -a RLINE FEED CDLINE TIMER DA IA -:ni ? \ WRITE

Figure 6.5, HPSIM input file for the interface circuit. receipt of the next character. A five bit counter TIMER is declared to count down the clock to 9 ms intervals and a three bit counter CMP is provided to count received data bits. The input file in Figure 6.5 is accepted by the simulator. The AHPL control sequence portion is explained by comments in the file set off by quotation marks. The communication section of the input file which applies only to the simulator is treated as discussed in the previous example.

The simulator output listing is shown in Figure

6.6. Since steps 2, 4r 6, and 12 are wait steps the corresponding output is suppressed.

When the bb line goes to zero and indicates that there is a start bit, the data bits are shifted into the

DATA register. When all eight data bits are received the word appears on CHARLINE. The second character to appear on the bb line is a "" which sets the PASS flip flop to 1, This tells the printer not to print.- And puts a 1 on output feed causing a line feed.

At clock #35 the serial data begin shifting into the data register. At clock #183, where there is a 1 on line write, all eight bits are accepted. The second character shifts its first bit into £he data register at clock .#264, with the full character present at clock #411.

For this character the write line stayed zero for second of 76

AHPL FUNCTION LEVEL SIMULATOR OUTPUT IS LISTED BELOW:

1 CHARLINE FEED CDLINE I TIMER I I DATA I 1 PASS ! I 1 1 I I WRITE ! t I I I 10 0 0 00000000 0 01 00000 00000000 000 O0 0 0 111 OOOOOOOO 0 1 00000 00000000 OOO 0 0 0 0 0 1 OOOOOOOO 0 1 00110 OOOOOOOO OOO 0 0

1 0 0 1 OOOOOOOO 1 10001OOOOOOOO 000 O 0 1 0 0 1 OOOOOOOO 1 10010 OOOOOOOO 000 0 0 1 0 0 1 OOOOOOOO 1 10010 00000001 000 0 0 0 0 0 1 OOOOOOOO 1 10001 OOOOOOOl 001 0 0 0 0 0 1 OOOOOOOO 1 10010 OOOOOOOl 001 0 0 0 0 0 1 OOOOOOOO 1 10010 00000010 001 0 0 0 0 0 1 OOOOOOOO 1 10001 00000010 010 0 0 0 0 0 1 OOOOOOOO 1 10010 OOOOOCIO 010 0 0 0 0 0 1 OOOOOOOO 1 10010 00000100 010 0 0 1 0 0 1 OOOOOOOO 1 10001 0000010O Oil 0 0 1 0 0 1 OOOOOOOO 1 10010 00000100 Oil 0 0 1 0 0 1 OOOOOOOO 1 10010 00001001 Oil 0 0 117 1111 OOOOOOOO 0 10001 00001001 119 1111 OOOOOOOO 0 1 10010 00001001 119 1111 OOOOOOOO 0 1 10010 00010011 100 0 1 0 0 1 OOOOOOOO 0 1 10001 00010011 101 0 139 1 1 0 1 OOOOOOOO 0 1 10010 00010011 101 0 140 1 1 0 1 OOOOOOOO 0 1 10010 00100111 101 0

0 1 0 1 OOOOOOOO 0 1 10001 00100111 110 0 0 1 0 1 OOOOOOOO 0 1 10010 00100111 110 0 1 0 1 OOOOOOOO 0 1 10010 01001110

180 1 1 0 1 OOOOOOOO 0 1 10001 01001110 181 1 1 0 1 OOOOOOOO 0 1 10010 01001110 182 1 1 0 1 OOOOOOOO 0 1 10010 10011101 111 0 0 110 1 10011101 01 10010 10011101 111 0 1 0 111 10011101 01 01001 10011101 111 0 0 0 0 0 0 10011101 0 1 00110 1OO11101 262 10 0 0 10011101 0 1 10001 10011101 000 O 0 263 10 0 0 10011101 0 1 10010 10011101 264 10 0 0 10011101 01 10010 00111011 000 0 0 283 0 1 0 0 10011101 0 1 10001 00111011 001 0 0 284 0 1 0 0 10011101 0 1 10010 00111011 001 0 0 283 0 1 0 0 10011101 0 1 10010 01110110 001 0 0 304 0 1 1 1 10011101 0 1 10001 01110110 010 0 0 303 0 1 1 0 10011101 0 1 10010 01110110 010 0 0 306 0 1 1 0 10011101 0 1 10010 11101100 010 0 0 325 0 1 1 0 10011101 0 1 10001 11101100 Oil 0 0 326 0 1 1 1 10011101 0 1 10010 11101100 Oil 0 0 327 0 1 1 0 10011101 0 1 10010 11011000 Oil 0 0

346 1111 1001110! 0 1 1C001 11011000 100 0 0 347 1110 10011101 0 1 10010 11011000 100 0 0 348 1111 10011101 0 1 10010 10110001 100 0 0 367 1110 10011101 0 1 10001 10110001 101 0 0 368 1110 10011101 0 1 10010 10110001 101 0 0 369 1110 10011101 0 1 10010 01100011 101 0 0 388 0 1 1 0 10011101 0 1 10001 01100011 110 0 0 389 0 1 1 0 10011101 0 1 10010 01100011 110 0 0 390 0 1 1 0 10011101 0 1 10010 11000110 110 0 0 409 1111 10011101 0 1 10001 11000110 111 0 0 410 1111 10011101 0 1 10010 11000110 111 0 0 411 1111 10011101 0 1 10010 10001101 111 0 0 412 1111 10001101 1 1 10010 10001101 111 0 0

::::: p r o g r a m r e a c h e d the c l o c k l i m i t . interpreter st o p s :::::

Figure 6.6. HPSIM output listing for the interface circuit. 77

"Return character" and nothing was to be written. Instead,

at clock #412 a 1 is placed on Line Feed.

6.3 Stack Controller % A stack controller circuit is to be designed which pushes data on a 25 6-word RAM. Two auxiliary data registers are used to realize a push-down store for which push and pop operations will appear from the outside to be accomplished in one clock period. It is assumed that consecutive stack operations will be separated in time by at least four clock periods. A third operation, LOOK, has also been made possible. This operation is merely an interrogation of the wopd gt the top of the stack without disturbing the stack. This operation is left to the stack user control sequence by making the top word a continuous output of the stack. An input data word will be received from the OBUS.

The PUSH and POP commands will be signaled by one period levels on lines push and pop. When the stack is ready to receive a command, it will indicate with a continuous 1- leyel on line, ready.

The basic block diagram of the stack modules is shown in Figure 6.7. In addition to the RAM two 18 bit registers Rl and R2 are included. When ready = 1, R2 will contain the word at the top of the stack; and Rl will

1, This example first appeared in Chapter 13 of Reference 2, 78

STACK POINTER READY <

Figure 6.7. Stack Implementation. 79

represent the next available space above the stack. R2 will

be connected to a vector of output lines. The 8-bit

address register, STKPNT, will point at the second word in

the stack. Figure 6.8 is an AHPL description of the stack.

a h p l m d d u l e :STACK EXINPUTS:0BUSC8D JPUSH»POP f START . INPUTS:DATAOUTC83 ? COMPLETE. MEMORY:R1[8]fRSCS];STKPNT[8];READYFFfFULLFF. OUTPUTS:DATAC83;ADDRESSINC83 rEMPTY?READY?FULL?WRITE;REAH. CLUNITS:INCC83(STKPNT)?DECC83(STKPNT) . 1 STKPNT<=8$0 ? READYFF <= \1\? FULLFF <= \0\? => <"START)/(1). 2 READYFF*(PUSH+POP) <= \0\? R1*PUSH <=OBUS? =>(-("COMPLETE)/(3). 4 R2 <= Rl? READYFF <=\1\? STKPNT <= INC(STKPNT)? FULLFF*(8/STKPNT) <=\1\? => (2). 5 STKPNT <= DEC(STKPNT)? FULLFF <= \0\. 6 READ =\1\? => ("COMPLETE)/(6). 7 R2 O DATAOUT? READYFF <= \1\? =>(2 ). ENDSEQUENCE CONTROLRESETd ) ? READY=READYFF? FULL=FULLFF? DATA=R2? EMPTY = "(+/STKPNT) 8 "FULLFF? ADDRESSIN=STKPNT. END.

Figure 6.8. AHPL description of the stack.

The stack-control circuit communicates with RAM for receiving and delivering the data, so for the simulation to be complete the RAM hardware should also be described.

Figure 6.9 shows the AHPL description of the RAM which is used by the stack. 80

AHPLMGDULE JRAM INPUTS: DATAC83 f ADDRESSINC8D f READ,* WRITE. MEMORY: M<256>C8D i MDC83. OUTPUTS: DATAOUTC8]; COMPLETE. CLUNITS: BUSFNC83(M;DCD(ADDRESSIN) ) fDCriC2563(ADDRESSIN) . 1 =>(^ (READ+WRITE,”(READ+WRITE))/(4,l). 5 NULL. 6 M*DCD < ADDRESSIN > <= DATA F => (4) . ENDSEQUENCE CONTROLRESETd ) F DATAOUT = MD. END.

Figure 6.9. RAM AHPL sequence.

Simulating the STACK and the RAM the printout shown in Figure 6.10 was obtained from the HPSIM system.

The values of the external lines which caused pushes and pops, and the external data are part of the HPSIM printout which is shown in Figure 6.11.

This example illustrates the virtual concurrence of execution of AHPL steps. When two or more steps are active at the same time, the result of their execution will appear to be concurrent. For example step 6 of the STACK module and step 4 of the RAM module are both active at clock periods number 37 and 47. Step 6 of STACK checks COMPLETE while step 4 of RAM can change its value. The result of this virtual concurrent execution will cause the condition of step 6 of STACK to fail, since it sees a 1 on the line

COMPLETE, Multi-branching causes concurrence in one module. 81

AHPL FUNCTION LEVEL SIMULATOR OUTPUT IS LISTED BELOW:

START FULL EMPTY OBUS PUSH READY I POP

READ ! WRITE ! I COMPLETE ■ ! ! STKPNT * ! ! ! 1 ! ! ! 1 0 0 1 11110000 0 0 0 oooooooo oooooooo oooooooo 0 0 0 oooooooo 2 0 0 1 11110000 0 1 0 oooooooo oooooooo oooooooo 0 0 0 oooooooo 3 0 0 1 11110000 0 1 0 oooooooo oooooooo oooooooo 0 0 0 oooooooo 1 0 1 11110000 0 1 0 oooooooo oooooooo oooooooo 0 0 0 oooooooo 5 0 0 1 11110000 0 1 0 oooooooo oooooooo oooooooo 0 0 0 oooooooo 6 0 0 1 11110000 1 1 0 oooooooo oooooooo oooooooo 0 0 0 oooooooo 7 0 0 1 11110000 0 0 0 oooooooo 11110000 oooooooo 0 1 0 oooooooo 8 0 0 1 11110000 0 0 0 oooooooo 11110000 oooooooo 0 1 0 oooooooo 9 0 0 1 11110000 0 0 0 oooooooo 11110000 oooooooo 0 1 0 oooooooo 10 0 0 1 oooooooo 0 0 0 oooooooo 11110000 oooooooo 0 1 1 oooooooo 11 0 0 1 00000000 0 0 0 oooooooo 11110000 oooooooo 0 0 1 oooooooo 12 0 0 0 oooooooo 0 1 0 11110000 11110000 oooooooo 0 0 0 00000001 13 0 0 0 00001111 0 1 0 11110000 11110000 oooooooo 0 0 0 00000001 14 9 0 0 00001111 1 1 0 11110000 11110000 oooooooo 0 0 0 00000001 15 0 0 0 00001111 0 0 0 11110000 00001111 oooooooo 0 1 0 00000001 16 0 0 0 00001111 0 0 0 11110000 00001111 oooooooo 0 1 0 00000001 17 0 0 0 00001111 0 0 0 11110000 00001111 oooooooo 0 1 0 00000001 18 0 0 0 00001111 0 0 0 11110000 00001111 oooooooo 0 1 1 00000001 19 0 0 0 oooooooo 0 0 0 11110000 00001111 oooooooo 0 0 1 00000001 20 0 0 0 00111100 1 1 0 00001111 00001111 oooooooo 0 0 0 00000010 21 0 0 0 00111100 0 0 0 00001111 00111100 oooooooo 0 1 0 00000010 22 0 0 0 00111100 0 0 0 00001111 00111100 oooooooo 0 1 0 00000010 23 0 0 0 00111100 0 0 0 00001111 00111100 oooooooo 0 1 0 00000010 24 0 0 0 00111100 0 0 0 00001111 00111100 oooooooo 0 1 1 00000010 25 0 0 0 oooooooo 0 0 0 00001111 00111100 oooooooo 0 0 1 00000010 26 0 0 0 oooooooo 0 1 0 00111100 00111100 oooooooo 0 0 0 00000011 27 0 0 0 oooooooo 0 1 0 00111100 00111100 oooooooo 0 0 0 00000011 28 0 0 0 oooooooo 0 1 0 00111100 00111100 oooooooo 0 0 0 00000011 29 0 0 0 oooooooo 0 1 0 00111100 00111100 oooooooo 0 0 0 00000011 30 0 0 0 oooooooo 0 1 0 00111100 00111100 oooooooo 0 0 0 0000001I 31 0 0 0 oooooooo 0 1 0 00111100 00111100 oooooooo 0 0 0 00000011 32 0 0 0 oooooooo 0 1 1 00111100 00111100 oooooooo 0 0 0 00000011 33 0 0 0 oooooooo 0 0 0 00111100 00111100 oooooooo 0 0 0 OOOOOOll 34 0 0 0 oooooooo 0 0 0 00111100 00111100 oooooooo 1 0 0 00000010 35 0 0 0 oooooooo 0 0 0 00111100 00111100 oooooooo 1 0 0 00000010 36 0 0 0 oooooooo 0 0 0 00111100 00111100 oooooooo 1 0 0 00000010 37 0 0 0 oooooooo 0 0 0 00111100 00111100 00001111 1 0 1 00000010 38 0 0 0 oooooooo 0 0 0 00111100 00111100 00001111 0 0 1 00000010 39 0 0 0 oooooooo 0 1 0 00001111 00111100 00001111 0 0 0 00000010 40 0 0 0 oooooooo 0 1 0 00001111 00111100 00001111 0 0 0 00000010 41 0 0 0 oooooooo 0 1 0 00001111 00111100 00001111 0 0 0 00000010 42 0 0 0 oooooooo 0 1 1 00001111 00111100 00001111 0 0 0 00000010 43 0 0 0 oooooooo 0 0 0 00001111 00111100 00001111 0 0 0 00000010 0 0 0 oooooooo 0 0 0 00001111 00111100 00001111 1 0 0 00000001 4 5 0 0 0 oooooooo 0 0 0 00001111 00111100 00001111 1 0 0 OOOOOOOl 46 0 0 0 oooooooo 0 0 0 00001111 00111100 00001111 1 0 0 00000001 47 0 0 0 oooooooo 0 0 0 00001111 00111100 11110000 1 0 1 OOOOOOOl 4 8 0 0 0 oooooooo 0 0 0 00001111 00111100 11110000 0 0 1 OOOOOOOl 4 9 0 0 0 oooooooo 0 1 0 11110000 00111100 11110000 0 0 0 OOOOOOOl 50 0 0 0 oooooooo 0 1 0 11110000 00111100 11110000 0 0 0 OOOOOOOl

PROGRAM REACHED THE CLOCKLIMIT. INTERPRETER STOPS

Figure 6.10. Lines and registers binary values of the stack example. 82

AHPL MODULE(S) INITIAL INFORMATION DATE: 27-De TIME: 18:50

::::: execution will stop after 50 clock pulses :::::

::::: e x t e r n a l -l i n e (S) v a l u e s a r e l i s t e d b e l o w ::::: BUSEFFECT 40 77700000000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 77700000000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT ' 40 77700037000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 77700037000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 00007737000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 00007737000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 00007700000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 00007700000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 01002020000000000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 00000000002001000000000000000000000000000000000000000000000000000000000000000000 BUSEFFECT 40 04000000000000000000000000000000000000000000000000000000000000000000000000000000 o u t p u t s : ROW# s t a r t 0 FULL 0 EMPTY 0 OBUS 0 PUSH 0 READY 0 POP 0 R2 0 R1 0 DATAOUT 0 READ 0 WRITE 0 COMPLETE 0 STKPNT 0

Figure 6.11. HPSIM initial information for the stack example. CHAPTER 7

CPU TIME ANALYSIS

A CPU time analysis of the HPSIM system indicates that the CPU Time Per Clock (TPC) is proportional to the

Average number of Destination Bits per Step (ADBS). This proportionality is shown in Figure 7.1. The data of this figure were obtained by simulating 5 circuit descriptions on the DEC-10. Note that the CPU times of the CDC version of

HPSIM, which runs on a CYBER-175 computer, for the same 5 circuits were lower by an order of about 4.8. This is of course only due to the speed of CYBER-175 computer, and the two versions of HPSIM (HPSIM/10 and HPSIM/6400) are basically no different.

TPC and ADBS were calculated for each simulated circuit using the algorithm shown below,

TPC t= Tota,l CPU Time/Number of Clocks

For each module, number of steps ADBS - 1 E (LHS and Condition vercotor bits of step i) + i— 1

(Endsequence LHS Bitsl -X (number of steps)}/

(number of steps!

83 CPU TIME ANALYSIS FOR HPSIM

CPU PER CLOCK (MSEC)

140 'STACK CONTROL *

120

100 DIVIDER *

SO PHASE-METER >

MULTIPLIER * 60 HAND-SHAKE *

40

20

00 ! AVG. BITS PER STEP 10

Figure 7,1, CPU time analysis for HPSIM, CHAPTER 8

CONCLUSIONS

HPSIM illustrates how the design language, AHPL, provides a meaningful base for Computer-Aided-Logic-Design.

The HPSIM program can be improved by providing simulation

of more MSI integrated circuits. The HPSIM/10 can also be

improved by making it more interactive„ The present

HPSIM/10 is only a straight modification of HPSIM/6400 to

run on the DEC-10, and not much interaction is involved.

One modification is to make the external lines binary values be entered interactively and the output be printed for each

clock when the user requests.

The overall HPSIM system is proved to be useful and

capable of simulating a wide variety of digital systems.

The time analysis of Chapter 7 indicates that HPSIM is inexpensive to use. The cost of the most complicated example of. Chapter 6 (the stack controller) was $.60 on

the. Cyber 175. The fact that HPSIM is written in FORTRAN makes the program portable, and it can easily be modified

for other computers.

It is hoped that the HPSIM program can help the digital system designers for computerizing their design, and

computer aided digital system design becomes more realistic.

85 APPENDIX A

THE HPSIM INTERPRETER SOURCE CODE

86 00010 PROGRAM CALLER (I HP (JT= 1 2 9 ,0 OT P U T= 12 9 ,1 APE2= INPUT » T A P.E5=0 (J T PUT) 00020 IMPLICIT INTEGER (A-Z) 00030 COMMON/SHARE/ TABLE(131»9J ,SDT (201,5) ,LET (51,8) ,NEHSPT (58) , 00040 1 NOPU (54) ,.FLHS (54) ,XLATE(63) ,CHAR(80) ,DUMMY (3) ,STACK1(50) , 00050 2 KWT (32) 00060 COMMON/SYMANT/ SRT (301,10) 00070 COMHON/SYMAN2/ SSTP 00080 COMMON/EXECU1/ QTABLE (300 , 4)' 00090 CGMMON/EXECU8/ SQ'RT (300 ,,5) 00100 COMMON/EXECU9/ NEST(25,8) 00110 COMMON/EX ECU 2/ NESTROS? 00120 COMMON/EXECU3/ ROHSQ 00130 COMMON/EXECU4/ CQTR.N 00140. COMMON/EXECU6/ TOTS (500,4) 00150 COMMON/EXECU7/ TQTSRN 00160 COMMON/B8/ NEP 00170 COMMON/SYNERR/ ERRORF 00180 CALL MPARS 00190 IF (ERRORF*EQ-1) STOP 00200 CALL EXEC 00210 END 00010 SUBROUTINE HPARS 00020 IMPLICIT INTEGER (A-Z) 00030 ■ COMMON/SHARE/ TABLE(131»9) ,501(201 ,5) , LRT (51,8) , NERSPT (58) , 00040 1 NOPU (54) , FLHS (54) ,XLATE (63) , CHAR (80) DUMMY (3) #STACK 1 (50) , 00050 2 KWT<32) 00060 * THE TOKEN VALUES ARE TRANSLATED TO NEBSPT TO BE USED LOCAL TO PARSER 00070 ' DATA MEWSPT/3*0f1,2,3,0,4,0,0,5,6,7,8,9/10,0,0,11,12,13,14,15,0,16 00080 1,17,18,19,34,35,0,0,0,0,20,21,22,0,0,0,0,0,0,0,0,23,24,25,26,27,28 00090 2,29,30,31,33,0,0,32/ 00100 * NUMBER OF POP UPS DEPENDS ON WHAT THE REDUCTION NUMBER IS, 00110 DATA NOPU/3,3,3,2,3,3,2,2,2,1,0,4,2,2,3,3,3,3,3,3,3,1,3,3,3,3,3,3, 00120 13,3,2,2,2,2,3,6,4,4,4,4,5,3,3,1,1,3,3,1,3,2,4,8,2,4/ 00130 * FIND THE FINAL LEFT HAND SIDE FROM THE FOLLOWING VECTOR 00140 DATA FLHS/0,2*37,3*38,3*39,2*4 0,3*41,4*42,4*43,2*44,20*45,2*46,2* 00150 147,2*48,49,3*50/ • 00160 * CALL THE SYMBOL PARSER FOR THE TOKENS 00170 CALL . SYPARS(SPT,SPS) 00180 IF(SPT»EQ.56) SPT=46 00190 * SINCE THIS WAS THE FIRST CALL A DASH IS EXPECTED, THE PRECEDENCE TABLE 00200 * VALUE OF DASH IS 84 00210 IF (NEWSPT (SPT) »EQ» 35) GO TO 1 0 00220 WRITE (5, 2000) 002 30 * PUSH THE DASH ON THE STACK 00240 • 10 CONTINUE 00250 CALL PUSH(84,0) 00260 20 CONTINUE 00270 * CALL THE SYMBOL PARSER FOR THE NEXT TOKEN 00280 CALL . SYPARS(SPT,SPS) 00290 IF (SPT, EQ. 56) SPT=46 00300 * IF A SEQUENCE NUMBER OR A NODELAY IS IN, IMMEDIATE CALL TO SEMANTICS 00310 * IS NEEDED IN ORDER TO MAKE A TABLE OF EXECUTABLE QUADRUPLES 00320 IF (NEWSPT (SPT) .HE. 21 .AND. NEWSPT (SPT) .HE. 29) GO TO 30 00330 PV1 .= SPS 00340 CALL SEMANT(NEWSPT(SPT), 1,PE 1,PE2,PE3,PE4,PE5,PE6,PE7,PE8, 00350 1 PV1,PV2,PV3,PV4,PV5,PV6,PV7,PV8,NEWPNTR) • 00360 *.WHERE PE STANDS FOR POPED ELEMENT AND PV FOR POPED VALUE. 00370 * THE SECOND ARGUMENT IS 1 INDICATING THAT THE FIRST ARGUMENT IS EITHER 003 80 * SEQUENCE NUMBER OR A NODEIAY AND NOT A REDUCTION NUMBER, 00390 * NEWPOINT IS FOR THE POINTER BROUGHT BACK FROM SEMANTICS 00400 30 CONTINUE 00410 * CALL THE PROCEDENCE ROUTINE TO FIND WHAT ACTION HAS TO BE TAKEN 00420 * TSP=TABLE OF SYNTAX PRECEDENCE;X IS THE TOP OF STACK USED. 00430 * NSA=NEXT SYNTAX ACTION 00440 40 CONTINUE 00450 IF (NEHSPT (SPT). . NE. 0) GO TO 50 00460 WRITE(5,2010) 00470 GO TO 20 00480 50 CONTINUE 00490 CALL TSP (NEWSPT (SPT) »NSA,X) 00500 IF (NSA.NE.O) GO TO 60 00510 CALL ERROR (NEWSPT (SPT) ,X) 00520 GO TO 20. 00530 60 CONTINUE 00540 * THE TABLE ENTRIES WHICH ARE ABOVE 300-OCTAL INDICATE A REDUCTION, 00550 * 300-OCTAL IS FOR SHIFTING 00560 IF (NSA, GT.300B) GO TO 70 00570 * SINCE NSA IS LESS THAN 3008 SHIFT. HAS TO BE DONE 00580 CALL PUSH(NSA,BPS) 00590 * GO FOR THE NEXT TOKEN 00600 GO TO 20 00610 70 CONTINUE 00620 * A REDUCE IS ENCOUNTERED, THE TABLE ENTRY HAS A 300-OCTAL ADDED TO IT. 00630 * RN=REDUCTION NUMBER 00640 RN = NSA-30OB 006*50'---* ^KTTCTII iTG^THE* T^RTJOCTTTO F1TU1BF7R7 '"THE^WEB'ER "OF""? O'F-TJPB TTNTPTITE” FINirTTEIT 00660 * -SIDE CAN BE OBTAINED FROM NOPU &.FLHS VECTORS 00670 * POPUP ROUTINE, POPS THE STACK 006 80 IF (NOPU (RN) . NE.O) GO TO 80 006.90 NEWPNTR=0 00700 GO TO 90 00710 80 CONTINUE 00720 CALL POPUP (NOPU ( RN) , PEI ,.PE2, PE3, PE4, PE5,PE6, PE7, PE8, PV1 ,.PV2 , 00730 1 PV3,PV4,PV5,PV6,PV7,PV8) 00740 * WHEN A POP IS DONE, AND THE REDUCTION NUMBER IS ONE (OR FLHS=0) , ALL 00750 * AHPL PROGRAM IS ANALYZED AND ALL QUADRUPLES ARE MADE AND NEXT 00760 * IS TO EXECUTE THEM ALL 00770 IF(RN « EQ=1) RETURN 00780 * IF THE FINAL PRODUCTION IS NOT REACHED YET, CONTINUE WITH SEMANTICS, 00790 * SEMANTICS IS CALLED, TO TAKE THE RN AND PORED ELEMENTS AND MAKE THE 00800 * QUADRUPLES AND BRING A NEW POINTER BACK 00810 CALL SEMANT(RN,0/PE1,PE2fPE3fPE4,PE5,PE6,PE7,PE8,P71,PV2,PV3f 00820 1 PV4,PV5,PV6,PV7,PV8,NEWPNTS) 00830 * SECOND ARGUMENT IS 0 INDICATING THAT A REDUCTION NUMBER IS PASSED 00840 * TO FIND OUT THE NEXT.TOP.OF.STACK SPT IS CALLED 00850 90 CONTINUE 00860 IF (NEWSPT (SPT) . NE, 0) GO TO 100 00870 WRITE (5,2010) 00880 GO TO 20 00890 100 CONTINUE 00900 CALL TSP(FLHS(RN),NTOS,X) 00910, IF(NTOS.NE.O) GO TO 110 00920 CALL ERROR(FLHS(RN)»X) 00930 GO TO 20 00940 110 CONTINUE 00950 * THE NEW POINTER AND THE NEXT.TOS HAVE TO BE PUSHED ON THE STACK 009 60 CALL PUSH(NTOS,NEWPNTR) 00970 * SYMBOLS ARE PUSHED HE WILL FIND OUT WHAT ACTIONS TO TAKE 00980 GO TO 40 00990 2000 FORMAT(IX,15H SCANNER ERROR ) 01000 2010 FORMAT (I X ,38H>»» ILLIGAL GRAMMAR SYMBOL; IGNORED) 01010 END 00010 SUBROUTINE ERROR (STC„STR) 00020 IMPLICIT INTEGER (A-Z) 00030 COMMON/SYNE RR/ ERROR.F 00040 DIMENSION COLSYM (5 0) »RONSYM(131) 00050 * ROWSYM= ROW SYMBOL; COLSYM=COLUMN SYMBOL

00060 DATA ROWSYM/ 2*" \ „ " & 9 00070 1 " = "r ” / ", 2*" * 9 a 1 00080 2 2*" $ 11*" ( 9 13*" ) 0 3* V n 00090 3 2*» ! 3*» ; 9 o 9 o n 00100 4 6*» *> 9 &/ 9 +/ . 1 00110 5 2*" <= » => 0 7*" INTEGER • 9 NUMBER. STR ti 00120 6 3*MSEQNU.MBER 3*" SLRM 9 INC 0 ADD ii- 00130 7 » DCD » NT 9 CONTROLRES 0 DEADEND 1 ii 00140 8 « NODELAY "ENDSEQUENC 9 END 9 BUSFN n 00150 9 " NULL " :: 9 (BOF/EOF) 9 2* SEQUENCE ii 00160 1 " CLOCK.SEQ 3*» STEP 9 TIMING 9 2* ACTION

00170 2 2*11 RELATION 4*" ' DLRM 9 2*« CLHS 9 18* GLRM ii 00180 3 5*"EUNC.INPUT 3*»NUMBER.STR 9 UNCL.SEQ 0 START.STEP 00190 4 2*" BRANCH ■if 00200 DATA COLSYM/ \ 9 & 9 + m * 00210 1 " " / 9 9 a H ( ii 00220 2 " $ J7 9 ) 9 i ii 00230 3 ” 0 n 9 . 0 4 «i .11 +/ ii 00240 6/ Q 9 <= 9 = > ii 00250 5 " INTEGER 0 " SEQNUMBER 9 SLRM 9 INC ii 00260 6 " ADD 0 » DCD 9 NT 0 COMTROLRES ii 00270 7 « DEADEND 9 » NODELAY 9 ENDSEQUENC 9 END ii 002 80 8 " BUSFN 9 " NULL 9 o o 9 (BGF/EOF) ii 00290 9 " 9 » SEQUENCE 0 CLOCK.SEQ 9 STEP si 00300 1 " TIMING 9 " ACTION 9 RELATION 9 DLRM

00310 2 " CLHS 9 " GLRM 9 "FUNCoINPUT 9 NUMBEE.STB ii 00320 3 " UNCL.SEQ 9 "START.STEP 9 BRANCH / 00330 ERRORF=1 00340 WRITE (5,2000) ROWSYM (STR), COLSYM (STC) 00350 10 CONTINUE 00360 CALL POPUP (1 ,A,B,C,D,E,F,G,H,I,J,K,L,M,N,0/P) 00370 IF ((A- GE, 66) . AND, (A„ LE« 68) ) GO TO 20 00380 IF (ft.EQ = 87) GO TO 20 00390 IF(A. EQ.84) GO TO 30 00400 GO TO 10 00410 20 CONTINUE 00420 * FLUSH THE LIHE UP TO A PERIOD» AND CONTINUE PARSING 00430 CALL SCANNER(TOKEN,SUB) 00440 IF (TOKEN.NE. 22) GO TO 20 00450 RETURN 00460 30 CONTINUE 00470 WRITE (5,2010) 00480 40 CONTINUE 00490 CALL SYPARS(TOKEN,SUB) 00500 - IF (SPT, E.Q= 56) SPT=46 00510 IF (TOKEN, EQ. 30) STOP 00520 IF(TOKEN.NE,36) GO TO 40 00530 CALL PUSH (84,0) OO540 * PUSH THE START MARKER BACK IN THE STACK 00550 CALL PUSH(66,SUB) 00560 * PUSH THE STEP NUMBER INTO THE STACK 00570 RETURN 00580 2000 FORMAT (1.X,21H>»» SYNTAX ERROR: „A10,16H IS FOLLOWED BY , A10 00590 1 , 1 9H ...STEP -IGNORED...) 00600 2010 FORflAT(1X,104H...... SYNTAX CHECK FOR THIS MODULE STOPS HERE; 00610 1 INTERPRETER WILL PROCEED WITH THE NEXT MODULE (IF ANY).) 00620 END 00010 SUBROUTINE PUSH (SYMBOL,VALUE) 00020 IMPLICIT INTEGER (A-Z) 00030 COMMON/SHARE/ TABLE (131 „9) #SDT(201,5) ,LRT (51, 8) , NENSPT (58) , 00040 1 NOPU (54) , FLHS (54) „XLATE (63) , CHAR (80) , DUMMY (3) ,STACK1 (50) „ 00050 2 KWT (32) 00060 COMMON/STK2/ STACK2 (50) .00070 COMMON/STL/ STKLEN 00080 IF (STKLEN = GE» 50) GO TO 20 00090 STKLEN=STKLEN+1 00100 DO 10 1=1,STKLEN 00110 STACK1 (STKLEN-I-i-1 + 1) =STACK 1 (STKLEN-I+1) 00120 STACK2 (STKLEN-I't-I +1) =STACK2 (STKLEN-I +1) ' 00130 10 CONTINUE 00140 * SET THE TOP OF STACK TO SYMBOL AND VALUE (POINTER) 00150 STACK1(1)=SYMBOL 00160 STACK2 (1) =VALUE 00170 RETURN 00180 20 CONTINUE 00190 WRITE (5,2000) 00200 STOP 00210 2000 FORMAT (1.X„22H-— ^-STACK OVERFLOW--- ■) 00220 END 00010 SUBROUTINE POPUP (HOPD, PET, PE2, PE3,PE4.r PE5.,PE6,PE7,PE8 ,PV1 ,PV2, 00020 1 PV3,PV4,PV5,PV6,PY7,PV8) 00030 IMPLICIT INTEGER (A-Z) 00040 DIMENSION SYMBOL (8) „VALUE{8) 00050 COMMON/SHARE/ TABLE(131,9) ,501(201,5) ,LRT (51,8) ,NEWSPT(58) , 00060 1 DUHHY1 (54) ,FLHS(54) , XL ATE (63) , CHAR (80) , DUMMY (3) ,ST&CK1 (50) , 00070 2 KWT (32) 00080 COMMON/STK2/ STACK2(50) 00090 COMMON/STL/ STKLEN 00100 * SAVE THE TOP ELEMENT, THEN POP UP THE STACKS 00110 DO 20 1=1,NOPU 00120 * SAVING FOLLOWS 00130 SYMBOL (I) =STACK1 (1) 00140 VALUE (I) =STACK2 (1) 00150 * SHIFT UP BOTH OF THE STACKS 00160 DO 10 J=1,STKLEN 00170 ' STACK 1 (J) =STACK1 (J+1) 00180 STACK2 (J) =STACK2 (J+1) 00190 10 CONTINUE 00200 * DECREMENT THE LENGTH O021O STKLEN=STKLEN-1 00220 20 CONTINUE 00230 PE1=SYMBOL (1) 00240 PE2=SYMBOL (2) 00250 PE3=S Y MBOL(3) 00260 PE4=SYMBOL (4) 00270 PE5=S YMBOL(5) 00280 PE6=SYMBOL (6) 00290 PE7=SYMBOL (7) 00300 PE8=SYMBOL (8) 00310 PV1 = VALUE (1) 00320 PV2=VALUE (2) , 00330 PV3=VALUE(3) 00340 P V4=VALUE (4) 00350 PV5=VALUE (5) 00360 .PV6=VALUE (6) 00370 PV7=VALUE(7) 00390 PV8=VALUE (8) 003 90 BETURS 00400 END

I kO Ln 00010 SUBROUTINE ISP (NSE/NSA, TOS) 00020 IMPLICIT INTEGER (A-Z) 00030 COMMON/SHARE/ TABLE(131,9),SDTC201,5)»LRT(51»8)„NENSPT(58), 00040 1 NOPU <54) ,FLHS (54) ,XLATE(63) ,CHAR (80) ,DUMMY (3) ,STACK1.(50) , 00050 2 KNT(32) 00060 DATA . ((TABLB(I,J) ,J=1,9) ,1=1,6)/ .00070 10 00000 000000000000 00B» 0000000 000 0000000000B# 0.0000000000000000 000B, 00080 200000077000000 0000 0OB,0000000000000000000OB,0000000000 000000000OB, 00090 30000000000 00000000008,000000.0000000017500OB, 00000000000000000000B, 00100 400000352352000000352B,00352000000352352352B,00352352000000000352B, 00110 500000000000000000000B,00000000000000000000B,00000000000000000000B, 00120 6000000000000000000006,000000000000000000008,00000000000000000OOOB, 001.30 70 0001000000 0000000 008,0000 0013 0230000 000008,000000 00064065066 000 6, 00140 8000000720001071101 118,0011211300 00 000000008,0000012100012.30000008, 00150 9000000000000000000008,000000001520000000008,00000000000000000000 8, 00160 1000010000000000000008,000000130230000000006,00000000064065066OOOB, 00170 200000072000107 1101 118,001 121130000000000008,0000012100012.30000008, 00180 3000000000000000000008,000000001530000000008,00000000000000000OOOB, 00190 4000010000000000000008,000000130230000000008,000000000640650660008, 00200 5000000720001071101 11 8,001121130000 000000008,0000012100 01.230000008, 00210 6000000000000000000008,000000001460000000008,000000000000000000008, 00 2 20 7000000000000000000008,00000000 02600 00000008,000000000000000000008, 00230 800000 00000 00000000008,000000 0000 00 00000000.8,000000 00000000000 000 8, 002 40 90 0000000000000 0000 008,000 000 0000 00000000008, 00250 1000000000000000000008/ 00260 DATA ( (TABLE (I , J) , J=1, 9) ,1=7, 12) / 00270 1000010 00 0000000000 008,0000 001302300 00 000008,00000000064065066 0008, 00280 2000000720001071101118,001121130000 000000008,000001210001230000008, 002 90 300 0000000000000000008,0000000 015100 00000008,000000000000000000008, 00300 400 001000000 0000000 008,0000 00130230000 000008,00 00000006 4065066 0008, 003 10 .50000007200 0 10 71101 118,001121130 0000 00 000008,0000 0121000123 0000008, 003 20 60000 00 0000 00000000008,0000000 015700 000 00008,00 0000000000000000008, 00330 70 0001000 000 0000000 008,00000013 02.30 000000008,00000000064065066 0008, 003 40 800000072 0001071101118,0011211300 00000000008,0000012100 01230000008, 003 50 900000000000 00 00000008,0000000 015400000,00008,0000000000000 00000008, 00360 1000000000000000000 008,0000000000 00 000000003,00000000OOOOOOOOOOOOB, 00370 2000000730000000000 DOB,000000000000000000008,0000000000000OOOOOOOB, 003 80 300000000000000000000B,0000 000 000 00000000 00B,00000000000000000 00 08, 003 90 40000000000 00000000008,000000000150 000000008,00000000000000000000 8, 00400 50000000000 00000000 008,000000000000000000008,000000000000000000008, 00410 600 000000000000000 0 008,000000 000000000000008,000000 00 000000000000 8, 00420 7000000000000000000008,0000000 0 0140000000 008,000000000000000000008, 00 430 800000000000105000000B,000000 000000 0000 000 08,000000000000000000008, 00440 9000000000000000000008,001431450000000000008, 00450 1000000000000000000008/ 00460 DATA ( (TABLE (I, J) , J=1 ,9) ,1=13 , 18)/ 00470 1000000 000000000000 008,000000000000000000008,00 0000000000000000008, 00 480 20 000 0 074 00 0000 0000 008,00000000 0000 0 000000 08,000000 0000 000 00000008, 00490 3000000000000000000 008,000000000000000000008,000000000000000000008, 00500 40 00010 00 0000000000008,0000 0013 0230 000 000008,00000000064065066 0008, 00510 500000072000107 1101 118,0011211.30000 GOO000008, 0000012 1000123 0000008, 00520 6 000000 000000000000008,0 000 000 016517000 00008,0000 00 00000000000 00 08, 00530 70000100000 0000000 0008,00000013 023 0000 000008,0000000 0064 065.066 0008, 00540 80 0000072 0001071101118,001121130000000 000008,00 000121000123 0000008, 00550 9000000000000000000 008,000000001651710000008,0 00000000000000000008, 00560 10 0001000000000000000B,0000 0013 0230000 00000B,0000000 0064065066 000B, 00570 20000007200 01071101118,0011211300 00000000008,000001210001230000008, 00580 3000000000000000000008,0000000 01651720000008,000000 000000000000008, 00590 40 0 001000000000000OOOB,000000130230000 000008,00000000064 065066 0008, 00600 500000072 00 01071101118,001121130000000000008,000001210 001230000008, 00610 60 000000000 00000000 008,00000000165173 00 00008,000000000000000000008, 00620 v 700 001000000000000000.8,0000 0013023 0000000008,00000000064065066 0008, 006 30 8000000720001Q7 1101 118,001.1.2.1 1.30000000 000008,0000012100 0123 000 0008, 00640- 9000000000000000000008,000000001651740000008, 00650 looooooooooooooooooooB/--...... 00660 DATA ( (TABLE (I, J) , J= 1,9) , 1 = 19 ,24) / 00670 10 00 0100000 000 00000 008,000000130230000000008,00000000064 065066 0008, 00680 200000072000107 1101 118,001121130000000000008,000001210001230000008, 00690 30000000000 00000000 00B,0000000 0164 00000 000 08,00 0000 0000000 0000 0008, 007 00 4000000000000000000008,000000 000000000000008,000000000000000000008, 00710 50000007700 0000000000B,0000000000000 00000008,000000000000000000008, ‘00720 600000000000000000000B, 000000000000001 7.6000B»00000000000000000000B,, 00730 70000100000000 00000OOB,000000130230000 OOOOOB,00000000064065066000B* 00740 800000077 00010711011 IB,001121 130000000000005,00000121000123000000B, 00750 900 000000000000000 0OOB,00000000167000101000B,0000000000000O000000B, 00760 1000000000000000000OOB,0000000000000000000OB,000000000000000OOOOOB, 00770 20000 00770000000000OOB, 000 000000000000000OOB,0000000000000000000OB, 00780 3000000000000000000OOB,00000000000000177000B,0000000000000OOOOOOOB, 00790 400000000000325000325B,00000000000325325325B,00000000000000000325B, 00800 5oooooooooooooooooooob,oooooooooooooooooooob,oooooooooooooooooooob, 00810 6000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,00000000000000000000B, 00820 700000000000000000000B,000 000000003300OOOOOB,0000000000000000033OB, 00830 800000000000000000000B,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 00840 900 0000000000000000OOB,00000000 0000000000OOB, 00850 1000000000000000000OOB/ 00860 DATA ((TABLE (I „J) , J=1,9) ,1=25,30)/ 00870 100000344344000000344.8,00344.000 000344344344B, 00344344000000000344B, 008 80 2000000000000000000OOB,000000000000OOOO000OB,00000000000000000000B, 00890 3000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 00900 4000003453450000003458,00345000000345345345B,00345345000000000345B, 00910 500000000000000000 0OOB,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 00.920 6000000 000000000000OOB, OOOOOOOOOOOOOOOOOOOOB, OOOOOOOOOOOOOOOOOOOOB, 00930 700000346346000000346B, 0034600000 0346346346B, 00.346346000000000346B, 00940 8000000000000000000OOB,0000000000000000000OB,OOOOOOOOOOOOOOOOOOOOB, 009 50 9000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 009 60 100000 347.347 000 0003 478,0034 7000 00 03473473478,0034734 7000 00 0000347B, 00970 2000000000000000000OOB,000000000000000OOOOOB,OOOOOOOOOOOOOOOOOOOOB, 00980. 30000000000 00000000008,000000000000000000OOB, OOOOOOOOOOOOOOOOOOOOB, 00990 400000350350000000350B,00350000000350350350B,00350350000000000350B, 01000 5000000000000000000OOB,0000000000000000000OB,OOOOOOOOOOOOOOOOOOOOB, 01010 6000000000000000000OOB,000000000000000OOOOOB,OOOOOOOOOOOOOOOOOOOOB, 01020 700000351351 000000351.8,0035100000035135135IB, 0035135100000000035 IB, 01030 8000000000000000000008,000000000000000000008,00000000000000000OOOB, 01040 9000000000000000000008,000000000000000OOOOOB, 01050 1000000000000000000OOB/ 01060 DATA ( (TABLE (I, J) ,J=1,9) ,1=31,36)/ 01070 100000353353000000353B, 00353000000353353353B, 003533.5300 0000000353B, 01080 20000000000 0000000OOOBy0000000000000000000OB,00000000000000000000B, 01090 300 0000000000000000OOB,000OOOOOOOOOOOOOOOOOB,0 0000000000000000000B, 01100 40000000000 00000000OOB,000000000000000000OOB,0036336300000000000OB, oiiio 5oooooooooooooooooooob ,oooooooooooooooooooob ,oooooooooooooooooooob , 01120 600000000000000000000B,0000000000000000000OB,0000000000000000000OB, 01130 7000000000000000060OOB,0000000000000000000OB,0000000000000OOOOOOOB, 01140 * 8000000000000000000008,0000000000000000000OB,00000000000000000OOOB, 01 150 900 0000000000000000OOB,0000000000000000000 OB,00000000000000000OOOB, 01160 100000000000000OOOOOOB,000000000000000000008,000003640000000000008, 01170 200 0000000000000000OOB,0000000000000OOOOOOOB,00000000000000000OOOB, 01180 3000000000000000000OOB,000000000000000OOOOOB,000000000000 00000OOOB, 01190 40000000000000OOOOOOOB,0000000000OOOOOOOOOOB,000003660000OOOOOOOOB, 01200 5000000000000000000OOB,0000000000000000000OB,00000000000000000OOOB, 01210 60 00000000000000000OOB,0000000000000000000OB,00000000000000000OOOB, 01220 7000000000000000000OOB,000000000140000000OOB,000000OOOOOOOOOOOOOOB, 01230 800000000000105000000B,000000000000000000OOB,00000000000000000OOOB, 01240 9O0000Q00000000O00OO0B,001420O0O00000O0OO00B, 01250 1000000000000000000008/ 01260 DATA ( (TABLE (1,J) ,J=1,9) ,1=37 ,42)/ 01270 10 0001000 0000000000008,000000130230000 00000B,00000000064065066OOOB, 01280 20000 00720001071101118,001121130000000000006,00000121000123000OOOB, 01290 30 0000000000000000OOOB,0000000015500OOOOOOOB,00000000000000000OOOB, 01300 4000000000000000000OOB,0000000000OOOOOOOOOOB,0000000000000OOOOOOOB, 01310 5000OUU760000000000OOB,0000000000000000000OB,000000000000000000OOB, 01320 600 0000000000000000OOB,000000000000000000OOB,00000000000000000OOOB, 01330 7000000000000000000008,0000000001400000000OB,0000000000000OOOOOOOB, 013 40 800000000000105000OOOB,0000000000000000000OB,00000000000000000OOOB, 013 50 9000000000000000000OOB,001410000000OOOOOOOOB,OOOOQOOOOOOOOOOOOOOOB, 01360 1000010000000000000OOB,000000130230000OOOOOB,000000000 64065066OOOB, 01370 2000000720001071101 11B, 00 112.1130000000 OOOOOB, 00000121000123OOOOOOB, 013 80 3000000000000000000OOB,000000001560000000OOB,00000000000000000OOOB, 01390 4000000000000000000OOB,000000000140000000OOB,000000OOOOOOOOOOOOOOB, 01400 50 00710000001050000OOB,000000000000000000OOB,000000000000OOOOOOOOB, 01410 6 000000 000 000000001378,001401440000OOOOOOOOB,0000020200000OOOOOOOB, 01420 7000000000000000000OOB,0000000000000 00000OOB,00000000000000000OOOB, 01430 8000000750000000000OOB,OOOOQOOOOOOOOOOOOOOOB,00000000000000000000B, )

01440 .9000000000000000000006,000000000000000000003/ 014 50 10 00000 000000000000 006/ 01460 DATA ({TABLE (I, J) ,J=1/9) ,1=43 ,48)/ 01470 1000010 00000000000 0006,000000130230000 000006,00000000064 065066 0006, 01480 20000007200 01071101 116,001121130000000000006, 0000012100012.30000006, 01490 30000000000 0000000000.6,0000000 0166 0000 000006,000000000000000000006, 01500 4000000 000000000000006,000000 00 0000000000006,000000000000000000006, 01510 500 0000001030000000 006,000000 000000000000006,0000000000000 03010006, 01520 6000000000000000000006,00000000 00000 00000006,000000000000000000006, 01530 7000000 000000000000 006,0000000 0 0140000000006,0000000000000 0000000 6, 01540 80 0071000 00 01050000006,0000 000 00000000 000006,00000000000000000 0006, 01550 9000000 000000001351366,001401440000000000006,00 0002 03 0000000000006, 01560 1000000000000000000 006,000000000000 000000006,00 00000000000 00000006, 01570 20 0 0000003100000000006,000000000000 000 003106,0 00 000000000000000006, 01580 . 3 0000000000 00000000 006,000000 00 00000.00000006,00 00000000000 00000006, 01590 4000000000000000000 008,000000 00 00000 00000008,00 0000000000000000006, 01.600 500 0000 003110000000008,0000000000000000031.16,0 00000 0000000 00000006, 01610 6000000 000000000000008,000000000000000 000006,000000 00000000000000 6, 01620 70000000000 00000000006,000000000000 000 000008,000000000000000000008, 01630 800000000314000000000.8, 000000000000000003146,000000000000000000006, 01640 900000000000000 0000006,0000000 00000000000006, 016 50 1000 00000 00 00000000 006/ 01660 DATA ( (TABLE (I ,J) ,J= 1 ,9) ,1=49,54}/ 01670 10000000000000 00000 008,000000 0000 00000000008,00 00000000000 0000 000 6, 01680 200 00000 0315000 0000 005,000000 00 00 00000 003158,0 031500000000 00000008, 016 90 300 0000000000000000006,0 00 000 00 00 000 00 000008,00 0000 000 0000 0000000 6, 01700 400 0000000000000000006,000 000 000000000000006,00 0000000000000000006, 01710 500 0000 003160000000 005,000 00000 0000000003168,000000000000000000006, 01720 . 6000000 000000000000005,0000000 0 00000000000 06,000000 000000000000006, 017 30 7000000000000000000006,000000000000000000006,000000000000000000006, 01740 800 0000 000 0 00000000006,000 000 00 0 0000000000 06,0 036200 00 000 00000 0006, 017 50 900 0000 00000000000000 6,000 00000 00 00000000006,00 00 00 00000000000 000 8, 01760 10 00010000000000000006,000 00013 0230000 000008, 0000000 006406.50660006, 01770 2000000720001071101 116,001121130000000000006,000001210001.23 0000006,

01780 300000 00000000 00000008,000 0000 01620 000 000006,0000000000000 0000 0006, 100 017.90 . 4000010000000000000006, 000000 13 0230 000 000006, 00000000064 0000000006, '02160 100000000000000000000B»00000000 0000000000008,00000365000000000000B, 02170 200 0000000000000000008,000000 0000000 000000 08,00 0000 000 0000 0000000 8, 02180 30 0000 000000000000000B,000000 000000000000008,00 0000000000000000008, 02190 4000000000000000000 008,0000000000 00 430460 008,00 000000000000000000 8, 02200 500 0000 0000 00000000 008,0000 00 000000000000008,0000000000000 0000 0008, 02210 60 00000 00000000 0000 008,000 00000 0000000000008,00 000000000000000000 8, 0 2220 7000000 000000000000 008,0000000 0.3130000000008,00 00000000000 0000 0008, 02230 80 0313 00000 0.3130000 008, 00000000000 1151 16000B, 000000001220000000008, 02240 9000000001301330000008,000000000000000000008, 02250 1000000000000000000008/ 02260 DATA . ((TABLE(I,J) ,J=1,9) ,1=67,72)/ 02270 100000 0000000000000 008,0000000 031300 000000 08,000000 0000000 0000 0008, 022 80 20 0313000000313 00000 08,000000000001151160 008,00 0000 00122000000000B, 022 90 30 0 000 0001.311330000 008,0 000000 000 000000000 08,000000000 0000 0000 0008, .023 00 40 0000 00000 00000000 008,0000000 03130000 00000.8,0000000000000 0000 0008, 02310 500313 0000003130000008,0000000000011511600 0B,000000 0 01220000000008, 02320 6000000 00132133000 0 008,000 000000000000000008,000000 0000000 00000008, 02330 700 0000 00000 3260003268,000 000000003263263268,000000 00000000000326 8, 023 40 80.00000 000000000000008,000000 000000000000008,000000 000000000000008, 023 50 90000000000 00000000008,000000 0000000 00000008,00000000000000000000 8, 02360 10000000000 000 00000 008,0000 000 002200.00 000008,000000000000000000008, 02370 20000 000 000 00000000 008,000000000000000000 008,0000000 00000000000008, 02380 30 0 0000 000000000000008,000 000000000000000008,0000000000000 00000008, 023 90 40000 03 5435400 00003548,0035400 00003543543548,00354354 0000000003548, 02400 50 00000000000000000008,000 000000000000.000008,000000000 000000000008, 02410 600000000000000 0000008,0 00 000 0000000000000 08,000000000 000000000008, 0 24 20 7000000000000000000008,000 0000 001700000000 08,000000000000000000008, 02430 8000000000000000000008,000000000000000000008,000000000000000000008, 02 440 900000000000000 0000 008,0 00 000 000000000000008, 02450 1000000000000000000008/ 02460 DATA ( (TABLE (I,J) , J= 1,9) ,1=73 ,78)/ 02470 100 00000000 0000 000000 8,000 0000 0 0200000 0000 08,000 000000 00000000 000 8, 024 80 200000 0 0000 0000 0000 008,000000000000000 0000 08,000000000 00000000 0008, 02490 300 0000000000000000 008,00 00 00 0000 00 0000000 08,00 0000 0000000 0000 000 8, 02500 40000000000000 00000 008,00000000016 0000000008,000000000000000000008, 02510 5000000000000000000008,000000000000000000008,000000000000000000008, 02520 6000000 0000 000 0 0000 006,0000000 00000 000 000 00.8,00 0000 0000000 0000 000B, 02530 7000010000000000000OOB,00000013 023 0 000OOOOOB,00000000064 0650660008, 025 40 8000000720001071101118,001121130000000000008,00000121000123000000B, 02550 9000000000000000000OOB,000000001630000000008,000000000 00000000 000 8, 02560 1000000000000000000008,0000000 00240000 000008,0000000000000 00000008, 02570 200 00 0000000000 0000008,000 0000 000000000000 08,0000000000000 0000 0008, 02580 3 0000000000000 00000008,000 000 0000 00 0000000 08,000000000000000000008, 02 590 400 00000000000 00000 008,000000000000 000000008,0000005700000 0000000B, 02600 5000000000000000000008,0000000 000000 00000008,000 000000000000000008, 02610 600000000000000000000B,000000000000000000008,000000000000000000008, 02620 700 000000 00 00000000008,0000000 0312 0000 000008,000000 0000000 00000008, 02630 877031"ZCTOOUUO312UU00UOB,UUUOWUOUUUUUOUOOWOB/O0 0000 00000000000000 8, 02640 9000000000000000000008,00000000000000000000b , 02650 1000000000000000000008/ 02660 DATA { (TABLE (I, J) , J= 1,9) ,1=7 9 , 84) / 02670 10 000 00 000000000000OOB,0 00000000000000000008,000000 00000000000000 8, 0 26 80 2000000 000000000000008,0000000 01140000000008,0000000000000OOOOOOOB, 026 90 3000000000000000000OOB,000000000000Q000P200B,00201000000000000000B, 0 2700 4000000000000000000OOB,000000000000000000008,000000540000000000008, 02710 500 0 000000000000000 00B,0000000 00000000000008,000000000000000000008, 02720 6001261270000000000OOB,000000000000000000008,00 0000 0000000 00000008, 02730 7000000000000000000 008,000000000210000 0000 0B,000000000 0000 0000000B, 027 40 80 0000 00000 00000000008,00000000 00000 000000 08,00 000000 000000000 0008, 027 50 900 0000 000000000000 008,000 000000000000000 0 08,0000000000 000000000OB, 02760 1000000 000000000000 008,000000 0000000000000 08,000000560 000000000008, 02770 2000000000000000000 00B,000000 000000 000 000008,000000 000 00000000000 8, 027 80 30 0 000000000000000 0008,000000 0000000000000 08,0000000000000 0000 0008, 027 90 400000000000000000000B,000000000000000000008,000000000000000000008, 028 00 500000000000106 0000 008,000000000000000000008,000000 00000000000 0008, 02810 600 00000000000 00000 00B,0000000 00000 000000008,000000000000000000008, 028 20 7000000 00000000000000B,000000 000000000000008,00 0000000000000000008, 028 30 80 00000001020000000 008,000 000 000000000000008,00 00 0000000000000000 8, 028 40 90 01251270000000000008,000000000000000000008, 02850 1000000000000000000008/

02860 DATA ( (TABLE (I, J) , J= 1, .9) , 1=85 , 9 0) / 103 02870 10 00000000000000000 008,000 000 00 00 000000000 08,00 000000000000000000 8, 028 80 200 000000000 0000000008,000000000000000000008,00120000000000000000B, 02890 30 000 00 0000 0000 0000 00 8,0 00000000000 0 000000 08,000000 00000000000000 8, 029 00 40000000 000 000 00000 008,0000 000 00 000000 000008,0000000000000 00000008, 02910 50 00000 000000000000008,000 000 0000 00 000000008,00303 0000 00000000000 8, 02920 6000000000000000000 008,000000000000000 000008,000000000 00000000 0008, 02930 70000000000 00000000 00 8,000 000000000000000 008,000000 00000 00 0000 000 8, •. 029 40 800000 0001040000000008,00000000 0000000001178,0000000000000 00000008, 029 50 90000000000 00000000 008,0000000 00000000000008,000000000000000000008, 02960 10000000000OOOOOOOOOOb ; 000000000000-000:0.00008,000000000000000000008, 02970 200 000 000304000 0000008,000000000000000003048,000000000000000000008, 029 80 3 000000000000000000008,0000 000000000 00000008,00 00000000000000000 08, 02990 4000000000000000000008,000000000000000000008,000000000000000000008, 03000 50 0000 0003050000000008,00000000 0000000003058,0 00000000 0000 0000 0008, 03010 6000000000000000000 00B,000000000000000000008,0000 00 0000000 00000008, 030 20 70000000000 00000000008,00000000 0000000000008,000000000 0000 0000 0008, 03030 80 00 00000306 0000000008,0000000000 0000 0003068,000000 0000000 00000008, 03040 9000000000000000000008,000000000000000000008, 03050 1000000000000000000008/ 03060 DATA ( (TABLE (I, J) » J= 1, 9) , 1=9 1,96) / 03070 100 00000000 00000000 008,0000000 00140000000008,0000 000000000 0000000 8, 03080 20 00710000001050000 008,000 000000000000000008,000000 0000000 0000 0008, 030 90 30 0000 0000 000001341368,001401440000 000000008,00 0002 03 00000 00000008, 03100 40 0000 0 000000 00 0000 008,0000 000 000000 00 000 0 08,000000000 0000 0000 0008, 03110 50 0000 0003070000000 008,000000 000000000003078,00000000000000000 0008, 03120 60 0000000000 000 0000 008,000 000 0000000000000 08,000000 0000000 00000008, 03130 70000000000 00000000 008,000000OOOOOOQOOOOOOOB,00000000000000000000B, 03140 8000000000000000000008,000000000000000000008,00361000000000000 0008, 03150 9000000000000000000008,000000000000000000008,000000000000000000008, 03160 100000000000 0000000008,000000 000000000000008,000510610000000000008, 03170 20000 00 00000 0000000008,000000 0000 00000000008,0000 000000000 00000008, 03180 30000000000 00000000 008,000000 0000000 00000008,0000000000000 0000 0008, 03190 4000000000000000000008,000000000000000000008,003223220000000000008, 03200 500 0 000 0000 00000000008,00000000 0000000000 008,000000 0000000 00000008, 03210 60 00000000000000000008,000000000000000000008,00000000000000000 0008, 03220 7000000000000050000078,0000000000000 00 4404 78,00000000000000000 0678, 03230 80000000000 00000000 00B,000000000000000000008,000000000000000000008, 03240 900000000000000000000B» 00000000000000000000B, 03250 1000000000000000000OOB/ 03.260 DATA { (TABLE fl ,J) ,J=1 ,9) , 1=97, 102) / 03270 1 00000000000323000323B, 000 000000003230 4 4323B,0 0000000000000000323.B,. 03280 2000000000000000000008,000000000000000000008,000000000000000000008, 03290 30000000OOTTOOWOOOOBOB,"00000000000GO00000.000,000000000000000000003“~" 03300 400000000000324000324B,00000000000324324324B,00000000000000000324B, 0:3310 5oooooooooooooooooooob,oooooooooooooooooooob,oooooooooooooooooooob, 03320 6000000000000000000003,000000000000000000OOB,00000000000000000OOOB, 033 30 7000000000000000000076,00000000000027044047B,0000000000000000000OB, 033 40 800000000000000OOOOOOB,0000000000000000000OB,0000000000000000000OB, 03350 9000000000000000000OOB,0000000000000000000OB,OOOOOOOOOOOOOOOOOOOOB, 03360 1000000000000000000OOB,.0000000000000000000OB,0000000000000000007OB, 03370 2000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,00000000000000000OOOB, 03380 .300000 0000000000000OOB,0000000 00000000000008,00000000000000000OOOB, 033 90 4000000000000000000OOB,000 000 000 0003OOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 03400 50 00 000.0000000 0 0000 OOB, 000 000 0000 00 000000 OOB, 00 0000000 0000 OOOOOOOB, 03 410 6000000000000000000008,000000000000000000008,00000000000000000OOOB, 03420 700000003 004 0000000108,0001 10000000000450508,00.317.317000000000000B, 03430 8000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 03440 9000000000000000000OOB,0000000000odooo00000B, 034.50 10OOOOOOOOOOOOOOOOOOOB/ j 03460 DATA ( (TABLE (I, J)., J= 1, 9) ,1=103,10d) / 03470 10 00000030040000 000108,0 001 1000000d'0Q045050B, 003203.2OOOOOOOOOOOOOB, 03 480 20000000000000OOOOOOOB,000000ooooododoo00OOB,00000000000000000OOOB,, 03490 3000000000000000000008,000000000000080000008,OOOOOOOOOOOOOOOOOOOOB, 03500 4000000030040000000108,0 001 10000OOO'O004505OB, 00321321.000000000OOOB, 03510 5000000000000000000OOB,000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB, 03520 6000000000000000000008,0000000000000000000OB,0000000000000000000OB, 03530 700000003004 0000000108,0001100000032704505OB,00000000000000000327B, 03540 8000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,00000000000000000OOOB, 03550 9000000000000000000OOB,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB, 03560 10000033133100000033IB,0033100000033133133 IB,0 033133100000000033IB, 0357,0 200000000000000000000B,OOOOOOOOOOOOOOOOOOOOB,OOOOOOOOOOOOOOOOOOOOB,

03580 3000000000000000000OOB,0000000000000000000OB,00000000000000000OOOB, , 105 03590 400 000003332000000332B,00332000000332332332B,00332332000000000332B, ,036 00 SOOOOOOOOOOOOOOOOOOOOBfOOOOOOOOOOOOOOOOOOOOBfOOOOOOOOOOOOOOOOOOOOBp 03610 6000000000000000000 008,0000 0000000 0,0000000OB, 00000000000000000OOOB, 036 20 700000003004000000333B,00333000000333333333B,00333333000000000333B, 03630 800 000000000000000OOOB,000000000000000OOOOOB,00000000000000000OOOB, 03640 9000000000000000000008,00000000000000000000B, 03650 10000000000OOOO000OOOB/ 03660 DATA ( {TABLE {I, J) , J= 1 ,9) , 1=109, 114) / 03670 100000003004000000334B,000U000000334334334B,00334334000000000334B, 03680 2000000000000000000OOB,0000000000000000000OB,0000000000000OOOOOOOB, 036 90 3000000000000000000OOB,0000000000000 00000OOB,0000000000000OOOOOOOB, 03700 40000 00030040000003358,0 00110000003350453356,00335335000000000335B, 03710 5000000000000000000OOB,000000000000000000OOB,0000000000000OOOOOOOB, 03720 6000000000000000000OOB,0000000 000000000000 OB,00000000000000000OOOB, 03730 7000000030040000000OOB,00011000000336045050B,0033633600000OOOOOOOB, 037 40 8000000000000000000OOB,0000000000000000000OB,0000000000000000000OB, 03750 90000000000 0000000OOOB,0000000000000000000OB,0000000000000OOOOOOOB, 03760 100000337337000000337B,00337000000337337337B,00337337000000000337B, 03770 20000000000 0000000000B,000000000000000000008,00000000000000000OOOB, 0 3780 3000000000000000000OOB,000000000000OOOOOOOOB,00000000000000000OOOB, 03790 400 0000033400000003408,003-4000000034034034OB, 00340340000000000340B, 03800 500 0000000000000000OOB,0 00000000000000000OOB,0000000000000OOOOOOOB, 03810 600000000000000000000B,0000000000000000000OB,00000000000000000OOOB, 038 20 7000003413410000003418,0034100000034134 134IB,003413410 00000000 34 IB, 03830 8000000 000000000000OOB,0000000000000000 000OB,00000000000000000OOOB, 03840 90O00O0OOOOO0O0O000O0B,OOOOO0 00OOO0000 00000B, 03850 1000000000000000000OOB/ 03860 DATA ((TABLE (I, J) ,0=1,9) ,1=115, 120)/ 038 70 1000003423420000003428,003420000003423423428,00342342000000000342B, 03880 2000000000000000000OOB,0000000000000000000 OB,0000000000000OOOOOOOB, 038 90 300000000000 000000000B,0000000000000000000OB,0000000000000OOOOOOOB, 03900 400000003 004 0000000108,00011000000037045050B,0000000000000OOOOOOOB, 03910 5000000000000000000OOB,000000000000000 000008,000000000000000000008, 03920 6000000000000000000 008,000000 0000 00000000008,00000000000000000OOOB, 03930 700 0000030040000000106,00011000000355045050B,00355000000000000000B,

03940 800 0000000000000000OOB,0000000000000000000OB,OOOOOOOOOOOOOOOOOOOOB, 106 ( m s o yuouuu OOOOOOOUOOUOUOUB„ oooooooooooooooooooob , ooooooooooooooooo o o o b , 03.9 60 100000003004000000010B# 0001100000035604505 0B» 00356000000000000000B» 03970 20 0 0000 00000 0000000008,000000 000000000000005,00000000000000000 000 6, 03980 3000000000000000000005,000000000000000000008,00000000000000000OOOB, 039 90 400000003 0040000000108,000110000O0041045000B,0000O0000O0000000000B, 04000 50 0 OOOOOOOOOOOOOOOOOOB, 000 000 000000 000 00000.8,00 00000000000 0000 OOOB, 04010 60 0 0000000000000000 00B,000000000000000000008,0 00000000000000000008, 040 20 7000000 000000000000008,000000000000320000008,00053000000000000 0008, 04030 8000000 0000000 00000 008,000000000000000000008,00 0000000000000000008, 04040 9000000000000000000008,000000000000000000008, 04050 1000000000000000000008/ 04060 DATA . (

04290 3000000000000000000 008,00 0000 0 00000000000008,000000000000000000005, 107 04300 400000000000000000090B,0 00000000000000000005,00OOOOOOOOOOOOOOOOOOB, 04310 5000000000000000000008,000000000000000000008,003020 00000000000000B, 04320 60 00000 0000 00000000008,000 0000 00000000000008,00000 0 0000000 0000 0008, 04330 70 00000000000000000 00B,0000 000 0 0000000000008,00055063 00000 00000008, 043 40 80000000000 00000000 008,0000 000 00000000 000008,000000 000 000000000008, 043 50 9000000000000000000008,000000000000000000008,000000000000000000008, 04360 100000 0000000000000008,000000000000000000008,0000006000000 00000008, 043 70 20000 000000 00000000 00B,000000000000000 0000 08,000000000 0000 00000008, 04380 3000000000000000000008,000000000000000000008,000000000000000000008, 04390 4 0000000000 00000000 00B,0000000 00000000000008,00000062 000000000000 8, 04400 . 5000000000000000000008,000000000000000000008,000000000000000000008, 04410 60000000000 00000000 008,0000 00 000000000000008, 04420 7000000000000000000008/ 04430 DATA EPW/6/ 04440 DATA BPE/9/ 04450 DATA BPM/60/ 04460 * THE ABOVE ARE USED FOB PACKING THE ENTRIES (FOR 60 BIT MACHINE) 04470 * EPW=ENTRY PER WORD 04480 * BPE=BITS PER ENTRY 04490 * BPW=BITS PER WORD 04500 * FIND THE RIGHT PACKEDWORD,UNPACK IT AND RETURN THE CORRECT ENTRY 04510 * -FOR THE VALUE OF NSA(NEXT SYNTAX ACTION) 04520 COL=(NSE+(EPW-1))/EP8 04530 * PISPE-= PLACE IN SIX-PACKED ENTRY 04540 PISPE=NSE-(EPW* (COL-1).) 04550 * NOBS= NUMBER OF BIT SHIFTS 04560 NOBS=BPE* (EPW-P.ISPE) 04570 * SSPE=SHIFTED SIX-PACKED ENTRY 04580 TOS=STACK 1(1) 04590 SSPE=SHIFT (TABLE (TOS,COL) , (BPW-NOBS) ) 04600 HASK1=SHIFT(HASK(BPE),BPE) 04610 NSA=MASK1»ANDo'SSPE ...... 04620 RETURN 04630 END . 108 00010 SUBROUTINE SCANNER (TOKEN, SOB) 00020 ; * SCANNER: THIS ROUTINE DETECTS All CHARACTERS THAT CAN APPEAR 00030 * IN AHPL, AND PASSES A TOKEN FOR EACH DETECED CHARACTER FOR NUMBERS & 00040 * SYMBOLS,A SUBTOKEN IS ALSO GENERATED WHICH REPRESE.NTES THE VALUE OF A 00050 * NUMBER OR THE NAME OF SYMBOL. 00060 * CONVERT ALL FORTRAN CHARACTERS TO INTERGERS 00070 IMPLICIT INTEGER (A-Y) 00080 DIMENSION CARD (8) 00090 COMMON/SHARE/ TABLE(131,9),SDT(201,5),LRT(51,8),NEWSPT(58), 00100 1 NOPU (54) , FLHS(54) ,XLATE(63) ,CHAR (80) ,DUMMY (3) ,STACK1 (50) , 001 10 2 KWT (32) 00120 * THE MODULE NUMBER IS IN COMMON BETWEEN SCANNER AND SEMANTICS 00130 COMMON/MODNUM/ N 00140 * THE NUMBER OF BITS PER WORD IN CDC-6400 IS 60 SO; 00150 DATA BPW/60/ 00160 * EACH CHARACTER OCCUPIES 6 BITS SO: 00170 DATA BPC/6/ 00180 * AHPL READS ALL 80 COLUMS IN A CARD , CHARACTERS PER CARD IS 80 00190 DATA CPC/80/ 00200 * THEREFORE EACH CARD OCCUPIES 8 WORDS OF CDC,WORD PER CARD IS 8,SO: 00210 DATA HPC/8/ 00220 * A MUXIMUM OF 10 CHARACTERS CAN BE PLACED IN EACH CDC-WORD SO: 00230 DATA CPW/10/ 00240 * A MAXIMUM OF 16 DIGIT NUMBER CAN BE PLACED IN EACH CDC-WORD SO: 00250 DATA DPH/16/ 00260 * IN CDC ZERO IS REPRESENTED AS 27,CDC ZERO CHARACTER IS 27, SO; 00270 DATA CZC/27/ 00280 * NUMBER OF CHARACTERS THAT THE SCANNER WILL IGNORE,AFTER THE FIRST 10 00290 DATA NCI/10/ 00300 * ARRAY CHAR IS WHERE ALL THE CHARACTERS READ FROM A CARD WILL BE. 00310 DATA CHAR/80*0/ 00320 * THE FOLLOWING TWO DATA CARDS ARE INITIALIZATIONS 00330 * PAP STANDS FOR PERIOD ALREADY PASSED 00340 * BSI STANDS FOR BACK.SLASH.IS-IN

00350 DATA PAP/0/ 109 00360 DATA BSI/0/ 00370 00380 * THE FOLLOWING VECTOR TRANSLATES THE ASCII CODE USED IN CDC TO 00390 * SIMULATOR INTERNAL REPRESENTATION. THE SUBSCRIPT OF THIS VECTOR IS AN 00400 * ASCII CODE,AND THE VALUE OF THE VECTOR ITSELF IS THE TRANSLATION 00410 * WHICH IS USED FOR THE SIMULATOR. 00420 DATA XLATE/26*1,10*2,6,30, 12, 11,15,16, 14,8,3 1, 19,22,3, 17, 18,9,2 4 00430 1,3,20,5,3,3,7,10,13,4,23,21/ 00440 * IN AHPL NO CHARACTER HAS INTERNAL REPRESENTATION OF 3 ;IN THE ABOVE 00450 * NUMBER 3 WAS USED FOR ALL ILLIGAL CHARACTERS. 00460 00470 * THE FOLLOWING IS THE INITIALIZATION: 00480 * DAS=DASH ALREADY SENT 0 04.90 * CAL=CHARACTER ARRAY LENGTH 00500 DATA DAS,CAL/0,0/ 00510 * BEFORE ANYTHING IS SCANNED, A DASH IS SENT TO THE PARSER TO INDICATE 00520 * THE START,AND WILL SET DAS TO 1 00530 00540 IF (DAS-.EQ. 1) GO TO 10 00550 DAS=1 00560 TOKEN=30 00570 SUB=0 00580 RETURN 00590 10 CONTINUE 00600 00610 00620 ******************* ************<=******************************* ********* 00630 * THIS PART READS ONE CARD PUTS IT IN AN ARRAY OF 80 WORDS IF ARRAY 00640 * IS EMPTY IT READS ANOTHER CARD. 00650 00660 * CHECK THE ARRAY LENGTH TO SEE IF IT IS ZERO 00670 IF (CAL. NE.O) GO TO 80 00680 * ARRAY IS EMPTY READ A CARD AND FILL THE ARRAY 00690 READ (2,2000) (CARD (I) ,1=1, WPC) 00700 * CHECK IF THE ABOVE CARD WAS AN EOF 007 10 IF ( ( (CARD (1) . AND. 77777777770000000000B) .OR. 007 20 1 00000000005555555555B) . EQ«11 UNIT: ") UNIT=1 00730 IF (EOF (2) ) 20,30 00740 20 TOKEN=30 00750 SOB=0 00760 RETOBN 00770 30 CONTINUE 00780 IF (0N.IToEQ» 0) GO TO 40 00790 CAL=0 00800 GO TO 10 00810 40 IF (CARD (1) <= NEo H AHPLMODOLE*1) GO TO 50 00820 N=N + 1 00830 CALL TIME (Z.TIME) 00840 CALL DATE (ZDATE) 00850 WHITE (5,2010) N,ZDATE,ZTIME 00860 50 WHITE (5,2020) (CARD (I) ,1=1,WPG) 00870 DO 70 1=1,WPC 00880 * BUILD UP A MASK OF 6 BITS TO BE ABLE TO REACH AT ONE CHARACTER 00890 MASK1=MASK(BPC) 00900 DO 60 J=1,CPW 00910 * »AND. THE MASK WITH ONE OF THE EIGHT WORDS THAT THE CARD OCCUPIES 009 20 * THE RESULT GOES INTO.THE-MASKED CDC WOED-SO; 00930 . MCW=CARD (I) „ AND. MASK 1 00940 * RIGHT JUSTIFY THE ABOVE,AND NAME IT;RIGHT JUSTIFIED WORD, 00950 * NUMBER OF PLACES THAT THE WORD IS TO BE SHIFTED=NPS 00960 NPS=J*BPC 00970 RJW=SHIFT(MCW,NPS) 00980 * ONE CHARACTER IS READY SO THE LENGTH OF CAL HAS TO BE INCREMENTED 00990 CAL=CAL+1 01000 * PUT THE RIGHT JUSTIFIED WORD INTO THE ARRAY CHAR(ELEMENT NUMBER CAL) 01010 CHAR (CAL)=RJW 01020 * MAKE UP THE NEW MASK BY SHIFTING THE OLD MASK,60-6=54 TO THE LEFT 01030 MASK1=SHIFT (MASK1,BPW-BPC) 010 40 * CONTINUE THE ABOVE PROCEDURE UNTIL THE ARRAY IS FULL 01050 60 CONTINUE 01060 70 CONTINUE 01070 * CHARACTER SO FAR IS THE NUMBER OF THE CHARACTER CURRENTLY USED 01080 80 CSF=CPC+1-tCAL 01090 * THE CURRENT CHARACTER HAS TO BE TRANSLATED TO AHPL CHARACTER INTERNAL 01100 * REPRENTATION(CIR) 01110 CIR=X1ATE (CHAB (CSE) ) 01120 * IF CIR IS BLANK IGNORE IT AND GET THE NEXT CHARACTER 01130 IP (CIR. NE. 31). GO TO 100 01140 90 CAL=CAL-1 01150 GO TO 10 01160 100 CONTINUE 01170 01180 ************ ************************************************************ 01190 * CHECK IF A COMMENT IS ENCOUNTERED,IF SO GET THE COMMENT CHARACTERS 01200 * AND IGNORE THEM OP TO THE COMMENT DELIMITER. 01210 * THE FOLLOWING WILL DECREMENT THE CAL TO INDICATE THAT THE NEXT CHAR­ 01220 * ACTER IS PULLED OUT OF CHAR.ARRAY. 01230 * CHECK TO SEE IF TOKEN IS EQUAL ,TO CIR,IF NOT CHECK FOR OTHER CHARS 01240 IF (CIR. NE„ 24) GO TO 130 01250 110 ,CAL=CAL- 1 01260 CSF=CPC+1-CAL 01270 CIR=XLATE (CHAR (CSF) ) 01280 * CHECK FOR END-COMMENT 01290 IF (CAL.GT. 1) GO TO 120 01300 CAL=CAL-1 013 10 WRITE (b* 203 U) 01320 GO TO 10 01330 120 CONTINUE 01340 IF (CIR.NE.24) GO TO 110 01350 'GO TO 90 01360 01370 ************ ************************************************************ 01380 01390 130 CONTINUE 01400 * CHECK IF PERIOD IS ALREADY PASSED 01410 IF (PAP. EQ. 1) GO TO 140 01420 * NO PERIOD IS PASSED YET SEE IF THE CARRENT CHARACTER IS A PERIOD

01430 IF (CIR. NE. 22) GO TO 180 112 01440 CA1=CAL-1 01450 TOKEN=22 01460 SUB=0 01470 " PAP=1 01480 RETURN 01490 140 CONTINUE 01500 * A. PERIOD IS ALREADY PASSED SO THE INTEGER FOLLOWING THE PERIOD IS A 01510 * STEP IF A DIGIT IS RECEIVED GO FOR CALCULATING THE NUMBER AND PASSING 01520 * THE STEP TOKEN NUMBER,OTHERWISE GO TO THE REGULAR ROUTINE OF CHECKING 01530 * FOR THE OTHER TOKENS. 01540 IF (CTR.EQ. 2) GO TO 150 01550 PAP=0 01560 GO TO 180 01570 150 CONTINUE 01580 * SNV STANDS FOR STEP NUMBER VALUE 01590 SNV=0 01600 * NSD STANDS FOR NUMBER OF STEP DIGITS 01610 N S D=0 01620 * DECIMAL CALCULATION OF SNV 01630 160 SNV=SNV* 104-CHAR (CSF) -CZC 01640 * THE CURRENT DIGIT IS ADDED TO SNV, GET THE NEXT ONE 01650 CAL=CAL-1 01660 CSF=CPC+1-CAL 01670 CIR=XLATE(CHAR(CSF) ) 01680 * SEE IF WE STILL HAVE ANOTHER DIGIT.IF NOT PASS THE TOKEN FOR STEP AND 01690 - * SET, PAP BACK TO ZERO 01700 IF (CIR = EQ. 2) GO TO 170 01710 PAP=0 , 01720 TOKEN=36 1 01730 SUB=SNV 01740 CAL=CAL—1 01750 RETURN 01760 170 CONTINUE 01770 * ANOTHER DIGIT IS. DETECTED CHECK’ £OR LIMIT 01780 NSD=NSD+1 01790 IF (NSD.LE. DPW) GO TO 160 01800 CAL=CAI-1 113 01810 TOKEN=0 01820., SUB=0 01830 WHITE{5,2040) 01840 RETURN 01850 180 - CONTINUE . 01860 01870 * CHECK IF THE CURRENT CHARACTER IS > / .* <9 $ ( ) [] „ I ; . OR - 01880 IF (CIRvLT- 10 ».OR. CIfi.GZ.23)GO TO 190 01890 CAL=CAL~1 01900 TOKEN=CIR 01910 SUB=0 01920 RETURN 01930 190 CONTINUE 01940 * CHECK FOR THE BACK SLASH (\) 0,1950 , IF (CIR» NE« 4) GO TO .200 01960 BSI=1-BSI 019/0 TOKEN=CIR ' — . . 01980 SUB=0 01990 CAL=CA1-1 02000 RETURN 02010 020 20 * * * * * * * * * 02030 200 CONTINUE 02040 * CHECK FOR & * < = AND : WHICH COULD BE FOLLOWED BY ANOTHER CHARACTER 02050 * TO FORM A DOUBLE CHARACTER TOKEN. 02060 'IF (CIR.LT.5) GO TO 300 02070 02080 *##********************************************************************* 02090 * NOW CHECK AND SEE IF THE CARR ENT CHARACTER IS 6 02100 IF (CIR.NE.5) GO TO 220 02110 * GET THE CHARACTER THAT FOLLOWS & AND SEE IF IT IS / 02120 CAL=CAL—1 02130 CSF=CPC+1-pAL 02140 CIR=XLATE(CHAR(CSF)) 02150 IF (CIR.NE. 11) GO TO 210 02160 TOKEN=25 114 X '02170 S0B = 0 02180 * SINCE THE / SLASH IS DETECTED,HOVE THE POINTER TO THE NEXT CHARACTER 02190 CAL=CAL-1 02200 RETURN 02210 210 CONTINUE 02220 * SINCE NO SLASH IS FOUND THE TOKEN IS ONLY O DO NOT HOVE THE POINTER 02230 TOKEN=5 02240 SUB=0 , 02250 RETURN 02260 220 CONTINUE 02270 02280 ************************************************************************ 02290 .* CHECK FOR + AND GO THROUGH APROCEDURE SAME ABOVE 02300 IF (CIS.NE.6) GO TO 240 02310 CAL=CAL— 1 02320 CSF=CPC+1-CAL 02330 CIR=XLATE(CHAR(CSF)) 02340 * CHECK FOR SLASH 02350 IF (CIR= NE„ 11) GO TO 230 023 60 TOKEN=26 02370 SUB=0 023 80 MOVE THE POINTER 02390 CAL=CAL-1 02400 RETURN 024 10 230 CONTINUE 02420 * SLASH IS NOT FOUND THE TOKEN IS ONLY + 02430 TOKEN=6 02440 SUB=0 02450 RETURN 02460 240 CONTINUE 02470 02480 **************** ******** ******************** **************************** 02490 * CHECK FOR < 02500 IF (CIR= NE» 7) GO TO 260

02510 * GET THE NEXT CHARACTER TO SEE WHAT IT IS 115 02520 CAL=CAL-1 , 02530 CSF=CPC-M-CAL 02540 CIR=XLA'f E TO FORM => 02770 IF (CIR-NE, 10) GO TO 270 027 80 * THE RIGHT ANGULAR BRACKET IS FOUND RETURN TOKEN AND MOVE POINTER 02790 TOKEN=28 02800 SUB=0 02810 CAL=CAL-1 02820 RETURN 02830 270 CONTINUE 02840 * RIGHT ANGULAR BRACKET IS NOT FOUND TOKEN IS EQUAL SIGN ONLY. 02850 TOKEN=8 02860 SUB=0

028J0 RETURN 116 02880 280 CONTINUE 02890 029 00 02910 * AT THIS POINT COLON IS THE ONLY REMAINING CHARACTER. 02920 * MOVE THE POINTER TO SEE WHAT FOLLOWS IT. 02930 CAL=CAL-1 02940 CSF=CPCM-CAL 02950 CIR=XLATE(CHAR(CSF)) 02960 * .DOES ANOTHER COLON FOLLOWS THE ALREADY DETECTED COIGN? 02970 IF (CIR.NE.9) GO TO .290 02980 * ANOTHER COLON FOLLOWS THE FIRST COLON PASS THE TOKEN FOR :s 029 90 TOKEN=29 03000 SU.B=0 03010 CAL=CAL-1 . ' 03020 RETURN 03030 290 CONTINUE 03040 * NO MORE COLON WAS FOUND 03050 TOKEN=,9 03060 SUB=0 03070 RETURN 03080 300i CONTINUE 030 90 03100 03110 03120 03130 03140 03150 * AT THIS STAGE WE KNOW THAT VALUE OF CIR IS LESS THAN 5,50 THE 03160 * CHARACTER IS EITHER A LETTER OR A DIGIT OR AN ILLIGAL CHARACTER. 03170 * CHECK FOR LETTER 03180 IF (CIR.NE. 1) GO TO 380 03190 * CHARACTER IS A LETTER>SET THE ID.SO.FAR TO ZERO 03200 ISF=0 03210 > TWENTY CHARACTERS ARE ALLOWED FOR EACH SYMBOL,10 WILL BE IGNORED 03220 DO .350 1=1, CPW 03230 ❖ SHIFT THE CURRENT LETTER AND PLACE IT NEXT TO THE LAST SCANNED LETTER 03240 * IN THE 60 BIT WORD. FIRST FIND THE NUMBER OF.SHIFTS FOR.LETTER(NSL) 03250 NSL=BPC*(CPH-I) 03260 * LEFT JUSTIFY THE LETTER 03270 LJL= SHIFT (CHAR (CSF) , NSL) ■032 80 * .OR* THE LEFT JUSTIFIED LETTER WITH WHAT 1SF 03390' . I5f=lSF.OR.lJL ...... " ' ' 033 00 * GET THE NEXT CHARACTER 03310 CAL=CAL-1 . 03320 CSF=CPC+1-CAL 03330 CIR=XLATE (CHAR (CSF) )., 03340 * IS THE NEXT CHARACTER A LETTER OR A DIGIT? 03350 IF (CIR. EQ». 1. OR. CIR. EQ= 2) GO TO 320 03360 * WE DO NOT HAVE ANY CONTINUATION FOR THE ID. SEE IF ITS LENGTH IS 10 033 70 IF(I.GE,10) GO TO 360 03380 * OUR ID DOES NOT HAVE 10 CHARACTERS YET,FILL THE REST WITH BLANKS 03390 * THE LOOP LIMIT IS 10-1, NUMBER OF,BLANK,FILLS=NBF 03400 NBF=CPB~I 03410 DO 310 J= 1 NBF 03420 * BLANK.CHARACTER.CODE IS 31 03430 BCC=55B 03440 * SHIFT THE BLANK CHARACTER 6* (10-I-J) PLACES TO THE LEFT 03450 * NUMBER OF. BLANK. SHIFTS=NBS 03460 NBS=BPC* (CPW-I-J) 03470 SBC=SHIFT (BCC/NBS) 03480 * .OR. THE ABOVE WITH ISP TO .FORM THE BLANK FILLED ID 03490 ISF=ISF, OR. SBC • 03500 310 CONTINUE 03510 GO TO 360 03520 32 0 CONTINUE 03530 * THE CURRENT CHARACTER IS A LETTER OR DIGIT, AGAIN CHECK 03540 * IF THE LEGTH OF THE ID IS MORE THAN ITS LIMIT, 03550 IF (I.LT.CPW) GO TO 340 03560 * IGNORE THE NEXT TEN CHARACTERS. 03570 * CHARACTER IGNORE COUNT=CIC 03580 CIC= 1

03590 330 CONTINUE 118 03600 * GET THE NEXT CHARACTER 03610 C&L-CAL-1 03620 CSF-CPC+I-CAL 03630 C I R - X M T E (CHA.H (CSF) ) 03640 * IS .THEBE" ANY MORE LETTERS OR DIGITS TO BE IGNORED 0.36 50 IF (CIRo NEo 1 .AND. CIE.NE. 2) GO TO 360 03660 * THE CURRENT CHARACTER HAS TO BE IGNORED 03670 CIC=CIC+1 03680 IP (CIC. LT. 10) GO TO 330 03690 WRITE (5,2050) 03700 TORE N=37 03710 SUB=0 03720 RETURN 03730 340 CONTINUE 03740 350 CONTINUE 03750 * CALL THE KEY-WORD SUBROUTINE TO SEE IF IF THE ID CAN 03760 * BE FOUND THERE. 03770 ,360 CONTINUE 03780 SU.B=.ISF 03790 CALL KEYWORD (ISF,IDN) 03800 * ZERO WILL BE THE VALUE OF IDN IF NOT FOUND IN THE KEY-WORD TABLE 03810 IF (IDN = NE= 0) GO TO 370 03820 T0KEN=37 03830 RETURN 03840 370 CONTINUE. 03850 * SINCE ISF WAS FOUND IN KEY-WORD TABLE, PASS IDN TO THE PARSER WHICH 038 60 * INDICATES THE KIND OF KEY WORD. 03870 TOKEN=IDN 038 80 RETURN 038.90 380 CONTINUE 03900 /039 10 03920 039.30 *******************^**************************************************** 03940 03950 03960 * CHECK IF THE CURRENT CHARACTER IS A DIGIT OR IS IT AN ILLEGAL 03970 * -CHARACTER. 03980 IF (CIR. NE. 2) GO TO 420 03990 * SINCE CIR WAS EQUAL TO TWO THE CURRENT CHARACTER IS AN INTEGER 04000 * INITIALIZE THE VALUE.OF THE.NUMBER AND DIGITS.SO.FAR -TO ZERO 04010 VON=0 04020 DSF=0 04030 390 CONTINUE 04040 * FIND THE DECIMAL VALUE OF ALL DETECTED INTEGERS AND ADD THEM ALL UP. 04050 VON=VON*tO* (CHAR(CSF) -CZC) 04060 * GET THE NEXT CHARACTER 04070 CAL=CAL-1 04080 CSF=CPC+ 1-.CAL 04090 CIR=XLATE(CHAR(CSF)) 04100 * CHECK FOR DIGIT . 041 10 IF{CIR.NE.2) GO TO 400 04120 * INCREMENT THE DIGIT COUNTER 04130 DSF=DSF*1 04140 * CHECK DSF AGAINST THE DIGIT LIMIT 04150 IF (DSF.LE. DPW). GO TO 390 04160 * THE NUMBER OF DIGITS IS GOING ABOVE ITS LIMIT SEND THE ERROR MASSAGE 04170 WRITE {5,2060) 04180 TOKEN=0 04190 308=0 04200 RETURN 04210 400 CONTINUE 04220 * CHECK TO SEE IF THE NUMBER IS SUPPOSED TO BE A BINARY NUMBER 04230 IF(BSI.NE.1) GO TO 410 04240 * THE NUMBER IS BINARY NUMBER CHECK FOR DIGITS OTHER THAN 0 OR 1. 04250 IF (VON. EQ. 1 .OR. VON.EQ.O) GO TO .410 04260 WRITE (5,2070) 04270 T O KE N= 0 04280 5UB=0

04290 RETURN 120 04300 410 CONTINUE 04310 TOKE N=35 04320 SUB=VON 04330 RETURN 043 40 043 50 42 0 CONTINUE 04360 04370 04380 04390 ##*##*&####*a#*#**#**##**###*#*###*#****###*###*#*####*#*#*##*#*###*#### 04400 04410 * CIR HAS NOT EQUA1 TO ANY OF AH.PL CHARACTER CODES,SO ILLEGAL CHARACTER 04420 * HAVE BEEN ENCOUNTERED. GIVE AN ERROR MASSAGE. 04430 HRITE (5,2080) CIR 04440 TOKEN=0 04450 SUB=0 04460 CAL=CAL-1 . 04470 RETURN 04480 2000 FORMAT (8A10) 04490 2010 FORMAT(1H1, 20H AHPL MODULE NUMBER ,15, 9H FOLLOWS;,2QX, 04500 122H DATE: ,A10,21H TIME: ,A10,//) 04510 2020 FORMAT (15X,8A10) 04520 2030 FORMAT (1X,29H$S$$S END-COMMENT IS MISSING ) 04530 2040 ■ FORMAT (1X, 47H$$$$$ STEP NUMBER DIGI.T-LIMIT IS EXCEEDED $$$$$) 04540 2050 FORMAT(IX,36H$$$$$ SYMBOL LIMIT IS EXCEEDED $$$$$) 04550 2060 FORMAT (IX,36H$$$$$ DIGIT LIMIT IS EXCEEDED $$$$$ ) 04560 2070 FORMAT(IX,33H$$$$$ ILLEGAL BINARY DIGIT $$$$$ ) 04570 2080 FORMAT (IX,46H$$$$$ ILLEGAL AHPL CHARACTER WAS SCANNED $$$$$ 04580 113) 04590 END ' 121 00010 SOBSOOTINE KEYF.1X (ISP) 000 20 IMPLICIT INTEGER (A-Z) 00 030 * THIS SUBROUTINE WILL ELIMINATE THE IDENTIFICATION NUMBER LETTER 00040 * -FROM THE FUNCTION NAME, 00050 00060 DATA BLK4/00000055OOOOOOOOOOOOB/ . 00070 * BLK4:BLANK IN THE 4TH PLACE 00080 DATA BLK6/000000000 0550000000OB/ 00090 * BLK6:BLANK IN THE 6TH PLACE 00100 DATA MSK4/77777700777777777777B/ 00110 * M S K 4 M A S K THE 4TH CHARACTER 00120 DATA MSK6/77777777770077777777B/ 00130 * MSK6:MASK THE 6TH CHARACTER 00140 00150 DATA BLK8/0000000000000055000OB/ 00160 DATA MSK8/77777777777777007777B/ 00170 00180 FIXED=OR{BLK8,AND(ISF,MSK8)) 00190 IF (FIXED, NE- ’"COMPARE ”) GO TO 10 00200 IS F=FIXED 00210 GO TO 30 00220 10 CONTINUE 00230 00240 FIXED=OR (BLK6*AND(ISF„MSK6)) 00250 IF ( (FIXED, NE. "BUSFN "), AND, (FIXED. NE. "ASSOC ") } 00260 1 GO TO 20 00270 ISF=FIXED - ' 00280 GO TO 30 •00290 20 CONTINUE ; 00300 FIXED=OR (BLK4 „ AND (ISF-,MSK4)) 00310 IF (FIXED.NE."ADD " . AND, FIXED. NE. "INC " .AND. 00320 1 FIXED.NE."DEC " .AND. FIXED. NE. "PRI " .AND. 00330 2. FIXED.NE,"DCD » ) GO TO 30 ' 00340 " ISF=FIXED ' 00350 30 CONTINUE

00360 RETURN 122 00370 END 00010 SUBROUTINE KEYWORD (ISFfIDN) 00020 * A STRING OF LETTERS AND DIGITS IS BROUGHT INTO THIS SUBROUTINE; THIS 00030 * ROUTINE .WILL CHECK TO SEE IF THE SYMBOL BROUGHT VERSUS ISF IS A 00040 * RESERVED WORD, IF SO THE TOKEN FOR DETECTED KEY-WORD WILL BE .PASSED 00050 * TO THE SCANNER VERSUS IDN; OTHERWISE ZERO WILL GO TO THE SCANNER.FOR 00060 * THE VALUE OF IDN.. 00070 IMPLICIT INTEGER (A-Z). 00080 * KEY. WORD. TABLE CONTAINS 22 ELEMENTS 00090 * NUMBER OF.KEY.WORDS IS 212 00100 COMMON/ESC/ ESC 00110 COMMON/SHARE/ TABLE (131,9) ,SDT.<20 1,5) ,.LET (51,8) ,NEWSPT (58) , 00120 1 NO.PU (54) ,FLHS (54) ,.XLATE(63) ,CHAR (80) ,DUMMY (3) ,STACK1 (50) , 00130 2 KWT (3.2) 00140 DATA NKW/32/ 00150 DATA KWT / "AHPLMODULE","MEMORY ","INPUTS ","OUTPUTS ", 00160 1" BUSES ","LABELS ","ONESHOTS ", ".EXINPUTS ","INC ", 00170 2"ADD ","DCD ","NT ","CONTROLRES","DEADEND ", 00180 3”NODELAY ","ENDSEQUENC","END »,»NDLL ","DEC ", 00190 4"CLUNlTS ","BUSFN ","EXBUSES ","ASSOC "/"COMPARE ", 00200 5"P.RI ","1111111111", "2222222222”,"3333333333","4444444444", 00210 6»5555555555”,"6666 666666","7777777777"/ 00220 00230 * ELIMINATE THE IDENTIFICATION NUMBER OF THE STANDARD FUNCTION 00240 CALL KEYFIX (ISF) 00250 DO 10 J=1,NKW 00260 * CHECK.ISF AGAINST EACH OF THE ABOVE KEY WORDS.IF IT MATCHES ANY 00270 * GO FOR FINDING THE IDN, IF IT DOES NOT .MATCH ONE,CONTINUE THE LOOP 00280 * CHECK THE CURRENT ISF AGAINST THE NEXT WORD. 00290 IF (ISF. NE. KWT (J)) GO TO. 10 00300 IDN=J+37 00310 IF ( (J.EQ. 19) .OS. (J.EQ.25) ) IDN=46 00320 IF ( (J.EQ. 23) .OR. (J.EQ, 24) ) IDN=47 00330 IF (J.EQ. 16) ESC= 1 . 003 40 RETURN

00350 10 CONTINUE 123 00360 * &FTE8 THE SYMBOL IN IS'F IS CHECKED AGAINST ALL KEY WORDS AND DID NOT 00370 * MATCH ANY OF THEM, WE WILL SEND ZERO FOR THE VALUE OF IDN 00380 * TO THE SCANNER TO INDICATE THAT THE SYMBOL IS NOT A KEY WORD, 003 90 IDN=0 00400 RETURN 00410 END 124 00010 SUBROUTINE SIHANG(FSyH,TYPE,BLG,ClG,BLL,BOL,Cll,CUL,CODE,aDC, 00020 1 SSYM,POINTER) 00030 * THIS ROUTINE IS CALLED THE SYMBOL MANAGER .ROUTINE= THE DECLARED 00040 * SYMBOLS ALONG WITH THEIR DEMENSION COME TO THIS ROUTINE AND THEY GET 00050 * LOCATED, WHEN SYMBOLS ARE IN,. A .POINTER IS PASSED TO THE SYMBOL 00060 * PARSER AND THEN TO THE MAIN PARSER,THEREFORE THE MAIN PARSER RECEIVES 00070 * A POINTER FOR EVERY SYMBOL NO MATTER HOW COMPLEX THE SYMBOL IS, THIS 00080 * POINTER POINTSS TO SYMBOL REFERENCE TABLE WHERE ALL THE NECESSARY 00090 * INFORMATION FOR FINDING ALL THE ELEMENTS OF THE SYMBOL IN THE 00100 * (SYMBOL, VALUE, LIST, TABLE) SVLT CAN BE FOUND,. 00110 IMPLICIT INTEGER (A-Z) 00120 COMMON/SYMAN1/ SRT(301,10) 00130 COMMON/SYMAN2/ SRTP 00140 COMMON/SHARE/ TABLE (13 1«, 9) ,SDT(201,5) , LET (51,8) ,NEWSPT(58) , 00150 1 NOPU (54) , FLHS (54) , XL ATE (63) , CHAR (80) „ DUMMY (3) , STACK 1 (50) , 00160 2 KWT (32) 00170 COMMON/SYMAN4/ SDTP 00180 COMMON/B8/ NEP 00190 * SDT= SYMBOL DECLARATION TABLE 00200 * SBT= SYMBOL.REFERENCE TABLE 00210 * LRT= LEBEL REFERENCE TABLE 00220 * SDTP= POINTER TO SDT 00230 * SRTP= POINTER TO .SDT 00240 * LRTP= POINTER TO RLT 00250 * NEP= NEXT,EMPTY,PLACE IN SYMBOL VALUE LIST TABLE 00260 DATA SDTP,SRTP,LRTP,NEP/0,0,0,1/ 00270 * FDCM= FIRST DECLARATION OF THE CURRENT MODULE 00280 * FSCM= FIRST SEQUENCE SYMBOL OF THE CURRENT MODULE 00290 * FLCM= FIRST LABEL OF THE CURRENT MODULE 00300 DATA FDCM,FSC.M,FLCM/1 ,1,1/ 00310 * LSLT= LOCATION OF SYMBOL IN THE LABEL TABLE 00320 * LSRT= LOCATION OF SYMBOL IN THE REFERENCE TABLE 00330 * LSDX= LOCATION OF SYMBOL IN THE DECLARATION. TABLE 00340 * PSI= POINTER TO SYMBOL INFORMATION

00350 COUNT=0 125 00360 * FIRST A CHECK IS DOME TO SEE IF WE HAVE THE POINTER & WE WANT THE 00370. * INFORMATION, OR WE HAVE All THE INFORMATION AND WE WANT TO ASSIGN A 00380 * POINTER TO THE SYMBOL FOR WHICH THE INFORMATION IS BROUGHT IN. 00390 * WE WANT TO ASSIGN POINTER IF THE INCOMING POINTER IS ZERO 004 00 IF (POINTER* EQ, 0) GO TO 10 00410 * AN INTERNAL ERROR HAS OCCURED= 00420 RETURN 004.30 10 CONTINUE 00440 * FIRST CHECK TO SEE IF AN END OF MODULE IS ENCOUNTERED. 00450 IF (CODE,EQ, 4) GO TO 220 00460 IF (TYPE.NE.38) GO TO 20 00470 IF (SDTP. NE. 0) GO TO 220 00480 RETURN 00490 20 CONTINUE 00500 * DIFFERENT DECISIONS ARE MADE ON .BASIS OF CODE,IF THE CODE=1, A LABEL 00510 * IS DECLARED SO PUT ALL THE INFORMATION OF THE DECLARATION IN THE LRT. 00520 IF (CODE. NE. 1) GO TO 60 00530 * FIRST CHECK IF THE LABEL IS DIMENSIONED CORRECTLY 00540 IF ( (RUL-RL1+1) o NE.RLG .OR. (CUL-CLL-H) . NE, C1G) GO TO 40 00550 * THE LABEL IS DIMENSIONED CORRECTLY,MOVE THE POINTER TO LABEL TABLE 00560 * AND PUT THE NEW LABEL IN. 00570 LRTP=IRTP+1 00580 LET (LRTP, 1)=FSYH 00590 LRT (LRT.P,2) =ELG • 00600 LET (LRTP,3)=CLG 00610 LRT (LRTP , 4) =SSYM . 00620 LRT (LRTP, 5) = R1L 00630 LRT (LRTP,6) =RUL 00640 LRT(LRTP,7)=CLL T J 0 5 W ' " ~ LTTTlRfP7'S) =C0L ' " ” ' ...... 00660 * CHECK IF WE ARE NOT OVER-LOADING THE LABEL TABLE 00670 IF (LRTP.GE.51) GO TO .30 00680 RETURN 00690 * 30 CONTINUE

00700 WRITE (5,2000) ' 126 00710 GO TO 50 . 00720 40 CONTINUE -0 0730 MBITS (5, 20 10) 00740 50 CONTINUE 00750 MBITS (5,2020) 00760 RETURN 00770 00780 60 CONTINUE 00790 * THE LABEL IS TAKEN CARE OF. NON TAKE CARE OF THE REST OF DECLARATIONS 00800 IF (CODE.EQ.3) GO TO 120 00810 * THE CODE IS EITHER 2,5,OR 6= CODE 2 REPRESENTS REGULAR DECLARATION. 00820 * DECLARATION 00830 If (CODE. NE.2 .AND. CODE. NE. 6) START— 1 00840 IF (CODE. EQ. 2 .OR. CODE. EQ. 6) START=.FDCH 00850 GO TO 90 00860 70 CONTINUE 00870 * MOVE THE SDT-POINTER AND PLACE THE NEW DECLARED SYMBOL IN THE TABLE 00880 SDTP=SDTP+i 00890 SDT (S DTP ,1) =FSYM 00900 SDT (SDTP, 2) =TYPE 00910 SDT (SDTP, 3) =RLG 00920 SDT (SDTP, 4) =CLG 00930 SDT (SDTP, 5) =0 00940 * CHECK IF SDT IS OVERFLOWED 00950 IF (SDTP.GE. 301) GO TO .80 00960 RETURN 00970 80 CONTINUE 00980 * THE SDT IS OVERFLOWED SEND AN ERROR MASSAGE 00990 WRITE (5,2030) 01000 GO TO 50 x 01010 90 CONTINUE 01020 IF (SDTP. EQ. 0) GO TO 70 01030 01040 * SEE IF THE SYMBOL HAS BEEN DECLARED BEFORE, IF NOT ENTER IT AT THE 01050 * END OF (SDT) , OTHERWISE IF IT IS NOW DECLARED AS (OUTPUTS) AND IT

01060 * WAS PREVIOSLY DECLARED AS (INPUTS) IN ANOTHER MODULE, CHECK THE 127 01070 * DIMENSIONS OF THE TWO DECLARATIONS TO MATCH. IF THEY DO NOT MATCH, 01080 * OR IF THE SYMBOL IS DECLARED AS (INPUTS) AND (OUTPUTS) IN THE SAME 01090 * MODULE, ERROR MESSAGE SHOULD BE ISSUED- 01100 DO 110 I=START,SDTP 01110 * CHECK THE SYMBOLS 01120 IF ( (SDT (I, 1) ) » NE-.FSYM) GO TO 110 01130 * CHECK INPUT-OUTPUT DECLARATION IN THE SAME MODULE 01140 IF ( (SDT(1,2)-EQ.40 .AND. TYPE.EQ.41) . AND. (I.LT.FDCM) ) 01150 1 GO TO 100 01160 WRITE(5,2040) 01170 GO TO 50 011 80 100 CONTINUE 01190 * I/O IS DECLARED BEFORE BUT IN A DIFFERENT MODULE -NO ERROR- 01200 * CHECK IF THE PREVIOUSLY ENTERED 1/0 IS DIMENSIONED THE SAME AS 01210 * THE NEW ONE. 01220 IF(RLG. EQ. (SDT (1,3)) .AND. CLG, EQ. (SDT (I ,4) ) ) GO TO 110 01230 * DIMENSIONS ARE DIFFERENT,ERROR. 01240 WRITE (5,2050) 01250 GO TO 50 01260 11.0 CONTINUE 01270 GO TO 70 01280 01290 01300 120 CONTINUE D T3 T 0 " " THE-ONLY SYMBOLS THAT ARE NOT STILL DEALT WITH ARE SEQUENCE SYMBOLS 01320 * FIRST LOOK FOR THE SYMBOL IN THE LABEL TABLE. ONLY CHECK THE SYMBOL 01330 * AGAINST THE CURRENT MODULE1'S LABELS. 01340 IF (LRTP. EQ. 0) GO TO 170 01350 * JUST CHECK IF THE LABEL TABLE IS EMPTY 01360 DO 130 I=FLCM,LRTP 01370 IF (LRT(1,1).NE.FSYM) GO TO 130 01380 LSLT=I 01390 GO TO 140 01400 130 CONTINUE 01410 GO TO 170 01420 140 CONTINUE 01430 * THE SYMBOL WAS FOUND IN THE LABEL TABLE CHECK IF IT IS SUBSCRIPTED 01440 * CORRECT! Y<» 01450 IF ( (RUL-RLl* 1) . LE. (LRT (LSLT, 2) ) .AND. (CUL-CLL +1) . LE. 01460 1 (LRT (LSLTy 3) ) ) GO TO 150 01470 WRITE (5, 2060) 01480 GO TO 50 01490 150 CONTINUE 01500 * NOW CHECK FOR THE DEFAULT CASE 01510 IF (UDC = EQ. 1) GO TO 160 01520 * DEFAULT IS NOT USED FIND THE SUBSCRIPTS OF THE ORIGINAL SYMBOL AND 01530 * REPLACE THE DIMENSIONS OF THE LABEL SYMBOL WITH REAL SUBSCRIPTS. 01540 FSYM=LRT(LSLT,4) 01550 RLL=LRT(LSLT,5)+RLL 01560 RUL=LRT (LSLT, 5) +.RUL 01570 CLL=LRT (LSLT,7) +CLL 01580 CUL=1RT(LSLT,7)+CUL 01590 GO TO 170 01600 160 .CONTINUE 01610 * DEFAULT IS USED SO SUBSCRIPTS ARE SAME AS THE SUBSCRIPTS OF THE 01620 * LABELED ORIGINAL SYMBOL. 01630 FSYM=LRT(LSLT,4) 01640 RLL=LRT (LSLT, 5) 01650 RUL=LRT(LSLT,6) 01660 CLL=LRT(LSLT, 7) 01670 CUL=LRT (LSLT, 8) 01680 UDC=0 01690 170 CONTINUE 01700 * SEARCH FOR THE SYMBOL IN THE REFERENCE TABLE 01710 IF (SRTP.EQ. 0) GO TO 210 01720 DO 180 I=F SCM,SRTP 01730 IF (FSYM. NE. (SRT

01780 180 CONTINUE 129 01790 GO" TO 210 01800 190 CONTINUE 01810 * THE SYMBOL IS FOUND AND THERE IS NO NEED TO ENTER IT AGAIN 01820 PSI=LSBT 01830 200 CONTINUE 01840 POINTER=PSI 01850 RETURN 01860 210 CONTINUE 01870 * THE SYMBOL IS NOT FOUND S ENTER IT IN THE TABLE 01880 SRTP=SRTP+1 01890 SRT (SRTP,1)=FSYM 01900 SRT(SRTP„5) =RLL 01910 SRT(SRTPf 6) =RUL 01920 SRT

02500 DC.N=SRT(J,9) 131 02510 * DCN=DEFAULT CODE NUMBER 02520 IF { (SET (U y 9)} .EQ. 0) GO TO 270 02530 * DEFAULT IS TO BE USED 02540 260 CONTINUE 025 50 02560 IP { (DCN.EQ.1) «> OR. (DCN. EQ. 10) ) SET (J„5) =0 02570 IF ( (DCN.EQ. 1) .OH. {DCN- EQ. 10) ) SET (J,, 6) =SRT (J, 3) 02580 1 . 1 02590 IF ( (DCN.EQ.1) .OR. (DCN. EQ.5 ) ) SET (J,7) =0 02600 IF ( (DCN.EQ.1) .OR. (DCN, EQ.5 ) ) SET (J , 8) =SHT {4 ) 02610 1 1 . 02620 GO TO 280 02630 27 0 CONTINUE 02640 * CHECK THE LIMITS 026 50 IF (SET (J,, 6) , IT. SET (J , 3) , AND. SHT (J, 8) .LT. SBT (J, 4) ) 02660 1 GO TO 280 02670 WRITE (5, 2080) SET (J„6) ,SET (J,8) ,SRT (J» 1) 02680 GO TO 260 026 90 280 CONTINUE 02700 290 CONTINUE 02710 300 CONTINUE 02720 * COUNT HON MANY TIMES IT HAS GONE THEOUGH THE NESTED LOOPS 02730 COUNT=COUNT*1 02740 IP (COUNT.EQ.1) GO TO 310 02750 IP (COUNT. HE. 2) GO TO 320 02760 * COUNT IS 2P GO THROUGH THE LOOPS ONE MORE TIME CHECKING FOR EXTERN 02770 * INPUTS. 02780 U=99 02790 7=59 02800 W=4 5 02810 X=59 02820 Y=45 02830 Z=9 9 02840 * Z=99„ IS A DUMMY CONSTANT AND THE CONDITION ON Z MILL NEVER BE 02 8 50 * ' SATISFIED.

02860 GO TO 230 132 02870 310 CONTINUE 02880 * THE COUNT IS ONE AND THIS HILL BE THE SECOND TINE GOING THROUGH THE 02890 \ * NESTED LOOPS,.GO THROUGH THE LOOPS ONLY IF THE EOF IS REACHED, FIRST 02900 * TOP ASSIGNMENT WAS FOR REGULAR DECLARATIONS ONE MODULE AT A -TIME 02910 * SECOND TOP ASSIGNMENT WAS FOR REGULAR INPUTS AND OUTPUTS, 02920 * THIRD TOP ASSIGNMENT HAS FOR EXTERNAL INPUTS,ONCE FOR -EVERY AHPL 02930 * PROGRAM,THIS WILL PLACE THE EXTERNAL INPUTS AT THE BOTTOM OF SYMBOL 02940 * VALUE LIST, 02950 DL B=1 02960 SLB= 1 02970 * THESE DO LOOP STARTS ARE SET TO ONE SO THAT SYMBOLS OF ALL MODULES 02980 * WILL BE CHECKED, 02990 * THE VALUE OF Z IS AGAIN DUMMY 030 00 * IN CASE OF EOF, GO THROUGH THE LOOP, 03010 IF (CODE, EQ, 4) GO TO 300 03020 * FINDOUT THE NEW TABLE LIMITS 03030 FDCM=SDTP+1 030 40 FSCM=SRTP+1 03050 FLCM=LRTP*1 03060 RETURN 03070 320 CONTINUE 03080 03090 * IF THE SYMBOL IS A ONE-SHOT, PUT ITS DURATION IN COLUMN#9 OF SET 031 00 * IF THE SYMBOL IS AN OUTPUT, LOOK FOR AN INPUT WITH THE SAME NAME 03110 * AND IF FOUND REPLACE ITS SVT POINTER 03120 * WITH THAT OF THE OUTPUT SYMBOL, 03130 * ALSO FOR ALL SYMBOLS SEE IF THEY HAD BEEN DECLARED, 03140 DO 360 1=1,SRTP 03150 * SEE IF THERE IS ANY SYMBOL NOT DECLARED 03160 IF (SET (1,10), NE, 0) GO TO 330 03170 WRITE (5^2090) SET (1,1) 03180 GO TO 360 03190 330 CONTINUE 032 00 * CHECK FOR ONE-SHOTS 03210 IF (SRT (1,2) , NE, 44) GO TO 340 032 20 SET (I,9)=SRT (1,3) 03230 SRT (1,3) =1 133 03240 SRT (1,4) = 1 03250 SET (1,5) =0. 03260 SET (1,6) =0 03270 SRT (.1,7) =0 ! 03280 SRT (1,8) =0 03290 GO TO 360 033 00 340 CONTINUE 03310 IF (SET (1,2).NE.41) GCI TO 3 60 03320 DO 350 J=1,SRTP 03330 IF (SET (1,1) .NE. SRT (J, 1) ) GO TO 350 033 40 * LOOK FOR THE SYMBOL WHICH WAS DECLARED AS -OUTPUT- 03350 IF (SET (J,10) . NE.0) SET (J,10)=SET (I, 10) 03360 350 CONTINUE 03370 360 CONTINUE 03380 RETURN 03390 2000 FORMAT(IX,23H##### TOO MANY LABELS ) 03400 2010 FORMAT(IX,42H##### LABEL IS NOT DIMENSIONED CORRECTLY ) 03410 2020 FORMAT(1X,46H=.__ THE ABOVE DECLARATION IS IGNORED ..... ,// 03420 1) 03430 203 0 FORMAT(IX,29H##### TOO MANY DECLARATIONS ) 03440 2040 FORMAT(IX,42H##### ILLEGAL I/O OR MULTIPLE DECLARATION) 03450 2050 FORMAT(IX,30H##### I/O DIMENSIONS CONFLICT). 03460 2060 FORMAT(1X,30H##### BOUNDS EXCEED FOR LABEL) 03470 2070 FORMAT(1X,49H##### TOO MANY SYMBOLS ARE IN THE AHPL SEQUENCE 03480 1 ) 03490 2080 FORMAT(IX,21H##### UPPER BOUNDS (,I4, 10H) AND/OR (,I4,33.H) EX 03500 1CEED THE LIMITS OF VARIABLE (,A10,22H); DEFAULT IS ASSUMED.) 03510 2090 FORMAT(1X,27H##### THE SYMBOL, OR CLU (, A10, 17H) IS NOT DECLA 03520 1 RED) 03530 END 00010 SUBROUTINE SYPABS(SPX,SPS) 00020 * THIS ROUTINE IS CALLED SYMBOL PASBE.H, ALL .THE DECLARED VARIABLES MILL 00030 * BE DETECTED AND AFTER HAVING LOCATION IN SYMBOL,VALUE.LIST,TABLE 00040 * MILL BE TOTALLY DELETED. THE SEQUENCE VARIABLES HILL BE REPLACED BY 00050 * A POINTER. AND THE POINTER HILL BE RETURNED TO THE MAIN PARSER. 00060 IMPLICIT INTEGER (A-Z) 00070 * THE FOLLOWING IS A LIST OF VARIABLES USED IN THIS ROUTINES,AND THEIR 00080 * INITIALIZATIONS, 00090 * RLG=ROW LENGHT 00100 * CLG=COLUMN LENGHT 001 10 * RLL=ROW LOWER LIMIT 00120 * RUL=ROW UPPER LIMIT .00130 * CLL=COLUMN LOWER LIMIT 00140 * CUL=COL UMN UPPER LIMIT 00150 * CODE=CODE USED TO DISTINGUISH BETWEEN THE. DECRATIONS AND SEQUENCE 00160 * FSYM=FIRST SYMBOL ENCOUNTERED IN A DECLARATION OR SEQUENCE 00170 * SSYM=SECOND SYMBOL USED FOR LABELS 00180 * POINTER= POINTER TO THE SYMBOL REFERENCE TABLE 00190 * CRT=CURRENT RESERVED TOKEN 00200 * CRS=CURRENT RESERVED SUB TOKEN 00210 * SIC=5CANNER IS CALLED AND THE RESERVED (CRT AND CBS) CONTAIN INFORMAT 00220 * TO BE PASSED TO THE MAIN PARSER IN THE NEXT CALL TO THIS ROUTINE. 00230 * PSE=.PROG.RAM START IS ENCOUNTERED 00240 * TYPE IS THE DECLARATION TOKEN 00250 * UDC=USE DEFAULT CASE.THIS VARIABLE IS ONE, WHENEVER A COMPLETE 00260 * REGISTER OR MEMORY IS TO BE USED WITHOUT USING THE SUBSCRIPTS. 00270 COMMON/SYMAN4/ SDTP 00280 COMMON/SHARE/ IABLE(131,9) ,SDT(201,5) , LET (51, 8) ,NEWSPT(58) , 00290 1 NOPU (54) ,FLHS (54) ,XLATE(63) ,CHAR(80) ,DUMMY (3) ,STACK1 (50) , 00300 2 KWT (32) 00310 DATA CRT,CRS,SIC,PSE/0,0,0,0/ 00320 DATA RHS/0/ 00330 DATA FT1/0/ 00340

00350 10 CONTINUE 135 00360 RLG=0 00370 CLG=0 00380 RLL=0 00390 801=0 00400 CLL=0 00410 CUL=0 00420 CODE=0 00430 T YPE=0 00440 UDC=0 004 50 FSYM=" " 00460 SSYM=" " 00470 POINTEB=0 00480 * FIRST CHECK TO SEE IF RESERVED TOKEN AND SUBTOKEN ARE NOT PASSED 00490 * PARSER YET. 00500 IF (SIC.NE.1) GO TO 20 00510 * IF THERE ARE ANY INFORMATION TO BE PASSED TO THE MAIN PARSER, SET 00520 * THEM EQUAL TO SYMBOL.PARSER,TOKEN AND SYMBOL.PARSER,SUB. 00530 - SPT=CR.T 00540 5PS=CRS 00550 SIC = 0 00560 RETURN 00570 20 CONTINUE 00580 CALL SCANNER (TOKEN, SUB) 00590 * SEE IF THERE IS A DASH 00600 IF (TOKEN. NE. 30) GO TO 40 006 10 * THE TOKEN IS A DASH NOW SEE IF IT IS THE FIRST DASH (BEGIN.ING OF 00620 * -THE PROGRAM) OR THE END DASH 00630 IF(PSE.NE.O) GO TO 30 00640 * IT IS THE BEGINIG, PASS THE DASH TO THE MAIN PARSER 00650 SPT=.TOKEN 00660 SPS=SUB 00670 * PSE IS SET TO 1 TO INDICATE THAT THE NEXT DASH IS THE END.OF.FILE 00680 PSE= 1 00690 RETURN 00700 30 CONTINUE 00710 CODE=4 00720 * THE VALUE OF CODE IS SET TO 4 TO INDICATE THE EOF 136 00730 CALL SYMAMG (FS YM„ TTPE, RLG, CLG, ELL, BUL„ CL1,, CUL, CODE, UDC, SSYM, 00740 1 POINTER) 00750 SPT=TOKEN 00760 SPS=SU3 00770 RETURN 00780 40 CONTINUE 00790 ■ * IF A MODULE IS ENCOUNTERED WE GO THROUGH DECLARATION DETECTION. 00800 00810 IF (TOKEN. NE.38) GO TO 310 00820 TYPE=TOKEN 00830 * CALL SYMANG FOR PROCESSING DECLARATIONS OF THE PREVIOUS MODULE, 00840 CALL. SYHANG (” »,TYPE, 0,0 ,0, 0, 0 , 0,0,0 l»,0) .00850 CALL SCANNER (TOKEN, SUB) 00860 * CHECK FOR COLON 00870 IF (TOKEN, EQ,9) GO TO 50 00880 WRITE (5, 20 00) 008.90 50 CONTINUE 00900 C A L L . SCANNER(TOKEN,SUB) 00910 F3YM=SUB 00920 C O DE= 2 00930 CALL SYHANG (FSYJS,TYPE,RLG,CLG,RLL,RUL,CLL,CUL,CODE,UDC,SSYM, 00940 1 POINTER) 00950 CALL SCANNER(TOKEN,SUB) 00960 IF.(TOKENo NE<,22) GO TO 60 00970 CALL SCANNER(TOKEN,SUB) 00980 60 CONTINUE 00990 * CHECK TO SEE IF ANY DECLARATION IS MADE FOR THIS MODULE 01000 IF ((TOKEN. GE. 39 .AND. TOKEN. LE. 45) .OR. TOKEN. EQ. 59 .OR. TOKEN. 01010 1 EQ,57) GO TO 90 01020 WRITE (5,2010) 01030 RETURN 01040 70 CONTINUE 01050 WRITE(5,2020) 01060 80 CONTINUE 01070 CALL SCANNER(TOKEN,SUB) 01080 IF(TOKEN = EQ.22) GO TO 270 01090 GO TO 80 01100 90 CONTINUE 01110 IF (TOKEN, ME. 43) GO TO . 100 01120 WRITE (5, 2030) 01130 GO TO 70 01140 100 CONTINUE 01150 * CHECK FOE EXTERNAL LINES, OR OUTPUT DECLARATIONS 01160 • IP(TOKEN.ME.4 5 . OR. TOKEN, NE. 59 .OB. TOKEN. NE, 41) (GO TO 110 01170 CODE=5 01180 GO TO 130 01190 110 CONTINUE 01200 * CHECK FOB (INPUTS) DECLARATION 01210 IF (TOKEN. NE. 40) GO TO 120 01220 CODE-6 01230 GO TO 130 X 01240 120 CONTINUE 01250 * THE DECLARATION IS EITHER MEMORY,OR BUSES,OR ONESHOTS 01260 CODE= 2 01270 130 CONTINUE 01280 TYPE=TOKEN 01290 C ALL SCANNER (TOKEN, SUB) 013 00 IP (TOKEN. BQ. 9) GO TO 140 01310 WRITE (5,20 40) 01320 140 CONTINUE 01330 * REINITIALIZE RLG, CLG, RLL, RUL, C.L1, AND GUI 01340 RLG= 1 ' 01350 CLG= 1 01360 RLL=0 01370 501=0 01380 CLL=0 01390 CUL=0 01400 CALL SCANNER (TOKEN,SUB) 01410 * CHECK FOR DECLARATION NAME 01420 IF (TOKEN.EQ.37 .OR. TOKEN.EQ.46 .OR. TOKEN.EQ.47 .OR TOKEN-EQ, 01430 1 48 .OR. TOKEN.EQ.56 .OR. TOKEN.EQ.58) GO TO 160 01440 150 CONTINUE 138 01450 WHITE (5,20 50) 01460 GO TO 70 01470 160 CONTINUE 01480 FSYM=SUB 01490 CALL SCANNER(TOKEN,SUB) 01500 * CHECK.IP AN ANGULAR OR A SQUARE BRACKET IS FOLLOWED BYTHE ID 01510 IF (TOKEN, EQ, 7 , OR, TOKEN, EQ, 17) GO TO 180 01520 RLG=1 .01530 CLG= 1 01540 GO TO 230 015 50 * IF NOT,PRINT THE CORRESPONDING ERROR MASSAGE 01560 170 CONTINUE 01570 WRITE(5,2060) 01580 GO TO 70 01590 180 CONTINUE ' 01600 * FIND OUT THE KIND OF BRACKET 01610 IF (TOKEN, EQ, 7) GO TO 220 01620 190 CONTINUE 01630 CALL SCANNER(TOKEN,SUB) 01640 * SHOULD RECEIVE AN INTEGER 016 50 IF (TOKEN, EQ, 35) GO TO 210 01660 200 CONTINUE 01670 *■ AN INTEGER IS NOT SCANNED PRINT THE CORRESPONDINGERROR MASSAGE 01680 WRITE (5,2070) 01690 GO TO 70 01700 210 CONTINUE 01710 RLG=SUB 01720 CALL SCANNER(TOKEN,SUB) 017.30 * CHECK FOR THE CLOSING BRACKER 01740 IF (TOKEN,NE,18) GO TO 170 01750 CALL SCANNER(TOKEN,SUB) 01760 IF (TOKEN, NE,7) GO TO 230 01770 220 CONTINUE 01780 * AN ANGULAR BRACKET IS SCANNED 01790 CALL SCANNER(TOKEN,SUB) 01800 * WE SHOULD RECEIVE AN INTEGER 139 01810 IP (TOKEN. HE. 35) GO TO 200 01820 CLG=SUB 01830 * CHECK FOR CLOSING ANGULAR BRACKET 01840 CALL SCANNER(TOKEN,SOB) 01850 IF (TOKEN.NE„10) GO TO. 170 01860 * A COLUMN DIMENSIONING COULD BE FOLLOWED BY A RON DIMENSIONING CHECK 01870 * FOR SUCH A CASE. 01880 CALL SCANNER(TOKEN,SOB) 018.90 IF (TOKEN.EQ.17) GO TO . 190 01900 230 CONTINUE 01910 * IF TYPE IS CLUNITS IGNORE BIGHT-PAREN., 1EFT-PAREN AND WHAT IS IN IT 01920 IF (TOKEN. NE, 15 „ OR. TYPE. NE. 57) GO TO 250 01930 PAREN=1 01.9 40 240 CONTINUE 01950 CALL SCANNER(TOKEN,SUB) 01960 IF (TOKEN-EQ. 15) PAHEN=PAREN + 1 01970 IF (TOKEN.EQ.'16) 'PAREN=FAREN-1 ...... 01980 IP (TOKEN-HE. 16 -OR. PARIS. NE. 0) GO TO 240 01990 CALL SCANNER(TOKEN,SUB) 02000 250 CONTINUE 02010 02020 * THE VARIABLE DIMENSIONING IS ALL DONE CHECK FOR OR PERIOD 0.2030 IF (TOKEN. NE. 21) GO TO 260 02040 CALL SYMANG (FSYM»TYPE „ RLG, CLG , RLL,.RUL, CLL, CUL, CODE, UDC, SS.YM, 02050 1 POINTER) 02060 GO TO 140 02070 26 0 CONTINUE 0208,0 * CHECK FOR A PERIOD 02090 IF (TOKEN. BE..22) GO TO 290 02100 * SEND THE GATHERED INFORMATION TO THE SYMBOL MANAGER ROUTINE 02110 CALL SYMANG (FSYM,TYPE,RLG,CLG,.RLL„RUL,CLL, CU.L, CODE, UDC, SSYM, 02120 1 POINTER) 02130 270 CONTINUE 02140 CALL SCANNER(TOKEN,SUB) NUMBER WHICH 02150 * TO SEE IF DECLARATION IS ENDED, CHECK FOR A STEP 140 02160 * COMES AFTER ALL THE DECLARATIONS ARE MADE 02170 IF (TOKEN. NE» 36) GO TO 280 02180 SPT=TOKEN 02190 SPS-SUB 02200 RETURN 02210 280 CONTINUE 02220 * NOW AT LEAST ANOTHER -.DECLARATION FOLLOWS , OR ERROR IS MADE 02230 IF ( (TOKEN, GE,39 . AND. TOKEN.IE. 45) .OR. TOKEN.EQ.59 . OR. 02240 1 TOKEN. EQ. 57) GO TO 100 02250 WRITE(5,2080) 02260 GO TO 70 02270 290 CONTINUE 02280 * THE DECLARATION IS NOT ENDED SO IT IS EITHER A LABEL OR AN ERROR 02290 IF (TOKEN. EQ. 8) GO TO 300 023 00 * PRINT THE ERROR MASSAGE 02310 WRITE (5,2090) 02320 GO TO 70 02330 300 CONTINUE 02340 * SINCE AN 'EQUAL SIGN IS SCANNED, A LABEL IS DECLARED 02350 CODE=1 02360 CALL SCANNER(TOKEN,SUB) 02370 * A SECOND SYMBOL NAME SHOULD BE SCANNED 02380 IF (TOKEN, NE.37) GO TO 150 02390 SSYM=SUB 02400 CALL SCANNER(TOKEN,SUB) 02410 IF (TOKEN. EQ.7 . OR. TOKEN. EQ. 17) GO TO 350 02420 * IF AFTER THE NAME A BRACKET IS NOT OPENED, AN ERROR IS MADE 02430 WRITE(5,2100) 02440 GO TO 70 02450 310 CONTINUE 02460 * FTI= FIRST TIME IN 02470 * PUT ARTIFICIAL EXINPUT, AND EXBUSES IN THE SET IN THE ORDER 02480 * THAT THEY ARE DECLARED, SO THAT THE FIRST LINE READ WILL CORRESPON: 02490 * TO THE FIRST DECLARED BIT. 02500 IF (FTI.NE.0) GO TO 330 02510 FTI= 1 02520 DO 320 M=1,SDTP 141 02530 FSYM=SDT (M, 1) 02540 TYPE=SDT (M,2) 02550 RLG=SDT(Hr3) 02560 CLG=SDT (M,4) 02570 R.LL=0 02580 RUL=RLG~1 02590 CLL=0 02600 CUL=CLG— 1 02610 CODE=3 02620 UDC=0 02630 IF (TYPE» EQ» 45 .OR, TYPE. EQ. 59) CALL SYMANG (FSYM^TYPE, 02640 1 RLGfCLG,RLL,RULfClL,CULfCODEfUDCfSSYM,PNT) 02650 PNT=0 02660 320 CONTINUE 02670 33 0 CONTINUE 02680 026 90 * ALL THE DECLARATIONS FOR THE CURRENT MODULE ARE 02700 * TAKEN CA&E OF, DETECTG THE SEQUENCE SYMBOLS. 02710 * ALSO THE COMBINATIONAL LOGIC UNITS WILL BE TREATED AS SYMBOLS. 02720 IF(TOKEN.EQ.37 .OR. TOKEN.EQ.46 .OR. TOKEN.EQ.47 -OR. TOKEN. 02730 1 EQ.48 , OR. TOKEN. EQ. 56 .OR. TOKEN. EQ. 58) GO TO, 340 02740 SPT=TOKEN 02750 SPS=SUB 02760 RETURN 02770 340 CONTINUE 02780 * AN ID , OR A CLUNIT NAME IS DETECTED 02790 * SAVE THE TOKEN NUMBER, PRTKN=PROCCESED TOKEN NUMBER 02800 PRTKN=TOKEN 02810 FSYM=SUB 02820 C0DE=3 02830 CALL SCANNER(TOKEN, SUB) 02840 IF (TOKEN.EQ.7 .OR. TOKEN. EQ. 17) GO TO 350 02850 * BRACKET DOES NOT FOLLOW THE ID SO. USE THE DEFAULT CASE 02860 UDC=1 .02870 GO TO 430 142 02880 350 CONTINUE 028 90 U D 0= 15 . 02900 * CHECKi FOR ANGULAR OR SQUARE BRACKET 02910 IF (TOKEN. NE. 17) GO TO .390 02920 360 CONTINUE 02930 UDC=UDC-10 02940 CALL SCANNER(TOKEN,SUB) 02950 * AN INTEGER SHOULD BE IN SUB 029 60 IF (TOKEN*. NE«.35) GO TO 200 02970 RLL=SUB 02980 CALL. SCANNER(TOKEM,SUB) 02990 * A COLON SHOULD COME BETWEEN THE TWO SUBSCRIPTS 03000 IP(TOKEN.EQ.9) GO TO 370 03010 RUL=RLL 03020 GO TO 380 03030 370 CONTINUE 03040 CALL SCANNER(TOKEN,SUB) 03050 * THE SECOND'INTEGER OF THE SUBSCRIPT SHOULD BE IN SUB 0.3060 IF (TOKEN. NE. 35) GO TO 200 03070 R U.L= SUB 03080 CALL SCANNER(TOKEN,SUB) 03090 380 CONTINUE 03100 * A CLOSING BRACKET IS EXPECTED 03110 IF (TOKEN. NE. 18) GO TO 170 0.3120 CALL. SCANNER (TOKEN,SUB) 03130 * NOW CHECK TO SEE.IF ALL THE SUBSCRIPTS ARE ALL TAKEN CARE OF, 03140 IF (TOKEN. NE. 7) GO TO 420 03150 39 0 CONTINUE 03160 UDC=UDC-5 03170 * AN ANGULAR BRANCKET IS SCANNED 03180 CALL SCANNER(TOKEN,SUB) 0.3190 * AN INTEGER SHOULD FOLLOW THE LEFT ANGULAR BRACKET 03200 03210 IF (TOKEN. NE.35) GO TO 200 0.3220 CLL=SUB

03230 CALL SCANNER (TOKEN, SUB) 143 03240 IF (TOKEN.EQ. 9) GO TO 400 03250 . C0L=CLL 03260 GO TO 410 03270 400 CONTINUE 03280 C&LL . SCANNER(TOKEN,SUB) 032 90 * THE SECOND "INTEGER SHOUIE T O H O V . THE :C010N...... : 03300 IF (TOKEN-ME.35) GO TO 200 03310 CUL=SUB 03320 CALL SCANNER (TOKEN,SUB) 03330 410 CONTINUE 03340 * A LEFT ANGULAR BRACKET SHOULD CLOSE THE SUBSCRIPTS 03350 IF (TOKEN. ME. 10) GO TO 170 03360 CALL SCANNER(TOKEN,SUB) 03370 * CHECK FOR ROW SUBSCRIPTS 03380 IF (TOKEN.EQ.17) GO TO 360 03390 420 CONTINUE 03400 03410 03420 * ROW AND COLUMN LIMITS ARE ALL FOUND. 03430 IF (CODE.EQ. 1) GO TO 230 03440 * THE CHARACTER AFTER THE SYMBOL IS ALREADY SCANNED IN ORDER NOT TO 03450 * LOOSE IT, STORE IT IN CRT AND CRS AND SET THE SIC FLAG TO ONE. 03460 430 CONTINUE 03470 * FIRST SEE IF ANY OTHER SYMBOL IS SCANNED RIGHT AFTER THE CURRENT 03480 * SYMBOL. 03490 IF (TOKEN. NE. 37) GO TO 440 03500 WRITE (5,2110) 03510 GO TO 70 03520 44 0 CONTINUE 03530 CRT=TOKEN 03540 CRS=SUB 03550 3IC= 1 03560 * SEND ALL THE GATHERED INFORMATION ABOUT THE CURRENT SYMBOL TO THE 03570 * SYMBOL MANAGER, THEN BRING A PONTER BACK AND SEND IT TO THE MAIN 03580 * PARSER. 03590 CALL SYMANG(FSYM,TYPE,RIG,CLG,RLL/RUl,CLL,CUL,CODE,UDC,SSYM, 03600 1 POINTER) 144 03610 SPT=PRTKN 03620 SPS=POINTER 03630 RETURN 03640 20 00 FORMAT (IX, 52 H > » » WASHING, AH.P1 SYHTAX IS VIOLATED. COLON ASSU 03650 1 MED) 03660 2010 FORMAT {1X,45H>»» DECLARATION IS NEEDED EO.R THIS MODULE ) 03 6 70 2020 FORMAT (1X,37H.„,.„ DUE TO ERROR; LINE IS REJECTED ) 03680 2030 FORMAT {1 X , 5 8 H » » > SOME DECLARATION HAS TO BE MADE BEFORE. LAB 03690 1ELING IT ) 03700 2040 FORMAT (1X,53H»»> WARNING, AH.PL SYNTAX IS VIOLATED. COLON ASSU 03710 1MED ) 03720 2050 FORMAT (I X , 3 3 H » » > DECLARATION NAME IS EMPTY ) 03730 2060 FORMAT (IX, 42 H » » > VARIABLE NOT DIMENSIONED CORRECTLY ) 03740 2070 FORMAT (IX, 23H>»>> MISSING INTEGER ) 03750 2080 FORMAT (IX, 52 H > » » SEQUENCE SHOULD FOLLOW THE END OF DECLARAT 03760 • 1ION) 03770 2090 FORMAT (IX, 32 H » » > DECLARATION IS NOT ENDED ) 03780 2100 FORMAT (IX, 40 H > » » DEFAULT DOES NOT EXIST FOR LABEL ) 037 90 2110 FORMAT (IX, 27 H» » > OPERATOR IS MISSING ) 03800 END 145 : 00010 SUBROUTINE SEHANT (NEWLHS» CODE PE 1 , PE2 „ PE3 ».PE4» PE5„ PE6 » PE7» PE8 „ | 00020 1 PV1 f P?2 f PV3, PV4, PV5, PV6 , PV7 „ PV8 » NEUPNT.) 1 00030- IMPLICIT INTEGER (A-Z) 00040 COMMON/ESC/ ESC 00050 COMMON/MODNUM/ EODN 00060 COMMON/SYMAN1/ SRT (301,10) 00070 COMMON/SYMAN2/ SRT'EN 00080 ' COMMON/EXECU1/ QTABLE(300,4) 00090 COMMGN/EXECU8/SQRT(300,5) 00100 COMMON/EXECU9/ NEST(25,8) 00110 COMMON/EXECU2/ NESTRON 00120 COMMON/EXECU3/ ROWSQ 00130 COMMON/EXECU4/ CQTRN ' 00140 COMMON/EXECU6/ TOTS (500,4) 00150 COMMON/EXECU7/ TOTSRN 00160 00170 * MOON:STANDS FOR THE CURRENT MODULE NUMBER GENERATED IN THE SCANNER AND 00180 * -COMMON BETWEEN SEMANTIC AND EXECUTION ROUTINES, 00190 * TOTS;IS THE SYMBOL RELATION TABLE WHICH IS GENERATED IN SYMANG ROUTINE 00200 * -AND IS COMMON BETWEEN SEMANTIC AND EXECUTION ROUTINES, 00210 * TOTSRN;IS THE SYMBOL RELATION TABLE ROW NUMBER WHICH IS COMMON BETWEEN- 00220 * -SEMANTIC AND EXECUTION ROUTINES, 00230 * QTABLE;STANDS FOR QUADRUPLE TABLE WHICH ISGENERATED IN THE SEMANTIC 00240 * -ROUTINE AND WILL ALSO BE USED IN EXECUTION ROUTINE, . 00250 * SQRT;STANDS FOR SYMBOL Q-TABLE RELATION TABLE,GENERATED IN SEMANTIC AN 002 60 * -D WILL BE USED IN THE EXECUTION ROUTINE, 00270 * NEST;STANDS FOR NEXT EXECUTABLE STEPS TABLE,GENERATED IN SEMANTICS,AND 00280 * -WILL BE USED IN EXECUTION ROUTINE, 00290 * NESTROW:IS THE NEST ROW NUMBER, 00300 * ROWSQ;IS THE SQRT ROW NUMBER, 00310 * CQTRN:IS THE CURRENT Q-TABLE ROW NUMBER WHIch WILL BE USED IN SEMANTIC 003 20 * -ROUTINE AS A Q-TABLE END MARKER, 00330 * TOTS:STANDS FOR TABLE OF TEMPORARY SYMBOLS 00340 * TOTSRN;STANDS FOR TOTS ROW NUMBER 00350 00360 DATA CQTRN/1/ 00370 ' DATS. ROWSQ/1/ 00380 * SQNE STSNDSS FOE THE NUMBER OF STEPS FOR WHICH QUADRUPLES ARE NOT ENDE 00390 ' DATA NESTROW/1/ 00400 00410 DATA ERR/0/ 00420 DATA TOTSRN/O/ 00430 00440 * CHECK IF STEP NUMBER IS IN I.E. IS CODE=1 ? 00450 00460 IF{CODE„EQ,0) GO TO 40 00470 * CODE IS ALSO EQUAL TO 1 FOR NODELAY BUTTHIS WILL BE TAKENCARE OF BY 00480 * -PRODUCTION#!0, SO RETURN UPON 29 00490 IF (NEWLHS»EQo 21). GO TO 10 00500 NEHPNT=0 00510 RETURN 00520 10 CONTINUE 00530 * A STEP i IS IN„AND THE NUMBER IS IN PVUSEE IF THE STEPNUMBER IS 00540 * -NOT REPEATED IN THE SAME MODULE 00550 DO 20 1=1,ROWSQ 00560 IF (SQRT (1*1) » NE= MODN .OR, SQRT (1,2) » NE.PV1) GO TO 30 00570 WRITE (5,2000) MODN,PV1 00580 RETURN 00590 20 CONTINUE 006 00 00610 30 CONTINUE 00620 * STEPNUMBER IS NOTREPEATED ENTER IT IN THE SQRT, AND MARK Q-TA.B.LE ROW 00630 ' SQRT (ROWSQ, 1) =MO.DN 00640 SQRT (ROWSQ,2)=PV1 00650...... SQRT (ROWSQ,3) =CQTRN ...... 00660 * INCREMENT THE ROW NUMBER OF SQRT,READY FOR THE NEXT STEP NUMBER 00670 ROWSQ=ROWSQ+1 00680 NEWPNT=0 006 90 RETURN 00700 00710 40 CONTINUE 00720 * STEP NUMBER IS TAKENCARE OF, SEMANTIC ACTIONS FOR PRODUCTIONS STARTS 00730 007 40 GO TO (50,60,50,70,70,70,5 0,90,9 0, 100,50,50,50,50, 130, 140, 150, 007 50 1 50,160,170,110,330,180,110,190,190,190,190,19 0,190,200,2 00,200, 00760 2 200,19 0,210,220,220,22 0,220,210,110,110,330,120,180,24 0,320,50, 00770 3 50,250,280,290,300),NEHLHS 00780 00790 00800 50 CONTINUE 00810 NEW.PNT=0 00820 RETUBN , . 00830 00840 60 CONTINUE 00850 SQRT ( (ROWSQ-1) ,4}=CQTBN-1 00860 NE'NPNT=Q 00870 RETURN 00880 00890 70 CONTINUE 00900 IF(ESC.BQ.O) GO TO 80 009 10 SQ.RT ( (ROWSQ-1) ,4) =CQTRN-1 00920 ESC=0 00930 NEWPNT=0 00940 RETURN 00950 80 CONTINUE- 00960 S Q R T ((ROWSQ-2) ,4)=CQTRN-1 00970 NEWPNT=0 00980 RETURN 00990 01.000 90 CONTINUE 01010 QTABLE (CQTRN, 1) = NEWLHS 010 20 IF (ESC- NE. 1), SQRT ( (ROWSQ-1) ,3) =SQET ( (ROWSQ-1) ,3.) +1 01030 CQTRN=CQTRN+1 01040 NEWPNT=0 01050 RETURN 01060

01070 100 CONTINUE 148 01080 SQRT ( (ROWSQ-1) ,5) =1 01090 NEWPNT=0 01100 RETURN 01110 01120 110 CONTINUE 01130 NENPNT=PV2 01140 RETURN 011 50 01160 120 CONTINUE 01170 NEWPNT=PV1 01180 RETURN 01190 01200 130 CONTINUE 01210 01220 140 CONTINUE 01230 01240 150 CONTINUE 01250 QTABLE (CQTRN, 1) = NEHLHS 01260 QTABLE {CQTRN„2)=PV3 01270 QTABLE {CQTRN, 3) =PV 1 01280 QTABLE (CQTRN, 4) =0 01290 CQTRN=CQTRN+1 01300 NEWPNT=0 01310 RETURN 01320 01330 160 CONTINUE 01340 01350 170 CONTINUE 01360 01370 180 CONTINUE 01380 TOTSRN=TOTSRN*1 01390 * THE INTEGER 1 IN COL#1 OF THE TOTS TABLE INDICATES 01400 * CURRENT TOTS RON IS A POINTER TO THE RESULT OF AN ADDBESS-OPERATIOH. 01410 * TOTS COL#2 CONTAINS THE OPERATION, TOTS COL#3 6 4 CONTAIN T¥0 01420 * POINTERS TO THE TOTS TABLE WHERE THE OPERNDS ARE. 01430 T OTS(TOTS RN,1) = 1 01440 TOTS(TOTSRN,2)=NENLHS 149 014 50 TOTS (TOTSKN,3)=PV3 01460 TOTS(TOTSRN *4)= P V 1 01470 EEWPNT=TOTSBH' 01480 BETORH 01490 01500 190 CONTIHOE . 01510 TOTSRN=TOTSBN+1 01520 QTaBLE (CQTBN, 1) =NEH.LHS 01530 QTABLE (CQTEN,2)=PV3 01540 QTABLE(CQTBM,3)=P71 01550 QTABLE(CQTRE,4)=TOTSRN 01560 GO TO 230 01570 01580 200 CONTINUE 01590 IF (NEWLHS.EQo 34) NEWLHS=33 01600 TOTSRN=TOTSRN+1 01610 QTABLE(CQTEN,1)=NEHLHS 01620 QTABLE (CQTRN,2) =0 01630 QTABLE(CQTRN,3)=PV1 01640 QTABLE(CQTRN,4)=TOTSSN 01650 GO TO 230 01660 01670 210 TOTSRN=TOTSEN+1 01680 QTABLE (CQTRN, 1) =NE$7LHS 01690 QTABLE(CQTRN,2)=PV4 01700 QTABLE (CQTRN,3) =P?2 01710 QTABLE (CQTRN,4)=TOTSRN 01720 GO TO 230 01730 01740 220 CONTINUE 01750 TOTSRN=TOTSRN+1 01760 QTABLE (CQTRN, 1) =NEW.LHS 01770 QTABLE (CQTRN,2)=PV4 01780 QTABLE (CQTRN, 3) =PV2 01790 QTABLE(CQTRN,4)=TOTSRN 01800 230 CONTINUE uiH o 01810 CQTRN=CQ.TRN+1 01820 NENPNT=TOTSRN 01830 * THE INTEGER 4 IN THE FIRST COLUMN OF TOTS INDICATES THAT THE. 018 40 * CORES PONDING TOTS RON NUHBER APPE&'RS IN COL#4 OF THE QTABLE 01850 ' * AND CQL#2,COL#3,S COL#4 OF THIS TOTS RON 1ILL BE FILLED TO 01860 * POINT TO THE TEMPORARY SYMBOL IN THE VALUE TABLE, DURING 01870 * THE EXECUTION. 01880 TOTS(TQTSRN,1)=4 01890 TOTS (T0TSRN„2) =0 01900 TOTS (TOTSRN, 3) =0 01910 TOTS (TOISBN,4) =0 01920 RETURN 01930 01940 240 CONTINUE 01950 TOTSRN=TOTSRN>1 01960 TOTS (TOTSRN,1) =1 01970 "TOTS (TOTSRN,2) -NEWLHS... ' ...... 01980 TOTS (TOTSRN,3) =PV3 01990 TOTS (TOTSRN, 4) =PV1 02000 NENPNT=TOTSRN 02010 RETURN 02020 02030 250 CONTINUE 02040 * ENTER STEP NUMBER ZERO IN THE SQRT AND NEST TO INDICATE END SEQUENCE 02050 SQRT (ROWSQ, 1) =MODN 02060 SQRT (ROWSQ,2) =0 02070 SQRT (ROWSQ, 3) =CQTEN 02080 ROWSQ=ROWSQ+1 02090 NEST(NESTROW,1)=MODN 02100 NEST(NESTROW,2) =0 02110 NESTROW=NESTROW+1 02120 PTS=PV2 02130 260 CONTINUE 02140 * IF THE PONTER IS CONTINIOUS (IT IS MADE UP OF OTHER POINTERS)FIND THE 02150 * OTHER SYMBOLS 02160 IF (TOTS (PTS, 1) oNEo 2) GO TO 270 02170 * SINCE THE FIRST COLUMN OF TOTS IS EQUAL TO 2 THE END OF CONTINIOUS 02180 * POINTER IS FOUND. 021 90 NEST(NESTROW,1)=MODN 02200 NEST (NESTROW,2) =TOTS (PTS»4) 02210 NE3TR0¥= NESTROW+1 . 02220 RETURN 02230 27 0 CONTINUE 02240 NEST (NESTROW,1)=M0DN 02250 NEST (NESTROW,2)=TGTS(PIS, 4) 02260 NESTROW=NESTROW+1. 02270 PTS=TOTS(PTS,3) 02280 GO TO 260 02290 02300 280 CONTINUE 02310 QTABLE (CQTRN, 1) =52 02320 QTABLE (CQTRN,2) =PV6 02330 QTABLE (CQTRNi, 3) =PV2 02340 QTABLE(CQTRN,4)=0 02350 GO TO 310 02360 02370 290 CONTINUE 02380 TOTSRN=TOTSRN+1 02390 * THE INTEGER 2 IN COL#1 OF THE TOTS TABLE INDICATES THAT THE 02400 * LAST(THE LEFT MOST) INTEGER OF A NUMBERSTRING IS IN COL#4 OF 02410 * THE CURRENT TOTS ROW. 02420 TOTS(TOTSRN,1) =2 02430 TOTS (I0TSRN„2) =0 02440 TOTS (TOTSRN,3)=0 02450 TOTS(TOTSRN,4)=P71 02460 QTABLE (CQTRN, 1) =53 02470 QTABLE(CQTRN,2)=TOTSRN 02480 QTABLE (CQTRN,3) =0 02490 QTABLE(CQTRN,4)=0 02500 GO TO 310 025 TO 02520 300 CONTINUE 02530 QTABLE (CQTRN, 1) = 54 02540 QTABLE (CQTRN, 2) =0 02550 QTAB1E (CQTRN, 3) =PV2 02560 QTABLE (CQTRN, 4) =0 02570 310 CONTINUE 02580 CQTRN=CQTRN+1 02590 NEWFNT=0 02600 RETURN 02,610 02620 320 CONTINUE 02630 TOTSRN=TOTSRN+1. 02640 TOTS (TOTSRN, 1) =2 02650 TOTS (TOTSRN,2) =0 02660 TOTS (TOTSRN,3) =0 02670 TOTS (TOTSRN,4) =17 1 02680 NEWPNT=TOTSRN 02690 RETURN 02700 02710 330 CONTINUE 02720 * CHECK TO SEE IF THE CURRENT ID HAS BEEN ENTERED IN TOTS 02730 * IF SO, PASS THE TOTS ROW NUMBER WHERE THE IDADDRESS IS 02740 * IF NOT ENTER IT IN THE TOTS TABLE AND PASS THE NEW TOTS 02750 * BEFORE CHECKING, SEE IF THE TOTS TABLE IS EMPTY, IF SO 02760 * THE ID ADDRESS IN THE TOTS TABLE AND PASS THE NEW TOTS ROW# 02770 IF (TOTSRNo EQ» 0) GO TO 350 02780 02790 DO 340 1=1,TOTSRN 028 00 TOTSROW=I 02810 IF ( (TOTS (I,1)„EQ-3) .AND. (TOTS (I, 4) . EQe PV1) ) 02820 340 CONTINUE 02830 02840 * THE ID HAS BEEN ENCOUNTERED FOR THE FIRST TIME „ 02850 . 350 CONTINUE 02860 TOTSRN=TOTSRN»1

02870 TOTS (TOTSRN, 1) =3 153 02880 TOTS (TOTSRN , 2) =0 02890 * THE NUMBER 3 IN TOTS COL#1 INDICATES THAT THIS POINTER POINTS TO SET 02900 TOTS{TOTSSN„3)=0 02910 ' TOTS(TOTSRN,4)=PV1 029 20 NEWPNT-TOTSBN 02 930 RETURN 02940 02950 360 CONTINUE 02960 NEWPNT=TOTSROH 02970 02980 RETURN 029 90 2000 FORMAT(IX,248t!!!1 IN MODULE NUMBER ,I3,1H„,13H STEP NUMBER „ 03000 115,26H IS REPEATED, STEP IGNORED) 03010 END 154 00010 SUBROUTINE TABLE 00.020 IMPLICIT INTEGER (A -.z j 00030 COMMON/SYMAN1/ SET<301,10) 00040 COMMON/SYMAN2/ SRTRN 00050 COMMON/EXECU1/ QTABLE (300,4) 00060 COMMON/EXECUS/ SQRT (300,5) 00070 COMMON/EXECU9/ NEST (25,8) 00080 COMMON/EXECU2/ NESTSOW 00090 C0MMON/EXEC03/ ROWSQ 00100 C0MM0N/BXECU4/•CQTBN 00110 COMMON/EXECU6/ TOTS (500,4) 00120 COMMON/EXECU7/ TOTSRN 00130 00140 00150 CQTRN1=CQTRN-1 00160 RONSQ1=ROWSQ-1 00170 N ESTRO 1 = NESTROW-1 00180 001.90 WRITE (5,2000) 00200 WRITE(5,2010) 00210 WRITE (5,2020) 00220 DO 10 1=1,TOTSRN 00230 WRITE (5, 2030) I, (TOTS (I, J) , J= 1,4) 00240 10 CONTINUE 00250 00260 WRITE (5,2040) 00270 WRITE (5,2050) 00280 WRITE (5,2060) 00290 DO 20 1=1,SRTRN 00300 WRITE (5,2070) I, (SRT(.I, J) ,J=1, 10) 00310 20 CONTINUE 00320 00330 WRITE (5,2080) 003'40 WRITE (5,2090)

00350 WRITE (5, 2100) 155 00360 DO 30 .1=1,CQTRN 1 00370 MBITS (5,2110) I, (QTABLE(I,J) ,J=1,4) 003 80 30 CONTINUE 00390 00400 WRITE (5,2120) 00410 WRITE (5,2130) 00420 WRITE (5,2140) 00430 DO 40 1 = 1 ,RGWSQ1 00440 WRITE (5,2150) I, (SQRT (I, J.) , J= 1, 5) 00450 40 CONTINUE 00460 00470 00480 WRITE (5,2160) 00490 WRITE (5,2 170) 00500 WRITE (5,2180) 00510 DO 50 1=1,NESTED1 00520 WRITE (5,2190) I, (NEST (I, J) , J= 1, 8) 00530 50 CONTINUE 00540 00550 WRITE (5,22 00) 00560 RETURN 00570 2000 .FORMAT (1H1 ,35X,33HTABLE OF TEMPORARY SYMBOLS (TOTS)) 00580 2010 FORMAT (/, 36X, 4HROW#, 4X,4HCODE, 3X, 4HPROD,2X, 5H0PND1, 2X, 5HO.PMD2) 00590 2020 FORMAT (36X, 34H------) 00600 2030 FORMAT (33X,I6,2H: ,417) 00610 2040 FORMAT(///,40X,28HSYMBOL REFERENCE TABLE (SRT)) 00620 2050 FORMAT(/,1 OX,4HROW #,6X,6HSYMBOL,4X,4HTYPE,4X,4 HCOLS,4 X,4HRO WS, 00630 15X,3HCLL ,5X ,3HCUL,5X,3HRLL,5X ,3HRUL,4X,4HD.FLT, 4X, 4HPNTR) 00640 2060 FORMAT (10X, 17 H --- — — — , 9 ( 8 H----- )) 00650 2070 FORMAT (6X,I7,3H; ,AID,918) 00660 2080 FORMAT(///,41X,24HQ0ADRUPLE TABLE (QTABLE)) 00670 2090 FORMAT (/, 36X,4HROW1f,4X,4HPROB,2X, 5HOPND1, 2X, 5HOPN.D2, IX, 6HRESU.L 00680 IT) 00690 2100 FORMAT (36X,34H------) 00700 2110 FORMAT(33X,16,2H: ,417) 00710 2120 FORMAT(///,37X,34HSTEP, QTABLE RELATION TABLE (SQRT)) 00720 213 0 FORMAT(/,33X,4HROW#,4X,4HMOD#,2X,5HSTEP#,2X,5HL0W-Q,3X,4HUP-Q, 00730 1 5X,2HND) 00740 2140 FORMAT (33X,41H------— ------) 00750 2150 FORMAT(30X,16,2Hs ,517) 00760 2160 FORMAT(///,37X,34HREXT EXECUTABLE STEPS TABLE (NEST)) 00770 2170 FORMAT{/,20X,4HROW#,5X,4HMOD#,3X,5HSTEP#,6X,2HND,3X,5HNEXT1,3X 00780 1 ,5HNEXT2,3X,5HNEXT3,3X,5HNEXT4,3X,5HNEXT5) 00790 2180 FORMAT (20X,70H------00800 1 ) 00810 2190 FORMAT(16X,17,2H: ,818) 00820 2200 FORMAT(///,34X,44H[[[[[ COMPILING DONE, EXECUTION NEXT JJ]]] 00830 D . 00840 END 00010 SUBROUTINE.EXEC 00020 ' * THIS ROUTINE IS THE EXCU.TION OPERATOR ROUTINE WHICH DETERMINES 00030 * WHEN E A C H .EXECUTION-SUPPORTING-ROUTINES HAVE TOBE CALLED. 00040 * OSB=ONESHOT BUILDER 00050 * INREAD=INPUT READER 00060 * INTRAN=INPUT TO OLD-SYMBOL-VALUE-TABLE TRANSITION ROUTINE 00070 * N£SR=NEXI EXCUTABLE STEP ROUTINE 00080 * MOD=MODULE NUMBER 00090 * STEP=STEP NUMBER 00100 * NDI=A NODELAY IS IN 00110 IMPLICIT INTEGER (A-Y) 00120 COMMON/EXECU3/ SQRN 00130 COMMON/ERR/ MOD,STEP 00140 COMMON/EXECU8/ SQRT(300^5) 00150 COMMON/EXECU2/ NESTBN 00160 COMMON/CLOCK/ CLIMIT 00170 COMMON/EXECU9/ NEST<25,8} 00180 COMMON/TABLE/ DEBUG 00190 CALL ; DELETE 00200 CALL OSB 00210 10 CONTINUE 00220 READ(2,2000) LABEL,CLIMIT 0023-0 IF (DEBUG. EQ. 10 .OR. DEBUG. EQ. 11) GO TO 20 00240 CALL DATE (ZDATE) 00250 CALL TIME (ZTIME) 00260 WRITE(5,2010) ZDATE,ZTIME 00270 IF (LABEL.NE."DEBUG" ") GO TO 20 002 80 OPT=CLIMIT 00290 IF (OPT.EQ.Q) DEBUG=10 00300 IF (OPT. EQ. 1) DEBUG=1 1 00310 IF (OPT. EQ. 1) WRITE (5 ,2020) 00320 IF (OPT. EQ. 0) WRITE (5, 2030) 00330 GO TO 10 00340 20 CONTINUE

00350 IF (LABEL. EQ,"CLOCKLIMIT"). GO TO 30 158 00360 WRITE(5,2040) 00370 STOP 00380 30 CONTINUE 00390 IF (CLIMXTo 1E= 2400) GO TO 40 00400 WRITE(5,2050) ■ 00410 CLIfiIT=2400 00420 GO TO 50 00430 40 CONTINUE 00440 WRITE (5,2060) CLIMIT 00450 50 CONTINUE 00460 CALL IN REM) 00470 CALL INTRAN 00480 - * THE ABOVE CALLS WILL BUILD THE ONE-SHOT TABLE, READ THE INPUT 00490 * INTO AN EXTERNAL INPUT FILE, AND WILL PLACE ONE CLOCK PULSE OF INPUT 00500 * INTO THE OLD SYMBOL VALUE TABLE 00510 00520 60 CONTINUE 00530 * CALL THE NESR TO FIND OUT THE STEP # TO BE EXECUTED NEXT 00540 CALL NESR(MOD,STEP,NDI,RNON) 00550 00560 * MOD WILL BE ZERO IF THERE ARE NO MORE STEPS 00570 IF (MGDoEQ= 0) GO TO 80 00580 * AS LONG AS MOD IS NOT ZERO.FIND THE QTABLE LIMITS AND EXECUTE . 00590 DO. 70 I=1,SQRN 00600 * LOOK IN THE SQRT FOR THE STEP AND MOD NUMBER 00610 IF ( (SQRT (1,1) -NE, MOD) = OR, (SQRT (1,2).NE.STEP)) GO TO 70 00620 * THE STEP AND MODULE NUMBER ARE BOTH FOUND 00630 * LQTL=LOWER Q-TABLE LIMIT 00640 * UQTL= UPPER Q-TABLE LIMIT 00650 LQTL=SQRT(1,3) 00660 0QTL=SQRT (1,4) 00670 70 CONTINUE . 00680 CALL QLINER (LQTL,UQTL,RNON) 00690 GO TO 60 00700 80 CONTINUE

00710 CALL ORDER 159 00720 * FOR EACH CLOCK EXECUTION CALL THE ONE-SHOT EXECUTION ROUTINE 00730 CALL OSE 00740 90 CONTINUE , 00750 * NEST DOES NOT HAVE ANY MOfiE NOT-EXECUTED STEPS, BENEN IT 007 60 CALL NSTNEW 00770 * IF THEBE IS ANY NODELAY IN THE SQRT, PLACE IT IN THE CORBESPGNDING ROW 00780 * -OF NEST 00790 DO 110 1=1,NESTRN 00800 DO 100 J=1,SQRN 00810 IF ((SQRT (J, 1) . NE, NEST (1, 1) ) .OR, (SQRT (J, 2) .NE.NEST (1,2)) ) 00820 1 GO TO 100 00830 NEST (I,3)=SQRT (J, 5) 00840 GO TO 110 00850 100 CONTINUE 00860 110 CONTINUE 00870 120 CONTINUE 00880 00890 CALL NESR(MOD,STEP,NDI,BNON) 00900 * CHECK FOR'NODELAY 00910 IF(NDI„NE.1) GO TO 150 00920 00930 00940 * LOOK FOR Q-TABLE LIMITS IF THERE IS A NODELAY 00950 DO 130 1=1,SQRN 00960 IF ( (SQRT (1,1) . NE® MOD) , OR» (SQRT (1,2) = NE» STEP) ) GO TO. 130 00970 LQTL=SQBT (1,3) 00980 UQTL=SQBT (1,4) 00990 GO TO 140 01000 130 CONTINUE 01010 140 CONTINUE 01020 CALL QLINER(LQTL,UQTL,ENON) 01030 * QLAC=QLINER IS ALREADY CALLED, AND ITS TABLE IS FULL 01040 QLAC=1 01050 GO TO 120 01060 150 CONTINUE

01070 IF(QLAC.NE.1) GO TO 160 160 01080 CALL NSTRST (MOD) 01090 QLAC=0 01100 CLIMIT=CLIMIT+1 01110 GO TO 90 01120 160 CONTINUE 01130 CALL . OUTPUT 01140 * THE CURRENT STEP. DOES NOT HAVE A NODELAY, IF THE NEST IS EMPTY RENEW IT 01150 IF (MOD = EQ, 0) GO TO 80 01160 * HEAD AM INPUT COL, FOB THE CURRENT CLOCK PULSE 01170 * TRANSFER THE MEN TABLE INTO THE OLD TABLE OF VALUES,. 01180 CALL . NOTRAN 01190 CALL. INTRAN 01200 170 CONTINUE 01210 * LOOK FOR THE STEP IN SQRT 01220 DO 180 1=1,SQRN 01230 IF ( (SQRT (I , 1) = NE, MOD) , OR, (SQRT (I# 2) , NE, STEP) ) GO TO 180 01240 LQT.L= SQRT (1,3) 01250 UQ.TL=SQRT (1,4) . 01260 GO TO 190 01270 180 .CONTINUE 01280 190 CONTINUE 01290 CALL QLINER(LQTL,UQTL* RNON) 01300 * THE LAST STEP WAS EXECUTED FIND A NEW ONE AND GO TRHOUGH THE SAME 013 10 * PROCEDURE EXCEPT THAT IT IS KNOHN THAT'NO MORE NODELAY WILL COME IN, 01320 * SINCE NODELAYS ARE LOCATED AT THE TOP OF THE NEST AND ARE EXECUTED 01330 * FIRST, 01340 CALL NESR (MOD,STEP, NDI,RNON) 01350 * IF MOD IS ZERO A RENEW NEEDED FOR THE NEST,OTHERWISE CONTINUE EXEC- 01360 * -UTING THE STEPS OF THE CURRENT CLOCK PULSE 01370 IF (MOD,EQ, 0) GO TO 80 01380 GO T O .170 01390 2000 FORMAT (A10, IX,14) 01400 2010 FORMAT(1H1,54H AHPL MODULE(S) INITIAL INFORMATION, EXECUTION S 01410 1TATUS:,15X,6HDATE: „A10,15X,6HTIMES ,A10,//) 01420 2020 FORMAT(IX,73H[[[[[ THE DEBUG PROGRAM IS CALLED, EXECUTABLE TAB

01430 1LES WILL BE LISTED ]]]]]) 161 01440 2030 FORMAT(IX,44H[[[£[ EXECUTION OF THE HPSIM PROGRAM MODULES 01450 1,/,1X,50HHILL ST&BT BY EXECUTING THE STEPS SPECIFIED BY ThE 01460 2,/, 1X,48H-C0NTB01HESBT- STATEMENT, ALL THE EXECUTED. STEPS 01470 3,/,1X,45HAND THElB MODULE NUMBER MILL BE LISTED BEFORE 01480 4,/, IX, 45HTHEIR CORRESPONDING OUTPUTS ARE PRINTED ]]]]]) 01490 2040 FORMAT(IX,//,54H ---- > CLOCKLIMIT IS NOT GIVEN5 EXECUTION Ifl 01500 1POSSIBLE) 01510 2050 FORMAT(// , 87H [£[[[ CLOCKLIMIT CANNOT EXCEED 2400; FOR EXEC 01520 1UTION CLOCKLIMIT OF 2400 IS ASSUMED ]]]]]) 01530 2060 FORMAT(//, 68H .[[[[[ CLOCKLIMIT HAS READ; EXECUTION WILL STO 01540 IP AFTER GOING THROUGH ,I4,19H CLOCK PULSES ]]]]]) 01550 END 00010 SUBROUTINE INHEAD 00020 * THIS ROUTINE READS THE EXTERNAL INPUT DATA FROM THE DATA FILE AND PLAC 00030 * - THIS INPUT INTO THE EXTERNAL INPUT ARRAY (EX.IA.) 00040 IMPLICIT INTEGER (A-Z) 00 050 COMMON/BI/ CLP3 (80) 00060 COMMON/B2/ LINE 00070 COMMON/SHARE/ EXIA (60,40) ,DPTM (24,24),UNUSED (10) 00080 COMMON/SYMAN1/ SET (301,10) 00090 CGMMON/SYMAN2/ SRTRN 00100 COMMON/OUT/ OUTTBL(50,3) ^OUTROH 00110 COMMON/SUPPRE/ SUPP(5,2) 00120 00130 DATA BPW/60/ 00140 DATA PGCOL/133/ 00150 DO 20 M=1,60 00160 DO 10 N=1,40 00170 EXIA (M, N)=0 00180 10 CONTINUE 00190 20 CONTINUE 00200 * PGCOL, IS THE MAXIMUM NUMBER OF COLUMNS IN ONE PAGE, THIS CAN BE 00210 * EASILY CHANGED IF THE PRINTER HAS LESS ORMORE THAN-133 COLUMNS 00220 00230 ODPW= BPW/3 00240 W PC = 8 0/ODP'W 00250 * SET CLP3 TO ZERO 00260 DO 30 1=1,80 00270 CLP3 (I) = 0 00280 30 CONTINUE 00290 LINE=0 00300 003 10 00320 R E A D (2,2000) LABEL 00330 IF (LABEL™ EQ»"OUTPUTS z ") GO TO . 150 00340 IF (LABEL.EQ. "EXLINES: 11) GO TO 50

00350 40 CONTINUE 163 00360 WRITE (5,2010) 00370 STOP 00380 50 CONTINUE 00390 WHITE (5,2020) 00400 60 CONTINUE 00410 HEAD (2 ,2030.) LABEL ,.VABO , VAH 1, VAR2 , VAR3 , VAR4 , VAH5, VAR6 , VAB7, VARS, 00420 1 VAR9 00430 LEN=VARO 00440 I.F (LABEL. EQ» ” BUSEFPECT ») GO TO 80 00450 IF (LABEL-NE."SUPPRESS; ") GO TO 70 00460 SUPP (1 , 1) =VAR0 00470 SUPP (1,2)=VAR1 00480 SUPP (2, 1) =VAR2 00490 S U PP ( 2, 2) = V A.R3 00500 SUPP (3,1) =VAR4 00510 SUPP (3, 2) =VAR5 00520 SUPP (4, 1) =VAR6 00530 ,SUPP(4,2)=VAR7 00540 SUPP (5,1)=VAR8 00550 SUPP(5,2)=V A R 9 00560 GO TO 60 00570 70 CONTINUE 00580 IF(LABEL.EQ."OUTPUTS: ") GOTO 160 00590 GO TO 40 00600 80 CONTINUE 00610 WRITE (5,2040) LABEL,LEN 00620 00630 00640 LINE=LINE+1 00650 * LINE= NUMBER OF EXTERNAL INPUT' BITS 00660 IF (LINE. LE. 60) GO TO 90 00670 WRITE(5,2050) 00680 GO TO 60 00690 90 CONTINUE 00700 FLEN= (LEN/24Q) +240

00710 * NOC=NUMBER OF CARDS 164 007 20 NOC=( (LEN-1) /240 .) + 1 00730 * CHECK TO SEE IF THE NUMBER OF COLCK PULSES DOES NOT EXCEED 2400 00740 IF (NOCoLEo 10) GO TO 100 00750 WRITE (5, 2060) 00760 00770 100 CONTINUE 00780 DO 140 CARD=1„NOC 00790 * CLP3=THREE CLOCK PULSES{ONE OCTAL DIGIT) 00800 READ (2*2070) (CLP3 (I),1=1,80) 00810 WRITE(5,2080) (CLP3 (I),1=1,80) 00820 DO 130 WORD=1,WPC 00830 DO 120 D.IGIT3= 1 f ODP W 00840 * ODN=OCTAL DIGIT NUMBER 00850 0DN=DIGIT3+(WORD-1)*ODPW 00860 * EIWN=EXTERNAL INPUT WORD NUMBER 00870 EIWN=41-(WOED+(CAED-1)*WPC) . 00880 * ODV=OCTAL DIGIT VALUE 00890 ODV=CLP3(ODN) 00900 ' IF (ODV»LE=7) GO TO 1 10 00910 WRITE (5,2090) 00920 ODV=0 00930 110 CONTINUE 00940 IF (ODV« EQ«. 0) ODV=0 009 50 IF (ODV=EQ«,1 .OH. ODV»EQo3 .OR.ODV.EQ. 4 «OR. ODV.EQ.6) 00960 1 ODV=ODV-( (-1) **ODV) *3 00970 * SOD=SHIFTED OCTAL DIGIT 00980 SOD=SHIFT (ODV,3* (DIGIT3-1) ) 00990 EXIA (LINE,EIWN) =OR (EXIA (LINE, EIWN) , SOD) 01000 120 CONTINUE 01010 130 CONTINUE 01020 140 CONTINUE 01030 GO TO 60 01040 150 CONTINUE 01050 WRITE (5,2100) 01060 160 CONTINUE

01070 WRITE (5,2110) LABEL , 165 010 80 170 CONTINUE 01090 READ (2,2120) SYMBOL,ROW 01100 IF (EOF (2)) 180,190 01110 180 RETURN 01120 190 CONTINUE 01130 WRITE (5,2130) SYMBOL,ROW 01140 DO 210 1=1,SRTRN 01150 IF (SRT (I, 1) «. NE= SYMBOL ) GO TO 210 01160 PAGEL=PAGEL*SRT(1,3)+1 01170 IF (PAGEL.GT.PGCOL) GO TO 220 01180 * CHECK FOR ROW LIMIT 011 90 IF (ROW., 1E= SRT (1, 8) ) GO TO 200 01200 WRITE (5,2140) 01210 GO TO 170 01220 20 0 CONTINUE "012 30 OUTROW=OUTROW*1 01240 OUTTBL(OUTROW,1)=SYMBOL 01250 OUTTBL (OUTROW,2) =SRT (1,3) 01260 OUTTBL (OUTROW,3) =SRT (I, 10) +SRT (1,3) *ROW 01270 GO TO 170 01280 210 CONTINUE 01290 WRITE (5,2150) 01300 GO TO 170 01310 220 CONTINUE 01320 WRITE (5,2160) 01330 GO TO 170 01340 2000 FORMAT(A10) 01350 2010 FORMAT(IX,//,87H ---- > (OUTPUTS:) OR (EXLINES:) WERE EXPECTS 01360 ID,(OUTPUTS:) IS REQUIRED; EXECUTION STOPS) 01370 2020 FORMAT(IX,//,60H [[[[[ VALUES FOR THE EXTERNAL LINES ARE LISTE 01380 ID BELOW ]]]]]) 01390 2030 FORMAT(A10,IX,14,IX,14,4(61,14,IX,14)) 01400 204 0 FORMAT ( IX, A1 0 , 6X,I4«, 4) 01410 2050 FORMAT ( IX,31H--- -> TOO MANY EXTERNAL LINES) 01420 2060 FORMAT(IX,69H---- > EXTERNAL INPUTS CANNOT EXTEND FOR MORE TH

01430 IAN 2400 CLOCK PULSES) 166 01440 2070 FORMAT (8011 = 1) 01450 2080 FORMAT(IX,8011) 01460 2090 FORMAT(IX,53H ~> 8 OR 9 APPEAR IN THE INPUT STRING, 0 ASS 01470 10MED) 01480 2100 .FORMAT (IX,//,93H [[[[[ NO VALUE WAS READ FOR EXTERNAL BUSES AL 01490 1L BUSES (IF ANY) ARE ASSUMED AT (0) LEVEL ]]]}]) 01500 2110 FORMAT(//,IX,A10,5X,5H ROW#) 01510 2120 FORMAT(A10,IX,14) 01520 2130 FORMAT(IX,A10,6X,14-4) 01530 2140 FORMAT(IX,77H----- > SUCH A ROW DOES NOT EXIST FOR THE ABOVE S 01540 1YMBOL; PRINT REQUEST IGNORED) 01550 2150 FORMAT(IX,88H----- > THE ABOVE SYMBOL IS UNKNOWN, OR DECLARED 01560 1 AND NOT USED; PRINT REQUEST IGNORED ) 01570 2160 FORMAT(IX,78H— -— > THE OUTPUT LENGTHEXCEEDS THE PAGE COLUMN 01580 1 LIMIT; PRINT REQUEST IGNORED) 01590 END. 167 00010 SUBROUTINE EXERR - 00020 IMPLICIT INTEGER (A-Z.). 00030 COMMON/CEQBL/ CEQ{50,3),CEQRON 00040 COMMON/EXECU9/ NEST(25,8) 00050 COMMON/CEQB12/ CEQTOP 00060 COMMON/ERROR/ DETECT 00070 DATA COUNT/0/ 00080 * DETECT IS SET TO TELL TO THE OUTPUT ROUTINE NOT TO BOTHER PRINTING 000.90 * SINCE AN ERROR HAS FOUND, COUNT IS TESTED AND INCREMENTED IN ORDER 00100 * TO STOP IF MORE THAN 10 EXECUTION ERRORS HAVE BEEN DETECTED 00110 DETECT=1 . 00120 IF (COUNT. GT. 10) STOP 00130 COUNT=COUNT+1 00140 * THIS ROUTINE ONLY WRITES THE.STEP AND THE MODULE NUMBER WHERE ERROR 00150 * WAS FOUND. 00160 WRITE (5,2000) NEST (CEQ (CEQTOP, 3) ,1) ffNEST (CEQ (CEQTOP, 3) , 2) ■ 00170 RETURN 001 80 2000 FORMAT {1X,33H«, = »<,, ERROR HAS FG0H.D IN MODULE#, 13* 7H ,STEP#, 00190 1,/) 00200 END 00010 SUBROUTINE HESB(HOD,STEP,HDI,BNOM) 00020 * THIS ROUTINE TAKES COLUMNS 4 TO 8 OF EACH ROW OF NESR AND BUILDS A NEW 00030 * ROW FOR EACH NONZERO COL- NODELAYS WILL BE TAKEN CARE OF FIRST, THEN 00040 * IN THE SECOND PASS THROUGH, END SEQUENCES WILL BE RETURNED AND FINALL 00050 * -Y REGULAR STEPS WILL BE RETURNED 00060 00070 * RNON= ROW NUMBER OF NEST, TO BE TRANFERED 00080 * CURROW=CURRENT ROW OF NEST 00090 * NDC= NODELAY COMPLETED 00100 * ESC=END SEQUENCE COMPLETED 001 10 * RSC= REGULAR STEPS COMPLETED 00120 IMPLICIT INTEGER (A-Z) 00130 COMMON/B3/ CUROW1 00140 COM MON/EX EC U9/ NEST (25, 8) 00150 COMMON/EXECU2/ NSTRN 00160 DATA CURROH,NDC,ESC,BSC/1,0,0,0/ 00170 DATA TURN/0/ 00180 TURN=TURN+1 . 00190 * TURN IS THE NUMBER OF TIMES THAT THIS ROUTINE HAS BEEN CALLED 00200 NESTRN=NSTRN-1 . 00210 * CHECK TO SEE IF NEST HAS ANY ROW 00220 IF (NESTRN . NEo 0) GO TO 20 00230 IF (TURN-EQ. 0) GO TO 10 00240 WRITE (5,2000) 00250 CALL OUTPUT 00260 STOP 00270 10I■ CONTINUE 00280 WRITE (5, 20 10) 00290 CALL EXERR 00300 STOP 00310 201 CONTINUE 00320 00330 * SEE IF REGULAR STEPS ARE TAKEN CARE OF 00340 IF (RSC» NE» 1) GO TO 30 003 50 * ALL THE STEPS ARE TAKEN CARE OF, RESET EVERY THING AND RETURN 00360 CURROW=1 00370 MOD=0 00380 ST EP=0 003 90 NDI=0 00400 NDC=0 00410 ESC=0 00420 RSC=0 00430 RETURN 00440 30 CONTINUE 00450 * SEE IF NODELAYS ARE TAKEN CARE OF 00460 IF {NDC= EQ« 1) GO TO 60 00470 40 CONTINUE - 00480 * CHECK FOR -NODELAY IN THE CURRENT ROW IF THERE IS A NODELAY RETURN THE 00490 * STEP# AND MOD#, IF THERE IS NO NODELAY LOOK FOR IT IN THE NEXT ROW IF 00500 * IT WAS NOT FOUND SET NDC=1,T0 INDICATE THAT NO MORE NODELAYS ARE PRES 00510 * ENT IN THE CURRENT NEST. 00520 IF (NEST (CURROW,3) o EQ» 1) GO TO 50 00530 * CURRENT ROW OF NEST DID NOT HAVE ANY NODELAY CHECK THE NEXT ONE. 00540 CURROW=CURROW+1 00550 IF(CURROW,LE.NESTRN) GO TO 40 00560 CURROW=1 . 00570 NDC=1 00580 GO TO 60 00590 50 CONTINUE 00600 * RETURN THE NODELAY STEP 00610 MOD= NEST(CURROW„1) 00620 STEP=NEST (CURROW,2) 00630 NDI=NEST(CURROW,3) 006 40 RNON=CURROW 00650 CUROW 1 = CURROW...... ' ...... 00660 CURROW=CURROW+1 00670 IF(CURROW.LE.NESTRN) RETURN 006 80 CURROW=1 . 00690 NDC=1 00700 RETURN 00710 00720 60 CONTINUE 00730 * CHECK FOR COMPLETION OF THE ENDSEQUENCE STEPS 00740 IF (ESC, EQq 1) GO TO 90 00750 70 CONTINUE 00760 * GO THROUGH THE SAME PROCEDURE AS FOR THE NODELAY 00770 IF (NEST(CURROW,2) = EQ.0) GO TO 80 00780 CURROH=CURROW>1 00790 IF (CURROW»LE«NESTRN) GO TO 70 00800 CURROW=1 00810 ESC=1 008 20 GO TO 90 00830 80 CONTINUE 00840 MOD=NEST (CURROU , 1) 00850 STEP=0 00860 NDI=0 00870 RNON=CURROW 00880 CUROH1=CURROH 00890 CURROW=CURROH+1 00900 IF (CURRON»LE« NESTRN) RETURN 00910 CURROW=1 009 20 ESC=1 00930 RETURN 00940 90 CONTINUE 00950 * AT THIS POINT NODELAYS AND ENDSEQUENCES ARE TAKEN CARE OF, NOW LOOK 00960 * FOR REGULAR STEPS 00970 * FIRST SEE IF THE CURRENT ROW IS A REGULAR STEP, IF NOT GET THE NEXT 00980 * ROW, IF SO RETURN IT AND INCREMENT ROW 00990 IF { (NEST (CURROW, 2) . EQ» 0) .OR. (NEST (CURR0W,3) « EQ. 1) ) GO TO 100 01000 MOD=NEST {CURROW , 1) 01010 STEP=NEST (CURROW,2) 01020 NDI=0 01030 RNON=C URROW 01040 CUROW1=CURROW 01050 CURROW=CURROW +1 . 01060 IF (CURROW.LE.NESTRN) RETURN 01070 RSC=1 01080 RETURN 01090 100 CONTINUE .01100 * A NODELAY OR ENDSEQ. WAS FOUND, GET THE NEXT ROW 01110 CURRGW=CURRQW+1 01120 IF (CUSROW, LE» NESTRN) GO TO 90 01130 * NEST IS ALL TAKEN CARE OF,RESET THE VARIABLES IN ORDER TO RECEIVE A 01140 * NEW NESR TO WORK WITH, 01150 NDC=0 01160 ESC=Q 01170 R S C=0 01180 MOD=0 01190 STEP=0 01200 NDI=0 01210 C URRO W=1 ■ . 01220 RETURN 01230 2000 FORMAT{//,IX,66H[[[[[ PROGRAM REACHED A COMPLETE DEADEND; INTE 01240 1RPRETER STOPS- ]]]]]) 01250 2010 FORMAT (IX,58H---- > NO STARTING STEPS ARE GIVEN; EXECUTION IM 01260 1POSSIBLE ) 01270 END 172 00010 SUBROUTINE NSTNEW 00020 IMPLICIT INTEGER (A-Z) 00030 * WHENEVER THIS SUBROUTINE IS CALLED THE NEST TABLE WILL BE RENEWED IN 00040 * THE SENCE THAT IT WILL TAKE THE NON-ZERO COLUMNS OF NEST AND MAKE A 00050 * NEW ROW FOR EACH OF THEM. IF THERE IS A -1 IN COL#4 OF NEST. THE ROW 00060 * WILL BE DELETED, SINCE A -1 INDICATES A DEADEND. 00070 COMMON/EXECUS/ SQRT(300,5) 00080 COMMON/EXECU9/ NEST (25, 8) 00090 C O M MO N/E X E C U 3/ SQRN 00 100 COMMON/EXECU2/ NESTRN 001 10 COMMON/CLOCK/ CLIMIT 00120 00130 * CRN=CURRENT ROW OF NEST 00140 * CCN=CURRENT COL. OF NEST 00150 00160 00170 * WATCH FOR THE CLOCK LIMIT 00180 CLIMIT=CLIMIT-1 . 00190 IF (CLIMIT. GE. 0) GOT O 10 00200 WRITE (5,20 00) , 00210 STOP 002-20 1C1 CONTINUE 00230 * IF NESTRN IS=0 EXECUTION IS ENDED 00240 IF (NESTRN.NE.0) GO TO 20 00250 * -::::::: P R I N T O U T LAST B E S U L T :::::::: 00260 CALL OUTPUT 00270 WRITE (5,2010) 00280 STOP 00290 20 CONTINUE 00300 CBN=1 00310 30 CONTINUE 00320 CCN=4 00330 00340 IF (NEST (CRN,2) .EQ. 0) GO TO 60 00350 * THE ABOVE CHECKS FOR ENDSEQUENCE STEPS IF ONE EXISTS IT WILL 00360 * -LEAVE IT AS IT IS, IN ORDER TO BE EXECUTED AT EACH CLOCK. 00370 00380 * IF COL#4 IS ZERO LOOK IN SQRT AND PLACE THE NEXT STEP IN THE SAME ROW 003 90 * OF NEST.THIS IS DONE EECAOSE THE NEXT STEP OF AHPL WILL BE ASSUMED IF 00400 * NO STEP IS SPECIFIED ALSO IF THE NEXT STEP CORRESPONDS TO ANOTHER MOD 00410 * -OLE DELETE THE CURRENT ROW 00420 IF (NEST (CRN,CCN) » NE„ 0) GO TO 80 00430 00440 00450 DO 50 1=1,SQRN 00460 IF ( (SQRT (I , 1) . NE„ NEST (CRN „ 1) ) .OR. (SQRT (1,2).NE. 00470 1 NEST (CRN,2) )) GO TO 50 00480 * THE CURRENT STEP OF NEST IS FOUND IN SQRT. CHECK TO SEE IF THE NEXT 00490 * ROW OF SQRT CORRESPONDS TO THE SAME MODULE OR NOT. IF NOT, PUT A (-1) 00500 * IN THE NEST(CRN,4) TO INPLEMENT A DEADEND. 00510 IE ( (SQRT (1, 1) . NE. SQRT ((1 + 1),1)) .OR. (SQRT ((1 + 1),2). 00520 1 EQ.O) ) GO TO 40 00530 NEST (CRN, 2) =SQRT ( (1+1) ,2) 00540 GO TO 60 00550 40 CONTINUE 00560 NEST (CRN,4) =-1 00570 GO TO 80 00580 50 CONTINUE 00590 00600 60 CONTINUE 006 10 * GET THE NEXT ROW. OF NEST AND REPEAT UNTIL NEST IS ALL TAKEN CARE OF 00620 CRN=CRN+1+SD 00630 SD=0 00640 70 CONTINUE 006 50 IF (CRN. LE. NESTRN) ' GO TO 30 ...... ‘ ...... 00660 RETURN 00670 006 80 80 CONTINUE 00690 * CHECK FOR -NODELAY 00700 IF (NEST (CRN,CCN) „ NE. (-1) ) GO TO 110 00710 * NODELAY IS IN, DELETE THE ROW.AND DECREMENT NESTRN 174 00720 DO 100 1= CRN,NESTRN 00730 DO 90 J= 1,8 - 00740 NEST (I, J) =NESI ((1 + 1) ,J) 00750 90 CONTINUE 00760 100 CONTINUE 00770 NESTEN=NESTRN-1 . 00780 IF (NESTBN, NE« 0) GO TO 70 00790 CALL OUTPUT. 0080.0 WHITE (5,2010) .. 00810 STOP 00820 P H I N T O U T LAST R E s U L T :::::::: 00830 110 CONTINUE 00840 *' PUT THE CONTENTS OF COL#4 INTO COL#2 OF THE SAAB ROW 00850 NEST(CBN,2)=NEST(CBN,CCN) 00860 NEST (CRN,CCN) =0 00870 120 CONTINUE 00880 * CHECKTHE OTHER COLUMNS OF THESAME ROW 00890 CCN=CCN+1 - 00900 IF (NEST (CRN,CCN) . EQ=0) GO .TO 60 00910 * MAKE A NEST-ROW FOR ALL COLUMNS FROM 5 TO 8 00920 DO 140 J=CRN,NESTRN 00930 K= NESTRN-(J-CR.N) 009 40 * SHIFT THE NEST DOWN STARTING FROM THE CURRENT ROW .8 MAKE AN EMPTY ROW 00950 DO 130 L=1,8 00960 NEST ( (K+1) ,L) =NEST (K,L) • 00970 1.30 CONTINUE 00980 140 CONTINUE 00990 NEST ( (CRN+1) , 1)=NEST (CRN, 1 ), 01000 NEST ((CRN+1) ,2) =NEST (CRN, CCN) 01010 NEST (CRN, CCN) =0 01020 NEST ( (CRN+1) ,3) =0 01030 NEST ( (CRN+1) , 4) =0 01040 NEST ( (CRN + 1).,5) =0 01050 NEST((CRN+1),6)=0 01060 NEST ( (CRN+1) ,7) =0 01070 NEST( (CRN+1) ,8)=0 175 01080 01090 NESTRN=NESTEN+1 01100 SD=SD+1 01110 * SEE IF ALL COLOHNS ARE TAKEN CARE OF 01120 IF (CCN-LT.8) GO TO 120 01130 * THE CURRENT ROW OF NEST IS RENEWED, RESET THE VALUES IN COL#3 TO .8 01140 * TO ZERO AND GET THE NEXT ROW, 01150 NEST (CRN,3)=0 01160 NEST(CRN,4)=0 01170 NEST{CRN,5)=0 01180 NEST {CRN, 6) =0 01190 NEST{CRN,7)=0 01200 NEST (CRN, 8) =0 01210x GO TO 60 01220 2000 FORMAT(IX,//,81H £[£[[ PROGRAM REACHED THE TIME LIMIT SPECIFIE 01230 ID BY USER, INTERPRETER STOPS ]]]]]) 01240 2010 FORMAT(IX,66H[[[[[ PROGRAM REACHED A COMPLETE DEADEND, INTERPR 01250 1ETER STOPS, ]]]]]) 01260 END 00010 SUBROUTINE INTRAN 00020 * THIS ROUTINE TAKES ONE BIT COLUMN OF EXIA AND PUT IT IN THE OLD-■SYMBO 00030 * L-VALUE-TABLE (OSVT) 000 40 ' 00050 * LINE=NUMBER OF EXTERNAL INPUT LINES 00060 * OSVT— OLD SYMBOL.VALUE TABLE 00070 * EXIA=EXTERNAL INPUT ARRAY 00080 * FEXP=FIRST EXTERNAL INPUT POINTER 00090 * OBNOSVT BIT NUMBER 00100 * ERN=EXIA TABLE ROW NUMBER 00110 * LEXP=LAST EXTERNAL INPUT POINTER 00120 * BPW=BITS PER WORD 00130 * BITRAN=BIT TO BE TRANSFERED 00140 * OSVRN=OLD SYMBOL VALUE TABLE ROW NUMBER 00150 * BPFL=BIT POSITION IN THE OSVT FROM LEFT SIDE OF THE WORD CONTAINING IT 001 60 * NBR=NUMBER OF BITS REMAINED 00170 * PBT=p 6s.ITIONED TRANSFERABLE BIT (POSITIONED TO THE PLACE THAT IT HAS TO 00180 * GO INTO THE OSVT 001 90 * IMFRB=INPUT WORD FIRST RIGTH BIT 00200 00210 IMPLICIT INTEGER (A-Z) 00220 00230 COHMON/B2/ LINE 00240 COMMON/SHARE/ .EXIA(60,40) „ DPTM (24,24) ,UNUSED (10) 00250 COMMON/SYMAN1/ SRT (301,10) 00260 COMMON/SYMAN2/ SRTRN 00270 DATA BPW/60/ 00280 DATA COUNT/0/ 00290 DATA FEXP/0/ 00300 003 10 IF (LI NE» EQ= 0) RETURN 00320 IF (COUNT* NE. 0) GO TO 20 00330 COUNT= 1 00340 DO 10 1=1,SRTRN 00350 IF (SRT (1,2) . HE. 45 . AND* SRT (1,2) * NE, 59) GO TO 1 0 177 00360 * AN EXTERNAL INPUT VARIABLE IS FOUND IN THE SRT, GET THE POINTER 003 70 FEXP=SRI(I,10) 00380 GO TO 20 00390 10 CONTINUE 00400 WRITE (5,2000) 00410 RETURN 00420 20 CONTINUE 00430 LBXP=FEXP+LINE—1 004 40 DO 30 I=FEXP,LEXP 00450 ERN=I-FEXP+1 00460 MASK1 = MASK (1) 00470 MAS K2=SHIFT(MASK 1, 1) 00480 BITRAN=AND (MASK2 , EX.IA (ERN, 40) ) 00490 CALL' PUTBIT(I,15,BITRAN) 00500 30 CONTINUE 00510 * SHIFT THE RIGTH MOST BIT OF EXIA OUT,AND THE RIGTH MOST BIT OF EACH 00520 * WORD INTO THE LEFT MOST PLACE OF THE NEXT WORD, AND SET THE LEFT MOST 00530 * BIT OF EXIA TO ZERO. FOR THIS PURPOSE SHIFT LEFT EACH INDIVIDUAL WORD 00540 * OF A ROW AND THEN STARTING FROM THE RIGTH MOST WORD, ZERO THE LEFT 00550 * MOST BIT OF IT AND , OR. THE LEFT MOST BIT OF THE ROW ON ITS LEFT TO 00560 * IT.WHICH IS EQUIVALENT TO PLACING THE LEFT MOST BIT OF WORD (N) INTO 00570 * THE LEFT MOST PLACE OF WQRD(N + 1). 00580 DO 60 1=1,LINE 00590 DO 40 J=1,40 00600 EXIA (I, J) =SHIFT (EXIA (I, J) , (BPW-1)) 006 10 40 CONTINUE 00620 * SHIFTING OF EACH WORD IS DONE 00630 DO 50 J=1,39 006 40 K= 4 1 - J 00650 - MASK3=MASK (BPW-1) 00660 MASK3=SHIFT(MASK3,(BPW-1)) 00670 EXIA (I, K) =AND (MASK3 ,EXIA (I, K) ) 00680 * THE LEFT MOST BIT IS ZERO 00690 IWFRB=AND (MASK1 ,EXIA (I, (K-1) ) ) 00700 EXIA (I, K) =QR (EXIA(I,K) , IWFRB) 00710 50 CONTINUE 00720 * THE LEFT MOST BIT OF EX.IA HAS TO BE ZBBO 00730 EXIA (1, 1 ) = AND (MASKS „ EX IA (I r 1) ) 00740 60 CONTINUE 00750 . RETURN 00760 2000 FORMAT(76H ------> EXTERNAL INPUT IS NOT DECLARED,INPUT CANNOT 00770 1 BE READ.EXEC CONTINUES.) 00780 END 00010 SUBROUTINE NOTRAN 00020'' * THIS ROUTINE TRANSFERS THE NEW TABLE OF VALUES INTO THE OLD TABLE OF 00030 * VALUES,.THE NEW TABLE WILL STILL HAVE ITS VALUE. 00040 IMPLICIT INTEGER (A-Z) 00050 COMMON/B4/ OSVT (500) 00060 COMMON/B5/ NSVT (500) 00070 DO 10 1=1,500 00080 OSVT (I) =NSVT (I) 00090 10 CONTINUE 00100 RETURN 00110 END 180 00010 SUBROUTINE OSB 00020 * THIS ROUTINE HILL LOOK IN SRT FOR ALL VARIABLES DECLARED AS ONESHOT 00030 * -AND HILL PUT THEM IN A SEPARATE TABLE 00040 IMPLICIT INTEGER (A-Z) 00050 * OST=ONE SHOT TABLE 00060 * OSTRN=OST ROW NUMBER 00070 COMMON/SYMAN1/ SRT (301 ,10) 00080 COMBON/SYMAN2/ . SRTRN 00090 COMMON/B6/ OST(10,3) VOSTRN 00100 DATA OSTRN/O/ 00110 00120 * LOOK IN EACH ROW OF SRT FOR A 44 SYMBOL TYPE 00130 DO 10 1=1,SRTRN 001 40 IF (SRT (1,2) oNE, 44) GO TO 10 00150 * A SYMBOL TYPE 44 IS FOUND 00160 OSTRN=OSTRN+1 00170 ■ OST (OSTRN,1)=SRT(I,1) 00180 OST (OSTRN,2) =0 00190 OST (OSTRN,3) =SRT (I, 10) 00200 10 CONTINUE 00210 RETURN 00220 END ' 00010 SUBROUTINE OSE O0O2O * THIS IS ONE-SHOT-EXECUTION ROUTINE; WHEN CALLED,IT WILL PLACE A 1 IN 00030 * NSVT IF THE LENGTH COLUMN OF ONE OF ITS ROWS IS .GT. ZERO. 00040 IMPLICIT INTEGER (A-Z) 00050 COMMON/36/ OST(10,3),OSTRN 00060 00070 IF (OSTRN.EQ.0) RETURN 00080 00090 DO 10 1=1,OSTRN 00100 IF (OST (1,2) = EQ= 0) CALL PUTB.IT (OST (.1,3) , 1 6, 0) 00110 IF (OST (I, 2) . LE. 0) GO TO 10 00120 * THE"LENGTH" ROW IS GREATER THAN ZERO SO A 1 MUST BE PLACED IN THE NSVT 00130 CALL PUTBIT (OST(I,3) , 16, 1) 001 40 . OST(1,2)=OST(I,2)-1 00150 * THE LENGTH OH DURATION OF ONE-SHOT IS DECREMENTED IN THE ABOVE STATEME 00160 * -NT. THIS WILL CAUSE THE ONE-SHOT TO BE ON AS LONG AS IT IS DECLARED 00170 ' 00180 10 CONTINUE 00190 RETURN 00200 END 00010 SUBROUTINE BVB (VP,BV,VHB) 00020 * THIS ROUTINE PUTS ELEMENTS OF A CONTINUIUOS SYMBOL WHOSE FIRST ELEMENT 000.30 * -POINTER IS GIVEN BY (VP) INTO ONE VECTOR CALLED BV. 00040 IMPLICIT INTEGER (A~Z) 00050 DIMENSION BV (64) 00060 COMMON/EXECU6/ TOTS (500,4) 00070 * VHB=VALUE HORIZENTAL BITS 00080 * BV=BINARY VECTOR 00090 * POINTER=POINTER TO TOTS (POINTER) 00100 * VALUE POINTER 00110 VHB=0 00120 POINI=VP 00130 10 CONTINUE 00140 VHB=VHB+1 . 00150 BV (VHB) =TOTS {POINT,4) 00160 * CHECK IF THE LAST ELEMENT IS YET REACHED, IF SO RETURN IF NOT LOOK FOR 00170 * THE OTHER-ELEMENTS AND PUT THEM IN THE VECTOR 00180 IF (TOTS (POINT, 1) - NE. 1) RETURN 00190 * VECTOR CONTINUES 00200 POINT=TOTS(POINT,3) 00210 GO TO 10 00220 END 00010 SUBROUTINE EXECUTE (LQTI.,UQTL) 00020 * THIS IS THE MAIN EXECUTION ROUTINE AND EXECUTES EACH ROW OF QTABLE .00030 * THE DISTRIBUTOR PART DISTRIBUTES THE TASK OF EXECUTION TO THE PROPER 00040 * MODULES 00050 IMPLICIT INTEGER (A-Z) 00060 00070 COMMON/EXECU1/ QTABLE(300,4) 00080 C0MM0N/CEQBL2/ CEQTOP 00090 COMMON/C.EQBL/ CEQ(50f3) „CEQROH 00100 COMMON/SYMAN2/ SRT.SN ooi io COMMON/SYMAN1/ SRT (301,10) 00120 COMMON/EXEC04/ CQTRN 00130 COMMON/B3/ CUROW1 00140 COMMON/EXECU9/ NEST (25,8) 00150 COM.MON/EXECU6/ TOTS (500, 4) 00160 DIMENSION BV (64) ^FOBV (64) , SOBV (64) 00170 COMMGN/B8/ NEP 00180 COMMON/B6/ OST (10,3) »OSTRN 00190 DIMENSION DPM (24,24) 00200 COMMON/SHARE/ EXIA (60,40) ,DPTM(24»24)„ UNUSED{10) , ’ 00210 COMMON/ERROR/ DETECT 00220 00230 DATA DML/24/ 00240 00250 00260 00270 00280 00290 003 00 * THE FOLLOWING COMMENTS DEFINE THE VARIABLES USED IN THE FIRST* 00310 * PART OF THE PROGRAM, * 00320 00330 * DML=DESTINATION MATRIX LENGTH 00340 * DPM=DESTINATION POINTER MATRIX

00350 * DP=DESTINATION POINTER 184 00360 * DCP=DESTIMATION AND CONDITIONAL POINTER 00370 * CV.P=CONDITXON&L VECTOE POINTER 00380 * DPTH=DESTINATION POINTER TYPE MATRIX 00390 * ?B=VERTICAL BITS (NUMBER) 00400 * HB-HORXZENTA1 BITS (NUMBER) 00410 * PHB=PREVTOUS HORIZENTAL BITS 00420 * CVB=COLUMN VERTICAL BITS 00430 * DPMROW=DPM LAST ROW FILLED 00440 * NVB=NEW VB 00450 * VP=VALUE POINTER 00460 * VVB=VALUE VERTICAL BITS 00470 * VHB=VALUE HOR1ZENTAL BITS 00480 * H8S=HQRIZENTAL BITS START 00490 * HBE= HOHIZENTAL BITS END 00500 * VBS=VERTICAL BITS START 00510 * VBE=VERTICAL BITS END 00520 * TOP=TOP ELEMENT POINTER 00530 * COC=B.IT COLUMN NUMBER 00540 * ROW=BIT ROW NUMBER 00550 * DCOL=DESTINATION BIT COLUMN NUMBER 00560 * . DROW=DESTXNATION BIT ROW NUMBER 00570 * SDHL=S0B DESTINATION HOR.IZENTAL LENGTH 00580 * SDVL= SUB DESTINATION VERTICAL LENGTH 00590 * SDE5T=SUB DESTINATION (DLRM) 00600 * CVP=CONDITIONAL VECTOR POINTER 00610 * CVHB=CONDITIONAL VECTOR HORIZENTAL BITS 00620 * CVVB=CONDITIONAL VECTOR VERTICAL BITS 00630 * CVHBS^CONDITIONAL VECTOR HORIZENTAL START 00640 * CV H BE = CO NDITION AL VECTOR HORIZENTAL BITS END 00650 * CVVBS=CONDlTI0NAL VECTOE VERTICAL BITS' START 00660 * CVVBE=CONDITIONAL VECTOR VERTICAL BITS END 00670 * CTOP=CONDITIONAL VECTOR TOP POINTER 00680 * SCVHB=SUB CONDITIONAL VECTOR HORIZENTAL BITS 00690 * NHB=NEW HORIZENTAL BITS 00700 *

007 10 SEE IF QTABLE IS EMPTY FOR CURRENT CLOCK 185 00720 IF (LQTL-GT. UQTL) RETURN 00730 007 40 * IF NOT DO THE EXECUTION FOE EACH BOW IN THE PEOPEE LIMITS 00750 00760 00770 00780 **************************************************************** 00790 * T H E D. I S I B I B U T I 0 N PAST * 00800 * * 00810 * IN THIS PAST THE GO-TO STATEMENT DISTBIBUTES THE EXECUTION * 00820 * TO THE APPROPRIATE SECTIONS OF THE PROGRAM* * 00830 ************ **************************************************** 00840 00850 DO 1690 Z=LQTL»UQTL 00860 PROD=QTABLE (2,1) 00870 GO TO (10,10,10,10,10,10,10,1690,20,10,10,10,10,10,30,30,30, 00880 1 10,10,10,10,10,10,10,730,730,730,730,730,730,730,730,730,10, 00890 2 1380,1380,1410,1410,1620,1620,1660,10,10,10,10,10,10,10,10, 00900 3 10,10, 1670,1680,1670) PfiOD 00910 00920 00930 10 CONTINUE 00940 WRITE (5,2000) 00950 STOP 00960 00970 20 CONTINUE 00980 * A DEADEND IS IN ENTER, (-1) IN THE 4TH COL OF NEST,IN THE CURRENT ROW 00990 * OF THE NEST TABLE 01000 NEST (CEQ (CEQTOP,3) ,4)= -1 01010 GO TO 1690 01020 01030 01040 186 01050 a * # * # * # * * * # * * * * * * * # # **#**********#*##*#*##*# 01060 * PART ONE * 01070 * * . 01080 * ONLY TRANSFER, CONDITIONAL-TRANSFER, AND EQUIVALENCE WILL BE * 01090 * EXECUTED IN THIS SECTION OF THE PROGRAM. * 01100 * * 01110 **************** ************************************************ 01120 01130 01140 30 CONTINUE 01150 * A TRANSFER -OR EQUIVALENCE IS IN,FIRST BESET THE DPM 01160 DO 50 J= 1, D.ML 01170 DO 40 1=1,DHL 01180 DPM(I,J)=0 01190 DPTM(I,J)=0 01200 40 CONTINUE 01210 50 CONTINUE 01220 * CHECK FOR CONDITIONAL TRANSFER 01230 IF(PROD.EQ.17) GO TO 60 01240 DP=QTABLE (Z, 2) 01250 GO TO 70 01260 60 CONTINUE 01270 DCP=QTABLE (Z,2) 01280 DP=TOTS(DCP,3) 01290 CVP=TOTS(DCP,4) 01300 70 CONTINUE 01310 * AT THIS POINTTTHE POINTER TO TOTS IS IN (DP) ,FILL DPM UP WITH LEFT CON- 01320 * CATENATED SYMBOLS.. 01330 DPM (1,1) =DP 01340 DPTM (1, 1)=TOTS (DP, 1) 01350 DO 150 J=1,DHL 01360 DO 140 1=1,DHL 01370 * CHECK TO SEE IF THE END SYMBOL IS REACHED OR NOT 01380 80 CONTINUE

01390 IF (DPTM (I, J) o EQ. 1) GO TO 90 187 014 00 * SEE IF THE CURRENT COLUMN IS ENDED IF SO GET THE NEXT COLUMN 01410 IF (DPTfl (I, J) o EQo3) GO TO 140 01420 GO TO 150 01430 90 CONTINUE 01440 DP=DPfl{I,J) 01450 DPM (I» J) =TOTS (DP, 4) 01460 DPTH (I,a).=TOTS (DPM (I, J) » 1) 01470 * - CHECK FOR ROW OR COLUMN CONCATENATION 01480 IF (TOTS (DP,2)-EQ, 20) GO TO 110 01490 * TYPE IS 19,OR COLUMN CATENATION GET THE REST OF THE SYMBOLS AND SHIFT 01500 * THE CURRENT SYMBOL DOWN AND PUT THE NEW SYMBOL AT THE TOP OF IT IN THE 01510 * DPM MATRIX. 01520 DML1=DML-1 01530 DO 100 K=I,DML1 01540 ' L=DMLUI-K 01550" DPH((L*1).,J)=DPH(1,J) 01560 DPTM ( (L+1) , J) =DPTM (L, J) 01570 100 CONTINUE 01580 GO TO 130 01590 01600 110 CONTINUE 01610 DML1=DML—1 01620 * THE L.HS OPERATION IS A ROW CATENATION SHIFT ALL THE SYMBOLS THE CURREN 01630 * -T ROW ONE PLACE TO THE RIGTH 01640 DO 120 K=J,DML1 016 50 L=DML1+J-K 01660 DPM (I, (L+1) ) =DPM (I,.L) 01670 DPTM (I, (L+1) ) =DPTM (I,L) 01680 120 CONTINUE 01690 01700 130 CONTINUE 01710 * PLACE THE NEW SYMBOL IN THE 7ACENT PLACE 01720 DPM(I,J)=TOTS(DP,3) 01730 DPTM (I, J) =TOTS (DPM (I, J) , 1) 01740 GO TO "80 01750 140 CONTINUE 01760 150 CONTINUE ' 01770 01780 * TRANSLATE DPH FROM TOTS POINTERS TO SET POINTERS AND FIND VERTICAL AND 01790 * HORIZONTAL BITS OF DPM 01800 VB=0 01810 HB=0 01820 DO 240 1=1,DML 01830 * CHECK FOR THE END OF DPM ROW . 01840 IF

0.2110 1 (SRT (LHSY, 2) . EQ. 59) ) GO TO 200 189 02120 190 . CONTINUE 02130 WRITE(5,2020) 02140 CALL EXERR 02150 200 CONTINUE 02160 210 CONTINUE 02170 02180 * CHECK FOR COL. HATCHINGS 02190 IF (I. EQo 1) GO TO 220 022 00 IF (HB.EQ.PHB) GO TO 230 02210 WRITE(5,2030) 02220 CALL EXERR 02230 GO TO 1690 ' 02240 220 CONTINUE 02250 PHB=HB 02260 230 CONTINUE 02270 HB=0 02280 240 CONTINUE 02290 250 ' CONTINUE 02300 * PROD#17 SEPARATES FROH 15 AND 16 AT THIS POINT(PROD#17 IS CONDITIONAL 02310 * LEFT HAND SIDE) 02320 IF(PROD.EQ.17) GO TO 490 02330 260 CONTINUE 023 40 VP=QTABLE(Z,3) 02350 * BRANCH DEPENDING ON THE TYPE OF VALUE POINTER 02360 GOTO (270,290,340,350) TOTS (VP,1) 02370 27 0 CONTINUE 023 80 * A CONTINIOUS POINTER IS REACHED BUILD THE BINARY VECTOR 02390 CALL BVB(VP,BV,VHB) 02400 V V B=1 02410 , IF ( (VVB. EQ= VB) .AND. (VHB.EQ.HB)) GOTO 370 02420 280 CONTINUE 02430 WRITE (5,2040) 02440 CALL EXERR 02450 GO TO 1690 02460 290 CONTINUE

02470 IF ( (VB. NE. 1) .OR. (HB.NE. 1) ) GO TO 280 190 02480 * CHECK FOR ONE SHOT 02490 IF (SET (DPM (1 » 1) »2) »EQ»44) GO ;IO 30 0 02500 * THE LHS IS NOT ONE SHOT 025 10 VaLUE=TOTS (VP,4) 02520 POINTR=SRT(DPH(1,1) ,10) + SBT (DPH (1, 1) , 5) 02530 IF {SET (DPM (1,1) ,2) .EQ. 4 2 -OR. SET (DPM(1, 1) ,2) - EQ.59) 02540 1 PROD=99 02550 CALL PDTBIT{POINTR,PROD,VALUE) 02560 GO TO 1690 02570 300 CONTINUE 02 580 * A ONE-SHOT IS TO BE SET 02590 XF(PROD.HE. 15) GO TO 310 02600 * ONE-SHOT IS ON THE LHS OF AN EQUIVALENCE ERROR IS TO BE GIVEN 02610 WRITE (5, 2050) 02620 CALL EXERR 02630 GO TO 1690 026 40 310 CONTINUE 02650 IF (TOTS (VP,4)-EQ. 1) GO TO 320 02660 WRITE (5,2060) 02670 CALL EXERR 02680 GO TO 1690 02690 320 CONTINUE 027 00 DO 330 1=1,OSTRN 02710 * LOOK IN SET FOR THE ONE SHOT 02720 IF (OST (I, 1)-NE.SRT (DPM {1,1) , 1) ) GO -TO 330 02730 * THE ONE SHOT IS FOUND, GET ITS DURATION 02740 OST (I, 2) =SRT (DPH (1,1) ,9) 02750 ' GO TO 1690 02760 330 CONTINUE 02770 340 CONTINUE 02780 * A SYMBOL IS FOUND ON THE RHS WHOSE INFORMATION IS IN SET 02790 VHB=SRT (TOTS (VP,4) ,3) 02800 VVB=SRT(TOTS(VP,4),4) 02810 HBS=SRT (TOTS (VP,4) ,5) 02820 HBE=SRT(TOTS(VP,4),6)

02830 VBS=SRT(TOTS(VP,4),7) 191 02840 VBE=SRI (TOTS (VP,4) ,8) 02850 !IOP=SRT(TOTS(VP*4) ,10) 02860 GO TO 360 02870 350 CONTINUE 02880 * A SYMBOL IS IN BBS WHOSE INFORMATION IS IN TOTS 02890 VHB=TOTS (VP,2) 02900 VVB=TOTS (VP,3) 02910 HBS=0 02920 HBE=TOXS (VP, 2) -1 02930 VBS=0 02940 VBE=TOXS(VP,3)-1 02950 TOP=TOTS (VP,4) 02960 360 CONTINUE 02970 LEN1=HBE-HBS+1 02980 LEN2=VBE-VBS+1 02990 IF ( (LENI-NEoHB) ORo(LEN2,NE-VB)) GO TO 280 03000 370 CONTINUE 03010 * TRANSFER RHS INTO LHS BIT BY BIT 03020 DO 460 COI=1,HB 03030 DO 450 ROW=1,VB 03040 DCOL=COL 03050 DROW=ROW 030 60 DO 410 1=1, DHL 03070 DO 400 J=1,DHL 030 80 * SEE IF DPM COLUMNS IN THE CURRENT ROW ARE ENDED 03090 IF (DPM (I, J) ,EQ, 0) GO TO 410 03100 SDHL=SBT (DPM (I, J) , 6) —SET (DPM (I, J) ,5) +1 03110 SDVL=SRT (DPM (I, J) ,8) -SRT (DPM (I,J) ,7) +1 03120 IF(SDHLo GEo DCOL) GO TO 380 03130 DC 0 L= DC OL— S D H L 03140 GO TO .400 03150 * HERE WE ARE TRYING TO FIND THE EXACT DESTINATION OF EACH BIT IN LHS 03160 380 CONTINUE 03170 IF (SDVL= GEo DROW) GO TO 390 03180 DROW=DEOW-5DVL

03190 DCOL=COL 192 03200 GO TO 410 03210 39 0 CONTINUE 03220 SDEST=DPM{I,J) 03230 GO TO 420 032 40 400 CONTINUE 03250 410 CONTINUE 032 60 420 CONTINUE 03270 * LOCATION IS FOUND FIND. POINTERS. AND BHS BIT VALUE 03280 POINTR=SRT(SDEST,10) *SRT (SDEST,3)*(SRT(SDEST ,7)+DROW- 03290 1 4 SET (SDEST, 5) 4DTCOL-I ...... 033 00 * SEE IF THE VALUE POINTEfi POINTES TO A CONTINIOUS SYMBOL 03310 IF (TOTS (VP, 1) -NEo 1) GO TO 430 03320 VA.LUE=BV (VHB+1-COL). 03330 GO TO 440 03340 430 CONTINUE 033 50 ADDRES=T0P4VHB* (VBS + RO.N-1) + (HBS+COL-1) 03360 CALL GETBIT(ADDRES,VALUE) 033 70 440 CONTINUE 03380 IF (SET (SDEST, 2) »EQ» 42 ,OR» SET (SDEST, 2) . EQ. 59) 03390 1 PROD=99 034 00 * IF -BU5- IS ON THE LEFT HAND SIDE SET PROD=99 SO THAT THE BUS 034 10 * VALUE BE ORED NTTH ITS PREVIOUS VALUE ■ 034 20 CALL PUTBIT(POINTR,PROD,VALUE) 03430 450 CONTINUE 03440 46.0 CONTINUE 03450 * CONDITIONAL LHS SEPARATES FROM THIS ROUTINE HEBE 034 60 IF { (PRODo NE«» 17) » OR» (DPMROW, EQ» 1) ) GOTO 1690 03470 DPMR1=DPMROW-1 03480 DO 480 I=1,DPMR1 034 90 DO 470 J = 1,DHL 03500 DPM(I,J)=DPM((I+1),J) 03510 470 CONTINUE 03520 480 CONTINUE 03530 DPMROW=DPMR1 03540 * IN THE ABOVE STATEMENTS,THE TOP RON OF DPM NAS ELIMINATED IN CASE i

03550 * A CONDITIONAL TRANSER» THIS IS DONE AFTER BIT TRANSFER IS DONE INTO 193 03560 * EACH RON OF SYMBOLS OF DPM. 03570 GO TO 370 03580 490 CONTINUE 03590 * CONDITIONAL TRANSFER BRANCHES TO HERE FOR SEPARATE EXECUTION 03600 GO TO (500,510,530,540) TOTS (CVP/1) 03610 500 CONTINUE 036 20 , WRITE (5,2070) 03630 CALL EXERR 03640 GO TO 1690 03650 510 CONTINUE 036 60 * .SEE IF IN CASE OF ONE REGISTER DESTINATION,THE LHS IS SINGLEREGISTER 03670 IF ( (DPH(2, 1).,EQ.0) •AND. {DPH {1,2).EQ.0)) GOTO 520 03680 WRITE(5,2080) 03690 CALL EXERR 03700 GO TO 1690 03710 520 CONTINUE 03720 IF (TOTS (CVP,4)„EQ» 0) GO TO 1690 03730 GO TO 260 03740 53 0 'CONTINUE 03750 * CONDITION VECTOR POINTER POINTS TO SET AND ALL THE INFORMATION FOR FIN 03760 * -DING THE VALUES CAN BE FOUND IN SET 03770 CVHB=SRT (TOTS (CVP„4) ,3) 037 80 CVVB=SRT (TOTS (CVP,4) ,4} 03790 CVHBS=SRT (TOTS (CVP,4) ,5) 03800 CVHBE=3RT(TOTS(CVP,4),6) 03810 CVVBS=SRT(TOTS(CVP„4) ,7) 03820 CVVBE=SRT(TOTS(CVP,4),8) 03830 CTOP=SRT (TOTS (CYP,4) ,10) 03840 GO TO 550 03850 54 0 CONTINUE . 03860 * THE INFORMATION ABOUT THE CONDITIONAL VECTOR IS IN TOTS 03870 CVHB=TOTS (CVP,2) 03880 CVVB=TOTS(CVP,3) 03890 CVHBS=0 03900 CYHBE=CVHB—1

03910 CVVBS=0 194 03920 .CVVBE=CVVB-1 03930 CTOP=TOTS(CVP#4) 03940 550 CONTINUE 03950 IP(CVyBE.EQ-CVVBS) GO TO 560 03960 WHITE (5,2090) 039 70 CALL EXERR 03980 GO TO 1690 03990 560 CONTINUE 04000 SCVHB=CV HBE-CVHBS + 1 04010 IE(YBoEQ.SCYHB) GO TO 570 04020 WRITE (5,2100) 04030 CALL- EXERR 04040 GO TO 1690 04050. 570 CONTINUE 04060 CNAR=1 04070 IF ( (SET (DPM (1 ,1) ,8) - SET (DPM (1^1) »7) + 1) .GT. 1 ) 04080 1 GO TO 630 04090 DO 620 1=1,SCVHB 04100 'ADDHES=CTOP+CVHB*CYVBS-1+CVHBS+I 04110 CALL GETBIT(ADDRES,VALUE) 04120 IF(DPHROW.EQ.O) GO TO 1690 04130 IF(VALUEoNEo0) GO TO 59 0 04140 DO 580 J=1,DHL 04150 IF (DPH(I> J) .EQ.0) GO TO 620 04160 DPH(I,J)=0- 04170 580 CONTINUE 04180 GO TO 620 04190 590 CONTINUE 04200 04210 * IF THE VALUE OF THE CURRENT CONDITIONAL VECTORBIT IS ZERO GET THE HEX 04220 * -T BIT AND IF IT IS ONE, PLACE THE CORRESPONDING ROW OF DPM IN THE DPM 04230 IF (I.EQ.CNAR) GO TO 610 04240 DO 600 J=1,DHL 04250 IF (DPM (I, J) =EQ,0) GO TO 610 04260 DPM{CNAR,J) =DPM(I, J)

04270 DPM (I, J) =0 195 04280 600 CONTINUE 04290 610 CONTINUE - 04300 CHAE=CNAR+1 04310 620 CONTINUE 04320 * IN THE ABOVE STATEMENTS THE ROWS OF DPM FOR WHICH THE CORRESPONDING 04330 * BINARY VECTOR BITS WERE ZERO WERE OMMITED FROM THE DPM THIS MAKES THE 04340 . * DPM SAME AS THE REGULAR TRANSFER DPM AND CONTROL CAN BE HANDLED BY THE 04350 * SAME PROCEDURE 04360 _ DPMROW=CNAR-1 04370 * FIND THE NEW SIZE OF DPM 04380 GO TO 660 04390 630 CONTINUE 04400 DO 640 N=1,SCVHB 04410 ADDHES=CTOP+CVHB*CVVBS-H-CVHBS*N 04420 CALL GETBIT(ADORES,VALUE) 04430 IF (VALUE = EQ= 0) GO TO 640 04440 REFROW=N-1 04450 GO TO 650 04460 640 ' CONTINUE 044 70 GO TO 16 90 044 80 650 CONTINUE 04490 SRTRN = SRTRN + 1 04500 SET (SRTRN* 1) = SBT (DPfl (1, 1) , 1) 04510 SET (SRTRN*2) = SRT (DPM (1,1) ,2) 04520 SRT (SRTRN, 3) = SET (DPM (1, 1) ,3) 04530 SRT (SRTRN, 4) = SRT (DPM (1*1),4) 04540 SRT (SRTRN, 5) = SET (DPM (1,1),5) 04550 SET (SRTRN, 6) - SET (DPM (1,1),6) 04560 SET (SRTRN, 7) = REFROW 04570 SRT (SRTRN,8) = REFROW 04580 SRT (SRTRN, 9) = SET (DPM (1,1),9) 04590 SET (SRTRN, 10) = SRT (DPM (1,1),10) 04600 DPM (1,1) = SRTRN 04610 660 "CONTINUE ...... 04620 VB=0 04630 HB=0 046 40 DO 720 I=1,DPMROW . 04650 DO 680 J=1,DML 04660 VB=SRT (DPM(1, 1)., 8) -SET (DPM (1,1) ,7) +1 04670 * SEE IF THE CURRENT DPM ROW IS ALL TAKEN INTO ACCOUNT 0.46 80 IF (DPM (I, J) o EQ«. 0) GO TO 690 > 04690 NVB=SRT (DPI (/I, J) , 8) -SRT (DPM (I, J) ,7)+l 04700 IF (VB- EQ« NVB) GO TO 670 04710 WRITE (5, 2010) 04720 GO TO 1690 04730 670 CONTINUE 04740 HB=HB+SRT (DPM (I, J) ,6) -SRT (DPM (I, J) ,5) +1 04750 680 CONTINUE 04760 690 CONTINUE 04770 IF (I. NE, 1) GO TO 700 04780 PHB=HB 04790 GO TO 710 04800 700 CONTINUE 04810 IF (HB»EQ,PHB) GO TO 710 04820 WRITE (5,2030) 04830 GO TO 1690 04840 710 CONTINUE 04850 HB=0 04860 720 CONTINUE 04870 HB-= PHB 04880 * NOW THAT DPM IS COMPOSED OF REGISTERS WHOSE CORRESPONDING BITS IN THE 04890 * CONDITIONAL VECTOB ARE ONLY ONE,' IT CAN BE TREATED THE SAME AS A DPH OF 049 00 * A REGULAR •TRANSFER 04910 IF(DPM(1,1).EQ.0) GOTO 1690 04920 * THE ABOVE CHECKS FOR EMPTY DESTINATION, 04930 04940 GO TO 260 197 04950 04960 * PART T H 0 * 04970 * * 04980 ♦ FROM HERB ON, EXECUTION OF EXECUTABLE PRODUCTIONS OTHER THAN * 04990 * TRANSFER, CONDITIONAL-1RANSFER, AND EQUIVALENCE FOLLOWS THE * 05000 * ROUTINE BRANCHES TO THE APPROPRIATE LABEL ACCORDING TO THE * 05010 * PRODUCTION NUMBER. THIS IS DONE BY THE FIRST GIANT COMPUTED * 05020 * GO-TO STATEMENT AT THE BEGINING OF THE PROGRAM. * 05030 05040 05050 * FOP=FIRST OPERATOR POINTER 05060 * SOP=SECOND OPERATOR POINTER 05070 * RP=RESULT POINTER ■ 05080 * FOBV=FIRST OPERATOR BINARY VECTOR 05090 SOBV=SECOND OPERATOR BINARY VECTOR 051 00 * FOHB=FIRSI OPERATOR HORIZENTAL BITS 05110 * FOVB=FIRST OPERATOR VERTICAL BITS 05120 * FOHBS=FIRSI OPERATOR HORIZENTAL BITS START ' 05130 * FOHBE=FIRST OPERATOR HORIZENTAL BITS END 05140 ❖ FOVBS=FIRST OPERATOR VERTICAL BITS START 05150 * FOVBE-FIRST OPERATOR VERTICAL BITS END 05160 * FOTOP=FIRST OPERATOR TOP. POINTER 05170 * FOHL=FIRST OPERATOR HORIZENTAL LEGTH 051 80 ❖ FOVL=.FIRST OPERATOR VERTICAL LENGTH 05190 * SOHB=SECOND OPERATOR HORIZENTAL BITS 05200 * SOVB=SECOND OPERATOR VERTICAL BITS 05210 * SOHBS=SECOND OPERATOR HORIZENTAL BITS START 05220 * SOH BE=SECOND OPERATOR HORIZENTAL BITS START 05230 * SOVBS=S.ECOND OPERATOR VERTICAL BITS START 05240 * SOVBE=SECOND OPERATOR VERTICAL BITS END 05250 * SOTOP=SECOND OPERATOR TOP POINTER 05260 * SOHL=SECOND OPERATOR HORIZENTAL LENGTH 05270 ' * "SOVL=SECOND OPERATOR VERTICAL LENGTH 05280 * FOSP= FIRST OPERATOR SRT POINTER

05290 *■ SOSP=SECOND OPERATOR SRT POINTER 198 05300 * FOGT=FIRST OPERATOR GENERAL TYPE 05310 * SOGX=SECOND OPERATOR GENERAL TYPE 05320 * FOQB=FIRST OPERATOR ONE BIT 053 30 * SOOB=SECOND OPERATOR ONE BIT 05340 * INDEX=BINARY VECTOR POINTER 05350 * RHL=RESULT HORIZENTAL LENGTH 05360 * RVL=RESULT VERTICAL LENGTH 05370 * SOB=SECOND OPERATOR BIT 05380 * F08=FIRST OPERATOR BIT 05390 * GFIP=GENERAL FUNCTION INPUT POINTER 05400 * PDV=POS.ITION OF "ONE" IN THE DECODED VECTOR 05410 * CARBY=CARRY BIT, THE RESULT OF BIT BY BIT ADDITION 05420 * FSBX=FIRST AND SECOND BITS EXCLUSIVE ORED 05430 * FSBA=FIRST AND SECOND BITS ANDED 05440 * CFSBXA=CARRY ADDED WITH FSBX 05450 * NOB=NUMBER OF BITS 05460 * BVA=BINARY BIT VALUE 05470 • 05480 05490 730 CONTINUE 05500 * EXECTION OF PRODUCTION 25 TO 33,THESE PRODUCTIONS ARE 6+5),!* 6/ +/ ~ 05510 * AND NT 05520 FOP=QTABLE (Z,3) 05530 SOP=QTABLE(2,2) .05540 SUBPNT=SOP 05550 * SUBPNT = SUBSCRIPT POINTER, USED FOR STANDARD FUNCTION SUBSCRIPTS 05560 RP=QTABLE (2,4) 05570 740 CONTINUE 05580 * EXECUTION OF PRODUCTIONS NUMBER 37 TO 40 MERGES WITH ROUTINE AT 05590 * THIS POINT 056 00 IF ( (TOTS (FOP, 1) .EQ= 1) -OR. (TOTS (FOP,1) » EQ. 2) ) GO TO 770 05610 * THE TYPE OF POINTER IS EITHER 3 OR 4 WHICH INDICATES THAT THERE IS A 05620 * POINTER FOR THIS OPERAND TO SYMBOL VALUE TABLE 05630 IF (TOTS (FOP, 1) .EQ-4) GO TO 750 05640 * TYPE IS 3,SO THE POINTER TO SVT AND INFORMATION ABOUT THE OPERAND ARE,

05650 * IN SRT. 199 05660 FOSP=TO.TS (FOP, 4) 05670 FOHB=SBT (FOSP,3) 05680 FOVB=SET (FOSP, 4) 05690 FOHBS=SBT (FOSP,5) 05700 FOHBE=SHT(FOSP, 6) 05710 FQVBS=SBT (FOSP,7) 05720 FOVBE=SRl' (FOSP, 8) 05730 FOTOP=SRT(FOSP, 10) 05740 FOHL=FOHBE-FOHBS+1 05750 FOVL=FOVBE-F07BS+1 05760 00 TO 760 05770 750 CONTINUE 05780 * TYPE- IS 4, INFORMATION IN TOTS 05790 FOHB=TOTS (FOP, 2) 05800 FOV B=TOTS(FOP,3) 05810 FOHBS=0 05820 FOHBE=FOHB-1 05830 FOVBS=0 05840 'FOVBE=FOVB-1 05850 FOTOP=TOTS(FOP,4) 05860 FOHl=FOHB 05870 FO?L=FOVB 05880 760 CONTINUE 05890 FOGT=3 05900 GO TO 780 059 10 770 CONTINUE 05920 * TYPE IS 1 OR 2 AND THE VALUE IS IN TOTS 059 30 CALL BVB (FOP, FOBV ,F0H"B) ...... 05940 FOGT=1 05950 FOHL=FOHB 05960 FOVL=1 05970 780 CONTINUE 05980 * ONE OPERAND-PRODUCTIONS AND BUILT-IN FUNCTIONS SEPARATE HERE 05990 IF (PROD.EQ» 54) GO TO 1090 . 06000 IF ((PROD.LT.31)-OB, (PBOD.GT-38) )• GO TO 790

06010 IF ( (PROD.EQ.37) .OR. (PROD. EQ, 38) ) GO TO 1420 200 06020 GO TO 970 06030 790 CONilHOE 06040 * RECOGNIZE THE SECOND OPERAND AS WAS DONE FOE THE FIRST ONE 06050 IF ( (TOTS (SOP, 1) oEQ.1) =OR» (TOTS (SOP, 1) EQ.2)) GO TO 8 20 06060 IF (TOTS (SOP, 1) «, EQ, 4) GO TO 800 06070 SO.SP=TOTS (SOP, 4) 06080 SOHB=SRT (SOSP„3) 06090 SO¥8=SBT(SOSP,4) 06100 SOHBS=SRT{SOSP,5) 061 10 " SOHBE=SRT(SOSP,6) 06120 SOVBS=SRT (SOSP,7) 06130 SOVBE=SRT (SOSP.,8) 06140 SOTOP-SRT(SOSP,10) 06150 SOHL=SGHBE— SOHBS*1 06160 SOVL=SOVBE-SOVBS+1 06170 GO TO 810 06180 800 CONTINUE 06190 SOHB=TOTS (SOP, 2) 06200 SQVB=TOTS(SOP,3) 06210 SOHBS=0 06220 SOHBE=SOHB-1 06230 SOVBS=0 06240 S07BE=S0VB-1 06250 S0T0P=T0TS(SOP,4) 06260 SOHL=SOHB 06270 SOVL=SOVB 06280 810 CONTINUE 062 90 SOGI=3 06300 GO TO 830 06310 820 CONTINUE 06320 CALL BVB(SOP,SOBV,SOHB) 06330 SOGT=1 063 40 SOHL=SOHB 06350 SOVL=1 06360 830 CONTINUE

06370 * ALL THE PRODUCTIONS OTHER THAN 25,26, OR 27 SEPARATE HERE 201 06380 IP ( (PROD.LT.25).OR (PROD,GT.27)) GO TO 1070 06390 * CAREY ONLY PRODUCTIONS 25 TO .27 FROM HERE ON. 064 00 FOOB=1 06410 SOOB=1 06420 IF ( (FOHL.EQ.'.SOHL) .AND- (FOVL. EQoSOVL) } GO TO 860 06430 IF { (FOHL. EQ. 1) , AND, (FOVL. EQ, 1) ) FOOB=0 06440 IF ( (SOHL.EQ. 1).. AND. (SOVL.EQ. 1) ) SGOB=0 06450 * THE ABOVE THREE STATEMENTS CHECK FOE THE DIMENSION MATHINGS, IF 06460 * DID NOT MATCH AND ONE OF THE OPERANDS HAD ONLY ONE BIT A FLAG IS 06470 * OTHER THAN THESE CASES ERROR MASSAGE IS GIVEN. 06480 IF { (FOOB.EQ. 0) .OR. (SOOB.EQ.O) ) GO TO 840 06490 WRITE(5,2110) 065 00 CALL . EXERR 06510 GO TO 1690 065 20 840 CONTINUE 06530 TOTS {RP,4)=NEP 06540 IF(FOOB. EQ. 0) GO TO 850 06550 TOTS(RP,2)=FOHL 06560 TOTS (RP,3)=FOVL 06570 RHL=FOHL 06580 RVL=FOVL 065 91) ' " GO TO 870 -- -- " " " " ' ' 06600 850 CONTINUE 06610 TOTS(RP„2)=SOHL 06620 TOTS (RP , 3) =SOVL 06630 RHL=SOHL 06640 RVL=SOVL 06650 GO TO 870 06660 860 CONTINUE 06670 TOTS (RP, 2) =FOHL 06680 TOTS (RP,3) =FOVL 06690 TOTS (RP,4) = NEP 06700 RHL=FOHL 06710 EVL=FOVL 06720 870 CONTINUE

06730 * DEPENDING ON THE TYPE OF THE POINTERS EXECUTION BRANCHES HERE 202 06740 IF ( (FOGT.EQ. 1) .AND. (SOGT.EQ. 1) ) GO TO 880

r 06750 IF ((POGT-EQ-1)-aNP- (SOGT.EQ-3)) GO TO 900 06760 IF ((FOGT<,EQ=3) - AND, (SOGT.EQ. 1)) GO TO 920 06770 IF ((FOGT.EQ.3)-AND. (S0GT.EQ.3) ) GO TO 940 06780 880 CONTINUE 067 90 * THE VALUE OF BOTH OPERANDS ARE IN TOTS IN THIS CASE 06800 D O .890 1=1,RHL 06810 INDEX=1+FOOB*(FOHL-I) 06820 FOB=FOBV(INDEX) 06830 INDEX=1+SOOB*(SOHL-I) 06840 SOB=SOBV(INDEX) 068 50 IF (PROD= EQ= 25) RESOLT=AND (SOB,FOB) 06860 IF(PROD.EQ,26) RESULT=OR(SOB,FOB) 06870 IF(PROD,EQ.27) RESULT=OR(SOB,FOB) 06880 CALL PUTBIT(NEP,PROD,RESULT) 06890 NEP=NEP+1 06900 890 CONTINUE 06910 GO TO 1690 06920 900 CONTINUE 06930 * THE VALUE OF THE FIRST OPERAND IS IN TOTS AND THE SECOND HAS A POINTER 06940 * TO SVT WHERE THE VALUE IS STORED 069 50 DO 910 1=1,RHL 06960 INDEX=1+FOOB*(FOHL-I) 06970 FOB=FOBV (INDEX) 06980 ADDRES=SOTOP + SOHB*SOVBS+S0HB3 +SOOB* (I- 1) 06990 CALL GETBIT(ADDRES,SOB) 07000 IF (PROD, EQ,25) RESULT=AND (SOB, FOB) 07010 IF (PROD. EQ. 26) RESULT=OR (SOB,FOB) 07020 IF (PROD, EQ. 27) RESDLT=XQR (SOB,FGB) . 07 030 CALL PUTBIT (NEP , PROD, RESULT) 07040 NEP=NEP+1 07050 910 CONTINUE 0.7060 GO TO 1690 , 07070 920 CONTINUE 07080 * THE VALUE OF THE FIRST OPERAND IS IN SVT WITH ITS POINTER IN TOTS,

07090 * AND THE SECOND OPERAND HAS ITS VALUE IN TOTS 203 07100 DO 930 1=1,RHL 071 10 INDEX=1+500B*(SOHL-I) 07 1 20 SOB-SOBV (INDEX) 07130 ADDRE5= FOTOPFOHB*FOVBS +FOHBS +FOOB* (1-1) 071 40 CALL GETBIT(ADDRES,FOB) 07150 IF (PROD. EQ. 25) RESULT=AND (FOB, SOB) 07160 IF (PROD.EQ.26) RESULT=OR (FOB,SOB) 07170 IF (PROD. EQ. 27) RESULT=XOR (FOB,SOB) 07180 CALL PUTBIT (NEP,PROD,RESULT) 07190 NEP=NEP+1 07200 93 0 CONTINUE 07210 GO TO 1690 07220 940 CONTINUE 07230 * BOTH OF THE OPERANDS HAVE ADDRESSES IN TOTS WHICH POINT TO SVT 07240 DO 960 J=1,RVL 07250 ' DO 950 "1-1 ,R H L ...... 07260 ADDRES=FOTOP + FOHB* (FOVBS+FOOB* (J-1) ) +FOHBS+FOOB*(I-1) 07270 CALL GETBIT(ADDRES,FOB) 07280 ADDRES=SOTOP + SOHB* (SOVBS+SOOB* (J-1) ) +SOHBS+SOOB* (1-1) 07290 CALL GETBIT(ADDRES,SOB) 073 00 IF (PROD. EQ. 25) RESULT=AND (FOB,SOB) 07310 IF (PROD.EQ.26) RESULT=OR (FOB,SOB) 07320 IF (PROD. EQ. 27) RESULT=XOR (FOB,SOB) 073.30 CALL PUTBIT(NEP,PROD,RESULT) 07340 NEP=NEP+1 07350 950 CONTINUE 07360 96 0 CONTINUE 07370 GO TO 1690 073 80 97 0 CONTINUE 07390 * EXECUTION OF PRODUCTIONS 31,32,AND 33 BEGINS HERE. 07400 * CHECK FOR (NT),AND BRANCH IF */ OR &/ ARE PRODUCTIONS TO BE EXECUTED 07410 IF (PROD. NE. 33) GO TO 1020 07420 TOTS (RP , 2) =FOHL 07430 TOTS(RP,3)=F0VL 07440 TOTS (RP,4) =NEP

07450 * SEE IF THE VALUE OF THE OPERAND IS IN SVT OR IN TOTS 204 07460 IF (FOGT. NE. 1) GO TO 990 07470 DO 980 1=1,FOUL 07480 NEWBIT=FOBV(FOHL+1-1) 07490 IF {NEWBIT. EQ» 0) E ES 011=1 07500 IF (NEWBIT„EQ« 1). SES011=0 07510 CALL . PUTBIT(HEP,PROD,EESOLT) 07520 NEP=NEP4-1 07530 980 CONTINUE 07540 GO TO 1690 07550 990 CONTINUE 07560 DO 1010 .1= 1 , ,FOVL 07570 DO 1000 J= T,FOHL 07580 ADDRES=FOTOP + FOHB* (FOVBS + I-1)+FOHBS+J-1 07590 CALL GETBIT{ADDEES,FOB) 07600 IF (FOB»EQ,0) BESULT= 1 07610 IF (FOB,EQ= 1) RESU1T=0 07620 CALL PUTBIT(NEP,PROD,RESULT) 07630 NEP=NEP+1 07640 1000 CONTINUE 07650 1010 CONTINUE 076 60 GO TO 1690 07670 1020 CONTINUE 07680 * INITIALIZE RESULT TO 0 OR 1 ACCORDING TO THE PRODUCTION, 0 FOR +1 AND 07690 * 1 FOR &/ 07700 IF (PROD-EQ„ 31) RESU1T=1 07710 IF{PROD,EQ,32) RESULT=0 07720 TOTS (RP,2) =FOVL 07730 TOTS (HP,3) =1 07740 TOTS (RP,4) = NEP 07750 IF (FOGT, NE, 1) GO TO 1040 07760 * THE OPERAND IS IN TOTS 07770 DO 1030 1=1,FOHL 07780 FOB=FOBV(FOHL+1-I) 077 90 IF (PROD. EQ, 31) RESULT=AND (RESULT, FOB) 07800 IF (PROD. EQ. 32) RESULT=OR (RESULT, FOB)

07810 1030 CONTINUE 205 07820 CALL PUTBIT (NEP, PROD,RESULT). 07830 NEP=NEP+1 07840 GO TO 1690 07850 10 40 CONTINUE 07860 DO 1060 -1=1,FOVL 07870 DO 1050 J=1,FOHL 07880 ADDRES=FOTOP4-FOHB* (FOV.BS+I-1) +FOHBS + J-1 07890 CALL GETBIT(ADDRES » FOB) 07900 IF (PROD. EQ. 31) RESULT=AND (FOB » RESULT) 07910 IF (PROD. EQ. 32) BESULT=OB (FOB, RESULT) 07920 1050 CONTINUE 07930 CALL PUTBIT (NEP,, PROD,RESULT) ' 079 40 NEP=NEP>1 07950 1060 CONTINUE 07960 GO TO 1690 - 07970 07980 1070 CONTINUE 07990 IF(PROD.NE.52) GO TO 1160 08000 * PROD IS 52 WHICH INDICATES A BRANCH 08010 IF (SOVL. EQ. 1) GO TO 1080 08020 WRITE (5,2120) 08030 CALL EXERR 08040 1080 CONTINUE 08050 GO TO 1100 08060 1090 CONTINUE 08070 SOHL=FOHL 08080 SOGT=1 08090 1100 CONTINUE 08100 IF (S0HL.LE.5) GO TO 1110 08110 WRITE (5,2130) 08120 CALL EXERR 08130 SOHL= 5 08140 1110 CONTINUE 08150 NESTCL-4 08160 DO 1150 1=1,SOHL

08170 IF (SOGT. EQ. 1) GO TO 1120 206 08180 * THE DECISION VECTOR IS IN TOTS 08190 ADDRES=SOTOP+SOHBS+I-1 08200 CALL GETBJT (ADORES„SOB) 08210 GO TO 1140 08220 1120 CONTINUE 08230 IF(PROD-NE« 54) GO TO 1130 08240 SOB=1 08250 GO TO 1140 08260 1130 CONTINUE 08270 50B=SGBV(SOHL+1-I) 08280 1140 CONTINUE 08290 * PLACE THE STEP# IN NEST IF SOB=1; IGNORE OTHERWISE 08300 IF (SOB, NE. 1) GO TO 1 150 08310 NEST{CEQ(CEQTOP„3)„NESTCL)=FOBV(SOHL+1-I) 08320 NESTCL=NESTCL+1 08330 1150 CONTINUE 08340 GO TO 1690 08350 08 360 1160 CONTINUE 08370 IF (PROD-EQ-39) GO TO 1520 08380 * PROD HAS TO BE -,28,29,, OR 30„ BRANCH ACCORDINGLY 08390 IF(PROD-29) 1170,1260,1330 08400 * ROW CATENATION EXECUTION START HERE 08410 1170 CONTINUE 08420 IF (FOVL*EQ» SOVL) GO TO 118 0 08430 WRITE (5,2140) 08440 CALL EXERR 08450 GO TO 1690 08460 1180 CONTINUE 08470 TOTS (RP,2) = FOHL+SOHL 08480 TOTS {RP.,3) =FOVL 08490 TOTS (HP, 4).=NEP 08500 DO 1250 1=1,FOVL 08510 DO 1210 J= 1 , SOH.L 08520 IF (SOGT= EQo 3) GO TO 1190 08530 SOB=SOB¥(SOHL+1-J) 08540 GO TO 1200 207 08550 1190 CONTINUE 08560 ADDEES=SO:TOP+SOHB* (SOVBS+I-1) +SOHBS+J-1 08570 ' ' CALL GETBIT(ADORES„SOB) ...... 08580 1200 CONTINUE 08590 CALL PUTBIT{NEPS PROD* SOB) 08600 NEP=NEP+1 08610 1210 CONTINUE 08620 DO ,1240 J=1tFOHL . 08630 IF (FOGT= EQ«. 3) GO TO 1220 08640 FOB=FOBV (FOHL+I-J) 08650 ' GO TO 1230 08660 1220 CONTINUE 08670 ADDRES=FOTOP4-FOHB* (FOVBS+I-1) +FOHBS+J-1 08680 CALL GETBIT(ADDRES » FOB) 08690 1230 CONTINUE 08700 CALL PUTBIT(NEP,PROD,FOB) 08710 NEP=NEP+1 08720 1240 CONTINUE 08730 1250 CONTINUE 08740 GO TO 1690 v 08750 1260 CONTINUE 08760 IF (FOHLc EQ« SOHL) GO TO 1270 08770 WRITE (5,2150) 08780 CALL EXERR 08790 GO TO 1690 08800 1270 CONTINUE 08810 IF (SOGT-NE»1 .AND. FOGT.NE.1) GO TO 1280 08820 WRITE (5,2160) 08830 GO TO 1690 08840 1280 CONTINUE 08850 TOTS (HP, 2) =FOHL 08860 TOTS (HP, 3) =FOVL+SOVL 08870 TOTS (RP,4) =NEP 088 80 DO 1300 1=1,SOVL

08890 DO 1290 J=1,SOHL 208 08900 ADDRES=SOTOP+SOHB*(SOVBS+I-1)+SOHBS+J-1 089 10 CALL GETBIT(ADORES,SOB) 089 20 CALL PUTBIT (MEP , PROD,SOB) 08930 NEP=EEP+1 08940 1290 CONTINUE 08950 1300 CONTINUE 08960 DO 1320 I=1ffPO¥L 08970 DO 1310 J=1,FOHL 08980 ADDRES=FOTOP*FOHB* (FOVBS^-I-I) +.FOHBS+J— 1 08990 CALL GETBIT(ADDRES,FOB) 09000 CALL PUTBIT(NEP,PROD,FOB) 09010 NEP=NEP+1 09020 1310 CONTINUE 09030 1320 CONTINUE 09040 GO TO 1690 09050 09060 1330 CONTINUE 09070 * EXECUTION OF CONDITIONAL RHS STARTS HERE 09080 IF (FOVL= EQ« 1) GO TO 1340 09090 WRITE (5,2170) 09100 CALL BXERR 09110 1340 CONTINUE 09120 IF (FOHL, EQ.SOVL) G O T O 1350 09130 IF(FOHL.GT.SO?L) FOHL=SOVL 09140 WRITE(5,2180) 09150 CALL EXERR 09160 1350 CONTINUE 09170 IF (FOGT,EQ»3) G O T O 136.0 09180 WRITE(5,2190) 09190 CALL EXERR 09200 GO TO 1690 09210 1360 CONTINUE 09220 TOTS (RP,2) =SOHL 09 230 TOTS (RP/3) =1 09240 NEP= NE P+ SOHL

092 50 * CHECK IF THIS IS A BUSFN EXECUTION, TAKE THE SUBSCRIPTS. 209 09260 IF (ORIGIN. EQ.40) TOTS (EP,2) =SRT (SUBPNT,6) -SET (SUBPNT,5)+1 09270 DO 1370 1=1 »'FOHL 09280 ADDRES=FOTO.P+i-l4-.FOHBS 09290 CALL GEIBIT (ADDRES, FOB) 09300 IF(FOBoNEol) GO TO 1370 09310 TOTS(BPl,4)=SOTOP+SOHB* (SOVBS-H-I) +SOHBS 09320 * IN CASE OF BDSFN, CONSIDER THE SUBSCRIPTS, 09330 IF (ORIGIN,EQ, 40) TOTS (RP,4)=TOTS (RP,4) +SRT (SUBPNT^S) 09340 / GO TO 1690 09350 1370 CONTINUE 09360 GO TO 1690 09370 09380 ******************************************* 09390 09400 1380 CONTINUE 09410 * EXECUTION OF PRODS#35 AND 36 STARTS HERE 09 420 RP=QT ABLE (2,4) 09430 NOB=QTABLE(Z„2) 09440 BVA=QTABLE(Z,3) 09450 TOTS (RP,2) =NOB 09460 TOTS (RP<,3) = 1 09470 TOTS(RP,4)=NEP 09480 MASK1= MASK (1) 09490 MASK1 = SHIFT (HASK1,1) 095 00 TOPNT= NEP 09510 IF (NOB,LE, 60) GO TO 1390 09520 WRITE (5,2200) 09530 NOB=60 09540 1390 CONTINUE 09550 DO 1400 1=1„NOB 09560 BIT=AND(MASK1,BVA) 09570 PLACE=TOPNT+NOB-I 09580 CALL PUTBIT(PLACE,PROD,BIT) 09590 B7A=SHIFT (BVA,59) 09600 NEP=NEP+1 09610 T400 CONTINUE 09620 GO TO 1690 09630 09640 096 50 ******************************************* 09660 09670 1410 CONTINUE 09680 GFIP=QTABLE(Z,3) 09 6 90 RP=QTABLE(Z,4) 09700 XP ( (TOTS (SFIP,2)«NB.46) .OB. (TOTS (GFIP, 1) .BE. 1) J GO TO 730 09710 WRITE (5, 2210) 09720 CALL EXERR 09730 GO TO 1690 09740 1420 CONTINUE 097 50 * EXECUTION OF PRODUCTIONS 37 AND 38 ..RETURNS HERE 09760 PDV=0 09770 IF (FOVL.EQ, 1) GO TO 1430 09780 WRITE(5,2220) 09790 CALL EXERR 09800 * SETDETECT BACK TO ZERO, TO ENABLE THE PRINT SINCE THIS WAS NOT 09810 * VITAL ERROR. 09820 DETECT=0 09830 1430 CONTINUE 09840 IF (PROD.EQ.38) GO TO 1480 09850 DO 1460 I=1,FOHL 09860 IF (FOGT. EQ. 3) GO TO 1440 09870 FOB=FOBV (I) 09880 GO TO 1450 098.90 1440 C O N T I N U E...... 099 00 ADDRES=FOTOP+.FOHBS + FOHL-I 09910 CALL GETBIT (A.DDRES, FOB) 09920 1450 CONTINUE 09930 PDV= ( (2** (1-1) ) *.FOB) *PDV 09940 1460 CONTINUE 09950 * SEE IF THE STANDARD FUNCTION IS NOT SUBSCRIPTED MORE THAN ITS ARGUMENT 09960 IF ( (SRT (SUBPNT, 6) -SRT (SUBPNT, 5) + 1) .LB. 2**FOHL) 09970 1 GO TO 1470 09980 WRITE (5,2230) 09990 CALL EXERE 10000 GO TO 1690 10010 ■ 1470 CONTINUE 10020 TOTS(BP,2)=SBT(SDBPNT,6)-SRT(SUBPHT,5)+1 . 10030 TOTS (RPe 3) = 1 10040 TOTS(BP,4)=NEP+SBT(SUBPNT,5) 10050 NEP=NEP+PDV 100 60 RESULT=1 10070 CALL PUTBXT (NEP^PBOD,RESULT) 10080 NEP=NEP-PDV+{2**EOHL) 10090 GO TO 1690 10100 1480 CONTINUE 10110 SOHB=FOHL 10120 SOHL=FOHL 10130 * MAKE A SECOND OPERATOR WITH A VALUE OF 1 AND ADD IT TO THE FIRST 10140 * OPERATOR TO IMPLEMENT AN INC OPERATION. 10150 SOV.L=1 10160 * DEC IS A SUB-FUNCTION OF INC, SO (SOP) WILL BE ONE FOR DEC 10170 SIMNAM=(SET(SUBPNT,1) .AND.77777700777777777777B).OB. 10180 1 00000055000000000000B 10190 IF(SYMNAM.NE.nDEC ") GO TO 1500 102 00 DO 1490L=1,SOHL 10210 SOBV(L) = 1 10220 1490 CONTINUE 10230 SOGT = 1 10240 GO TO 1520 10250 1500 CONTINUE 10260 DO 1510 1=1,SOHL 10270 ' SOBV (I) =0 10280 1510 CONTINUE 10290 SOBV (1) = 1 10300 SOGT=1 10310 1520 CONTINUE 10320 SYMNAM=(SET(SUBPNT,1).AND. 77777700000000000000B) .OR.

10330 1 00000055555555555555B 212 103 40 IF ( (SYMNAM.EQ. ”ASS ») . AND. (FOVL. EQ= 1) ) , 10350 1 CALL ASSOC (RP,SU£PNY» FOBV , FOGT, .FOTOP, FOHL, FOHBS, FOVL,, SOBV , 10360 2 •SOGT,SOTOP,SOH1,SOHBS,SOVL,SOVBS,SOHB, HEP,ABOBT) 10370 10380 . IF ( (SYilMM-EQo "ASS »)-.AND. CFOVL.ME. 1} ) 10390 1 CALL ASjSOC (BP#saBPN!r»SOBV,SOGI,SOTOP,SOHL,SOHBS,SOVl,POBV, 10400 2 FOGT,POIOP,POHL»FOHBS,FOVL,FOVBS,FOHB, NEP,ABOBI) 10410 10420 IF (SYHEAH.BQ. MCOH ") CALL COflPABB (RP,SDBPST,FOBV,FOGI, 10430 1 FOTOP,FOHL,FOHBS,F07L,SOBV,SOGI,SOIOP,SOHL,SOHBS,SOVL, NEP, 10440 2 ABORT) 10450 10460 IF (ABORT.HE.1) GO TO 1530 10470 ABORT=0 10480 GO TO 1690 10490 1530 CONTINUE 10500 TOTS (BP, 2).= SRT (SUBPNT„ 6) - SET (SUBPNT, 5) + 1 10510 TOTS (RP, 3) = 1 10520 TOTS (RP,4)=NEP+SRT(SUBPNT,5)-i-1 10530 * CHECK FOR THE ROW # OF (ADD) AND (INC) ARGUMENTS 10540 IF ( (FdVL.EQ. 1) - AND. (SOVl.'EQ. 1)) GO TO 1540 10550 WRITE (5;2240) 10560 CALL EXEBR 10570 DETECT=0 10580 1540 CONTINUE 10590 * CHECK THE SUBSCRIPTS 10600 CLUBIT=SRT (SUBPNT,6) -SRT (SUBPNT, 5) +1 10610 IF ( (CLUBlTo LE» SOHL) .OB. ( (CLUBIT.LE. (SOHL + I) ) «=AND. (SYttNAM.; 106 20 1 EQ«"ADD ")) ) GO TO 1550 10630 WRITE(5,2230) 106 40 CALL EXERR 10650 GO TO 1690 10660 1550 CONTINUE 10670 CARBY=0 10680 DO 1600 1=1 ,SOHL .

1 0690 IF (SOGT. EQ, 3) GO TO 1570 213 10700 SOB=SOBV(I) 107 10 IF (FOGT.EQ„ 1) GO TO 1560 10720 ADDRES=FOTOP+FOHBS-I+FOHL 10730- CALL GETBXT (ADORES„ FOB) 10740 GO TO 1590 10750 1560 CONTINUE 10760 FOB=FOBV (I) 10770 GO TO 1590 10780 1570 CONTINUE 10790 ADDRES-SOTO.P + SOHBS-I+SOHL 10800 CALL GETBIT (ADD.RES„SOB) 10810 IF (FOGT.EQ.1) GO TO 1580 10820 ADDR2S=FOTOP+FOHBS-I+FOHL 10830 CALL GETBIT(ADDRES,FOB) 10840 GO TO 1590 10850 1580 CONTINUE 10860 FOB=FOBV (I) 10870 1590 , CONTINUE 108 80 * THE BIT BY BIT OPERATION OF ADD FOLLOWS 10890 FSBX=XOR (FOBrSOB) 10900 RESULT=XOR (CARRY/FSBX) 10910 FS BA=AND (FOB, SOB) 10920 CFSBXA=AND (CARRY,FSBX) 10930 CARRY=OR(FSBA,CFSBXA) 10940 PNTR=NEP+SOHL-I+1 .10950 CALL PUTBIT(PNTR,PROD,RESULT) 10960 1600 CONTINUE 10970 " 10980 IF (SRT (SUBPNT, 1) oNE» "ADD ") GO TO 1610 10990 * SINCE THE OPERATION IS AN ADD OPERATION, TAKE CARE OF THE CARRY 1 1000 TOTS (RPj,4) =TOTS (RP,4) -1 11010 X PNTR= NEP 1 1020 CALL PUTBIT(PNTR,PROD,CARRY) 11030 1610 CONTINUE 11040 NEP=NEP+SOHL+1

11050 GO TO 1690 214 11060 11070 1i0 80 ************************************************************************ 11090 11100 1620 CONTINUE 11110 * BUSFN & ADD EXECUTION FOLLOWS, THEY BOTH BRANCH TO PREVIOUS PARTS OF 11120 * THE PROGRAM,AFTER INITIAL EXECUTIONS. 11130 11140 S08PNT=QTABLE(Z,2) 11150 GFIP= QIABLE(2,3) 11160 RP=QTABLE (2,4) 11170 IF (TOTS (GFIP, 2) . EQ. 46) GO TO 1630 11100 WRITE (5,2250) 11190 CALL EXERR 11200 GO TO 1690 11210 1630 CONTINUE 1 1220. FOP=TOTS (G.FIP,4) 11230 SOP=TOTS(GFIP,3) 1 1240 - IF ( ( (TOTS (FOP,2) . EQ-46) .AND. (TOTS (FOP, 1) . EQ. 1) ) » OR. 1 1250 1 ( (TOTS (SOP, 2) .EQ.46) .AND. (TOTS (SOP , 1) « EQ» 1) ) ) GO TO 1640 11260 GO TO 1650 11270 1640 CONTINUE 11280 WRITE (5,2260) 11290 CALL EXERR 11300 GO TO 1690 11310 1650 CONTINUE 11320 ORIGIN=PRQD 11330 * PROD IS SAVED SO THAT IN CASE OF (BUSFN), WE AREABLE TOCONSIDER 11340 * THE SUBSCRIPTS. 1 13 50 IF (PROD.EQ.40) PROD=30 11360 GO TO 740 11370 11380 1 13 90 ******** **** ****************** ****************************************** 11400 11410 1660 CONTINUE 11420 WRITE (5,227 0) 215 11430 GO TO 1690 11440 11450 1 1460 **************************** ******************** ************************ .11470 11480 1670 CONTINUE 1.1490 * BRANCHING GOES TO 301 FOR INITIALIZATIONS AND TO 335- ,.FQR EXECUTION 11500 * NOTHING IS TO BE DONE HERE 11510 GO TO 730 11520 11530 11540 ************************************************************************ 11550 11560 1680 CONTINUE 11570 * NON CONDITIONAL BRANCHING 11580 NEST {CEQ (CEQTQ.P,3) »4) = TOTS ( (QTABLE (2,2) ) ,4) 11590 11600 11610 11620 **************** ****************** ************************************** 116.30 1 1640 1690 c o n t i n u e ' 11650 RETURN 11660 20 00 FORMAT (1.X„50H::::::: ::: C O M P I L E R E R R O R 11670 1:) 116 80 2010 FORMAT (1X»6.9H---- > THE NUMBER OF ROWS OF THE TWO CONCAT. OPE 11690 1 RANDS DO NOT MATCH ) 11700 2020 FORMAT (1X,56H---- > IL.LIGA1 SYMBOL ON THE LHS OF EQUIV. OR TR 11710 1ANSFER. ) 11720 2030 FORMAT (1X,70H---- > THE NUMBER OF COLUMNS OF THE TWO CONCAT, 11730 10PERANDS DO NOT MATCH) 11740 2040 FORMAT (IX,45H---- > UNEQUAL NUMBER OF BITS ON LHS AND RHS) 11750 2050 FORMAT (IX, 48H---- > A ONE SHOT NEEDS CLOCK TO BE SET;.IGNORED) 11760 20 60 FORMAT (1 X, 46H---- > ONE SHOT CANNOT RESET TO ZERO; IGNORED) 2070 11770 FORMAT (1X,76H— -- > A BINARY VECTOR CANNOT BE USED AS CONDITI 216 11780 ION FOR DESTINATION; IGNORED) 1 1790 2080 FORMAT(IX,67H— --- > SINGLE CONDITION FOR MULTIPLE DESTINATION 11800 1; TRANSFER IGNORED) 1 1810 2090 FORMAT (11,858— — > THE CONDITIONAL VECTOR HAS TO BE ONE DIME 11820 1NSIONAL; INTERPRETER CANNOT PROCEED ) 11830 2100 FORMAT(IX,79H----- > CONDITIONAL VECTOR BITS AND DESTINATION R 11840 1EGISTER DO NOT MATCH IN NUMBER) 1 1850 21 10 FORMAT (IX, 49H— > UNMATCHED DIMENSION IN & + OR a) OPERATION 1 1860 1) 11870 2120 FORMAT(IX,71H----- > THE DECISION VECTOR HAS TO BE ONE DIMENSI 1 1880 10NALj FIRST ROW ASSUMED) 11890 2130 FORMAT(IX,89H----- > THE MAXIMUM NUMBER OF BRANCHES CANNOT BE 11900 1 MORE THAN 5; PROCEED WITH THE FIRST FIVE) 11910 2140 FORMAT(IX,63H----- > THE NUMBER'OF ROWS IN A COLUMN CATENATION 11920 1 DO NOT MATCH.) 11930 2150 FORMAT(IX,63H----- > THE NUMBER OF COLUMNS IN A ROW CATENATION 11940 1 DO NOT MATCH.) 11950 2160 FORMAT (IX,45H-;---- > BINARY VECTOR CANNOT BE ROW CATENATED) 11960 2170 FORMAT(IX,76H----- > THE CONDITION VECTOR HAS TO BE ONE DIMENS 11970 1IONAL;THE FIRST ROW ASSUMED) 11980 2180 FORMAT(IX,87H----- > CONDITION VECTOR COLUMNS AND ARRAY ROWS D 11990 10 NOT MATCH IN NUMBER; SMALLER ASSUMED) 12000 2190 FORMAT(IX,65H----- > CONDITIONAL RHS CANNOT HAVE A PRE-SET CON 12010 1DIT.ION VECTOR. ) 12020 2200 FORMAT(IX,58H----- > ENCODE FUNCTION BITS CANNOT EXCEED 60. MA 12030 IX ASSUMED) 12040 2210 FORMAT(IX,49H----- > INC,DEC 6 DCD CAN ONLY HAVE ONE ARGUMENT. 12050 1) i 12060 2220 FORMAT(IX,81H----- > INC,DEC & DCD ARGUMENTS HAVE TO BE ONE DI 12070 1MENSIONAL; THE FIRST ROW ASSUMED) 12080 2230 FORMAT (IX,67H----- > FUNCTION IS SUBSCRIPTED MORE THAN IT HAS 12090 1ARGUMENTS; IGNORED) 12100 2240 FORMAT (IX, 84H— — > ADD, INC S DEC ARGUMENTS HAVE TO BE ONE 12110 1 DIMENSIONAL; THE FIRST ROW ASSUMED.) 121.20 2250 FORHAir (1X» 47H---- > THE CLU NEEDS ANOTHER ARGUMENT; IGNORED) 12130 2260----- FORMAT(IX,74H---- > ADD & BUSFN CANNOT HAVE MORE THAN TWO AEG 12140 1UMENIS ;OPERATION IGNORED) 12150 2270 FORMAT (1Xj,5H*****,92H INTERPRETER IS NOT YET ABLE TO RECOGNIZE 12160 1 ANY USER DEFINED FUNCTION,,THE OPERATION IS IGNORED) 12170 END 218 000 10 SUBROUTINE OUTPUT 00020 * THIS ROUTINE IS CALLED TO PRINT THE RESULTS OF THE LAST EXECUTED 00030 * STEP{S); EACH TIME BEFORE EXECUTION OF THE NEW -NEST 00040 * THIS ROUTINE PRINTS ONE LtNE OF OUTPUT™ 00050 IMPLICIT INTEGER (A-Z) 00060 DIMENSION LINE (133) 00070 COMMON/OUT/ QUTTBL (50,3) jOUTEOW 00080 COMMON/EXEC02/ NESTBN 00090 COMMON/EXEC09/ NEST (25,8) 00100 COMMON/TABLE/ DEBUG 00110 COMMON/ERROR/ DETECT 00120 COMMON/SUPPRE/ SUPP(5,2) 00130 ' . 00140 DATA CLPN/0/ 00150 DATA BLANK/0/ 00160 DATA PLIM/122/ 00170 * PLIM=PRINT LIMIT WHICH IS THE NUMBER OF COLUMNS THAT VALUE WILL BE PBI 00180 * -NTED IN A PAGE 00190 DATA PGCQL/133/ 00200 00210 IF (DETECT™ EQ™1) RETURN 00220 CLPN=CLPN+1 00230 * SKIP THE HEADING IF THE CLOCK PULSE NUMBER IS GREATER THAN ONE 00240 IF (CLPNo GT« 1) GO TO 110 00250 00260 ******** ***g**g**j**-^**E******H**E**A**D*:itI**N**G* ******** 00270 WRITE (5,2000) 00280 WRITE (5,2010) OUTTBL(1,1) 00290 LOOP=OUIROW+1 00300 DO 100 1=2,LOOP 00310 PNTR=0 00320 SPACE=11 00330 IF (I. NE.LOOP) GO TO 10 00340 LINE (1) = "C"

00350 LINE (2) ="L" 219 00360 LINE (3) ="0" 00370 LINE (4) ="C'1 00380 LINE (5) ="K" 00390 LINE (6) ='• " 00400 LINE (7)="#" 004 10 LINE (8) =» " 00420 LINE (9) = ” " 00430 LINE (10) =" " 00440 LINE (11)=" " 00450 LINE (12) =»1 " 00460 PNTE=12 00470 GO TO 30 00480 10 CONTINUE 00490 DO 20 N= 1*11 00500 LINE (N) =» » 00510 PNTR=PNTR+1 00520 20 CONTINUE 00530 PNTE=PNTE+1 00540 LINE (PNTR) ="!" 00550 30 CONTINUE 00560 DO 90 J=2,I 00570 SPACE=OUTTBL((J-1) ,2) 00580 START=PNTR+1 00590 STOP=PNTR+SPACE 00600 DO 40 N=START* STOP 00610 LINE (N) =" » 00620 PNTR= PNTR+1 00630 40 CONTINUE 00640 IF (J„EQ»I) GO TO .50 00650 PNTR=PNTR+1 . 00660 LINE(PNTR)=»!» 00670 GO TO 90 00680 50 CONTINUE 00690 IF(I.EQ.LOOP) GO TO 70 00700 SYMBOL=OUTTBL (1*1) 007 10 DO 60 F = 1 * 10 00720 LCHAR=AND(SYMBOL,MASK(6)) 220 00730 -LINE {PNTR*F) =LCHAB 00740 SYHBOL=SHIFT(SYMBOL,6) 00750 60 CONTINUE 00760 PNTR=PNTE+10 00770 ST&RT=PNTR+1 00780 70 CONTINUE 00790 DO 80 G=START,.PGCOL 00800 LINE (G) = ” « 008 10 80 CONTINUE 00820 WRITE (5,2020) (LINE (M) , M=1,PGCOL) 008.30 IE (I. EQ.LOOP) GO TO 110 00840 90 CONTINUE 00850 100 CONTINUE 00860 110 CONTINUE 00870 120 CONTINUE 00880 00890 00900 * SEE IF THE PRINT IS TO BE SUPPRESSED, SKIP THE PRINT 00910 * AND LEAVE A BLANK LINE, SET BLANK=1 TO INDICATE THAT NO 009 20 BLANK IS NEEDED NEXT TIME. IF PRINT IS NOT TO BE 00930 * SUPPRESSED, BLANK IS SET TO ZERO, 00940 00950 00960 IF (NEST.RN, EQo 0) GO TO 160 00970 LOOP = NESTRN-1 00980 IF (LOOP, LE. 5) INDEX=LOO.P 00990 . IF (LOOP. GT. 5) INDEX= 5 01000 DO 140 L=1,5 01010 DO 130 1=1,INDEX 01020 IF (NEST (1,1) . EQ, SUPP (L, 1) , AND, NEST (I, 01030 1 NEST (I, 2) . EQ-SUPP (L, 2) ) GO TO .150 01040 130 CONTINUE 01050 140 CONTINUE 01060 BLANK = 0 01070 GO TO 160 01080 150 CONTINUE 01090 IF {BLANK.EQo 1) RETURN 01 100 BLANK = 1 01110 HRITE (5,2030) 01120 RETURN 01130 ******THE SUPPRESS PART ENDS HERE******************************* 01140 ******** **************************** ** ************************** 01 150 160 CONTINUE 01160 IF (DEBUG. EQ. 11) CALL TABLE 01170 01180 ******PRINT THE VALUES********************* 01190 SPACE=0 01200 DO 180 1=1^ OUTROW 01210 L.IMT=OUTTBL (1,2) 012 20 DO 170 J=1,LIMIT 01230 ADDRES=OUTTBL(If3)+J-1 . 01240 CALL GETBIT(ADDRES,VALUE) 01250 SPACE=SPACE+1 01260 ’IF (VALUE. EQ.0) LINE (SPACE) =” 0" 01270 IF (VALUE.EQ.1) LINE(SPACE)="1" 01280 170 CONTINUE 01290 SPACE '=SPACE+1 . 01300 LINE (SPACE) = " " 01310 START=SPACE+1 01320 180 CONTINUE 01330 DO 190 S=START»PLIM 01340 LINE (S) = ” " 01350 190 CONTINUE 01360 WRITE (5,2040) CLPN, (LINE(M) ,M=1,PLIM) 01370 IF(DEBUG.NE.10) RETURN 01380 * PRINT THE ACTIVE STEPS FOR THE NEXT CLOCK PULSE 01390 * NFR=NEST FIRST ROW 01400 * NLR=NEST LAST ROW 01410 NLR=NESTRN-1 01420 NF R= 1

01430 WRITE (5,2050) NLR, ( (NEST (I,J) ,J=1,1) ,I=NFB,NLB) 222 01440 WRITE (5,2060) NLR, ((NEST (I, J) „ J=2,2) , I=NFR, NLR) 01450 01460 EETURN 01470 2000 .FOBMAT (1H1 „55H AH.PL FUNCTIOM LEVEL SIMULATOR OUTPUT IS LISTED 01480 1BELOW; ,//) 01490 2010 FORM.AI (//# 1X, 1 1X,A10) 01500 2020 FORMAT(iX„133A1) 01510 2030 FORMAT (IX,8H,« <,»» .««,) 01520 2040 ' FORMAT(1X,I8«8,3X,122A1) 01530 2050 FORMAT(/,L2X,7HMODULE#,=14) 01540 2060 FORMAT(12X,7HSTEP #,=14) 01550 END 00010 SUBROUTINE GETBIT(PNTR,VALUE) 00020 - IMPLICIT INTEGER (A-Z) 00030 * GETBIT DEALS ONLY WITH OLD-SVT, THE POINTER DETERMINES 00040 * THE OSVT AND VALUE IS THE VALUE THAT PNTR POINTS TO 00050 COMHON/B4/ O SV T (500) 00060 * WACP=WORDS ABOVE CURRENT POSITION 00070 * CPWN=CURRENT POSITION WORD NUMBER 00080 DATA BPW/60/ 00090 00100 WACP=PNTR/BPK 00110 * BCW=BITS IN COMPLETED WORDS 00120 * BITN=BIT NUMBER 00130 BCW=WACP*BPW 00140 - IF (PNTRoNE.BCW) GO TO 10 00150 CPWN-WACP 001 60 BITN=BPW 00170 GO TO 20 00180 10 CONTINUE 00190 CPWN=WACP+1 00200 BITN= PNTR- (WACP*BPW) 00210 2C) CONTINUE 00220 * CURW=CURRENT WORD 00230 CUR W=OSVT (CPW.N) 00240 * UMV=UNMAS KED VALUE 00250 UMV=SHIFT (CORN, (BPW +1-BITN) ) 00260 MASK1 = MASK (1) 00270 MASK1=SHIFT (MASK1 , 1) 00280 VALUE= AND (MASK1,.UMV) 00290 RETURN 00300 END 224 00010 SUBROUTINE PUTB.IT (PNTE, PROD, VALUE) 00020 IMPLICIT INTEGER (A-Z) 00030 * PUTBIT DEALS WITH BOTH OLD AND NEW SVT.GETBIT ALWAYS GETS THE VALUES 00040 * FROM THE OLD TABLE,SO VALUES WILL BE PUT INTO NEW TABLE ONLY IF PRODUC 00050 * -TIONS ARE 16 OR 17 WHICH ARE THE TWO TRANSFERS. ALL OTHER TIMES THE 00060 * VALUE WILL BE PUT INTO THE OLD TABLE 00070 * ALL VARIABLES ARE NAMED AS IN THE GETSIT ROUTINE 00080 COMMON/B4/ OSVT(500) 00090 COMMON/B5/ NSVT (500) 00100 DATA BPW/6Q/ 00110 WACP=PNTR/BPW 00120 b c w=w Ac p *b p w 00130 IF (PNTR.NE. BCW) GO TO 10 00140 CPWN=WACP 00150 BITN=BPW 00160 GO. TO 20 00170 10 CONTINUE 00180 CPWN= W ACP+1 00190 BITN=PNTR~ (WACP*BPW) 00200 20 CONTINUE 00210 * POV=POSITIONED VALUE 00220 MASK1=SHIFT(MASK(1),BITN) 00230 MASK1=COMPL (MASK 1) 00240 POV=SHIF.T (VALUE, (BITN-1) ) 00250 IF ( (PROD.EQ.16).OR. (PROD.EQ.17)) GO TO 40 00260 IF(PROD.EQ.99) GO TO 30 00270 OSVT (CPWN) =AND (MASK 1 ,OSVT (CPWN) ) 002 80 30 CONTINUE 00290 OSVT (CPWN) =OR (OSVT (CPWN) ,POV) 00300 * IF PROD WAS 99 A BUS IS ON THE LHS SO THE RECENT AND PREVIOUS 00310 * VALUES ARE ORED TOGETHER;OTHERWISE THE RECENT VALUE IS THE 00320 * EFFECTIVE VALUE OF OUTPUT 00330 * ALL THIS VALUE SETTING IS DONE IN THE OLD-SVT SINCE SOME KIND

00340 ' * OF LINE IS ON THE LEFT 225 003 50 RETORN 00360 40 CONTINUE 00370 NSVT (CPWN) =AND (MASK1 »NSVT (CPHN) ) 00380 NSVT (C.PWN) = OR (NSVT (CPWN) j, POY) 00390 RETURN 00400 END 226 000 10 SUBROUTINE QLINER {LQT1„UQTL,B NON) 00020 IMPLICIT INTEGER (A-Z) 000.30 COMMON/EXECU1/ QTA.BLE (300,4) 00040 • COMMON/CEQBL/ CEQ(50r3)yCEQROW 00050 00060 * THIS SUBROUTINE SEPARATES THE QUADRUPLES OE DIFFERENT OPERATIONS 00070 * OF A STEP. 00080 DATA CEQROH/0/ 00090 * CEQ=CURRENT EXECUTABLEQUARUPLES 00100 * CEQRON-CEQ ROW NUMBER 00110 BEGIN=LQTL 00120 10 CONTINUE 00130 I.F (BEGIN. GT.UQTL) GO TO 30 001 40 CE QROW=CEQROW +1 00150 CEQ(CEQROW,1)=BEGIN 001 60 CEQ (CEQROW„ 3) = RNON 00170 START=BEGIN 00180 DO 20 I=START„UQTL 00190 * CHECK FOR ONE OF THE QTABLE LIMITERS 00200 IF (QTABLE (!„ 1) » NE. 8 » AND. QTABLE (1,1). NE. 9 .AND.QTABLE (I, 00210 1 1) . NE. 15 .AND. QTABLE (I, 1) =NE. 16 .AND,QTABLE (1,1).NE.17 . 00220 2 AND,QTABLE(1,1) .NE.52 .AND.QTABLE(I,1).NE.53 . AND. 00230 3 QTABLE(I,1).NE.54 j GO TO 20 00240 * IF Q-LIMITER IS FOUND SEPARATE THE QUADRUPLES 002 50 CEQ(CEQROW,2)=1 00260 BEGIN=I+1 00270 GO TO 10 00280 20 CONTINUE * 00290 30 CONTINUE 00300 RETURN 00310 END 227 00010 SUBROUTINE ORDER 00020 IMPLICIT INTEGER (A-Z) 00030 DIMENSION ORT1 (30,2) ,ORT2 (30,2) 00040 COMMON/CEQBL/ CEQ<50,3),CEQROl 00050 COMMON/EXECU9/ NEST (25,8) 00060 COMMON/CEQBL2/ CEQTOP 00070 COMMON/EXECU1/ QTABLE(300,4) 00080 * THIS SUBROUTINE CALLS FOR EXECUTION OF QUADRUPLES IN SUCH AN ORDER 00090 * THAT THE OPERATIONS THAT USE THE LHS OF AN OPERATION FORTHEIR RHS, 00100 * BE EXECUTED AFTER THE OTHER OPERATION, EVEN IF THEY APPEAR FIRST, 00110 * ORT1=OPERAND/RESULT TABLE #1 00120 * ORT2=OPERAND/RESULT TABLE #2 00130 * NOST1=NUMBER OF OPERAND SYMBOLS IN TABLE #1 00140 * NOST2=NUMBER OF OPERAND SYMBOLS IN TABLE #2 00150 * NRST1=NUMBER OF RESULT SYMBOLS IN TABLE #1 00160 * NRST2=NUMBER OF RESULT SYMBOLS IN TABLE #2 00170 IF (CEQROW» EQ. 0) RETURN 00180 CEQTQP=1 00190 10 CONTINUE 00200 IF (CEQTOP, EQ,CEQROH) GO TO. .90 00210 CALL ORTB(CEQ(CEQTOP,1),CEQ(CEQTOP,2),ORTl,NOST1,NRST1) 00220 IF (NOST1, EQ, 0) GO TO 70 00230 NEXT=CEQTOP+1 00240 DO 60 J=NEXT,CEQROH 00250 CALL ORTB (CEQ (J, 1) , CEQ (J, 2) , ORT2,NOST2, NRST2) 00260 IF (NRST2, EQ, 0) GO TO 60 00270 DO 50 M=1,NOST1 00280 DO 40 N = 1,NRST2 002.90 IF(OETl (M, 2) = NE„ORT2 (N, 1) ) GO TO 40 003 00 * THE SYMBOL IS FOUND CHECK FOR FEEDBACK 00310 DO 30 R=1,NEST1 0CI320 DO 20 S— 1, NOST2 00330 IF (ORT 1 (R, 1) , NE,ORT2 (S,2)) GO TO 20

00340 * SEE IF THE FEED BACK IS IN TWO CONNECTIONS, IF SO, ERROR! 228 00350 IF(QTABLE(CEQTOP,1),NE.15 .OR. QTABLE(J, 00360 1 1) „ NE„ 15) GO TO 20 00370 WRITE (5,2000) NEST (CEQ (CEQTOP, 3) , 00380 1 NEST (CEQ(CEQTOP,3) ,2) , NEST (CEQ (J 00390 2 , 1) , NEST (CEQ (J,3) ,2) 00400 GO TO 80 00410 20 CONTINUE 00420 30 CONTINUE 00430 * NO FEED BACK, BUT THE OPERATIONS HAVE TO BE REPLACED 00440 X=CEQ(J, 1) 00450 Y=CEQ (J,2) 00460 Z=CEQ (J,3) 00470 CEQ (J, 1) =CEQ (CEQTOP, 1) 00480 CEQ (J,2) =CEQ (CEQTOP,2) 00490 CEQ (J,3) =CEQ (CEQTOP, 3) 00500 CEQ (CEQTOP, 1) =X 00510 CEQ (CEQTOP, 2) =Y 00520 CEQ (CEQTOP,3) =Z 00530 GO TO 10 00540 40 CONTINUE 00550 50 CONTINUE 00560 60 CONTINUE 00570 * CALL THE EXECUTE FOR THE TOP ROW OF CEQ, SINCE THERE IS NO TIME 00580 * CONFLICTS BETWEEN TOP OF CEQ QUADRUPLES AND ANY OTHER CONCURRENT 00590 * STEPS QUADRUPLES. 00600 70 CONTINUE 00610 CALL EXECUTE(CEQ(CEQTOP,1),CEQ(CEQTOP,2)) 00620 80 CEQTOP=CEQTOP+1 00630 GO TO 10 00640 90 CALL EXECUTE (CEQ (CEQTOP, 1) ,CEQ (CEQTOP, 2) ) 00650 CEQROW=0 ' ' ' . 00660 RETURN 00670 2000 FORMAT(IX,33H---- > ILLEGAL FEEDBACK, IN MOD# ,13, 00680 16H STEP#,14,1 OH ,AND MOD#,I3,6H STEP#,14) 00690 END 229 00010 SUBROUTINE OHTB(LQTL,UQTL,ORT»NOST,NRST) 00020 ■ IMPLICIT INTEGER (A-Z) 00030 DIMENSION ORT (30^2) 00040 C O.M MON/EX ECU 1/ QTABLE (300 , 4) 00050 COMMON/EXECU6/ 1013(500,4) 000 60 . ' CO.MMON/SIMAN1/ SET (301,10) 00070 * THIS SUBROUTINE BUILDS A TABLE THE FIRST COLUMN OF WHICH CONTAINS 00080 * THE DESTINATION LINES OR REGISTERS(CALLED RESULT FOR SHORT), AND 00090 * ITS SECOND COLUMN CONTAINS THE OPERAND OF A SET OF QUADRUPLES. 00100 * ORTB=OPERAND/RESULT TABLE BUILDER 00110 * ORT=OPERAND/RESULT TABLE . 00120 00130 NOST=0 00140 NRST=0 00150 DO 170 I=LQTL

01060 232 01070 1.50 CONTINUE 010 80 * if PASS IS=1* ONE OF THE OPEBA.NDS IS TAKEN CARE OF AND REPEAT FOR THE 01090 * SECOND ONE.IF PASS=2, GET THE NEXT QUADRUPLE. 01100 IF (PASS. EQ. 2) GO TO .160 01110 OPND=OPND2 01120 GO TO 1.10 01130 01140 160 CONTINUE 01150 PASS=0 01160 170 CONTINUE 01170 RETURN 01180 END 233 00010 SUBROUTINE DELETE 00020 IMPLICIT INTEGER (A-Z) 00030 * THIS SUBROUTINE DELETES ROWS OF NEST FOB WHICH NO QUADRUPLES EXIST, 00040 COMMON/EXECO2/ NESTROW 00050 C0MM0N/EXECU3/ RQWSQ 00060 COMMON/EXECU8/ SQRT (300,5) 00070 COMMON/EXECU9/ NEST (25,8) 00080 00090 ROUSQ1=ROWSQ-1 00100 NSTR01= NESTROW-1 00110 00120 DO 50 1=1,NSTRO1 00130 IF (NEST (1,2) .NE.0) GO TO 50 00140 00150 DO 40 J=1,ROWSQ1 00160 IF (SQRT (J, 1) .NE. NEST (1,1) OR„ SQRT (J,2) , NE , NEST (1,2) 00170 1 ) GO TO 40 00180 IF (SQRI(J, 4) oGE - SQRT (U ,3) ) GO TO 50 00190 IF (1= NE.NSTROI) GO TO 10 00200 NESTROW=NESTROW-1 00210 GO TO 60 00220 10 CONTINUE 00230 * SHIFT UP THE NEST TABLE 00240 DO 30 M=I,NSTROI 00250 DO 20 N=1,8 00260 NESI (M,N) =NEST ( (M + 1) ,N) 0 0270 20 CONTINUE 00280 30 CONTINUE 00290 00300 NESTROW=NESTROW-1 00310 GO TO 50 00320 40 CONTINUE 00330 50 CONTINUE 003 40 234 00350 60 CONTINUE 00360 00370 RETURN 003 80 END 235 000.10 SUBROUTINE NSTRST (MODN) 00020 IMPLICIT INTEGER (A-Z) 000.30 COMMON/EXECU2/ NESTEON . 00040 COMMON/EXECU9/ NEST{25,8) 000 50 * THIS SUBROUTINE RESETS THE NEST TABLE AFTER A NODELAY 00060 00070 IF {MO.DN= EQ. 0) GO TO 20 00080 10 CONTINUE 00090 CALL NESR(MODpSTEPpNDI?RNON) 00100 IF(NOD« NEo 0) GO TO 10 00110 00120 20 CONTINUE 00130 CALL . ORDER 00140 00150 ROW=NESTROH-1 00160 DO 30 1=1,.ROH 00170 IF (NEST (1,3) =EQ«, 0) NEST (1,4) =NEST (1,2) 00180 30 CONTINUE 00190 RETURN 00200 END 236 00010 SUBROUTINE ASSOC (R.P, SUBPNT„ RBV „BGT , RTOP, RHL, RHBS,RVL, ABV„ AGT, 00020 1 ATOP,AHL„AHBS,AVL» AVBS,AHB„ NEP,ABORT) 00030 00040 IMPLICIT INTEGER (A-Z) 00050 DIMENSION ABV (64) ,RBV (64) 00060 COMMON/EX.ECU6/ TOTS (500,4) 00070 COMMON/SYMAN1/ SRT(301,10) 00080 00090 IF ( (RVL- EQ, 1) .AND. (RHL.EQ.AHL) . AND. (AVL. EQ. SET (SUBPNT , 3) 00100 1 ) .AND. (RHLo LE. 64 ) . AND. (SRT (SUBPNT»4) «EQ. 1) ) GO TO 10 00110 00120 IF (RVL.NE.1) WRITE(5„2000) 00130 IF (RHL.NE. AHL) WRITE (5,2010) 00140 IF (AVL. NE. SRT (SUBPNT,3) ) WRITE <5,2020) 00150 IF (SRT (SUBPNT,4) .NE. 1) WRITE<5,2030) 00160 IF (RHL.GT.64) WRITE (5,2040) 00170 00180 00190 CALL EXERR 00200 GO TO 100 00210 00220 10 CONTINUE 00230 TOTS (BP, 2)-SRT (SUBPNT, 6) -SRT (SUBPNT, 5) +1 00240 TOTS (RP,3) =1 00250 TOTS (RP,4) =NEP+SRT (SUBPNT, 5) 00260 00270 IF (RGT.EQ. 1) GO TO 30 00280 00290 DO 20 1=1,RHL 00300 ADDRES=ETOP+RHBS+I-1 00310 CALL GETBIT(ADDRES,BIT) 00320 J=RHL—I+1 00330 RBV (J) = BIT 00340 20 CONTINUE 00350 237 00360 30 CONTINUE 00370 00380 DO 90 1=1,AVL 00390 DO 60 J=1,AH1 00400 IF (AGT» EQ= 1) GO TO 40 00410 ADD'BES=At 6p *AHB* (AVBS + I-I) +AHBS-J4-AHL 00420 CALL GETBIT(ADDBES,ABIT) 00430 GO TO 50 00440 40 CONTINUE 00450 ABIT=ABV DESC, MUST BE ONE DIMENSIONAL) 00610 2010 FORMAT(IX,52H----- > DESC, AND ASSOC. ARRAY ROW BITS DO NOT MA 00620 ITCH) 00630 2020 FORMAT (1X,5311— ---> ASSOC. FUNC. OUTPUTS AND # OF ROWS MUST M 00640 1 ATCH) 00650 2030 FORMAT ( TX",51H— ---> ASSOC. FUNC. OUTPUT MUST BE ONE DIMENSION 00660 1 AL) 00670 2040 FORMAT (1X,47H----- > MAX. FOR BITS/ROW O.F, ASSOC. ARRAY IS 64) 00680 END 238 00010 SUBROUTINE COMPARE (R.P, SUBPNT, BY 1, GTI/TOP 1, HL1 BBS 1» VL1 »BV2„GT2 » 00020 1 TOP2,HL2,HBS2fYL2? NEP,ABORT) 00030 00040 IMPLICIT INTEGER' (A-Z) 00050 DIMENSION BV1 (64) , BV2 (64) 00060 COMMON/EXECU6/ TOTS (500,4) 00070 COMMON/SYMAN1/ SET(301,10) 00080 00090 IF ( (VL1.EQ. 1) .AND, (VL2.EQ, 1). AND. (SET (SUBPNT, 3) .EQ.3) .AND. 00100 1 (SET (SUBPNT, 4) ,EQ. 1) .AND. (HL 1. EQ. HL2) . AND. (HL1. LE. 64) ) 00110 2 GO TO 10 00120 00130 IF ( (VL1. NE. VL2) .OR. (VL1.NE. 1) ) WRITE (5,2000) 001 40 IF ( (SET (SUBPNT,3) . NE.3) .OR. (SET (SUBPNT,4) .NE. 1) ) WRITE (5, 00150 1 2010) 00160 IF ( (ELI. NE. HL2) ,OH„ (HL1.GT. 64) ) WRITE (5, 2020) 00170 001 80 CALL EXERR 00190 GOX T O 80 00200 00210 10 ' CONTINUE 00220 TOTS(RP,2)=SRI(SUBPNT,6)-SRT(SUBPNT,5)+1 . 00230 TOTS (RP,3) =1 00240 TOTS (RP,4) = NEP+SRT (SUBPNT, 5) 00250 00260 IF (GT1.EQ. 1) GO TO .30 00270 00280 DO 20 1=1, HL1 00290 ADDRES=TOP1+HBSltI-1 00300 CALL GETBIT(ADDRES,BIT) 00310 J=HL 1-1 + 1 00320 BY 1 (J)= BIT 00330 20 CONTINUE 00340

00350 30 CONTINUE 239 00360 00370 IF(GI2-EQ- 1) GO TO 50 00380 00390 DO 40 I=1,H.L2 00400 ADDRES=TOP2+HBS2+I-1 . 00410 CALL GETB1T(ADDRES,BIT) 00420 J=HL2-3> 1 00430 B?2 (J)-BIT 00440 40 CO.NTINUE 00450 00460 50 CONTINUE 00470 00480 DO 60 1=1„HI1 004.90 J=HL 1-1+1 00500 IF (BV1 (J) . EQ. BV2 (J) ) GO TO 60 00510 IF { (BV1 (J) .EQ.0) .AND. (BV2 (J) . EQ. 1) ) GT=0 00520 IF ( (BV1 (J) .EQ. 1) .AND. (BV2 (J) .EQ.O) ) GT= 1 00530 .LT= 1 00540 IF (GT.EQ. 1) LT=0 00550 EQ=0 00560 GO TO 70 00570 60 CONTINUE 00580 00590 GT=0 00600 LT=0 00610 EQ=1 00620 70 CONTINUE 00630 00640 CALL PUTBIT(NEP»39,GT) 00650 NEP=NEP+1 00660 "CALL PUTBIT (NEP,39,EQ) 00670 ' NEP=NEP+1 00680 CALL PUTBIT(NEP,39,LT) 00690 NEP=NEP>1 00700 240 00710 80 CONTINUE 00720 &BOBT=1 00730 HETUBN 00740 2000 FOBHAT(IX#53H- BOTH COMPARE OPERANDS MUST BE ONE DIMENS1 00750 10HAL) 00760 2010 FORMAT (IX,52H- COMPARE FUNC OUTPUT MUST BE ONE DIM 8 3 B 00770 1ITS) 00780 2020 FORMAT(1X,53H COMPARE OPERANDS MUST HAVE EQUAL BITS & = 00790 1C 64) ' 00800 END 241 APPENDIX B

THE TSP (SYNTAX} TABLE OF THE HPSIM PARSER

242 S L I A D R N 1) C \ c ♦ = / * d> $ ( ) , ! ; . 6 / V 11 C U 5 0010020030040050 06007008009 0 10 0 1 10 120 130 140 150 160 17 0 ^ 0 0 1 \ 1 0 7 7 0 0 0 0 2 \ 2 3 5 2 3 5 2 3 5 2 3 5 2 3 5 2 3 5 2 3 5 2 152 3 5 ? rrooj 6 1 001 013023 064 0 6 5 0 6 6 0 7 2 1 0 7 1 10 11 c ccou ♦ 1 0 0 1 0 13 0 2 3 0 6 4 0 6 5 0 o 6 072 1 0 7 110111'lu or oc5 = 1 0 0 1 0 13 0 2 3 0 6 4 0 6 5 0 6 6 )7 2 1 0 7 110111 1 12 moot, / 1 0 2 6 0 ^ 0 0 7 1 0 0 1 0 13 0 2 3 0 6 4 0 6 5 0 6 6 1 0 7 110 112 O'OOM 0 0 1 0 1 3 0 2 3 0 64 0 65 0 6 6 ^ 5 1 0 7 1 10 112 •'OOC'f ‘l 0 0 1 | 0 1 3 0 2 3 0 6 4 0 6 5 0 6 6 1 0 7 1 10 1 12 '•r 0 10 ■I 1 C 7 3 1 0 0 11 $ 0 1 5 :co 12 { 1 j 3 1 4 1 0 5 0 0 0 1 I I 0 7 U rroiu ( 0 0 1 0 1 3 0 2 3 0 6 4 0 6 5 0 6 6 n o n ere 15 u 0 0 1 i 0 1 3 0 2 3 0 64 0 6 50 6 6 I”? lie 11 111 : r 0 1 f, ( 0 0 1 0 13 0 2 3 0 6 4 06 5 b 6 6 8 1 0 7 1 10 11 1 12 r C 0 17 ( 0 0 1 0 13 0 2 3 0 64 0 6 5 0 6 6 0 7 2 1 0 7 1 10 11 1 12 0 0 0 1 H 7 0 0 1 0 1 3 0 2 3 0 6 4 0 6 5 0 66 1 0 7 1110 11 112 0 0019 j M 0 0 1 0 1 3 0 2 3 0 6 4 0 6 5 0 6 6 1 0 7 1 10 11 112 rr 020 P’20 7 7 000 21 1 10 0 0 1 0 13 0 2 3 0 6 4 0 6 5 0 6 6 0 7 7 1 0 7 1 1 0 111112 " 0 0 2 2 ( 11 0 7 7 000 2 J ) 1 3 2 5 3 2 5 3 2 5 3 2 5 3 2 5 0 0 0 2 4 3 30 -.00 25 J 3 4 4 3 4 4 3 4 4 3 4 4 3 4 4 3 44 3 4 4 3 4 4 3 4 4 iUU r 0 0 2 •» J 4 3 4 5 34 5 3 4 5 3 4 5 345 345 14 5 145 14 5 JU'j 0 0 0 2 7 14 6 3 4 6 3 46 1 4 6 3 4 0 3 4 b 3 4 6 14 6 3 4 6 JUG 500 2 " I 3 4 7 3 4 7' 3 4 7 347 3 473 47347347 147 J4 / 0 00 2" 1 7 3 5 0 3 5 0 ! 3 50 3 50 150 3 5 0 3 50 3 50 3 50 ore i" 1 B 3 5 1:3 511 '351 3 5 1 3 5 1 351 351 151 351 W ' 0 0 u ) 153 3531 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 3 5 3 J'JJ 0 0J 2 10 3 6 3 3 6 3 ( V 0 J J I 1 1 3 0 6 •: '"iu 12 1 3 6 4 o r e J5 ) 1 J 1 3 6 6 0 0 0 JG 1 0 1 4 10 5 o r c j z 0 0 1 1 0 1 3 3231 0 6 4 0 6 5 0 6 6 0 7 2 1 0 7 110111 LOO?" 1 1 0 70 " 4 " 0 0 14 j 1 014! 0 0 0 4 0 0 0 1 0 1 3 0231 0 6 4 0 6 5 0 6 6 0 7 2 lie 111 0 0 0 4 1 1 i 0 1 4 D 7 1 1 0 5 0 0 0 4 2 07_ " i 0 0 0 4 J 1 0 0 1 0 1 3 0 6 4 0 6 5 0 6 6 U7?l 1 0 7 110111 0 0 0 4 4 1 J i P21 no j , , z i 243 < < < < F N 5 c E C < U U < T 0 N L R N n U A N D 0 < < E C 8 NR < T u N S CT A L EC TD It E 0 E K < I C A < < < I R LR 0 A L) 0 8 < s M TT D C GN S A L UEU U N s 5 TIIIL L L S TN a E L E E 3 U EEEN 0 0 R II R UT E E C N E N A N NFL u g P G N N M 5 MT R g P II T s D YC D N L :: - > > > > > > > > > > > > > > 0260270280290 3003103203303U03503603703803904004104 20 4304404504604704804 905C 1 175 21 1 !! j 121 VA Vi] 1 113 121 123 146 1 121 II] 121 157 1 113 121 if] 154 2 143 21 145 1 123 1651 4 II] III 123 165 5 113 1 6 51 (> 11 3 HI H i 165 :! 7 113 1 6 51 74 8 113 121 H i 164 V 176 10 1 13 121 123 167 III 1 1 2 J 4 (•s 87 9 n11 121 ) 1 142 21 113 121 12 3 155 1 141 2 113 121 123 156 1 137 1 4 0 1 4 4 202 2 1 11J 121 123 166 1 301 to 4> S L IA D RN D C \6* = /*d$ (),!;.** 6/ ♦/<= 11 CDD 0 0 1 0 0 2 0 0 300 40 05 006 00 7 0 08 00 9 0 100 1 10 120 130 140 150 160 17 01 BC 1902 00 210 22 02 J02't025 0 0 0 4 5 ; 4 014 071 105 0 0 0 4 6 . 2 C O O 47 . 3 000 4(1 . 4 3 14 0 C 0 4 9 . 5 315 9 C 0 5 0 . 6 316 0 0 0 5 1 . 7 0 0 0 5 2 * 1 001 0 1 3 364 0 6 5 0 6 6 0 7 2 1071 101 1 1 112 0 0 0 5 3 G / 1 00 1 0 1 3 06 4 0 7 2 107 0 0 0 5 4 ♦/ 1 001 0 1302 3 0 6 4 107 110 1 11112 0 C 0 5 5 <= 1 001 0 2 3 0 6 4 0 6 5 06 6 107 1101 1 1 112 0 0 0 5 6 <= 2 001 h 06 4 0 6 5 066 k 1071 10 11 1112 0 0 0 5 7 = > 1 til ICO 0 0 0 5 8 INTEGER 1 C O O 59 INTEGER 2 343 3 4 3 343 343 343 343 34 3 343 343 343 00060 INTEGKK 3 0 5 2 0 0 0 6 1 I N T E G E R 4 COO 62 INTEGER 5 3 57 3 57 357 0 0 0 6 3 INTEGER 6 360 36 0 360 0 0 0 6 4 INTEGER 7 365 0 0 0 6 5 < Nil HU E R. ST R>4 043 04 6 0 0 0 6 6 SEQNUMBER 1 313 313 313 0 0 0 6 7 SEONUMBER 2 313 313 0 0 0 6 8 SEUNUMBER 3 r , 33 J 13 131 3 0 0 0 69 S L R M 1 326 [3 26 |326 326 326 326 0 0 0 7 0 S L U M 2 022 0 0 0 7 1 S L R M 3 3 5 4 3541 3 5 4 3 5 4 3 54 354 354 354 354 354 0 0 0 7 2 INC 1 317 0 0 0 7 3 A D D 1 320 0 0 0 7 4 BC D 1 316 0 0 0 7 5 NT 1 001 0 1 3 023 064 06 5 366 3 7 2 107 110111 112 0 0 0 7 6 CONTROLRES 1 324 0 0 0 7 7 DEADEND 1 357 0 0 0 7 8 NODELAY 1 312 312 312 0 0 0 7 9 LN DSEQUENC 1 0 0 0 8 0 EN D 1 354 0 0 0 8 1 B U S F N 1 321 0 0 0 8 2 N U L L 1 356 0 0 0 8 3 :: 1 106 0 0 0 8 4 - 2 102 00085 1 00086 2 0 0 0 8 7 (CLOCK. S EQ> 1 104 C O O 88 < S T E P > 1 304 245 c E c < u U < i 0 N L R N n U A N D 0 < < E C 13 N R < TU N S CT A L E C TD n E 0 E K < IC A < < < IR LR 0 A 0 V 1) < s M r T D c G NS A L UEU U N S 5 T I 1 I L L LPS 5 TN RE L E E 5 U EEE N 0 0 R II R. U T E L C N E N A N N F L y y PGN N n S n T H y P 11 T S DYCDN L :: - > > > > > > > > > > > > > > 0 2 6 0 2 7 0 20 02 90 30 03 10 3203 30 3U03 50360370 38 0 390 1 COO 58 INTEGER 1 ' C 00 59 INTEGER 2 0 0 0 6 0 I N T E G E R 3 0006 1 INTEGER 4 COO 62 INTEGER 5 COO 63 INTEGER 6 0 0 0 6 4 I N T E G E R 7 0 0 0 6 5 < NU M B E R . ST R >4 0 0 0 6 6 SEQNUMUER 1 1151 16 130 133 C 0 0 6 7 SEyNUMBER 2 1 1 5 1 1 6 1 3 1 1 3 3 0 0 0 6 8 SEONUMB5R 3 115116 122 1 3 2 1 3 3 0 0 0 6 9 S L R M 1 0 C 0 7 0 S L R M 2 C 00 7 1 S L R M 3 0 0 0 7 2 INC 1 0 0 0 7 3 A D D 1 0 0 0 7 4 DC D 1 0 0 0 7 5 NT 1 113 121 123 163 0 0 0 7 6 CONTROLRES 1 00077 DEADEND 1 0 00 7 8 N O D E L A Y 1 00079 LNDSEyUENC 1 114 120020 1 C 0 0 8 0 END 1 126127 0 0 0 8 1 B U 5 F N 1 0 0 0 8 2 N U L L 1 C 0 0 8 3 :: 1 0 0 0 8 4 - 2 1 2 5 1 2 7 00085 1 C 09 86 < S E O > 2 ''0087 1 117 COOHM 1 304 246 K M S U 11 L I A U EE R N 1) c 6 ♦ = / * d $ ( ) , !! ; . " 6/ >/ <= => P H 11 C U •J 00100200 300 4005006 0070080090 100 1 10 120 130 lUO 150 160 17018 C 190200 2102202 3024025 0 0 0 8 9 < S T E P > 2 305 00090 3 306 0 0 0 9 1 < T I M I N G > 1 014 071 105 00092 1 307 0 0 0 9 3 < A C T I O N > 2 0 0 0 9 9 < R E LA T I O N > 1 051 061 0 0 0 9 5 2 322 322 0 0 0 9 6 < D L R M > 1 )05 007 044 047 0 6 7 0 0 0 9 7 2 323 323 3 2 3 044 323 32 3 C 00 98 < D L R M > 3 124 324 3 24 324 32 4 324 00099 <0LRM>4 007 02 7 044 0 4 7 00 100 1 07 0 00101 2 030 CO 102 < G L R H > 1 003 304 310 3 11 045 050 317 317 00 103 < G L R M > 2 003 304 3 1001 1 045050320320 00 104 < G L R 1 > 3 003 304 D l O D l 1 045 050 321 321 0 0 1 0 5 < G L R M > 4 0 0 3 304 3 1001 1 327 0 4 5 05 00 106 5 ti31 3 31 331 1331 331 331 331 331 331 W 0 0 1 0 7 < G L R M > 6 0 0 3 332 33 2 332 332 332 332 332 332 332 001 OR < G L R M > 7 0 0 3 304 3 3 3 333 333 333 333 1333 333 333 0 0 1 0 9 < G L R M > 8 003 304 334 3 1 1 334 334 334 334 334 334 001 10 < G L R M > 9 003 304 3 3 5 P 1 1 335 04 5 33 5 5 3 5 335 335 001 11 < G L R H > 1 0 003 304 0 1 1 336 04 5 05 0 336 336 00 1 12 1 1 33 7 337 3371)37 337 337 337 3 37 337 33 7 com 12 340 340 3401340 340 340 340 340 340 340 00 1 14 < G L R M >13 34 134 1 341341 34134 134 1341 341 34 1 00 1 15 1 4 342 34 2 3 42[)42 342342342342342 342 001 16 15 003 0 0 4 0 100 1 1 03 7 04 5 050 00 1 17 < G L R M > 1 6 003 0 0 4 3100 1 1 355045050355 001 18 < G L R 3 > 1 7 003 304 01001 1 356045 05 0 356 00 1 19 < G L R M > 1 0 003 30 u 3 10 3 1 1 041 045 0 0 1 2 0 1 0 3 2 053 00 121 2 033 0 53 0 0 1 2 2 3 03 4 053 0 0 1 2 ) 4 03 5 053 00 1 24 5 036 053 CO 1 25 < N UM 3 Eil . STR > 1 002 046 9 0 1 2 6 2 04 0 04 6 CO 127 < N U(10ER . GTR > 3 042 046 0 0 1 2 8 <0 NCL. S E y> 1 00 1 29 < ST A R T . S T E P >1 055 063 00 1 10 < DRA NC U > 1 060

CO 131 < D R A N C H > 2 1 062 247 ( ( ( ( FN s c K C (UU( T 0 N L RN n U A N D 0 ( ( E C u N R( T u N S CT ALEC T 13 li E 0 E K ( IC A ( < ( IRLH 0 A I) 0 a ( S MTT D c G N SA L UEU u N s 5 TI II L L •L P S 5 T N R ELE E 5 U EEE N 0 0 R if R UT E E C N E NANN FL U Q PG N N n S M T R Q P II T S DYCDN L :: - > > > > > > > > > > > > > > 0260270280290 300 31032033034035036037038039040041042043044045046047048049050 C 0 0 8 9 2 305] 0 C O 9 0 < S T E P > 3 30 6 0 0 0 9 1 1 1 3 4 1 3 6 1 4 0 1 4 4 203 0 0 0 9 2 ( A C T I O N >1 307 0 0 0 9 J < a c t i o n >2 361 0 0 0 9 4 (RELATIONS 0 0 0 9 5 2 0 0 0 9 6 < D L R M > 1 0 0 0 9 7 2 0 0 0 9 R < D L R M > 3 0 0 0 9 9 <0 I. RM >4 00 100 1 no 10 1 2 00102 < G L R M > 1 0 0 1 0 3 < G L R M > 2 00 104 3 00 105 4 00 106 < G L R M > 5 0 0 1 0 7 < G L R M > 6 00 1 OB 7 0 0 1 0 9 < G L R M > 8 001 10 < G L R M > 9 001 11 10 001 12 < G L R H > 11 00 1 13 < G L R M > 1 2 00 1 14 < G L R M > 1 3 0 0 1 15 < G L R M > 14 0 01 16 1 5 00 1 17 < G L R M > 1 6 001 10 1 7 0 0 1 19 < G L R M > 1 8 U0120 1 00 121 2 00122 < F U N C . I N PU T > 3 00 123 4 00 1 24 5 0 0 1 2 5 (NIJMOER. ST R > 1 00 1 26 2 00 127 (NUMBER.STR >3 00120 (U NC L . 5 E Q> 1 302 00 1 29 (START.5TEP>1 00 1 10 (BRANCII> 1 001 M ( BR A NCH >2 248 APPENDIX C

HPSIM PROGRAM OPERATION

In order to simulate a digital system using HPSIM, a knowledge of AHPL, the organization of the communication section, and program operation is required. Reference 2 provides the user with a thorough knowledge of AHPL, and in this appendix, first the organization of the communica­ tion section and then the program operation will be dis­ cussed.

C.l The Communication Section Parameters

The following parameters should be specified in the communication section.

C.1.1 Clock Limit

The clock limit tells HPSIM, the number of clock periods for which execution is to continue, if it does not reach a complete DEADEND. This card has the word

"CLOCKLIMIT" in columns 1 to 10 and, the limit in decimal should be in columns 12 to 15 right justified.

C.l.2 Assigning Values to External Lines

External inputs or buses can be assigned sequences of values in the data section which follows the clock limit.

This section starts with a head card which has "EXLINES:" in

249. 250 the first eight columns. The next card has the following form: BUSEFFECT— nnnn (starting in column 1), where nnnn is the number of clock periods for which the corresponding external line receives a value from the data set. This card should be followed by the data values in octal form, start­ ing in column one. This ends a data set and the next data set should follow it to assign values to the next declared bit. The first declared external line bit receives its external values from the first data set, and the nth declared external line bit receives its external values from the nth data set. Blanks instead of octal characters are assumed zero by the HPSIM system.

C.1,3 Print Requests

The above section (external data) will be omitted if no external line is declared. A print request section must always be included as the last part of the communication section. This part begins with a head card which has the keyword "OUTPUTS:" in columns one to eight. Following this card the symbols for which a print out is desired should be listed on a one card per symbol basis. Each symbol card has the symbol of the variable to be printed in columns one to ten; the row number, if the variable is an array, in columns twelve to fifteen. This ends the user communication section. 251

C.1.4 Debug Options

.Presently HPSIM has two debug options which will be

specified in the debug card before the clocklimit card.

Option 0 lists the active control steps at each clock

period before printing the circuit outputs for that clock

period. Option 1 lists the output of pass one of the

interpretations f as well as printing the circuit outputs at

each clock period.

The DEBUG card is optional and, if used, has to

have the word "DEBUG" in the first five columns and the .

option number in column number fifteen. If this column is

left blank, option zero will be assumed by the HPSIM.

system.

The printout of option 1 is long and costly, so

the user should watch the CLOCKLIMIT when using this option.

C.1.5 Suppress Switch

) Very often long waiting loops are encountered in the

simulation of a digital circuit. The printing of the

results at every clock period is obviously inefficient in

such cases. For such long loops the print can be suppressed

by a, "SUPPRESS:" card. This card is optional and if needed

should be placed before the "OUTPUTS:" card. The module and

step number of a step for which printout is to be suppressed

must appear on the SUPPRESS card. HPSIM allows up to five xsuppressed steps, The format of this.card is shown below: 252

Card 000000000111111111122222=2222333333333344444444*45555555555666666666677777777778 Col# 12345678901234567890123456789012345673901234567890123456789012345678901234S67Q90 SUPPRESS! ml 31 m2 s2 m3 S3 m4 s4 m3 sS

Note that all numbers are right justified. The integer, nu is the module number and s^ is the step number.

C.2 Running HPSIM and HPCOM

As was mentioned before, HPSIM and HPCOM now operate on the CDCr-64'00 and the DEC-10 systems. Using the programs depend on the computer system(s) of a particular plant. In this section we will show how the programs are used at The University of Arizona, and hope that this example will help users at other plants as well.

C.2.1 HPSIM on CDC-6400

The object code of HPSIM interpreter is stored as a permanent file in the CDC^-6400. To run a HPSIM program, the batch should include a control card section, AHPL sequence file, and communication section where two (7/8/9) multix'punch cards separate these three sections. Prepara­ tion of AHPL sequence file and the communication section were discussed in previous sections of this manual.

Figure C,1 shows the control cards necessary to run a HPSIM program on the CDC'-6400. 253

NAME?"user's billinS number"?CM70000♦ ATTACH(HPSIM rID = AHPL) SLOADER < RFL=70000) HPSIM♦

Figure C .1. Running HPSIM/6400

C.2.2 HPSIM on DEC-10

The HPSIM compiled and loaded file exists on the

PPN: 4100,135 disk on the DEC-10 and on the DEC-10 public library at The University of Arizona. To simulate an AHPL program, the user should first generate the AHPL sequence a,nd communication section files, using SOS or any other editing program (two separate files). Then in the monitor mode the following should be typed:

RUN PUB:HPSIM or

RUN STD:HPSIMI4100,135J

Then the HPSIM system will ask for the AHPL sequence file name. The user should respond to this by typing the file name nnd extension of his AHPL sequence. Next the system will a,sk for the communication section file name which should be answered similarly. Finally the name of the file in which the user desires the output to be copied should be entered after the HPSIM system has asked for it. An 254 example is shown in Figure C .2, Note that in this figure whatever is in the capital letters is typed by the system while the user responses are in lower case.

.RUN PUB}HPSIM

AKF'L SEQUENCE FILE NAME 1 "Enter Your AHPL seauence file name” COMMUNICATION SECTION FILE NAME♦0Enter your communication section file name” OUTPUT FILE NAMEEnter your output file namen

DONE! STOP

END OF EXECUTION CPU TIME: 0,12 ELAPSED TIME: 1,23 EXIT

Figure C.2. Using HPSIM/10 (Timesharing).

Each' of the three files must have an extension. The file name extensions are arbitrary except that if (.DAT) extension is given to the output file name, the pages will .

Be ejected where necessary.

C.2.3 HPSIM on DEC-10 Batch

. Figure C.3 illustrates how a card deck should be organized in order to simulate an AHPL program using HPSIM on. the DECt IO, Note that in this figure, what is not in capital letters will be determined by the user. 4*Job name [user's PPN] ^PASSWORD "PW for the above" $DECK "your AHPL seouence file name *

" The AHPL seouence"

$EOD $DECK "your communication section file name"

"The communication section"

t E 0 D STOPSIO .RUN PUBi HPSIM *"your AHPL seouence file name * *"your communication section file name" *"your output file name * . TYPE "your output file name * "(6/7/S/9) multi-punch card"

Figure C.3. Running HPSIM/10 batch. APPENDIX D

HP SIM PARAMETER LIMITS

Parameters DEC-10 CDC-6400

Maximum number of concurrently active steps 25 25

Maximum number Of left hand side row catenations 25 25

Maximum number of left hand side column catenations 25 25

Maximum number of external lines 60 60

Maximum number of clock periods 2400 2400

Maximum number of digits in a number 10 16

Maximum number of characters in an identifier 201 ' 20

Maximum number of bits in an encode functions C$1 35 - 60

Maximum number of labelings 5 0 50

Maximum number of destinations in one step 5 5

Maximum number of suppressed steps 5 5

Minimum number of steps for■each module 1 1

Maximum number of characters on a line 80 80

Maximum number of steps in all modules 600 300

1, Only the first 10 are significant.

256 APPENDIX E

HPSIM MODIFICATIONS FOR OTHER MACHINES "1 2 The HPSIM/6400, and HPSIM/10, are not quite machine independent and need to be modified in order to run on other machines. HPSIM/6400 is written for a 60 bit-per- word machine, and uses some non standard FORTRAN library functions of the CDC-6400 such as shift and mask functions.

On the other hand HPSIM/iO uses only standard FORTRAN library functions.

The first pass of HPSIM interpreter is the most machine dependent, since the source code is read (by the scanner subroutine) and the syntax is analyzed (by the TSP data subroutine) in this pass. HPSIM/10 uses all 36 bits of a word of the DEC^IO in this pass, therefore wherever the KPW (Bits Per Word) is a factor, modification is needed before running HPSIM on other machines. The CDC-6400 BPC

(Bits Per Character) is six and the DEC-10 BPC is seven.

This should be kept in iqind" when modifying the HPSIM system for other 3tiachin.es. Major modifications are needed for

1. HPSIM/6400 is the HPSIM which runs on the CDC-6400.

2. HPSIM/10 is the HPSIM which runs on the DEC-10.

257 258 scanner and TSP subroutines while other subroutines will need none or very little change.

The second pass of HPSIM/6400 also uses all the sixty bits of a CDC word, but HPSIM/10 only uses thirty-one bits of a 36-bit DEC-10 word. If HPSIM/10 is to be modified for another machine with a BPW of 31 or more, the second pass will need little, if any change. The OUTPUT sub­ routine of this pass is most likely to need work. REFERENCES

Hill, F . J ., and G. R. Peterson. Introduction to Switching Theory and Logical Design. Second edition. Wiley, New York, 1974.

Hill, F. J., and G, R. Peterson. Digital Systems: Hardware Organization and Design. Second edition. Wiley, New York, in press.

Iverson, K. E. A Programming Language. Wiley, New York, 1962.

Pratt, Terrence W. Programming Languages Design and Implementation. Prentice-Hall, Inc., Englewood Cliffs, N. J., 1975.

Naur, P., ed. "Report on the Algorithmic Language ALGOL 60," ACM, 6, No. 1 (1963), 1-17.

Gries, David. Compiler Construction for Digital Computers. Wiley, New York, 1971.

Grishman, Ralph. Assembly Language Programming. Algorithmics Press, New York, 1974.

Lewis, Philip M., II, Daniel J. Rosenkrantz, and Richard E. Stearns. Compiler Design Theory. Addison-Wesley, Reading, Massachusetts, 1976.

Druseikies, Fredrick C ., and G. David Ripley. "Error Recovery for Simple LR(K) Parsers," Proc. of ACM, 1976.

Ripley, G. David. "A Simple Recovery-Only Procedure for Simple Precedence Parsers." Department of Computer Science, University of Arizona, unpublished manuscriptf n.d. PS m m m m m :