Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 68

A PROGRAMMING SYSTEM FOR

HYBRID COMPUTER COMPUTATION

by

ROGER BRADFORD FISH

Submitted in Partial Fulfillment


of the Requirements for the
Degree of Bachelor of Science
at the

MASSACHUSETTS INSTITUTE OF TECHNOLOGY


June, 1975

Signature redacted
Signature of Author.. .0..
Department of Mechii dUl, Efgnee ring, May 9, 1975
Certified by .... Signature redacted
1SiVgflatu
I A - t u % Tie ais Supervisor
Accepted by. . . . . . re redacted
.

Chairman, Departmen l Committee on Theses

Archives
2

ABSTRACT

Simulation of dynamic systems is often limited by the


computer hardware it is running on. Digital simulation is
often slow and analog computation lacks the ability to do
operations such as delays and nonlinear functions. Hybrid
computation is a technique to combine digital and analog
computers into a system which has the best features of
each type of computer. This thesis is an attempt to pro-
duce a programming system to reduce the problems nresently
involved in hybrid computing. A system of digital computer
programs was created which automate many operations needed
in hybrid computing. Also a hybrid block operation's
interpreter was developed to allow high speed parallel
operation of the analog and digital computers. Tests of
this system show capabilities and features which improve
the operation and programming of hybrid computers. The
total system gives the user a powerful and simple system
for improving his simulation computations.
3

ACKNOWLEDG.EMENTS

I would like to acknowledge my thesis advisor,


Richard S. Sidell,for the ideas,suggestionsand guidance
he has given me during my undergraduate education and
during the preparation of this thesis.
I also want to express my thanks to my parents who have
supported and assisted me during my education,and to my
mother who suffered through the typing of this thesis.
Thank you very much.
4

TABLE OF CONTENTS

Abstract page 2.
Acknowledgements page 3.
Table of Contents page 4.
List of Tables and Figures page 5.

Introduction pages 6-8.

Hybrid Software System pages 11-12,

Hybrid Programming Language pages 16-18.

System Operation page 22.

Hybrid Simulation Test Cases page 23.


Conclusion page 31.

Recommendations page 32.

Bibliography page 33.


Anpendixes: pages 34-68.
A) Simulation pages 35-37.
B) Gas Turbine Ship pages 38-39.
C) Program Listings pages 40-68.
5

LIST OF TABLES AND FIGURES

Tables:
Table, 1. Roles of Digital Computers in page 7.
Hybrid Computation and Simulation
Table 2. Goals of System page 13.
Table 3. Hybrid Operations and Commands page 19.

Figures:
Figure 1. Hybrid Computing System page 9.
Figure 2. Bilateral Computer System page 10.
Figure 3. Hybrid Programming System page 14.
Figure 4. Interpreter Flow Chart page 15.
Figure 5. Example Block Program page 20.
Figure 6. Example Hybrid Program page 21.
Figure 7. Bar Simulation Diagram page 24.
Figure 8. Hybrid Model of Bar page 25.
Figure 9. Bar Program Listing page 26.
Figure 10. Gas Turbine Ship Diagram page 27.
Figure 11. Hybrid Model of Ship page 28.
Figure 12, Ship Program Listings page 29,
13. 30-
6

INTRODUCTION

Hybrid computation includes all computing techniques


which combine features of digital and analog computation
in the solution of a problem. The term hybrid computer is
now used to characterize computer systems involving linkages
between general-purpose digital computers and electronic
analog computers. Digital and analog computers each have
characteristics which lend them to certain forms of com-
putation.
Analog computers are excellant systems or simulating
continous systems.
Analog computers:
1) Treat all variables in continuous form.
2) All components operate in parallel.
3) Computation speed is not effected by problem com-
plexity.
4) Operations such as multiplication, addition,
integration are easily done.
5) Provisions exsist for system modification during
simulation.
Digital computers are best suited for logic operations,
control signal generation, and data manipulation.

Digital computers:
1) Have the facility to memorize numerical and nonnumer-
ical data indefinitely.
2) They perform logical operations and decision making
using numerical or nonnumerical data.
3) Floating point arithmetic eliminates scale-factors.
4) Information can be handled in discrete form.
5) Digital programs can control and modify themselves,
or analog systems by control signals.
An outline of hybrid operations is shown in table 1.
7

ROLES OF DIGITAL COMPUTERS IN HYBRID

COMPUTATION AND SIMULATION

I.) Digital supervision by digital system:

a) Supervisory control of analog-computer studies:

b) Storage and reduction of results:

c) Report preparation.

II.) ~Digital "Housekeeping" functions:

a) Set coefficient and function-generator settings.


b) Perform static checking.

c) Run diagnostic programs.

d) Do digitally controlled patching.

IlI.) Combined analog-digital simulation:


a) Open-loop combinations.

1) Digital orerations on analog-computer out-


puts without feedback.

2) Analog operation on digital-comruter out-


puts without feedback.

b) Digital simulation of a digital computer.

1) Simulate -closed loop digital controller.

c) Closed-loop combined simulation:


1) Parallel signal processing with feedback.
2) Digital signal generation, recording, and
control.

3) Data sampling and coefficient modification.

-Table 1.
8

Hybrid computer techniques represent an effort to com-


bine the best features of each type of computer to produce
the optimal computing system. True hybrid computers are
those systems which combine appreciable amounts of each type
of hardware, and are capable of bilateral operation. (See
fig. 2.) A system diagram of the Mechanical Engineering
Joint Computer Facility hybrid computer is shown in figure 1.
Hybrid computation is ideally suited for several com-
putation methods:
1) Sampled data system simulation.
2) Random process simulation.
3) Control system optimization.
4) Simulation of distributed parameter systems.
5) General simulation of systems which combine contin-
uous and discrete signals.

Presently hybrid computation is accomplished by programming


the analog computer, and then writing a FORTRAN program for
the digital computer using a number of data conversion and
analog control subuoutines. The routines do operations
such as send and recieve signals, set analog coefficients and
control the operation of the analog computer.
The goal of my project is to produce a programming
system which will allow parallel operation of the analog and
digital computer during hybrid runs. This system must be
fast enough so that the digital computer will not add a
large time delay to the signals it is processing. The system
will sue digital operations to replace and compliment the
analog computational elements, and to control and synchron-
ize total system operation.
-ANALOC- cbm PUT SR -\NTr--Rr-ACE

LO(rk C
?AT CA

M~
NPUTT
?MliVE A/t

-
Co~vekskom

5-'
Z/ I\CwTbR

AMD
1/0 (WSI STO PkG
CRT

R ft N 'A

EKE' -(o CtI - (00


XHTMO~ATA

-HYBRID --OPATIN&~ S*14 ' EM

G~UQR.
A LO&(7- b\CzTAAWAC
I /Q
z\ \10
31(ITA ANA\..%oO& M

/
0.1

3\LATER Amm SY STEM

El\r'RE. ?.
11

HYBRID SOFTWARE SYSTEM

To accomplish goal of this thesis I have developed


an interpretive software system which can perform many func-
tions necessary to simplify and automate hybrid computer
operations. The capabilities designed into the system are
show in table 2. The system has six basic states of operation.
1) Supervisor state.
In this mode the system processes input from the user
and determines the nature of the command. The super-
visor handles all overhead and linkage operations re-
quired, and handles user interaction and error anal-
ysis. If the input is a command to perform an immead-
iate operation the system performs the operation or
gives control to another section which performs the
operation, such as input/output or set up. If the
input is code to be compiled, control is passed to
the compile section. The supervisor is itself brok-
en into several sections so that it is able to con-
trol linkage between the several main programs which
make up the system.

2) Program compiler.
In this mode the system inputs the users hybrid pro-
gramming language statements and compiles them into
an intermeadiate code. This code is stored in disk
files which are referenced by the loader at load time.

3) Analog control.
In this mode the system reads the users command and
performs the desired operation on the analog system.
Control operations normally done manually at the
analog control console are done automatically by
the digital computer.
12

4) Input/Output.
This mode controls the reading, printing, and plot-
ting of data requested by the user. After control
is passed from the supervisor to this section, the
storage area referenced is located in the symbol
table, and the operation performed. Scaled fraction
data is used as the data type for the system. The
present input output operations include reading,
printing, and plotting, and are called by giving
the operation, the storage area identifier, and
any required parameters.

5) Loader.
This mode controls data base and program loading.
The compiled program is loaded from the disk and the
storage allocated by the compiler is initialized to
the required form. Buffers, tables, and delay lines
are cleared and special pointers and constants loaded.
The system can now perform input/output or enter
the hybrid interpreter section.

6) Hybrid Interpreter.
This mode controls the actual parallel operation of
the analog and digital computers. The users hybrid
program is translated from the intermeadiate form,
generated by the compiler, into core addresses in
the digital computer. The interpreter then synch-
ronizes itself with an external real time clock and
begins execution. The users program is executed line
by line for the specified time. Automatic A/D and
D/A conversions are performed each cycle. After the
cycle is completed, the interpreter waits for the
clock time step to finish and then restarts the cycle.
If time steps specified are too small to complete a
program cycle, error messages are given. (See fig. 4.)
A system structure and information flow diagram of the complete
system is shown in figure 3.
13

GOALS OF SYSTEM

I.) Control capabilities:


a) Program compilation.
b) Program loader.
c) Time synchronization.
d) Analog computer control.
e) Input/output controller.

II.) Block oriented programming:


a) Mathematical operations.
b) Automatic buffer input/output.
c) Function table lookup and interpolate.
d) Time delay line simulation.
e) Data manipulation. (scaled fraction).
f) Storage allocation.
g) A/D, D/A automatic conversion.

III,) Analog setup and control:


a) Servo pot setting.
b) Analog mode control.
c) Time Scale control.
d) Analog device measurement.

IV) Automatic digital input/output:


a) Plot buffers. (scaled fraction data vs. time)
b) Print. (scaled fraction data)
1) Buffers
2) Tables
3) Variables
c) Read. (scaled fraction data)
1) Variables
2) Function tables
3) Input buffers, delay line buffers

Table- 2.
14

STAkpT o

r -

-
~ZZZZ~
CARDSb

AtANoc' SET xP

oNTRo N

