mirror of
https://github.com/PDP-10/its.git
synced 2026-01-13 15:27:28 +00:00
1384 lines
61 KiB
Plaintext
1384 lines
61 KiB
Plaintext
.he 11SIM Reference Manual Page
|
||
.l 62
|
||
.paperw 62
|
||
.bspdir
|
||
.ds
|
||
.center
|
||
11SIM Reference Manual
|
||
.sp
|
||
.sect
|
||
I. Introduction
|
||
.sect
|
||
|
||
11SIM is a program that simulates a Digital Equipment
|
||
Corporation PDP-11 computer [Ref 1]. This simulator is designed
|
||
to run on the Artificial Intelligence Laboratory PDP-10 [Ref 3]
|
||
system under the ITS monitor [Ref 4]. A DDT-like [Ref 5] command
|
||
facility is included which makes available functions equivalent
|
||
to those provided by the PDP-11 console, the normal range of DDT
|
||
facilities, and the use of several special debugging features built into
|
||
the simulator.
|
||
11SIM is available under ITS as a system program of name
|
||
PDP11.
|
||
The PDP-11 processor simulator was
|
||
written by the author of this memo. The DDT command language
|
||
was designed and implemented by Richard M. Stallman.
|
||
|
||
.page
|
||
.sect
|
||
II. Processor Simulation
|
||
.sect
|
||
|
||
The PDP-11/20 processor is simulated by 11SIM under ITS [Ref 4]
|
||
with an increase in execution time of about a factor of 30. The actual
|
||
simulated versus real speed ratio varied from 25. to 37. for the PDP-11/20
|
||
processor maintenance programs. Things that would tend to increase this
|
||
ratio (i.e. slow down simulation) include activation of "direct to memory"
|
||
input-output devices that operate in parallel with the processor
|
||
on a real PDP-11 or frequent program reference to such things
|
||
as the program counter as a register other than as an addressing
|
||
index (i.e., BIC %7,-(3)), non-existant memory locations,
|
||
or the other special register locations.
|
||
11SIM keeps track of simulated time to one tenth of a microsecond
|
||
based on the nominal timing of the PDP-11/20. Delays caused by the EAE
|
||
(Extended Arithmetic Unit KE11-A) are not simulated. For information
|
||
on the timing treatment of other peripherals see the
|
||
Appendix.
|
||
As a convience, some PDP-11/45 [Ref 2] features are
|
||
also simulated but can be disabled by detaching the "I45" device
|
||
[Sec VIII]. With these PDP-11/45 features off, the
|
||
only known imperfection in the PDP-11/20 processor simulation is
|
||
that instructions that specify a register as a source and then modify
|
||
the register in the calculation of the destination address will fetch the
|
||
unmodified register as data. Thus MOV %3,(3)+ does not store
|
||
the incremented register 3 as on a real PDP-11. This is because it
|
||
is convenient for the simulator to fetch the source data before
|
||
calculating the destination address. Digital Equipment Corporation has
|
||
said it will not guarentee the compatability of this type of instruction
|
||
on future models of the PDP-11 [Ref 1].
|
||
|
||
.page
|
||
.ds
|
||
.sect
|
||
III. Command Level and Interrupt Commands
|
||
.sect
|
||
|
||
11SIM has a DDT-like command level [Ref 5] which the user
|
||
is initially typing at. Whenever command level is entered,
|
||
after the first time, it
|
||
prints out the location and symbolic representation of the next instruction
|
||
to be executed if the simulator were proceeded. (This location is not
|
||
"open" however [Sec V].) This is usually preceded by an indication
|
||
of why command level was entered. For example QUIT, BREAK, and
|
||
COUNT indicate command level was entered due to a ^G_, a
|
||
breakpoint [Sec IX], or a proceed count exhaustion [Sec VII].
|
||
When first started, 11SIM prints
|
||
out its version number (this should be included in the report of any bug)
|
||
and initializes the PDP-11 configuration [Sec VIII]. If the
|
||
user has no disk file named .PDP11 (INIT), zeroed PDP-11
|
||
core is attached to 8K from zero as with an attach command, causing
|
||
a print out. Command level is then entered with zero as the location
|
||
of the next instruction for the simulator to execute. The
|
||
resulting initial print out is as follows:
|
||
.ss
|
||
11SIM.nnn
|
||
CORE = 8.K
|
||
.sp
|
||
.ds
|
||
If the user does have a disk file named .PDP11 (INIT),
|
||
no core is initially attached by the simulator. Instead, "INIT"
|
||
is typed out and after command level is first entered, the user's file will
|
||
be executed as with a :XFILE [Sec X]. The user's INIT file
|
||
should attach the desired amount of core.
|
||
Command level is entered if the user quits (see ^G_ below
|
||
this section) or the simulator halts due to a HALT instruction,
|
||
a buss error during a trap, or some reason related to the debugging features
|
||
of the simulator. Command level types out an exclamation point as
|
||
a prompt character at the beginning of each new line of input to it.
|
||
Single character rub out is allowed between activation characters.
|
||
Simulated time does not pass in command mode.
|
||
The following characters have effect at the interrupt level regardless
|
||
of whether the simulator or command level is active. They are
|
||
invisible to simulated programs and ignored by command level
|
||
(but see ^Q_). Some help
|
||
in getting back to command level rapidly while most control the
|
||
destination of normal "console" or simulated teletype
|
||
output.
|
||
.ss
|
||
A. ^B_ (B_egin) Turns on output to line printer (but see
|
||
:WALLP [Sec X]). If not available, output will be buffered on the
|
||
disk for later printing by ITS.
|
||
.sp
|
||
B. ^E_ (E_nd) Turns off output to line printer.
|
||
.sp
|
||
C. ^G_ (bell) This is the "quit" character.
|
||
C.1 If typed while at command level it causes an immediate
|
||
error and return to the main command loop.
|
||
C.2 If typed while simulating, it sets up a transfer to command
|
||
level to occur at the end of the current instruction or simulated input-output
|
||
cycle. It is possible that due to a bug in the simulator the current
|
||
instruction or I-O cycle will not end soon. (This is very much more likely
|
||
for a complex newly introduced I-O device than for a basic PDP-11
|
||
instruction.) In this case more ^G_'s may be typed with the following
|
||
effects:
|
||
C.2.a ^G_^G_ This has the same effect as ^G_^S_ and will
|
||
allow the user to immediately see if he has quit or not despite much
|
||
buffered type out.
|
||
C.2.b ^G_^G_^G_ This causes command level to be entered
|
||
immediately, probably from within an I-O cycle. Proceding the
|
||
simulation will return to whatever was happening while a ;G [Sec VII]
|
||
will start simulation at the beginning of an instruction.
|
||
.sp
|
||
D. ^Q_ (Q_uote) This character causes the immediately following
|
||
character to be treated as an ordinary letter at interrupt level and also
|
||
at the main program level of command level. A ^Q_ will be invisible
|
||
to a program being simulated but the following character will always be
|
||
visible. It is useful for inputing any of the special characters listed
|
||
in this section. It may also be used to put
|
||
space, comma, colon, and semicolon into filenames. Rubbing
|
||
out a character quoted by a ^Q_ also automatically rubs out the ^Q_.
|
||
.sp
|
||
E. ^S_ (S_ilence) This character deletes all typeout
|
||
until the time it is invisibly read at the main program level.
|
||
.sp
|
||
F. ^V_ (V_oice) Turns on typeout. Typeout is also
|
||
switched on by some serious errors.
|
||
.sp
|
||
G. ^W_ (W_isper) Turns off typeout, except for most
|
||
error messages which bypass this switch.
|
||
|
||
.ds
|
||
.page
|
||
.sect
|
||
IV. Expressions in 11SIM DDT
|
||
.sect
|
||
|
||
Expressions in 11SIM DDT are composed of syllables
|
||
and operators. Syllables are composed as follows:
|
||
.ss
|
||
<digit>::= 0[ 1[ 2[ 3[ 4[ 5[ 6[ 7[ 8[ 9
|
||
<letter>::= A[ B[ C . . . X[ Y[ Z[ .[ $[ %
|
||
<octal-number>::= <digit>[ <digit><octal-number>
|
||
<decimal-number>::= <digit>.[ <digit><decimal-number>
|
||
<ASCII-value>::= '<any-characer>[ "<any-character><any-character>
|
||
<symbol>::= <letter>[ <letter><octal-number>[ <symbol><symbol>
|
||
.sp
|
||
<syllable>::= <octal-number>[ <decimal-number>[
|
||
<ASCII-value>[ <symbol>
|
||
.sp
|
||
.ds
|
||
In the above, <any-character> means either any ASCII
|
||
character not mentioned in section III and not rub-out,
|
||
or a ^Q_ followed by any mentioned in section III or rub-out.
|
||
Rub-out is used to implement a character at a time input
|
||
backup feature.
|
||
The value of a syllable (assuming no undefined symbols) is a
|
||
16. bit number and a flag that says if it is a register
|
||
number. A register value can come only from a register type symbol. The only
|
||
initial register symbols are %0, %1, . . . %6, %7. An expression
|
||
is register valued if and only if it contains a term which is a register
|
||
valued syllable.
|
||
Expressions are composed of syllables and certain operators,
|
||
with the indicated precedence, as follows:
|
||
.ss
|
||
<term>::= <syllable>[ <value>
|
||
<expr1>::= <term>[ -<term>[ +<term>
|
||
<expr2>::= <expr1>[ <expr1>*<expr1>[ <expr1>!<expr1>
|
||
<expr3>::= <expr2>[ <expr2>+<expr2>[ <expr2>-<expr2>
|
||
<expr4>::= <expr3>[ <expr3>&<expr3>[ <expr3>\<expr3>[
|
||
<expr3>#<expr3>
|
||
.sp
|
||
<expression>::= <expr4>[ <expr4><space><expr4>
|
||
.sp
|
||
.ds
|
||
In the above "!" signifies division, "&" means logical and,
|
||
"\" (back slash) means inclusive-or, and "#" means exclusive-or. A
|
||
<space> in an expression performs the operation of addition.
|
||
Since the PDP-11 has multi-word instructions, the command level
|
||
DDT can handle multi-word values. These may be composed by an
|
||
op-code or with angle-brackets as shown below:
|
||
.ss
|
||
<expr-sequence>::= <expression>[ <expression>,<expr-sequence>
|
||
.sp
|
||
<value>::= <expression>[ <op-code-with-operands>[
|
||
"<"<expr-sequence>">"
|
||
.sp
|
||
.ds
|
||
For an expr-sequence at the top level, each expression is
|
||
assembled as a successive word. In an embedded expr-sequence,
|
||
only the first expression is used. Surrounding register
|
||
value expressions with angle brackets strips off their registerness.
|
||
Op-codes may variously have zero, one, or two operands and
|
||
the operands may be of various sorts. The usual PDP-11 conventions
|
||
are followed [Ref 1] except for the set and clear
|
||
flag instructions where SFL or CFL followed by a space,
|
||
an atsign, and the appropriate flag letters is used (i.e. SFL @C
|
||
for SEC or CFL @Z for CLZ). In genral,
|
||
expressions of the right registerness may
|
||
be used in operands. Where a register is expected and an ordinary
|
||
value is supplied, it is treated as a register value
|
||
(i.e. RTS 7 is equivalent to RTS %7).
|
||
The following are some special symbols whose values are
|
||
automatically set.
|
||
.ss
|
||
. Current location [Ref 4].
|
||
%. Location actually open [Sec V].
|
||
% Set at entry to simulated program counter.
|
||
%OPC Address of last or current instruction.
|
||
%Q Has value of last quantity typed in or out.
|
||
%B Address of last breakpoint taken [Sec IX].
|
||
%GO Starting address for ;G with no argument.
|
||
%CORE Number of bytes attached (first non-existant
|
||
address).
|
||
%D Last explicit destination address typed in or out.
|
||
%JPC Sometimes set to address of last jump or trap [Sec IX].
|
||
%L Length of last quantity typed in or out.
|
||
%S Last explicit source address typed in or out.
|
||
%P Last subexpression in a multiword expression, else %Q.
|
||
%CSX Address used by ;X [Sec VII].
|
||
%PATR Location after instruction patched [Sec VII].
|
||
PATCH Patch space pointer [Sec VII].
|
||
%PMODE Permanent type out mode [Sec V].
|
||
%TMODE Temporary type out mode [Sec V].
|
||
.sp
|
||
.ds
|
||
Symbols are also defined for various device registers
|
||
(including the processor "device"). They are listed
|
||
in the Appendix.
|
||
|
||
.page
|
||
.sect
|
||
V. Examining and Depositing
|
||
.sect
|
||
|
||
In examining and modifying locations, 11SIM command level
|
||
follows the same general conventions as DDT [Ref 5]. "/"
|
||
when preceeded by an expression types out the corresponding location
|
||
in the current mode (see below this section for mode commands). This
|
||
command changes the values of the symbols %. and ".". If given
|
||
no argument, the value of %Q is used and only %. is changed. Open
|
||
square bracket is the same as "/" in all respects except that type out
|
||
is in non-instruction mode.
|
||
The "=" command retypes %Q or its argument,
|
||
if supplied, in numeric form. Close square bracket
|
||
is the same as "=" except that it types out in current mode.
|
||
The left arrow (or underbar) command reopens %. in the current
|
||
mode.
|
||
The :REGS command is available to examine all of the
|
||
eight procesor general registers.
|
||
Carriage return closes the currently open location and
|
||
deposits its argument, if any, there. Horizontal-tab,
|
||
line-feed, and up-arrow (or circumflex)
|
||
do the same but then type out the address of and open
|
||
a new location. For horizontal-tab, this is the location addressed
|
||
by the previously open location. For line feed, this is .+1 if
|
||
a byte is open or .+%L, if a word is open, where %L is
|
||
the length of %Q in bytes. For up-arrow, it is .-1 if a
|
||
byte is open and .-2 if a word is open.
|
||
There are three sets of type out modes. The one-shot set
|
||
are refered to during printing and are reset from the temporary set
|
||
at the end of every non-type-out-mode command. The temporary set are
|
||
modified to the permanent whenever the simulator types out
|
||
a prompting "!". This happens when DDT is entered and
|
||
after a carriage return, a colon command, and some
|
||
other commands. Thus the one-shot mode affects
|
||
only the next command.
|
||
Each set of
|
||
type out modes is a group of bits that can be cleared (with
|
||
a minus sign immediately before the mode character) or turned
|
||
on for either just the one-shot set (one semicolon), or
|
||
both the one-shot and temporary
|
||
sets (two semicolons), or all three (three semicolons). For example,
|
||
;-D;;;N will set numeric mode for all sets but clear decimal mode
|
||
in the one shot set. The following is a complete list of mode
|
||
characters:
|
||
.ss
|
||
B Byte mode, when opening an even location,
|
||
examine even addressed byte only. (Examining an
|
||
odd location always fetches byte only.)
|
||
D Decimal mode, when printing a quantity
|
||
numerically, use base 10. (Normal base is 8.)
|
||
I Instruction mode, when opening a location, print as an instruction.
|
||
N Numeric mode, overrides symbolic and ASCII modes.
|
||
R "Register" mode, stops register values form being
|
||
printed symbolicly.
|
||
S Symbolic mode.
|
||
! Non-printing mode, when opening a location, don't print its
|
||
contents, overrides all others.
|
||
" ASCII mode, overrides symbolic.
|
||
' Both ASCII and byte modes.
|
||
.sp
|
||
.ds
|
||
These different modes are relevant at different points
|
||
in type out. Decimal mode only has effect when
|
||
it has been decided to output a number. When a location is opened,
|
||
"!" mode is check first. If it is off, then "I" mode
|
||
is checked to see if instruction print out should be used. If
|
||
"I" is off then ASCII and "N" mode are successively
|
||
tested. (In examining an odd location or a register or when byte
|
||
mode is on, instruction mode is supressed.) When a quantity
|
||
is output, the same thing happens except the "!" and "I" modes
|
||
are not examined. When a quantity is printed symbolicly, it
|
||
is normally printed as the nearest symbol less than the
|
||
quantity plus the difference printed numerically. Special things
|
||
happen for register quantities. These are printed as a symbol
|
||
only if the symbol matches exactly, "R" and "N" mode are off,
|
||
and "S" mode is on. If
|
||
printed numericly a % is printed in front only if the context
|
||
(in an instruction) does not make it clear that the number is a
|
||
register.
|
||
Numeric and ASCII mode do not affect the output of
|
||
addresses printed by command level
|
||
because it is about to open them (i.e.,
|
||
those generated by line-feed, breakpoints, etc.). Expressions
|
||
typed before a mode setting command are treated as if
|
||
typed afterward.
|
||
|
||
.page
|
||
.sect
|
||
VI. Zeroing, Loading and Dumping
|
||
.sect
|
||
|
||
Although the simulated core and disk du<64><75> |