HP 3000 III Series Manual page 41

Table of Contents

Advertisement

System/CPU Overview
a Data
Segment Table.
These tables are known to both
software
and hardware.
Software uses the tables for
dynamic memory man-
agement by
the operating system.
Hardware uses
the tables
to
perform
references and
transfers
between segments
and to make
sure that
all the segments required
for
current execution
are
present in Main Memory.
(Re fe r to paragraph 2-24.) Code segments
can be up to 16K
words in length and data segments can be
up to
32K
word s in length.
2-19.
Processes
In an MPE environment, programs are run on the basis of processes
created and
handled by the operating system.
A process is
the
basic executable
entity in MPE.
A process is not just a parti-
cular program; it is the unique execution of a particular program
by a particular user at a particular time.
When a user requests
the execution of program, the system creates a private, hardware-
protected data segment
called a stack for that particular execu-
tion.
Data segments separate
from the stack
can be
obtained
dynamically during process execution.
Data segments can also be
expanded
and contracted
by the
operating
system as
required.
This includes
system handling
of the
stack overflow
interrupt
(paragraph
2-69) during which the data segment may automatically
be expanded to accommodate operation of the stack.
The program's
changing set of code segments operating on the data stack consti-
tute the process.
(The code segments
used by a
particular pro-
cess can
be shared
with
other processes,
but each
ind ividual
process data stack is private.)
In order for a
process to
exe~
cute,
its data stack and
code segment containing
the procedure
currently in execution by the CPU must be present in Main Memory.
2-20. Data Stacks
As previously discussed in paragraph 2-19, data for each user
is
organized
into
a
data stack.
In general, a stack is a storage
area where the last item stored in is usually the first item tak-
en out.
In actual use, programs have direct access to all
items
in the stack by specifying addresses relative to several CPU reg-
isters.
(Refer to paragraph 2-21.) All features
of
the
stack,
including the automatic transferring of data to and from CPU reg-
isters and checking for stack overflow and underflow, are
imple-
mented in the hardware.
When programming in high-level languages
such as COBOL or RPG, all stack
manipulations
are
accomplished
automatically
by the language processor.
The user can, however,
manipulate the stack directly by writing programs in SPL.
Figure
2-3 illustrates the general structure of a data stack
as
viewed
from
a
subprogram.
The white areas represent locations filled
with valid data and the shaded area represents available unfilled
locations.
The stack area is delimited by the locations
defined
as
Da
ta
Base
(DB) and Stack Pointe r (S-pointer).
The DB and S-
pointer addresses are retained in dedicated CPU registers.
(Re-
fer to paragraph 2-21.) The Q-minus relative addressing area con-
tains the parameters passed by the
calling
program.
The
area
between
the
S-pointer and Q contains the sUbprogram's local and
temporary var iables and inte rmedia te results.
2-9

Advertisement

Table of Contents
loading

Table of Contents