t T(IA(V- braTVA C03ML.


r
~''
L DATA %A I

IL-I9RTE ~mOC~~
0co)
DA -1

bo.
ALtmt"INTc h/DWA A/
0 taflOu %tocs
-IH isy c14Rt4%%%t.

4YUM
? PRo(&RPtA L\NK PRO &MRAtN&
-- + CONNack. %Nm VV ST -M
KEY DATA ho%)
lNFOMAT\0
Com"oN DATA FLOW)
2znP 90ROAM cot.

-FeARlE 3,
1

-
(E VT RY

SET PO\NTERS + FLAGS


TKAN16%ATE ADDRES$ AM)
OP C-bbMS TO B T - CuM,0T

SYNCtOMI'VE WT c,tOC-K

WREA A/D CVAANN.ws


bA~Th
F.ECUtTE PROOLRAM $TF-PS
W RITE I/A Ae

ZONE YS ITLR

N4

WAIIT FOA CaOC. Dome

SET COWtT L.OP To RSAD

I TNT ERRFTE
I r ow CAKAT
F Cvvgt 4 4
16

HYBRID PROGRAMMING LANGUAGE

The features included in the programming language are


listed in table 2. section II. The hybrid language is a sim-
ple block-oriented system with a format similar to popular
digital simulation systems such as EAI'S "HYTRAN", or IBMWS
"fCSMP". The major difference between these systems and the
hybrid block system is the internal linkage system. The
former are pure digital simulation systems, while the hybrid
system allows a simulation program using analog and digital
operation blocks which are linked together through the A/D,
D/A interface. This allows operations such as long time
delays, data storage, multi-input functions, and comple.x
logic control, which can all be done best digitally, to be-
come integral parts of an analog simulation.
The block nature of the system allows the user to set
up a system of defined operations using simple commands and
automatically link them to the analog system. The operations
available to the user are listed in table 3. An example of
a hybrid block program is shown in figure 5, and the hybrid
program needed to create this system of blocks is shown in
figure 6.
The programmer need only know a few simple rules of
argument syntax and the operation codes to program any block
system. The user has several data types and data structures
available to him.
1) Buffers for getting data from or putting data to.
2) Delay lines of specified length which shift one
entry per cycle.
3) Scaled fraction constants between 1.0.
4) Internal variables referenced by name.
5) Two-dimensional tables for function table lookup.
6) Analog to digital and digital to analog I/O channels.
7) Double precision variables for integrals.
17

One of the most important features of the system is


the automatic input-output operations and data conversions
done each time step. The interpreter reads all the availa-
ble A/) converters into a special buffer at the start of each
interpretive cycle. The program then interpretates the pro-
gram, taking values of the referenced A/iD channels from the
buffer. References to )/A channels also refer to a special
buffer. After the interpreter has executed the program for
the cycle the A/A block is written out from the D/A buffer.
The interpreter then waits for the external clock to finish a
and the process begins again. While the program is execu-
ting, the interpreter keeps a pointer that allows sequential
access to buffer entrees. This allows the user to record
data into or send data from a buffer with a PUT or GET state-
ment.
The function generator capabilities of the system are
very useful in hybrid computation. These functions allow the
user to store functions digitally and use them during hybrid
simulations. Single input functions with any number of
breakpoints can be used to generate nonlinear funtions that
are difficult to generate on an analog computer. Multiple
input functions with 441 values over the range of the two
inputs allow nonlinear functions of two parameters to be gen-
erated during simulations by referencing the data table with
a function operator.
Two function types a presently available. The first is
a single input, piecewise linear table look up function. The
user gives a table of input break points and output values
and then references the table by name in a function operation.
The value is computed by linear interpolation of the input to
the break points and the output values. The second type of
function available is the two input function. This function
is a fixed break point, two dimensional table look up system.
The user creates a table of 21 by 21 locations and inputs the
function values to the table in reference to an X Y plane.
18

The function calculates a location in the input arguments


plane and interpolates between four points to find the out-
put.
Delay line simulation is the final operation available
that is difficult or impossible to do on an analog computer.
Since lumped parameter systems often require transnort delays
in their simulation, the digital computer gives us the ability
to delay signals any amount of time required. The delay op-
erator works by shifting the input signal through a serial
shift register of length N. (N= DELAY TIME/CYCLE TIME.) As
the interpreter executes the program, a pointer is recircu-
lated through the delay line. When the oointer reaches a
storage slot the delayed value is sent to the output argu-
ment and the new input value is loaded into the slot. This
operation continues, slots being loaded, delayed, and sent
out as long as the program is executing.
Mathematical operations are also available to do arith-
metic operations with constants, variables, or A/D channels.
(See table 2.) This feature frees analog amplifiers from
operations such as addition, subtraction and inversion to be
used as integrators or in other analog operations.
The last feature of the hybrid programming language is
storage allocation and referencing. The allocation of stor-
age, to be identified by a symbol name, is controlled by
DEFINE statements, This command is followed by a specifica-
tion as to the type of storage, its identifier, and any dimen-
sioning data necessary. The system presently supports five
data structures.
1) TABLE -2 dimensional data tables for functions.
2) BUFFER -1 dimensional data arrays for I/O.
3)DELAY -delay line buffers of length N.
4)VARIABLE -internal variable storage locations.
(16 bits.)
5) DOUBLE -double precision variable for integra-
tions. (32 bits.)
All the data handled by the system is in 16 bit scaled frac-
tions for input or output to or from the user.
19

HYBRID OPERATIONS AND COMMANDS

I.) Operations:
ADD (add two inputs)
SUBTRACT ( subtract two inputs)
MULTIPLY ( multiply two inputs)
DIVIDE ( divide two inputs)
FUNCF1 ( one input function)
FUNCF2 ( two input function)
DELAY ( delay input N cycles)
PUT ( input into buffer)
GET ( output from buffer)
INTEGRAT ( integrate input,store in output)
MOVE ( move input to output location)
INVERT ( invert input
)

DEFINE ( allocate storage for orocessing)

II.) Commands:
*PROGRAM start new compilation)
*RUN execute program)
*LOAD load program from disk files)
*LIST print program code to orinter)
*SYMBOL print program symbol table)
*EXEC link to EXECUTIVE program)
*READ) input data to specified locations)
*PRINT print contents of specified arg.)
*PLOT plot buffer on CRT
)

*SETPOT set servo pot)


*TIMEOP set external clock for cycles)
*TSCL set analog time scale)
*ANVAL read and print analog component)
*EOJ end of job,exit hybrid system)

Table 3.
PULT
151APPA

A/0-1 zwoky
>(D -0 b/A-1
ADI
A/0-3

Z/A-M
C

Fw
A/D' ma)

(INT
A/~S

)
oAMe.~L

0.

FuIGURE S.
21

/ EXAMPLE HYBOL PROGRAM

DEFINE VARIABLE AB1J

DEFINE VARIABLE DTP;

DEFINE VARIABLE X1;

DEFINE VARIABLE

DEFINE DOUBLE INT;

DEFINE TABLE FUNC(20,2);

DEFINE BUFFER BUF(200);

DEFINE DELAY DL1 10;

/ DONE STORAGE ALLOCATIONSTART PROGRAM CODE.

DELAY DLIAPADOIPABI;

ADD AB1,#AO03o#DA0jJ

PUT PDA01,BUF;

SUBTRACT @AD04,AD02pDTP;

FUNCF2 DTPi0AD03,#DA04;

MULTIPLY @AD05,*0.030sX1

INTEGRAT X1,INT;

ADD PAD02,INTPODA02;

END;

NOTE: PADXX * A/D CHANNEL XX

ODAXX 0/AD CHANNEL XX

= SCALED FRACTION CONSTANT IDENTIFIER

FIARE (o.
22

SYSTEM OPERATION

Once the user has entered the hybrid system he con-


trols the operation of the system by a sequence of commands
and program statements from a deck of computer cards. A
typical run would consist of a *PROGRAM command followed
by the hybrid program statements terminated with an END.
The user would then input commands to set the external
clock, read any required input data, and then load and run
the program. After the system had finished the computation
requested the user could print or plot data saved during
the run, rerun the program, input a new program or any
other combination of operations.
The size of a hybrid program is limited by two factors.
During a simulation,the user can specify a run time of any
length he requires but the number of cycles of program ex-
ecution is limited to 32767maximum. The time step of this
cycle is limited to the time required to execute one cycle
of the program. The program cycle requires 600 microseconds
plus the time required to execute one program statement,
typically 15 to 50 microseconds. The second constraint is
storage space required. 10000 storage locations are avail-
able to the user for tables, buffers, program,etc. Programs
require 5 locations per line of code plus 32 locations for
A/D and D/A buffers. The remainder of core is available
for the users DEFINE allocations.
The format of commands and program statements are
standardized and must be input in the expected forms.

1) *COMMAND ARGT, ARG 2,...o9;


2) OPCODE ARG1, ARG2,...;
3) DEFINE (TYPE), ARG1, ARG2,... ;
4) END;
Example of programs and command input streams are shown
in figures 6,9,12.
23

HYBRID SIMULATION TEST CASES

Two hybrid simulations test cases were run to capa-


bilities of the hybrid programming system. The first test
case is the simulation of a bar of material, steel is as-
sumed, and its response to the impact of a force, assumed
to be a hammer. The lumped parameter model of the system
is shown in figure 7. The hybrid simulation model is
shown in figure 8, and the hybrid program is shown in
figure 9. By controlling the time scale of the analog
computer and the input potentionmeter of the integrator,
simulations of different bar to hammer mass ratios and
bar lengths were run. Results for several cases are
shown in appendix A.

The second test was of a simplified model of a gas


turbine powered ship. The system model of the ship was de-
veloped from a report on a pure digital simulation of the
system run on an IBM 360. (See fig. 10.) The hybrid system
model included four non linear functions and two integra-
tions to simulate the open loop performance of the ship to
fuel inputs. A block diagram of the hybrid simulation model
is shown in figure 11., and the hybrid program is listed in
figure 12 and 13. One test case simulation a speed change
from idling to full fuel flow was run simulating 100 seconds
of real time. The hybrid simulation required 10 seconds and
produced results equal to the digital simulation at 30 sec-
onds and 20% below at 100 seconds. A plot of the simulation
output is shown in appendix B.
44
SIVLM~k1l~t OF h~ SkA

ztA=4TF' PC

'II
F' :iV C

?Ai~sAMTER SwWdAPATION MAolo"U

OF: AitJ E~N C 3BPs

F I GIARS 7.

*N
-m

A/0-0
A%/r~O

IDELAYf
Rt3 A
y
Lo
-3
I,93C
WID
Owl

apslo BAR SMmAA'TION

F1sRE 8.
26

*PROGRAM;

/ BAR SIMULATION PROGRAM

DEFINE BUFFER VOUT(550);

DEFINE BUFFER AOUT(550);

DEFINE DELAY DEL 600

/ DELAY SIGNAL 60 CYCLES

DELAY DEL @AD000SDA00;

PUT @AD01,VOUT;

PUT PAD03,AOUTi

END;

/ CONTROL CARDS AND DATA

*EXEC;

*TIMEOP 10.0,0020J

*LOAD;

*RUN;

*PLOT V OUT 200;

*PLOT A OUT 200;

*EOUJ

- FIGURE 9.
IFV

Towu+

v.0 To .LST
R1PM

sAS TRR \MJN t


