HP 3000 III Series Manual page 160

Table of Contents

Advertisement

Machine Instructions and Stack Operations
Block 7 stores bits 8 through 15 of the label into bits 8 through
15 of the Status Register.
This indicates to the system that
we
are now operating in the called segment.
A check is then made to
see if the
called segment is absent from main memory.
If it is,
an absent code segment trap is incurred.
A similar check is made
for TRACE by checking the CST entry for the called segment.
The next ch eck is to see if bits 1 thr ough
7
of the label are
o.
These bits specify which STT entry in the target segment contains
the desired local label.
Since a value of
0
would point
at the
STTL word in PL,
the value of
0
is specially de fined to ind ica te
that P should be set to PB of the called segment; i.e., the local
label equals
O.
A check is then
made to see if the PB
entry is
callable if
it is
being called
from user mode.
Assuming that
bits 1 through
7
of the external
label are not
0,
the value so
indicated
will point to one entry in the Segment Transfer Table.
If it does not (i.e., if the value exceeds the STTL value), or if
the entry pointed to is not a local label (i.e., if bit
0
=
1),
there will be an STT Violation.
But if the label is valid,
it is
then checked to see if the procedure is callable if being
called
fr
an
user mode by checking bit 1 (must be
0) •
Block 8 sets the
P Register to the starting address of
the pro-
cedure.
The CPU at this point has a local label,
whether it is
in the same
segment as the PCAL or in a segment external
to the
calling segment.
The
value for P is
calculated by
adding the
contents of bits 2 through 15 of the local label to the
contents
of PB.
As a final check,
this value for P is checked to see if
it is between PB and PL.
The resultant absolute
value is
then
loaded
into the
P Register,
and
the location so
indicated is
fetched and execution of the procedure begins.
EXIT Sequence.
Figure 4-12 illustrates the operation of the EXIT
instruction.
If the exit is within the current segment, only the
steps on the left side of the diagram are performed.
For returns
to another segment the right side is also executed.
The first step (1)
is to fetch the 4-word marker pointed to by
Q,
which was
placed on the stack
when
the
current procedure
was
called.
S is set equal to
Q,
deleting any local
storage being
used by the current procedure.
If the current procedure is exe-
cuting in user mode, the privileged and external interrupt enable
bits in the marker status are compared with the current status to
ensure that the user has not modified these in the marker.
Then
X is restored from the marker.
In step 2,
if the current segment and the segment in the
mar ker
are the same, steps
3
through
6
are omitted; otherwise continue.
Steps 3 and 4 are similar to the equivalent steps in PCAL (figure
4-11) •
4-30

Advertisement

Table of Contents
loading

Table of Contents