Writing
Relocatable
Subroutines in
SPS
Header
Record
Trailer
Record
tape
after
the
SPS system has
been
loaded
in
the
normal way,
insert
the
instruction
36
00000 00300,
mount
the
modification tape,
and
press
the
release
and
start
keys.
After
the
modification
tape
has
been
read
in,
the
following message will
be
typed:
TYPE
IN
TWO
DIGIT
SUBROUTINE
NUMBER
The
correct 2-digit subroutine
number
must
be
typed,
and
the
release
and
start
keys pressed.
If
a typing error
is
made,
the
error
may
be
corrected
by
using
program
switch
4,
as described
under
OPERATING
PRINCIPLES.
Processing
may
be
continued
by
entering
the
SPS source program.
Since
the
sine-cosine subroutines
are
together as one
subroutine
with
differ-
ent
entries,
they
must
remain
in
the
subroutines for compatibility
with
the
re-
locator. However,
if
you wish to write a
new
sine-cosine subroutine,
it
must
be
compatible
with
the
relocator, i.e.,
the
sine
entry
equals cosine
entry
+ 44.
The
ongm
of a relocatable subroutine
must
be
at
location 5000,
and
must
be
the
address of
the
first instruction executed in
the
subroutine. Relative addresses
in
an
instruction are
indicated
by
flags over
the
0 or 1 positions
of
the
operation
code.
For
example,
if
the
P address of an instruction
is
relative to
the
origin
5000, a flag
must
be
over position
O.
The
P address will
then
be
modified
when
the
subroutine
is relocated.
The
flags
are
not
removed
by
the
relocator
but
are
stored in memory
with
the
instruction
at
object time. Since relative P
and
Q
addresses are to
be
modified, they
must
not
contain any flags
other
than
in
the
P
1
or Q, positions.
(Flags
on P
1
or Q, are
not
necessary to
the
subroutine
re-
locator. )
The
address of
the
argument
will
be
found
in location 19989
-20(
NN
-4)
v"here
NN
is
the
subroutine
number.
(If
compilation needs
additional
memory,
the
location of
the
argument
must
be
modified
by
20 or 40
K,
depending
upon
the
amount
of additional memory
used.)
The
calculated result of a relocatable
subroutine
must
be
left in
the
floating
point
accumulator
(FAC,
00051
through
00060),
or
a flag
must
be
set
in
location 0005l. Although
record
marks
may
be
contained
within
a subroutine, one
is
available in location 00401).
Relocatable subroutines
must
exit
by
a
Branch
Back
(BB).
A flagged digit, representing
the
high-order
digit of
the
highest
numbered
core storage location
used
in
the
system, is
in
location 00400. This
digit
is, for
example,
5'
for a 60,000 location
machine
configuration.
In
the
card
system,
the
header
card
has
the
following form:
Columns 1-2 Subroutine
number
(NN).
62 Zero.
76-80 Sequence
number
(sequence
number
=
NNOOO,
where
NN
is
the
subroutine
number.
The
first
sequence
num-
ber
in
the
subroutine
itself
would
then
be
NNOOl.)
In
the
tape
system,
there
are two
header
records:
the
first contains a single
zero
and
the
second contains
the
2-digit
subroutine
number.
In
the
card
system,
the
trailer
card
has
the
following form:
Columns 1-5
62
76-80
The
next
even
number
above
the
number
of locations
used
by
the
subroutine.
o (flag
zero).
Sequence
number.
Analysis of the
FORTRAN
Program 63