set B 40clf IDw(Ahv

E10.

L
SSTT 110( Si A/0-0
a mw

'I
p

*1'
ml
II L Ft~c.
A/D

-
bIA.f~ S
II
a Ak~- PP,
-I
I'
II
I Fv~c.t, Ib/A I
II
II
II
D/A3

P/A - 3 (Fu~cv)
*sol
AItop
AWALOGP MODIEL. I
II
II DIWAL ~TSmOcxV PROGAT
HYSRM S41? SI1..AJL~*4 I
I
F~~I~R
29

*PROGRAMj

/ GAS TURBINE SHIP SIMULATION PROGRAM

DEFINE TABLE TORQE(21s21);

DEFINE TABLE TPROP(21A21);

DEFINE TABLE FPROP(21,21);

DEFINE TABLE FRIC(8s2);

DEFINE VARIABLE Xj

DEFINE VARIABLE Z;

DEFINE BUFFER VSHIP(1000 );

DEFINE BUFFER RPM(1000);

DEFINE BUFFER BUF2(1000)#

DEFINE VARIABLE Y;

DEFINE VARIABLE R;

/ FUNCTIONS FOR SIMULATION

FUNCF2 TORQEsPAD01, AD00poDA0ol

FUNCF2 TPROPsPAD01s AD04soDA0J

FUNCF2 FPRCP(aAD01,@AD04,DA03J

FUNCF1 FRICs@AD04,(DA04;

PUT PADO1sRPMJ

PUT AD04pVSHIPJ

PUT AD00sBUF2)

ENDJ

FIGLAE \I.
30

/ CONTROL CARDS AND DATA

*EXEC;

*READ FRIC 7,2J

DATA CARDS FOR TABLE FRIC


0

*READ TORQE(21s21);

DATA CARDS FOR TABLE TORQE

*READ FPROP(21,21);

DATA CARDS FOR TABLE FPROP

*READ TPROP(21121);

DATA CARDS FOR TABLE TPROP

*TIMEOP 10.0s0.010'

*LOAD;

*RUN,

*PLOT VSHIP 200s5,1

*PLOT BUF2 200,5p1;

*PiOT RPM 20015;


31

CONCLUSION

From the results of tests run on system oneration and


of the two test cases run, I must conclude that the system
fulfills the goals set for it, and provides a useful system
for doing hybrid computation. The operations available
to the user remove most of the difficulties presently associ-
ated with hybrid computation. Input/output, time synchroni-
zation, delay simulation, and nonlinear function generation
are all available to the user without his needing to be an
accomplished programmer.
The practicallity of doing hybrid computation in simu-
lation of complex systems is apparent from the second test
case. An extremely simplified model, generated from a small
amount of data on ship component resnonse was able to pro-
duce results in good agreement with a much more complicated
model of a large digital computer. Using a hybrid computer
system such as this can greatly increase the speed and
involvement of many types of computer simulation. As digital
simulation of dynamic systems becomes faster and requires
less programmer experience analog simulation must move to-
ward hybrid computer system. Hybrid systems have the flex-
ibility and power to automate parameter optimization and
statistical studies, which are very time consuming simula-
tions to run digitally. As hybrid computer hardware and
software improve simulations will be able to benefit from a
system which provides the best features of digital and analog
computation.
32

RECOMMENDATIONS

The system now exsists in a form which is flexible and


provides the user with many commands. But some features
which would allow better utilization of available hardware
should be added. There are presently no features for testing
or setting sence lines from the analog computer. The system
also requires repetition of commands for multiple executions
of the hybrid program. Another nonoptimal feature is the
line by line non alterable execution of the program. Several
features added to the compiler/interpreter system could solve
some of these problems. The addition of statement labels
and logical decision making operations would allow the pro-
gram to control its own execution during run time. Several
new function types would also improve the system. A func-
tion with hysteresis would be useful in some systems. Also
the addition of a fixed break point single input function,
and a variable bread point multiple input function would
simplify function generation for the user.
In general a number of new operations such as transcen-
dental functions and more complex integrator operators would
be useful. The input/output operations could also be improved
by providing an option for indexed operation so that data
could be referenced on integral numbers of time steps. The
The commands available could also be increased to provide
operations such as load and run, repeat operations, and disk
storage of data for later use. There are many areas where
the system can be expanded and improved and in the future
I plan to include most of the above recommendations.
33

BIBLIOGRAPHY

Bekey, Geirge A. , and Walter J. Karpus.


Hybrid Computation, New York: Wiley and Co., 1968.

Korn, Granino A., and Theresa M. Korn.


Electronic Analog and Hybrid Computers, New York:
McGraw-Hill Book Co., 1972.

Rubis, C.J.
"Acceleration and Steady-State Propulsion Dynamics of a
Gas Turbine Ship with Controllable Pitch Propeller",
New York: The Society of Naval Architects and Marine
Engineers. , 1972.
34

APPENDIX

A) Bar Simulation Response Plots pages 35-37.


B) Ship Simulation Response Plots pages 38-39.
C) Hybrid Programming System pages 40-68.
Fortran and Assembler Source Listings
OV~~~~ ZV 99SU IrOAPCM O 0I
b~S0 wr
AA
I a a a a 2 2 a
B Ia
I a I 3 3 Sa OW'
a
loo I ..., 1- -r -, LO ~ I1 9I Iw II I
5
I
1

A 5j

-LO' oi~ L. a a 2 0 11 a
IL 0 0.1 ILA 0.Li Q.6& 07Y I.U &9

SCA'SI. Tr
M
v4
Lo v I I 9 I 9 1 9 U

Ki

--A--..- a I A s

ma0 0.1 0.a &a~ ILA 0.S 0.& 0.7 0U a.9

.
"T
SC-X-S T 8.s89c
vy c IFT 5 rmc,
S
ILO I v v 13
I 9 v
2
I v i r

Vvo t f,

a'ms

co

AL I

a A A 2 ft ft
--- L- - - - - i

aLO oI C~a Ie.2 &4 I.S I.c a?7 fam O.g 1


T 2 O. t

4tOo.p" V-GF
~Abe QQ-ql -sw
per rSU aV Z 1) 5V Pu, E. eV T 0
9 0
40

C mAIN COMMAt- fl PROCESSOR AN2D CO7MPILER PROGF.AM


REAL_*F LVAH
REAL*8 OpTEST
REAL*%z BUFISYMPOPCOD;:
REAL*R LTAB.LH-IF
REAL*R ARS(le)
REAL*g SYmTASPCLEAR
REAL POT
REA1. VAL
INT~cpP*2 INECI, IREC?,LITALITZLOADERRORS
INTcGFP*? OPERCD
INT7Gc'P*2 COMMASEMICL
IN'cGcR*2 EXECSETUP
INTrGFP*2 REAUPRINTpPLOToRUNpEj,PP'GRM
REAL*R PPrGS(3)
REAIj.*R L-DqLPLDEL
INTErGER*p LPCUN7
TNTrC~rRP CARL)IIPOSLCCCNT
INTI Gr*2 LITADCPLITDAC
INTPGFP*2 8UFFERsCARC,,FRPOROPVAL
INTr'G-P*2 COESYMBIL'~
TN~cGT*? PCOU~NT,"START
jTrGc*2 PEND
TNTrrGr*2 LJST
TNTrGrQ*p DATTAB
N'GlF9*? 11PCOR
INTEIFR*p TTMEOF~sITYPFPTPCODE
INTE1,ER*p SY"TYP
TNTrGcP*? NFILElNF ILE?, NINPpNTYP ,NSYMAX
INT3r~oiFQ* OPFLIAGPF1 AG, IrRRORNSYMFBLNSTMTNOPTAB, IJKIJKKJJ,
1NAPG~fNNpMi9,LSAVE!,!FILE
INTrcP*2 SYMVALPATS3IGN
INTrGrP*2 ARGVAL(l0)
INTF7Gc*2 CTESTpiiAMF.
TN'EGcR*2 ASTRS~(,fULNKpDflLSGN
!rNTrcGp*2 PtlUM
IN'~cr*2 CMEPTHREEt ZERO
INTCGFP*? IFLAc,~jnFCSpID(JMP
INTESER*p ARGTyP(1'1)
!NTrGcP*2 SFTPoTMOr~ETSCALEANAVAL
L01rCA[ FUCUAL
CDIMPNqTON CARf>(8v?),xt V),OPCODE(49!),OPVAL(40)
DIMPNq!flN SYMTAB(i0)SYVAL(100),SYMTYP(100)

C CCMMONX rnATA PASE AREA


COMNCnSKAPPGMPITPOTPNEJCRPYBLDMPIT
1 T INFnP, LrAD, ExECSETPOT, MODE, ANAVAL, TSCALE
COMMONI/CONTRL/PFLAGNFILF1,NFTLF ?,TOPCOROPFLAGNTYPNINPD#NSYMAX,p
1 NOvTA~pLoCCNTpNSV"L,
COMmOo-o/OrOD /fPCOD~pOPVALpOPERCDERUFSYMARG
41

COMMON/PRnGRM/PSTARTPCOUNTPENDNSTVTsPNUMNDFCSERRORS
COMMON/SYmBOL/SYrTAF, SYMVALSYMTYP
COMmO\ PROGS
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
C DATA INTTIALI 7 ATION
DATA ATESTDTESTsVTESTsSTEST/'9AD ','9DA I'Is 1s0# '/
DATA LTABPLBUF/ITABLE ','RUFFER '/
DATA nPSYMDsOPSYMYsOPSYMF/'DEFI's'DELA's'FUNCI/
DATA ATSIGN/'I '/sLPOUND/'# I/
DATA AqTRKsBLANKDQLSGN/f* fit ',$ '/
DATA rLEAp/I I
DATA LITAr)CiLITDAC/'AD's '0A'/
DATA LVAR/'VARIALE'/
DATA rTEST/'J 'I/
DATA LDOLLDEL/IDOUBLE 'I'DELAY '/
DATA OPSYmV/'DATAI/
DATA LITALITZ/'A 'PIZ '/
C ********* ***************************************************************
C FILE SPECIFICATION STATFMENTS
DEFT! FILE 1(109,3,1PIRFC1)
DEFTNF FILE ?(60,2,U,IPEC2)
DEFTNF FILE 3(10V00siUIREC3)
C * *** ***** ** ************ ****** *******************************************
C MAPK PILE I WITH PROGRAM ID

CALL PUTMrrS(' $MAIN ;')


REAr)(NjILE1'1)IPCODE, IERROR
IF(IPCODE.EQ.2) GO To 10
IF(IPCODE.EQ.5) Go To 11

WR ITE (NFILEl '1) IPCODE


C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
C *PROGRAM oP INITIAL FNTRYINITIALIZE FLAGS AND CLEAR TABLES
?CONIYUE
NPILE1=3
NDFrE=?
LOCCNTw33
ERRORP=0
NSYM9Lum
NSTMT=t
ERR r P=0
PFLAGw?
TERoCquo
PNUmut

PCOIINTOO
PSTAPT=0
C CLEAR SYtTAR
DO 7qP I sNSYMAX
SYMTAP (I).CLEAR
42

SYMVAL ()=0
SYMTYP( I)=
7910 CONTINUE
9150 FORVAT (5ys4A2,2X I

)
GO TC 1
C PRINT ERROR MESSAGE
I WRITE(NTYp,9120)IERPORsB!FSYM
9120 FORMAT(IX,'***** ERROR #sIp5p' SYMBOL ERROR P> 's A8,'SKIP CARD')
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
IF(IERROR.NE.10)ERRORS=ERRORS+1
1) CONTINUE
ITYpE=7
KKaoi
BUFRYMnCLEAR
IERRpCpo
oNE=t
THRFE=3
ZEROzo

LCOUNT=LOCCNT
IF(LOCCNT.GE.TOPCOR) GO TO 6000
C READ IN A CARD AND PROCESS
CALL CARDTN(ANGPFL AGsOPFLAGIERROR)
11 CONTINUE
IF(TE OR.NE. 9) GO TO 1
CALL mOVE(ARG(1),OiPTESTS0,8)
C LCOK IN OoERATUR TABLE
DO 95o K=isNOPTAF
IF(OPTEST.EQ.PCODE(K)) GO TO 600
55e CONTINUE
C IF OP COCE ILLEGAL DO ERROR ROUTINE
WRITE (NTYpi9102)OfPTFST
9102 FOPfiAT(1ys'ILLEGAL OPERATION CODE w> 'iIA8)
IERPCP=4
BUFSyM=OPTEST
GO TC 1
600 OPEpCn=OPVAL(K)
C TEST ARGE FOR TYPE
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **
C GET ARG 0
C TEST FOR IMMEAVIATE
TF(OPFLAG.EQ9.) GO TO 30po
C TEST FOp DEFINE ,FUNCTION, DFLAY STATEMENTS
OPHALF=REAL(OPTEST)
IF(npwALF.EQ.UPSYMD) GO TO 1000
IF(lpwALF.EQ.OPSYMY) GO TO 1100
IF(fPLJALF.EQ.UPSYMF) GO TO 1200
C NOT TYPE cTAT MENT C CHECK APGS FOR TYPE
C q IS AN I/O CHANNEL
C * IS A qCALEO FRACTION CONSTANT
43

C OTHERS MUST BE DEFINFO NAMES


800 CONTINUE
NARGS10
C PROCESS EACH ARGUMENT
DO Fol I1,NARGS
2
ARGTYP( I).
801 ARG\/AL (I)= Q
C CHECK FOP ARG TYPE I FIRST CHARACTER
DO p9o IJ.FoNARGS
CALL MrVE(ARG(IJ),0>TEST,0p3)
IF(FQUAL(TESTi0,ATEST , 3)) GO TO 840
ITF(cOUAL(TEST s 0, )TESTs 0, 3)) GO TO 845
IF(FQUAL(TESTsoSTEST~,si)) GO TO 870
IF (vQUAL(TEST0sETESTp0,1)) GO TO 89r
C TEST SYMBoL TABLE
IF(NSYMBL.EQ*0) GO TO 810
C LOOK IN SyMBOL TABLE
DO gjto Jjnl$NSYMBL
IF(PQOAL(ARG(lJ),0sSYMTAB(JJ)p~og)) G0 TO 820
810 CONTTIUE
C NOT IN SymTAB
WRITE(NTY* 9 105) ARG(IJ)
915 FOpMAT(ly'UNDEFINED SYMBOL a> 101A8)
IERPOp05
BUF;YM=ARG( IJ)
GO TO I
C SET ARG VALUE TO SYMPOL LOCATION
82v. ARGkAL( IJ SY MVAL (IJJ)
ARGTYp(IJ)=SYMTYP(JJ)
GO TO 880
C ******************************************************************
C 0 PROCEsS A/D D/A CHANNFL
C GET NUMSEP OF CHANNEL
847 ARGVAL(IJ)WNCFD(ARG(IJ),THREE)+1
ARGTYP(Ij)m6
IF((ApGVAL(IJ*LT.1).O.(ARGVAL(IJ).GT.16)) GO TO 846
GO TO 980
84r ARGVAL(IJ)SNCFD(ARG(IJ),THREE)+17
ARGTYv(TJ)=7
iF((A9GVAL(IJ).LT.17).OR.(ARGVAL(IJ).GTs32)) GO TO 846
GO TO 880
4 IERPOP025
9
WRITE(NTYPs 501)
9501 FOpMAT(1ys'ILLEGAL CHANNEL CODE')
BUFSYMUARnVAL(IJ)
GO TO i
C ********************************************************************
C 9CALED FRACTInN CONSTANT
8k7Ci ARGVAL(Ij)=LOCCNT
ARGTYP(IJ)=8
44

C LOAO SCALFD FpACTION INTO STORAGE


NOFCS NDFcs+l
ITYPE=4
MM=TSFIX(FPIN(ARG(IJ)sONF))
C WRITE SCALED FRACTION ONTO STORAGE FILE P
WRITE(NFILE 2'NDFCS)-ITYPELOCCNTMMI
LOCCNTaLOf"CNT+1
880 CONTI"UE
89r CONTINUE
89 ; CONT IN'jE
900 CQNT'iUE
PNUM=PNUM+6
NSTm.TuNSTMT+I
C wkITE HvBOL PROGRAM LINE ONTO STORAGE FILE
WRITE(NFILEI'NSTMT)OPERCDARGVAL(2),ARGVAL(3),ARGVAL(4)
I ,ARGvAL(g),ZERO
WRITE(NTYos,9988)OPERCDsAPGVAL(2),ARGVAL(3),ARGVAL(4),ARGVAL(5), 1
9988 FOpMAT(1yA8(16,4X))
ARnVAL(4)=O
ARGNvAL(5).=
GO To 10
c * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **

*
C DEFINE STATEMENT PROCESSOR
I10v! 9UFSYM=AprG(3)
TF(NSYMRLEQ0.) GO To 10P0
C TEST FOR CONFLICT
C L0OK IN SyMBO1 TABLE FOR LOCAT ION
DO looci I~lsNSYMFL
IF(RUFSYMEQ.SYMTAB(I)) GO TO 1010
10A5 CONTT INUE
GO TO 102o
1010 WPTTF(NTyP9107)BUFSYM
9ir07 FORMAT(lXiNAME CONFLICT => ',1A8.' PREVIOUSLY DEFINED NAME')
IERROR=6
0 TO I
10pV CTECTuSLANIK
CALL pYTE(BUFSYM,0pCTESTp0)
IF(CTESTeLT.LITA) GO TO 1025
IF(CTFST nToLITZ) GO TO 1025
C 1'UT NEV' NAME N SYMTAB
NSYMBL=NSyMBL+1
IF(NqYMPL*GT*NSYMAX) GO TO 1021
T uNzymL
SYMTA (NSyMBL ) =BUFSYM
C SYMBOL VALUE TS LOCATION COUNTER
SYMVAL ( NSYMBL)=LOCCNT
5YMTYD( I ).1
LStAVEwL OCCNT
LOCrNT=LOCCNT+1
FUFSym=ARq(2)
45

C TEST FOP TYPE OF DEFINE STATEMENT


IF(RUFSYM.EQ*LVAR) Go TO 10
IF(RUFSYMEQo.LTAR) Go TO 1030
IF(pUFSYM.EQ.LBUF) Go To 1040
IF(FUFSYM.E .LDBL) Go TO 1060
IF(qUFSYM.EQ.LDEL) Go TO 1070
WRITE(NTYPP9111)SUFSYM
9111 FOPMAT(lX,'ILLEGAL TYPE SPECIFICATION IN A DEFINE m>'plAg)
IERP P=7
GO TO I
10p1 IFRRoR=2q
GO To I
C ****** * *** * ****** *** **************** **** ******** **********************
C TABLE PFFINED ALLOCATE SPACE FOR N*M
C CALCULATE TABLE SIZE
1030 MNN.CFD(ARG(4),ZERO)
SYr'TYP(I).2
ITYPE=i
ZEP0nug
MM=NCFD (ApG (5) , ZERO)
NN=NN*MM
GO TO 1059
C ****** ** ************** ************************************************
C qUFFER nEFINED ALLOCATE LENGTH N+j
r CALCULATF RUFFER LENGTH
1040 NN=NCFN(ARG(4),ZERO)
ITYPE=?
SYMTyP(I).3
C SAVE COOE aNN
1091 LnCC NT" OCCNT+NN
1-051 NDCq=NDpCS+l
C wRITE TYPF LENGTH LOCATION AND CODE INTO STORAGE FILE 2 FOR LOADER
WRITE(NFILE2'NDFCS)ITYPELSAVENNI
GO TO 10
C IF DOUBLF PRECISION SCALFD FRACTION SAVE ONE MORE HALFWOPO
1060 LOrCNT=LoCCNT+1
SYMTyp(I)= 4
GO T0 10
C ***************************** *****************************************
C DELAY STATEMENT ALLOCATE LENGTH AND POINTERS
107V NN.NCFD(ARG(4)ZER9)
SYMTYC(I).-NN
ITYpEa3
ZERo=r'

TF(egUAL(ARG(5)s#sETESTspsi)) GO TO 1071
IwIcFTY(FpIN(ARG(5)yZEPO))
1071 LOCCNT= OCCNT+NN+P
GO TO 1051
10b VRITr (NTyP s9110) RUFSYM
46

9110 FORMAT(1X,'ILLEGAL "AME IN A DEFINE w>f,1A8)


IERPOPu8
GO TO I
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **

*
C DELAY STATFMENT PROCESSOP
1100 CONTINUE
BUPSYM=A R (2)
C LOOK IN SYv1BOL TABLE
DO 1101 I1NSYMPL
IF(PtjFrYM.EQ.SYMTAB(I)) SO TO 1105
IIz1 CONT TJUE
IEROP=P0
GO TO 1
11qib LSAVyoSYVAL(I)
IF(cyMTyP(I).LT.*) GO TO 1106
IEPwPo:"6
GO TO 1
1IL6 APG(p).ApG(3)
ARG(3)-APG(4)
C SHIFT DFLAY NAME TO 4 Tw ARGUMENT SLOT
APG(4) BUjFSYM
GO TO 900
**
C FUNCTION 5TATrMENT PPOCESSOR
12 0 BUFSY"=ApG(2)
DO 121l Imit NSYMRL
IF(qUFqYM.EQ.SYMTAB(I)) GO TO 1215
12 1 CONTINUE
WRITE(NJTYpP9135)PUFSYM
'115 FORMAT( 1XUNDEFIN'ED FUNCTION NAME =>I'1A8)
IERPOP=9
GO TO I

APG(3) APG (4)


C C)HIFT FUNlTrIONj NAME TO LAST ARG LOCATION
IF( QUAL(ARG(5)p,ETESTpqs)) GO TO 1220
ARG(4)=ARG(5)
APG(5)=RUrSYM
GO TO 100
4??V APr(4) =F9YM
GO TO 807
C *********************************************************************
C * CARD TMMEADIATE COMMA*O
3 0 T COITTPUE
IDUMPe3
C IEST Fop OOEPATION BLOCK CODF AND BRANCH
IF(nP r'CO.L.POGPM) GC TO 2
IF(OprYRCO.EGQSYMPOL) GO TO 3600
IF( OPrCD.EQ.EOJ) GD TO 5009
TF(OPrlC.D P WTSCA LE ) GO TO 7000
47

IF(mPr'CD,EQ.ANAVAL) GO TO 8000
IF(OPFPCn9EQ*SETPOT) GO TO 9000
C TF OP IN ryEC LINK TC EXFC
IF(nPERCDEQ.EXEC) GO TO 3001
IF(OPrRCDEQ.LOAD) GO TO 3001
IF(oPFRCDEQ.LIST) GO TO 3001
TF(nPFRCDEQ.PRINT) GO TO 3001
IF(OPERCneEQ* PLOT) GO TO 3001
IF(OPERCDEG.READ) GO TO 3001
1F (OPERCn.EQ*RUN) GO TO 3001
IF(OPrRCD.EQ.TIMEOP) GO TO 3001
r. TLLEAGAL 00VRATION
IERROP=10
GO TO 1
C LINK TO EXqC MAIN
30(1 CALL CHATN(PROGS,2)
C ~*****************************************
C qYMBrL TAPLE LIST BLOCK
36v' CONT TNUE
WRITF(NTyPp9371)LOCCNTTOPCOR
9371 FOpMAT(l//' LOCATI'lN COUNTER =' ,T6s' OF '1I6.#/)
WRITE(NTYpP9372)
9372 FORMAT(IX,'SYMBOL TABLE',/)
WRITE(NITYp,9370) (SY"TAB( ) SYMVAL (I), SYMTYP(), 1.a1NSYMBL)
93 7 (- FORtAT(4(,Xp1A8Sp 'I16p' (TYPE ',I~,')'))
GO TO 1
C ~***** *************************************************** *************
C tEMORY rULL FATAL ERROR
60o CONTINUE
WRITE(\'TYps,9395)LOCCNTpTOPCOR
93n5 FORMAT(1X'MEMOPY FULL, LOCATION COUNTER a o,16s' AVAILABLE CORE=
1'I16,' FATAL FRROR',/)
GO TO 500V
C ~********* *************************************************************
C 7ET ANALOG TImE SCALE
70 CINT INU
NNwNCFl (ApG(2),ZERO)
CALI HINT
CALL TSCL(NN)
GO TO 10
C ********** ************* ***********************************************
C rET ANALOq o Vo01TAGE FROM SPECIFIED CHANNEL
4 V, CONTT\IUJE
CAL[ MOVE(ARG(3)p pPOT. ,4)
CALL HINT
VAL=ANVA, (POT)
PUTVAL.,
GO TO 10
C ********* D**********************************************************
C SE T SERvrn 0 0T SE T TING AND DI'SPL AY ERROR
48

900V CONTTNUE
CALL MlVEARG(2)i0oP0Tp0p4)
vALFpTN(ARG(3)iZER0

)
CALL MINT
CALL, sPOT(POTiVALsIFR)
PUTIER
GO TO 10
C END OF JOR EXTT TO OPERATING SYSTEM
150(0V CONTTNUE
WRITE(NTYps9400)
94c0 FORMAT(1yo'* * + * * END OF JOB * * * * *

)
C FKD OF DROGRAM
END
49

C FXEC PROGAMLOADER INPHT/0UTPUTsCLOCK CONTROLLER


REAL*P PROGS(3)
REAL*8 LDPLsLDEL
REAL*Q LVAR
REAL*g OpTEST
REA*t *p BUFrSYMPOPCODE
REAL*R LTABsLBUF
REAL*R ARn(lo)
REAL*R SYmTABPCLEAR
INTErFR*p LOCLOADsITYPE
INTPGFR*2 OPERCDOLPOUNDCARDIIPOSsLOCCNTLITADCLITDACsBUFFERCARD
iDsEpRPo,0pVALLITALITZ
INTGFrP*P CORESYMBOLDUMPPCOUNTPSTARTPENDLISTDATTABsTOPCOR
INTrGFP*2 TIMEOPITYPEPIPCODEPSYMTYP
INTcGcP*2 COMMASEMICL
INTrGFP*? READo,PPINTPLOTRUNPE0J,PROGRM
INTc7G;R*2 OPFLAGPFL AG, IFRROR, NSYMBLNSTMT, NOPTAB IsJK IJKKJJ
1 NAPGINNMMLSAVEsNFILE
INTrGFQ*2 SYMVALATSIGN
INTrGqR*2 ARGVAL(IO)
INTrGPR*2 CTESTpNAME
IN"'GE*2 8UFFER(40),BFIELD(10)
IN'rGEP*2 ASTRSKBLANKDOLSGN
'NTrGFR*2 PNUM
jNTcGFr*2 ERRORS
INTFGER*p EXEC
INTCGrP*2 ONETHPEE,7ERO
INTFGFP*2 IFLAGsNDFCsIDUMP
INTFIFP*p TSTEPsNCYCLIPECI*IREC2
INTPGFP*2 LENGTHpLSAVESERRORNFILEIsNFILE2,NTYPNINPNSYMAX
INTrGcR*2 SETPOTPMODEPANVALTSCL
REAt )OLOTXSCL
LOGICAL EOUAL
DIMFNsION XPLOT(200)PXSCL(4)
DIMrNqTON CARD(80) ,(25),OPCODE(40),CPVAL(40)
DIMpNSION SYMTAB(100),SYMVAL(100),SYMTYP(100)
DIMPNSION DATTAB(JW 00)
C *** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
C COMMON DATA BASE AREA
COMMON/CODES/READPROGRMPRINTPLOTsRUNsEOJsCORESYMBOLsDUMPsLIST$
1 TIMEfPLOADEXECsSETPOTMODEANVALpTSCL
COMMON/CONTRL/PFLAG, NFILFIsNFILE2,TOPCOROPFLAG, NTYP, NINPNSYMAX,
I NOcTAPLfiCCNTNSYM9L
COMYON/OPCOD /OPCODEOPVALPOPERCDBUFSYMPARG
COMON/PRGRM/PSTART, PCOUNT, PEND, NSTMT, PNUM, NDFCS, ERRORS
COM ON/SYmBOL/SYMTA , SYMVALsSYMTYp
COMMON PRnGS
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*

C rATA INTTIALI 7 ATION


DATA CL(,EAp/'
/
50

DATA FTEST/' 'I/


C ***********************************************************************
C FILE SPFCTFICATION STATEMENTS
DEFTNF FILE 1(10V,3'UsIREC1)
DEFTNF FILE ?(60,?2, U, IPEC2)
DEFITN FILE 3(10P'0 1,U,IREC3)
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

*
C MAPK FILE I WTTH PROGRAM ID
NFILE33
IPC0DF=P
WRITE(NFILEl'1)IPCODE
CALL VHTMFS(' $EXEC ;')
C READ COPE LOAn FROM DAFILE
REA (NFILc3'1)(DATTAB(I)sI=1TOPCOR)
GO TO 10
1 CONTINUE
C wRITE ERROR MFSSAGE AND PROBABLE SYMOL
WRITE NTYpsv9001)IEPRORpB )FSYM
9001 FORMAT(1X,'***** ERROR #',I5,' 4UFSYM =sIPA8)
10 CONiTTIJNUE
C INITIALZF FLAGS AND BUFS
BUrSvMmCLEAR
ERRORSwl
ZERomm
IRFLAG=0
IERPOPm0
OPFLAG"0
C PEAD A CARD AND PROCESS INTO ARGS AND FLAGS
CALL rARDTN(ARGPFL\GOPFLAGIERROR)
IF(TEPPOR.NE90) GO TO 1
C IF NOT TMmEADTATE OPERATION GOTO MAIN
IF(nPrLAG.NEe1) GO o 15
OPTEsT=ApG(1)
C LrJOK IN op CODE TABLE FOR VALUE OF OP
00 16 T=1,NOPTAB
IF(OpTFST.EQoOPCODE(I)) GO TO 17
16 CONTINUE
IERROP=4
GO TO 1
C * *********~*************************************************************
17 OPEpCnr)PVAL(I)
9 -10 FORmAT(jXplV(jA8p2X))
C TEST ANn nO Tr PROPER SURBLOCK
IF(nPFECD.EQ.TIMEOP) GO TO 3800
TF(OPFRCD.EQ.NEAP) Go TO 3100
IF(rPrRCD.EoPRINT) G0 TO 3200
Iv( 0 P*E.RUN) GC TO 3400
IC(f7PFCD.E.L0AD) lO TO 2000
TF(rnpcPCD.EQ.LIST) rio To 2500
TP(nPErC0.EQ*DUMP) Go TO 3500
51

IF(fPFRCD.EU.PLOT) On TO 4000
C RETURN TO MAIN IF NOT A * OPFRCODE
IF IPCODF=5
C wIRTE CORr LOAD TO DAFILE
WRITE(NF1LE3'1)(DATTAB(I),I=is TOPCOR)
WRITE (N'IL El'1) IPCODEs IEPROR
CALL CHATN(PROGSil)
C **********************************************************************i
C LOAD PRnGRAM AND INITIALIZE DATA BASE
2000 PSTART=LnCCNT
PCOUNT=PSTART
DO ?010 1.2pNSTMT
REAo(,JFTLFI)DATTAB(PCONT),DATTAB(PCOUNT+l) ,DATTAB(PCOUNT+2),DATT
ITAB(PCOUNT+3) *DATTA9(PCOU'NT+4) ,JJ
PCOuNT=PCnUNT+5
2010 CONITTNUE
PCOUNT=PCOUNT-5
PENr pC0UKT
WPITF(NTyP19200) PSTAPT,PEND
92g FOPMAT(lys'PROGRAM STARTS AT 'AI5,5XjvPROGRAM ENDS AT ',15,/)
DO iCrA IlsNL)FCS
REAn(NFILF2'I)ITYPEPLOCsLENGTHtNN
PUTITYPELOCLENGT ,NN
C TA9LE(jFUFRpnELAYs#.sDONF
IF( TTYPEOF O I) GO TO 110o
!F(ITvPE.EQO2) GO TO 120o
TF(TTYPE.tEQ*3) GO TO 130
TF(ITYPEorQ-4) GO To 140q
rF(TyPrE*CQeP) GO TO 1500
I ER popRI
GO '0 I
1100 DATTA(,OC)u0
GO TO 999
120. DATTM3(LOC)=NN
GO TO 999
I3'W DATAR(LnC)=LENGTH
DATTAq(LnC+l)=l
DATTARP(L 0 Cr +2
)wNN
GO q c99'
14 0 DArTA(LnC)wLENGTH
999 CON INU
10V CONT INUE
150A CONTIPTUE
IF(PEND.eLT TOPCOP) GO TO 10
C IF CORE LOAr TOO LARGE FRROR
WRITE(NTYpp9500)PEN "TOPOOR
990V POPMAT(ly,'PROGRAM TOO LARGE =',16p'AVAILABLE CORE ='16p/)

GO Tr)
C *********************************************************************
52

C LIST PRnGpAM CODE ON PRINTFR


2 9c CON TINUE
cO ?0?p I.PSTARTpPENr,5
WRITE(NTYp 9 210)IDATTABII),DATTAB(I+I)sDATTAB(I+2) ,DATTAB(I+3)
I >DATTAF (T+4)
9210 FORMAT(5XsI5,5XI64XIt, 4XTI64X I6o,4XgI6)
20?0 CONT NUE
IF(RRORSEO.0) GO TO 10
WRITE (N'TYpp 9385) ERROR
93P5 FOR"AT(lXI5,'ERPORS IN PROGRAMAPUN WILL BE SUPRESS ED')
IEROp= p 12
IRF AGI
GO TO 1
C *******************************************************************.*
C READ OPcpATTONAPROCESS APGS
C NAME LENGTH WTDTH
31,0 NN=NrFD(ARG(3)PZERO)
ZERrnnA
MMCNCP0(ApG(4)sZERO)
BUrSym=ApG(2)
C LOOK IN SV M ROL TABLE FOR LO CATION
DO ,ij? 11,NSYMPL
IF(nUrqYM.E.SYMTAB(I)) GO TO 31?p
31I1 CON TTNJE
WRITE(NTYpP 9 230)
9210 F0PMAT(jys'SYMBOL NOT FOUND I
)

BUFqYMwARG (2)
IERqop=i
GO TO 1
3120 LSAVE=SYVVAL(I)
ITYPEnqYMTYP(I)
IF(CTYeF:T.0)LSAVE=LSA VE+2
IF(!TYPEe!(J-0) LSAVE=LS AVE-1
PUT, NN MM
DO ai-ic' IINN
RE ADNNp905o) (X(jJ) JJ.1sMM)
90'4v FORMAT(Ierio*5
)

[ - lip,; J'Is mm
KiLQAVE+J
rATTAp(K)=ISFIX(X(J))
3125 CnNTINUr
L S AVF L AVE +MM
3130 CON TT'NUE
GO TO I0
C ***** ***~******** ******************** ********************************4
C PRINT OPPRATION ,PROCESS ARGP
320V RiiFSYMiARG(2)
C LOOK IN SyMBOL TABLE FOP LOCATION
D)O i2l T.INSYMPL
IFC(qjrSYM.EQ.sYMTAB(I)) SO TO 32?1
53

32 10 CONTINUE
WRITE(NTYpp9230)
BUFSYM=ARG(2)
GO TO 1
322 LSAVE.SYMVAL(I)
NN=NCFD (ARG (3),7ER)
MMaNN/10
+

PUTNNIMM
DO 230 I1=,M
DO 12? J.il10
K=LSAvr+")
3225 X(J)=rLOTs(DATTAP(K))
WRITE (NTYp,9240)(X(JJ)sJj=Is10)
9240 FORMAT(1X,1F12.5)
LSAVF=LSAVE+10
3230 CONTTINUE
GO TO 10
C ************************
C RUN OPERATION,INITIALIZE AND CALL INTERP
34V, CONTINuE
jF(pSTAPT.E.PEND) Go TO 1
CALL w INT
CALL CVTO,0)
CALL 'C
PAUJE 10
C LINK TO ASM INTERPRETER PHASF
CALL T'NTEP(DATTABPSTARTNSTMTTSTEPNCYCL)
CALL 9'
CALL rVTO(1)
C r)ONE SIstAATInNPETUPkN
GO TO 10
C ******** *****~***** ****************************
C CLEAR STOPAGE
3500 uO 1511 I1.1TOPCOR
351V DATTAR(T)=V
WRITE(NFILE 3 '1) (DATTAB( I) IunlTOPCOR)
GO Tfl i0
C ********************* ***************************************************'

C CLOCK ST .LOCK
C WRITF OUT CLOrK VALUES AND SFT CLOCK
387V DTFPIN (ARG(3)AZER0)
ZERnat7
TIMprPIN (ARG(2),ZEP0)
NCYCLu+IPIX(TIMF/DT)
TSTFPpISFIX(DT)
PUTtT"IFNenTsNCYCL, TTEP
CALL wTNT
CALL CTqTP(DT)
GO TO 10
C *~** ***** * ****** **** ***************************************************
54

C pLOT BLOCKiPROCESS APGUMENTS


C NN=# OF PnINTS TO BE PLOTTEDMAX 200
4000 CONTINUE
NNuNCrn(ApG(3),ZERO)
IF(NN.GTop NNaP9.

)
ZEResa p
4b0 BUFSyM=APG(2)
C LOOK IN SyMBOI TAbLE FOR LOCATION
f00 4010 T=IPNSYMPL
IF(rtUAL(qUFSYMsesSYMTAB(I)s0,8) GO TO 4020
4010 CONTINUE
IERRO=41
GO TO I
402 V KaSYMVAL (I)
MMU,
IBOx.?
IPLnTml
IF(rQUAL(FTEST, 0s ARG (4 )p P I GO TO 40?1
ZEROU.
MM.n'CFO ( AmG ( 4), ZERO)
IF(rouAL(FTESToARG (5)so,1)) GO TO 4021
IBOva7
IF( FAL (TEST# Op ARG (6 )s i )I) GO TO 4021
)

IPL T=2
40p1 CONTTNUE
DO 403? I1,NN
JWK+I**m
XPLoT(I)=FLOTS(DATTAR(j))
403C CON T TNUE
C ;ET SCALE FACTORS
XSCL (i)=o.0
XSCL (p )=1.0
x SC L ( )=-1.
XSCL ( 4)=1
.

C PAUSF BFnRE pLOT


PAUs 3o
CALL OICTp(XPLOT,1sXLAE, XSCL I, N,0,'s IBf1Xs -2,is0,IPLOT)
CALL HINT
GO TO 19
C END OF 09nrPAm
END
55

C HYROL SrTUP MAIN-INITIALIZE FILES AND PARAMETERS


REAL*R PNAMES(3)
REAL*9 PROGS(3)
REAL*P OPCODE(40)
REAL*$2 OPr(40)
REAL*q ARG(10),BUFSYMSYMTAB(109)
INTEGFR*p ZERO
INTFGER*2 OPVAL(40)
INTFGrP*? SYMVAL(j0,)),SYMTYP(jo0)
IMPI T-IT TNTEGER*2 (A-?)
INTpsrR*? PFLAGNFILEIs NFILE2,TOPCOR, IFLAGsNTYPsNINPNSYMAXsNOPTAB
C *********************************************************************
C COMMON r)ATrA BASE AREA
COMMONI/COnE S/REAs, PRflGPM, PR INT sPLOT, PUNS EOJ, COREs SYMBOL sDUMP, LIST,
1 TIFnPsPLOADsEXECSrTPOTMODEANVALTSCL
COMmON/CDKNT RL /PFL AG. NFILE isNFILE2, TOPCr)R sOPFL AGs NTYPs NINP, NSYMAXs
1 NOPTARLnCCNTNSYMRL
COMMONI/OPCOD /OPCODEOPVALOPERCDBUFSYMsARG
COMMON/PROGRM/PSTART, PCOUNT, PENDNSTMTPNUM, NDFCSERRORS
COMMON/SYMBOL/SYMTABSYMVALSYMTYP
COMMON PROGS
C *** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

*
DATA PNAMFS/HYBOLMAN9s 'HYBOLRUN?,'HYBOLSETt/
DATA oPC/D0EFINE 's'FUNCF1 O'PDELAY ''SETPOT ','ADD ','SUB
1UBTpACT' iMUL TIPLY',?DIVIDE ',s'COS ''EXP 's'LOG ','GET
2E T ,iPUT 'I'SENCE p'REAV ''PRINT titPLOT 11RU
3RUN ','END ','SIN ',tINTEGRAT,''CONVOLUT,'sDELAYS ',tFU
4FUNCFP ','ODE ','SOPT ','rOJ 'P'PROGRAM','DUMP lp
5 'MnVF 's'SYMBOL ',sANVAL V'OLIST ', 'LOAD fs'RETURN ','
6 P'rxEC 's'TSCL ','TIMEOP Is'FUNCHYSTipt I/
C * ********* *** ******9* ******************** *******************************
C FILE SPFCFIFCATION STATEMENTS
C CALL DFy Tn OvEN FILES
ICAPTS'l
CALL !rI(fHYBULFL1 ',ICAPTs,1IER)
IF(TFPNE.O) Go TO 9R76
ICApTw?
CALL -H(,
YBOLFL? ',ICAPT,2? IER)
IF(TFP.NEe) Go TO 3R76
ICAPT=r,
CALL DFI 'DAFILE 'YICARTp3, IER)
IF(TEP.NE,0) Go TO q876
DEFTNF PI'E 1(100p3#UpTRFC1)
DEFINF rI 1 E 2(60,2,'JIREC2)
Nlr ILE 3(j10009'iUTREC3)DEF F

C DATA INITTALI 7 ATION


TOPCOp=10000

IPCnOrD=
56

N F IL E33
NFILE=P2
NFILEImI
C ClLEAR FTLEq 1,2o3 TO ZERO
nO 9 T=IP100
5 WRITE(JFILE1 I)ZEROZEROZEROZEROZEROIZERO
DO 10 I.1,60
10 WcITF( NFILE2 I) ZERO, ZERO, ZERO, ZERO
DO i5 !.1,TOPCOR
WRITE(NFILE3'I)ZEROZERO
15 CONTINE')
C MARK FILE 1 WTTH PROGRAM ID
WRITE (NFILE1 '1) IPC0E
DO I T"1'3
3 PROGS(I).pNAMES(I)
C sET UP CONTROL INFORMATION
NTYP.5
NINPup
NOPTAAn=40
NSYMA= 10
NSYMPL=M
L 0 A n=34
TIMFOP=38
EXECxlA
RE An=1
PROIRm=28
PR IN' T a 16
PLOT=17
RUN=I,
EOJ=27
CORE=?
SYmROL=31
rOUMo a9
LIST=??
SETDoT=4
MODCEpF
TSCL=37
ANVAL=12
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * ********
C TiANSFEp nATA INTO OPCOiF TAPLES
DO P T"1,NOPTAB
opcnnF(T)=OPC(T)
OPVAL (T)=T
2 CONTINUE
OPVAL (40)=0
C s"T jP pnGRAM CHAINING LINKAGE
CALL SFTCpN(PROGS,3)
C CHAIN Tr wy;OL MAIN
CALL CHATN(PROGS,1)
C ENn nF opnGRAM
57

9876 CALL F)XIT


END
58

SUBROjTINF CARDIN(ARGsPFLAGsOPFLAGsIERROR)
C SLUBROUTTNF TO READpRINT AND PROCESS A CARD*
REAL*9 ARq(10)
INTrGF*2 BUFFER(40),BFIELD(IO)
INTPGrP*2 CARDICARDALITALITZsOPFLAGIJIJJKKASTRSKBUFFER,
I BFIELDCTEST*SEMICLCOMMAIERRORBLANK
INTFGER*2 NINPNTYPKsIPOSoJPFLAG
INTpGrR*2 PARRIPARL
INT'rr.*2 SLASH
LOGICAL EQUAL
nIMENION CARD(8q)
C PITA FOc C-ARACTER TESTING
F)ATA C-OMMAPSEMICL/'s ot) I/
DA T A PARRPARL/') ','( I
DATA LITA/'A '/pLITZ/'7 '/
DATA ALANK/' '/
DATA FTFST/'J
rATA NI!NPNTYP/g15/
DATA ASTRqK/'* v/
DATA qLASq/'/ '/
C ***********************************************************************
10 CONT INUE
IEPRu=0
RE An(NINJP,9001) (CARI ( 1), TIis80)
WRITE(NTYpp9160) CARD
916tU FOPmAT(/, IX,'INPUT CAPD => ',80Atil' <0')
PFL A G=(
OPFLAn=0
90V1 FORMAT(9Al)
C IF / COMMFOT CARD JUST FPINT
IF(coUAL(CARD(j)A0ASLASHp0,j)) GO TO 10
DO 15 !1=s80
CARnI=CARn(I)
C L(OK FOP A ; (
)

IF(EclAL(CARDIpsFTESTs0,1)) GO TO 105
IF(FQAL(CARDI, pPARspi)) CARDu()=COMMA
IF(FQUAL(CARDI~pPA4Lp,1p)) CARD(I)=COMMA
15 CON T IUE
WPITE (NTYPP9390)
939V FORMAT(IX,'NO SEMICOLEN TERMINATOR CHARACTER IN CARD INPUTI)
IFRqop=1
PETtIPN
105 CARn(T)=CnMMA
CAR!)(!+1)=SEMICL
I 1
10 II=I+1
CA RnIm=L A NK
CALL RYTE(CARD(I),@0CAPDI0)
!F(T.,rT.1O) IERROR.?
IF(T.T.1op) RETUPN
59

C TEST FOP TMMEnIATE


C SKIP BLANk"
C CHECK FOR ALPHABETIC
IF( FolAL('ARDI0ASTRSKO1)) GO TO 101
IF(EOUAL(rARDI*,PBLANK;0si)) GO TO 100
IF(CAqnILT*LITA) G TO P0
IF(-APrIf'3 T.LITZ) GO TO pO0
GO TO 900
C * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** 0
C sET * FLAS,
10 OPFLAGt1
GO TO 100
20o WRITE(NTYpP 9 100) ICARDI
C rL.LEGAL INPUT IN FIRST ARG
91 0 FORMAT(1X,'ILLEGAL CHARACTER IN CARD COLUMN',12,'=> 'PA2)
IERPOrP3
RETUPN
C *~*****2*****k*****~***2*********k2kk*2k2***2***2k*************************4
C HAVE PRnBARLE HYBOL PROGRAM CARD
C PACK OUT JUNK BYTES
500 IF(I.F.l) GO TO 51
IJ IT-
C CLEAR LFAfING BLANKS
DO 509 JJ.IPTJ
DO 901 KK=IP79
501 CARo(wk )=ARD(KK+1)
50 c CONTTNUE
51(. CONTINUE
CALL PACK(CAROs8PsBlJFFR)
C (iLT FIELDS OUT
C MUVE APIUMENT FIELDS FROM CAPD TO ARRAY
IPO 9
DO =pq Ku118
CALL r ELn (BUFFE,BFIELD,IPOS)
CALL MOvE (iFIELDp Os ARGf(K), Os8)
5 CONTNIE
C CLEAR 9 LANk ApGS
DO 93( KuiS8
CTEST PLANK
CALL PvTF(ARG(K),psCTEST,0)
IF(CTrST*NE*BLANK) GO TO 530
00 c 4 JU <s 7
ARG(J)=ARG(J+1)
54-" CONTIUE
531 CON T IN1E
C rUNE PET(URP To CALLING PROGRAM
RETURN
END
60

EXTRN OPSP
ENTRY INTERP
* AYBOL AcM INTFRPRETER PHASE 2 REAL TIME PROGRAM EXEC.
* CALL INTERP(DATTABPFTARTNSTMTsTSTEPNCYCL,...
* TNTERPRPTER ENTRY
RO EQU 0
pI EQU 1
RR EQU 2
R3 EOU 3
R4 EQU 4
R5 ETU 5
R6 LOU 6
R7 EQU 7
R8 EQU 8
R9 LOU 9
Ril EGU to
RI EQU II
RI EaU 12
91 3 EaU 13
R 14 EQU 14
RI9 EQU I s
ONE EQU I
7E!t4 EaU rA
TWO EQU 2
OPNU1-m EU
ADN'4UM EQU 16
DPA 11M EQU 1?

* SAVE REGISTERq FOR FORTRAN


INTERPF STM oSAvEAR
LHH R14,PlF LnAD LINkAGF ADDPESS INTO 14
SVC 2,MEqSIN
SVC 2,SVf-2o4 SET STATUS FOR nC
* GET ARGjMFNJTS INTO REGISTERS
LHt- R1,2(P14)
LH R2,4(p14)
LH R3,6(PA4)
LH R4,8(9t4)
Lw R 5, 10 R1 4
)

* STORE ApGq IN SUB


* GET VALUES OF ARGUMENTS
LH R2,J(Q;)
LH R3,O(p3)
LH R4,V(94)
LHw R5,0p(95)
qTH RiTASLR
STH R2,PqTART
STH R'3,N4CTmT
S7- R4,TqTFP
STH R5,NrYCL
61

* CONVERT ApRUMFNT ARRAY INDEX VALUES INTO BYTE ADDRESSES


* CUFE TO TRANSLATE IDEXES INTO ACTUAL 9YTE ADDRESSES
* qET PROIRAM OrFSET
LHR R5,RI
LHR R6,R3 REG 6 a LINES OF CODE IN PRIG
* PYTE OFFSET.(T-I)*?
SIS R2,1
AHR R2pRp
AHR R 1 ,Rp
STH R1spOGAD
* PSTAPT a pSTApT OFFSET PLUA ADDRESS OF DATTAB
* D0 ALL CONVERSION ON 3 ARGS AT ONCE
GETADD LH Rp2(p)
LH R3,4(o)
LH R4,6(q1)
Lw P 9 O(q1) LOAD OP CODE
LH Rl0p8(RI)
* CHANGE TO RYTES
* ADD=(I-I)*?+A(DATTAB)
SIS R2api
STS R3PI
SYLS R01
SYS R10,
AHR p2pR?
AH R3PRi
AHR R4PR4
AHR R4,PRj4
* ADD A(DATTAB)
AHR R2PR9
AHR R3sRF
Awk Rj4 Rq
AHR R10js5
* STORE IN OLD LOC
STH R2s2(Pl)
STH R3p4(RI)
STH R4p6(R 1
)

XH.R PRPR LIAD A 0 INTO 8


COMPAR LH P7,0PCODE+2(P8) LOAD ADDRESS OF OP BLOCK
CL H Rq~oPCo7)E(8) COMPARF OPCDE TO TABLE
9E FOUND c-"UNr' OPCODF
AIS R8P4 INCREMENT TO NEXT OP CODE
Bq COMPAr TCXT NEXT
FOUND 9TH P7,0(pl) SAVE ()P ADD IN OP CODE LOCATION
* TEST IF DoNE
SES R6,I
RZS CONTNU GO TO INTFRPqETER SECTION IF DONE ADDRESS CONVERSION
* TIN'CREMENiT AND DO NEXT LINE
AT! Rltil
62

B GFTADD

* START INTEPRFTER
CONTNU EQU *
LH R12,PNCYCL
LIS R10,1' OAD FIRST TIME STFP VALUE INTO 10
* STOP ANn wAIT FOP CLOCK TO RESET
LHI RIPX'69' LOAD CLOCK ADDRESS INTO I
CWAIT SSR RjpR2 SENCE CLOCK STATUS
BNCS CWATT LOOp UNTIL CLOCK RESTETS
LHI 3,X'90 4 7'
LHI 2,X10401'

OCR 1,3
WwR 1,?
CYCLDN FQU
*

Lw R13pPPOGAD LOAD PPOGRAD START ADDPESS


SiS R13,I
* ** * ** * *** ** * ** **** * ** ** * ** ** *** ** **

*
* READ IN DATA FROM A/D BLoCK
* CODE TO RFAD A BLOCK OF A/D CONVERTEPS
READAD LH RITARLE LOAD A(DATTAB) INTO Rj
LHI R?,ADNtjM LOAD NUM OF A/DS
Lul R3,X' 8 4 ' LOAD OPCODE TO READ IN ADC AND INCREMENT MUX
LHI R5PX'A4' LOAD A HEX A4
LHI R6sXIAP' LnAD A HEX Ap
XwR 7,7 7EPR RrG 7
RFA)Y OCR R6,R5 SEND AN A4 TO DEVICE AP
WMR R6sR 7 SEND CHANNEL NtUME EP
LIS Rq9gi LOAD A 10 AND COUNT DOWN TO WAIT 10 MICROSECS
RWAIT SIS apQi WAIT FOR Pq tAICROSECONDS
BNMS RWATT
REAU OCR R6,R3 SEND AN 84 TO THE INTERFACE
PHR R6sRp RFAn SCALED FPACTION INTO R
NHI RRpX'FFCO'
STH RSO(R 1 ) SAVE VALUE IN DATTAB
AIS RIP2 INCREMENT ADDRESS
ATS R7,1 INCREMENT CHANNEL
#

Ss R 2 ,j SUBTRACT FROM LOOP COUNTER


BPZ READ
* DoN E READING RLOCK OF A/ IN

TEST EQU
* :ET OP rODEsApG1,ARG?,ARG3
* < INSTRiCTION OVERHEAD PER SET
ATS R13,10
LH Rlp9)(p1q)
Lw R2,2(pti)
L 4 R-1,4(qi3)
Lw R4,i6(oii)
63

Lp R5,8(pR3)
STH R2,APGP SAVE ADDPESSES
STH R3oARG3 RECAUSE SOME OPS NEED THEM
LH R2,0(92) GET VALUFS OF tRGS FOR IMMEADIATES
LH R3s0k 3)
9R RI BRANCH To OP CODE RLOCK

* INTERNAL ARGUMENT STORAGE LOCATIONS


A3VAL DC XI'A30 0
'

SVC204 DC X10004'
DC X'4007'
TABLE DC X''
PSTART DC x'~o
NSTMT DC y'o'
PROGAD DC x'i'
TSTEP DC X''
SVCONE DC XiO001'
ERROR DC y'o'
ERRORS DC X't"'
LINE DC X'l'
NCYCL DC X'l'
ARr;2 DC Xfol
ARG3 DC Xiot
A2VAL DC X'4200'
MASKAD DC x'FFCo'
LOST DC Xvol
SAVEAR DS 3?
* SVC 2 MESSAGE BLOCKS
MESSIN DC 7
DC 10
DC C' ENTER INT'
MESSS DC 7
DC 6
DC C' DO OP'
MESSI DC 7
Dc 10
DC C' RE4D ADCS'
MESSR DC 7
Or 10
DC C' WRTTF DAS'
MESSCL DC 7
DC 10
DC C' CHECK CLk''
* OPCODE AND BLtCK ADDFESS TABLE
OPCODE DC 5
DC A(ADDOP)
DC 6
DC A(SUBnp)
DC 7
DC A(MUL TOP)
64

DC 12
DC A(GETOP)
DC 13
DC A(PUTnP)
DC 8
DC A (DIVn0P)
DC 3
DC A(DELAY)
DC 19
DC A (ENDnps)
DC 21
DC A(INTGRT)
DC 23
DC A(DELAYS)
DC 22
DC A(CONVLT)
DC 2
DC A (FUNAC)
DC ?4
DC A(FUNCFp)
DC 30
DC A(MOVFoP)

DC A(ENDoPP)
DC 40
DC A(INVPRT)

* ADD TWO SCALEr FRACTIONS


ADDOP AHP R2'p3
STH R2oZ(4)
B TEST
* SUBTRACT TWO SCALED FRACTIONS
SUFBOP SHP R2'P3
STH R2,V( 4
)

B TEST
* MULTIPLY TV!O pCALEr) FRACTIONS
MULIOP L 4p pqpR?
MMk R8>Ro MULTYPY BY SF
SLA R8s I
STk R8,?(4) SAVE PESULT IN OUTPUT ARG LOC
B TEST
* DIVIDE TWn SCALED FRACTIONS
DIvDOP LHR P9oP 2
SHP R99tq
SPA p8,1
OHR RFPR DIVIlIE BY SF
STH 99s (4)
B TEST
INVERT LH R3,ARq3 GET LOC BACK
XHP P 1 ,9 1 CLEAR REG I TO 0
65

S. R1,Rp SUjTRACT VAL FROM ZERO


STH Rlp(pl) SEND VAL OUT
B TEST
* ** ** ** ** * * * * * * * * * * * * * * * * * * * * * ** * * * *

*
* PUT VALUE TNTn BUFFEP ( NCYCL)
PUTOP LH p3,ARG3
LHR R4,RIO GFT TSTEP

#
AH R4,R4
AHR R4,P3-
STH R2,?( 4 ) PUT VALUE IN RUFFER
B TEST
* GET VALUE FROm BUFFEP(NCYCL)
GETOP LH p3,ARGI
LH R2,ARr-

AHR R4,PR 4
AHR R4,RI
LH P3,O(R4)
STH R3PQ(?)
B TEST
MOVEOP LH PJAARG3 GET ADDRESS OF 3 BACK
STH R 2 oO(P 3 ) MOVE VAL Tl LOC OF 3
R TEST
DELAYS EQj
*

q TEST
CONVLT EQgi
*

e TEST

EPPUPi LI- p7s1.


SVC 2,MESsAG
E TEST
MESSAG DC 7
!r' 10
DC C'ILLrGAL Op'
* * ** ** *** * * ** *** * ** ** ** ** ** * **** ** * **
* DELAY LTNF - cIMPLE TYPE
* DELAY SijBROUTTNE
DELAY LH rga(R") REG 5 IS LENGTH NN
LH 96,2(94)
Lw P3,ARG3 GET LOC BACK
CLRP R6s5 COMPARE PNT TO NN
3NPS PNTqOK IF PNT SMALL ENOUGH GO TO OK
LIS R6,*OkE
PNITROK LH9 P7,R 6 SAVE PNT IN., REG 7
AHR R6PRA
AHR R6,R4 ADn DISPLACEMENT FOR DATTAR
AHI R6,4 A0D 4 FOR OFFSET
LH PR,0(R6) rET DELAYE I VALUE
STH R8O(P') sET VAL DELAYED THEN PUT AT OP LOC
STk R2?#(P6) PUT NEW VAL''E IN OLD SLOT
66

4 1 S P71I
STH R7p2(R4) OVE PNT+1 IN PNT
e TEST
* * * * * * * di * * * * * * * *i * * * *i * * * * * * * * * *i ** * *i * * *i
* ONE DIMCNsIONAL TABLE LOOKUP
FUNCI LH !3,ARG)
ATS P4,2 INCRMEN1 PNT TO DATA
FCOMP CH 42,0(R4 ) COMPARE X WITH X(I) IN TABLE
BE FE!JUAL X HIT TABLE EXACT
35ms FUNCO IF X LT POINT OK
ATS R 4 ,4 TNCRFMENT TO NFXT ADDRESS
RS FCOMP
FUNCDO SIq P4,4 SET 4 FOR X(I)
LH R5,0(9 4 ) LOAD X(1) IN 5
LH P6,2(R4) R6 Y(I)
Lw 97#4(94) R7=X(I+I)
LH R9,6(R4) Rj=Y(I+1)
SWR RqR6 99"y(I+1)-Y(I)
SHN R7pRP R7=y(I+1)wX(I)
SHP R2pRs p2=X-X(I)
MpR RgsRn P9=Pq*(X"X(I)) RESULT IN R8
Dwk R8,R 7 P8mp8/X(I+I-XfI) RFSULT IN R9
AHR Rq.ReA qsRR9+Y(2)
STH R9,po() pUT AT OUT LOC
S TEST DINE SO RETURN
FEQUAL LH p?22(p 4 ) GET Y(I)
STH R,0(R 3 ) pUT AT OUT LOC
B TFST
* ** **di* *** diiidd **i*
*** *d* ** ** ** ** * * *d**
*

V3276 DC 3276
FORTY2 DC 4P
TEN DC 10
TWENTY DC 20
?? INPUT FuNCTTON TABLE LOOK UP
FUNCF2 LH9 qjRF SAVE TAPLE AnDRESS IN I
Lwk RpR,4 SAVF OUTPUT LC IN 0
LH R5pP2 PUT X IN 5
LwR R7PR 3 PUT Y IN 7
M4 P4,TWP'NTY
Mw P6,TWPNTY
Lwk RgpR 4

ATS R4,11 7I+'i


AwR R4,R4 lI*p
* pb NOW HAS COLUMN BYTE OFFSET
AIS R6p1l J=d+10
LHR R7,PR 6 PHT OVER FOR
*

Mw R6,FOTY? J=J*4?
* R7 NOW HAc ROW OFFSET BYTES
* xIYJmL0-+p0W+'OL
67

AH R4,RI ADD TABLE LOC


LHH PR? PUT OUTPUT LOC IN 1
AwR R4,R7 ADD pOW OFFSET
* P5 NOW OOTNTS TO XIYJ VALUE LOCATION
LHR R11,4 SAVE LOC IN 11
LHR R7,Rg OUT 0 INTO 7
Mw R6,V3',76 *pY *I BUT NOT A SCALED FRAC
MH R8,V376 *RpYo
SUR RPR7 P2=nELTA X
SHR R3,R 9 P3unELTA Y
* CALCULATE FAKF ENE) PNTS ANr CENTER
LH R5,2(11) LOAD XI+IYJ
q'H R',0e'( 41 ) -X, 0Y J
Mwf. R4,P,- SF, * DELTA X DIFF
DH R4,V3,76 S.F. / BY .1
A R95,0(j1) + XIYj
LK R8,Rs SAVE IN 8
LH R5,44(11) LOAD Xl+jYdj+1
SH P5,42(11) - XIYJ+1.
MHN pR4, * By DELTA X c.F.
1
Dm R4,V3P76 S'F*/*
AH R5,?42( I) + XIYJ+1
S-KR R5sPP rELTA Z 7(I+1)-Z(2)
MkN R, P 5.F. * DELTA Y
DV R4,V37(, S.Fo /.1
AR , 7Pr(T)+rELTA Z
STH R5,p(p ) pUT AT OUTPUT LOC
H TEST
* TNTEGRATOP FLOCK
INTGRT LH Rj,ARq3 GET ADORESS
LHR Rq 9 ,R cET UP FOP MULTIPLY
SHR RRpRp CLEAR R8 TO ZEPO
MH R8,TSTFP INPUl*DT
SLA Rpj SM4TFT OUT EXTRA kIT
Ak P9,2(a)
ACH Rpo(3) AnD TEMP TO OLD INTEGRAL
RTH s03
STH Rq,2(3) STORE NEW INTEGRAL IN OLD LOCATION
B TEST DONE PETURN
* * * **** * ** ** * ** ** ** ** ** * ** ** * ** ** *** *

ENnoPS E0U
*

* WkITE OT DATA INTO f/A BLOCK


* OUTPUT r,/A RLnCK
LpI RIXIAA ' LOAD A HEX 40
LI P2,TAL.F
AHI P2,32 qET STARTING ADDRESS OF INPUT BUFFER
XH' R3,RI 7ERO 3
LHI R4pDANI
X14F RSR: 7ERO 5
Lwl R6,Xf8V' LOAD A INC AND SEND COMMAND CODE
68

oC R1,A2vAL SEND AN A2
WHR RiRR PUT IN RESET JAM MODE
OCR R1,R SET CHANNEL VALUE
WHR R 1 ,Rs WRITE FIRST ADDRESS
!RITDA OCP RlR 6 SEND SET COMM
WH RlP(P2) SFND VALUE
AIS R2,2 NFW AnD
SIS R4,i rECPEMENT LOOP
BNJZS WRITDA
OC R1,A3VAL SENU AN A3 TO INTERFACE FOR TFANSFER COMMAND
WHP RipRr SEN JUNK
* DONE WRTTTNKG pLOCK
AIS R 1 0, 1 ADD A ONE TO 10 TO COUNT STEPS DONE
SIS R12,i cSU1TpACT 1 FROM 12 TO SET CC FOR DONE
Bz DONE TF CC 7 ERO FINISrED RUN
LHI RoX!6P' LOAD CLOCK ADDPESS INTO 2

* rODE TO SFlJCE CLOCK STATUS


SSR RpR 4 SENCE STA TUS OF CLOCK PUT IN 4
frCS CHIT mTSS;4? PULSFTOO LONG A PROGRAM
RNRxiS CHIT CLOCK NCT RUNNING
CLOCP SSR pp94 TEST CLOCK STATUS
ACS CLOoP LOOo IF NOT DONE COUNTING DOWN
R CYCLJN pETU~N At\N PESTART PROGRAM IF NOT DONE
CHI, SvC -;MFSS-.> PUT OUT CLOCK ERROR MESSAGE
B CYCLDN
MESS? DC 7
oC 1
DC C'CLOcK LOST'
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * *

*
* of INTEqUPT CHECK IF FINISHES PROG OK
* FINISHEn PUNNTNG PROGRAM
DONE LH PIEPPOPS
BAL 5,S'p
nC 2
L-A PpSAVEAf' pETURN FEGISTFPS FOR FOPTRAN
AH r15, RETURN ADDRESS
(Ri5) GET
RR R1.

You might also like