SIMH Users’ Guide, V3.9-0
01-May-2012
COPYRIGHT NOTICE
The following copyright notice applies to the SIMH source, binary, and documentation:
Original code published in 1993-2012, written by Robert M Supnik
Copyright (c) 1993-2012, Robert M Supnik
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL ROBERT M SUPNIK BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Except as contained in this notice, the name of Robert M Supnik shall not be used in
advertising or otherwise to promote the sale, use or other dealings in this Software
without prior written authorization from Robert M Supnik.
Introduction ......................................................................................................................... 3
1 Compiling And Running A Simulator ............................................................................ 3
1.1
Compiling Under UNIX/Linux/Mac OS-X .............................................................. 4
1.2
Compiling Under Windows.................................................................................... 5
1.2.1 Compiling with Ethernet Support ....................................................................... 5
1.2.2 Compiling Under MinGW................................................................................... 5
1.2.3 Compiling Under Visual C++ ............................................................................. 5
1.3
Compiling Under OpenVMS.................................................................................. 6
2 Simulator Conventions ................................................................................................. 6
3 Commands .................................................................................................................. 6
3.1
Loading and Saving Programs.............................................................................. 6
3.2
Saving and Restoring State .................................................................................. 7
3.3
Resetting Devices ................................................................................................. 7
3.4
Connecting and Disconnecting Devices ............................................................... 7
3.5
Examining and Changing State ............................................................................ 8
3.6
Evaluating Instructions ........................................................................................ 10
3.7
Running A Simulated Program ........................................................................... 10
3.7.1 Controlling The Simulation Rate...................................................................... 10
3.8
Stopping The Simulator ...................................................................................... 11
3.8.1 Simulator Detected Stop Conditions ............................................................... 11
3.8.2 User Specified Stop Conditions....................................................................... 11
3.8.3 Breakpoints ..................................................................................................... 11
3.9
Setting Device Parameters ................................................................................. 12
3.10 Displaying Parameters and Status...................................................................... 12
3.11 Altering The Simulated Configuration ................................................................. 13
3.12 Console Options ................................................................................................. 13
3.13 Executing Command Files .................................................................................. 14
3.13.1 Displaying Arbitrary Text.............................................................................. 15
3.13.2 Testing Simulator State ............................................................................... 15
3.14 Executing System Commands ............................................................................ 15
3.15 Getting Help ........................................................................................................ 16
3.16 Controlling Debugging ........................................................................................ 16
3.17 Exiting The Simulator.......................................................................................... 16
Appendix 1: File Representations ..................................................................................... 17
A.1 Hard Disks .............................................................................................................. 17
A.2 Floppy Disks............................................................................................................ 17
A.3 Magnetic Tapes....................................................................................................... 17
A.4 Line Printers ............................................................................................................ 17
A.5 DECtapes ................................................................................................................ 18
Appendix 2: Debug Status ................................................................................................ 19
Revision History (covering Rev 2.0 to Rev 3.5)................................................................. 21
Acknowledgements ........................................................................................................... 27
Introduction
This memorandum documents the SIMH simulators. These simulators are freeware; refer to the license
terms above for conditions of use. Support is not available. The best way to fix problems or add features is
to read and modify the sources yourself. Alternately, you can send Internet mail to simh AT trailing-edge
DOT com, but a response is not guaranteed.
The simulators use a common command interface. This memorandum describes the features of the
command interface. The details of each simulator are documented in separate, machine-specific
memoranda.
1 Compiling And Running A Simulator
The simulators have been tested on VAX VMS, Alpha VMS, Alpha UNIX, NetBSD, FreeBSD, OpenBSD,
Linux, Solaris, Windows 9x/NT/2000/XP, MacOS X, and OS/2. Porting to other environments will require
changes to the operating system dependent code in the SIMH libraries (sim_fio.c, sim_timer.c,
sim_console.c, sim_ether.c, sim_sock.c).
The simulator sources are provided in a zip archive and are organized hierarchically. Source files for the
simulator libraries are in the top level directory; source files for each simulator are in individual
subdirectories. Note that the include files in the top level directory are referenced from the subdirectories,
without path identifiers. Your build tool needs to search the top level directory for include files not
present in the simulator-specific directory, or you will have to copy all files from the subdirectories into the
master directory. File manifests for each simulator are given in that simulator's documentation.
The simulators recognize or require a few compile-time #defines:
-
The 18b simulators require that the model name be defined as part of the compilation command
line (i.e., PDP4 for the PDP-4, PDP7 for the PDP-7, PDP9 for the PDP-9, PDP15 for the PDP15).
-
The PDP-10 and IBM 7094 simulators use 64b integer variables, requiring that USE_INT64 be
defined as part of the compilation command line. Since 64b integer declarations vary,
sim_defs.h has conditional declarations for Windows (_int64) and Digital UNIX (long). The
default is GNU C (long long). If your compiler uses a different convention, you will have to
modify sim_defs.h.
-
The PDP-10, PDP-11, and VAX simulators share common peripherals. To distinguish the target
system, one of three variables must be defined on the command line: VM_PDP10 for the PDP10; VM_PDP11 for the PDP-11; or VM_VAX for the VAX.
-
The PDP-11, PDP-11, and VAX simulators optionally support Ethernet. To include Ethernet
emulation, USE_NETWORK must be defined as part of the compilation command line. At
present, Ethernet support has been tested only on Windows, Linux, NetBSD, OpenBSD,
FreeBSD, Solaris, and Alpha VMS, but it should work in any host environment that supports the
Pcap library (see the Ethernet readme file).
-
The PDP-11 and VAX simulators optionally support disks and serial devices files greater than
2GB. To include large device support, both USE_INT64 and USE_ADDR64 must be defined as
part of the compilation command line.
-
The HP2100 Fast FORTRAN Processor (FFP) and 1000-F CPU options require 64b integer
support. Define HAVE_INT64 (not USE_INT64) as part of the compilation command line if your
host compiler supports 64b integers. On systems without 64b support, the 1000 F-Series CPU
will be unavailable, and FFP extended-precision instructions (e.g., XADD) will be disabled; the
remainder of the FFP instructions will work normally. There may be some compilation warnings.
To start the simulator, simply type its name. (On VMS the simulators must then be defined as foreign
commands in order to be started by name.) The simulator recognizes three command line switches: -q, -v,
and -e. If -q is specified, certain informational messages are suppressed. The -v and -e switches pertain
only to command files and are described in Section 3.13.
The simulator interprets the arguments on the command line, if any, as the file name and arguments for a DO
command:
% pdp10 {switches} { {arg,arg,...}}
If no file is specified on the command line, the simulator looks for a startup file consisting of the simulator
name (including its path components) plus the extension .ini. If a startup file is specified, either on the
command line or implicitly via the .ini capability, it should contain a series of non-interactive simulator
command, one per line. These commands can be used to set up standard parameters, for example, disk
sizes.
After initializing its internal structures and processing the startup file (if any), the simulator types out its name
and version and then prompts for input with:
sim>
1.1 Compiling Under UNIX/Linux/Mac OS-X
The sources originate on a Windows system and have cr-lf at the end of every line. For use on UNIX or
Mac, the sources must be converted to UNIX or Mac text conventions. This can be done with the UNZIP
utility (unzip -a).
The supplied makefile will compile the simulators for UNIX systems that support the POSIX TERMIOS. The
VAX and PDP-11 can be compiled with or without Ethernet support. The makefile will automatically build
these simulators with Ethernet support if the necessary libpcap components are available on the system
which is doing the building. The recommended libpcap components are those packaged and provided by
the host operating system vendor. If your host operating system vendor doesn’t distribute libpcap
components (all modern ones do), you may be able to use the libpcap which can be downloaded and built
from sources from http://www.tcpdump.org/.
To compile with or without Ethernet support:
gmake {target|ALL|clean}
Notes for hand compilation:
-
The default UNIX terminal handling model is the POSIX TERMIOS interface, which is supported
by Linux, Mac OS/X, and Alpha UNIX. If your UNIX only supports the BSD terminal interface,
BSDTTY must be defined as part of the compilation command line.
-
The PDP-8, PDP-11, 18b PDP, PDP-10, and Nova simulators use the math library. If your
UNIX does not link the math library automatically, you must add -lm to the compilation command
line.
Examples:
-
PDP-11 under TERMIOS UNIX:
% cc -DVM_PDP11 pdp11_*.c scp.c sim_*.c -lm -o pdp11
-
PDP-9 under TERMIOS UNIX:
% cc -DPDP9 pdp18b_*.c scp.c sim_*.c -lm -o pdp9
-
PDP-10 under BSD terminal UNIX:
% cc -DVM_PDP10 -DUSE_INT64 -DBSDTTY pdp10_*.c scp.c sim_*.c -lm -o pdp10
1.2 Compiling Under Windows
1.2.1 Compiling with Ethernet Support
The Windows-specific Ethernet code uses the WinPCAP 4.x package. This package for Windows simulates
the libpcap package that is freely available for Unix systems. Building simulators with built-in Ethernet
support can be done if the required WinPcap components are available on your build system at compile
time. These components are available by downloading the file:
https://github.com/downloads/simh/simh/windows-build.zip. This zip file contains a file called
0ReadMe_Build_Dependencies.txt which explains how to locate the unpacked zip file contents to build
simulators with Ethernet support.
In order for a simulator (built with Ethernet support) to provide working Ethernet functionality WinPCAP must
be installed on the system. In order to install the WinPcap package the following should be performed:
-
Download V4.x from http://www.winpcap.org.
Install the package as directed.
1.2.2 Compiling Under MinGW
MinGW (Minimalist GNU for Windows) is a free C compiler available from http://www.mingw.org. Msys is a
minimal set of Unix utilities to support Mingw, also available from http://www.mingw.org. The distribution
includes a batch file (build_mingw.bat) that will build all the simulators from source. By default, the PDP-11
and VAX are built with Ethernet support if the necessary Winpcap components are available at build time
1.2.3 Compiling Under Visual C++
Visual C++ requires projects to be defined for each executable which is being built. You can define your
own project for each simulator you are interested in, or you can use the predefined project definitions for this
simulator release.
Each simulator must be organized as a separate Visual C++ project. Starting from an empty console
application,
-
Add all the files from the simulator file manifest to the project.
Open the Project Settings (VC++ 98) or Properties (VC++ .NET) dialog box.
Under C/C++, Category: General, add any required preprocessor definitions (for example,
USE_INT64).
Under C/C++, Category: Preprocessor, add the top level simulation directory to the Additional
Include Directories. For the VAX and PDP-10, you must also add the PDP-11 directory.
Under Link, add wsock32.lib and winmm.lib at the end of the list of Object/Module Libraries.
-
If you are building the PDP-11 and VAX with Ethernet support, you must also add the WinPCAP
libraries (packet.lib, wpcap.lib) to the list of Object/Module libraries.
If you are using Visual C++ .NET, you must turn off /Wp64 (warn about potential 64b incompatibilities) and
disable Unicode processing. You will also have to turn off warning 4996 (“deprecated” string functions), or
lower the warning level to /W1. Otherwise, the compilations will generate a lot of spurious conversion
warnings.
1.3 Compiling Under OpenVMS
Compiling on OpenVMS requires DEC C. The simulators that require 64b (PDP-10 and VAX) will not
compile on OpenVMS/VAX. The SIMH distribution includes an MMS command file descrip.mms that will
build all the simulators from source. An example of hand compilation:
-
PDP-8 under VMS:
$ cc scp.c,sim_*.c,[.pdp8]pdp8*.c
$ link/exec=pdp8 scp.obj,sim_*.obj,[.pdp8]pdp8*.obj
2 Simulator Conventions
A simulator consists of a series of devices, the first of which is always the CPU. A device consists of named
registers and one or more numbered units. Registers correspond to device state, units to device address
spaces. Thus, the CPU device might have registers like PC, ION, etc, and a unit corresponding to main
memory; a disk device might have registers like BUSY, DONE, etc, and units corresponding to individual
disk drives. Except for main memory, device address spaces are simulated as unstructured binary disk files
in the host file system. The SHOW CONFIG command displays the simulator configuration.
A simulator keeps time in terms of arbitrary units, usually one time unit per instruction executed. Simulated
events (such as completion of I/O) are scheduled at some number of time units in the future. The simulator
executes synchronously, invoking event processors when simulated events are scheduled to occur. Even
asynchronous events, like keyboard input, are handled by polling at synchronous intervals. The SHOW
QUEUE command displays the simulator event queue.
3 Commands
Simulator commands consist of a command verb, optional switches, and optional arguments. Switches take
the form:
-{...}
Multiple switches may be specified separately or together: -abcd and -a -b -c -d are treated identically.
Verbs, switches, and other input (except for file names) are case insensitive.
Any command beginning with semicolon (;) is considered a comment and ignored.
3.1 Loading and Saving Programs
The LOAD command (abbreviation LO) loads a file in binary loader format:
load {implementation options}
The types of formats supported are implementation specific. Options (such as load within range) are also
implementation specific.
The DUMP command (abbreviation DU) dumps memory in binary loader format:
dump {implementation options}
The types of formats supported are implementation specific. Options (such as dump within range) are also
implementation specific.
3.2 Saving and Restoring State
The SAVE command (abbreviation SA) save the complete state of the simulator to a file. This includes the
contents of main memory and all registers, and the I/O connections of devices except network devices (such
as Ethernet controllers and terminal multiplexers):
save
The RESTORE command (abbreviation REST, alternately GET) restores a previously saved simulator state:
restore
Note: SAVE file format compresses zeroes to minimize file size.
3.3 Resetting Devices
The RESET command (abbreviation RE) resets a device or the entire simulator to a predefined condition. If
switch -p is specified, the device is reset to its power-up state:
RESET
RESET -p
RESET ALL
RESET
reset all devices
powerup all devices
reset all devices
reset specified device
Typically, RESET stops any in-progress I/O operation, clears any interrupt request, and returns the device to
a quiescent state. It does not clear main memory or affect I/O connections.
3.4 Connecting and Disconnecting Devices
Except for main memory and network devices, units are simulated as unstructured binary disk files in the
host file system. Before using a simulated unit, the user must specify the file to be accessed by that unit.
The ATTACH (abbreviation AT) command associates a unit and a file:
ATTACH
If the file does not exist, and the -e switch was not specified, a new file is created, and an appropriate
message is printed. If the -e switch was specified, a new file is not created, and an error message is printed.
If the -r switch is specified, or the file is write protected, ATTACH tries to open the file read only. If the file
does not exist, or the unit does not support read only operation, an error occurs. Input-only devices, such as
paper-tape readers, and devices with write lock switches, such as disks and tapes, support read only
operation; other devices do not. If a file is attached read only, its contents can be examined but not
modified.
For simulated magnetic tapes, the ATTACH command can specify the format of the attached tape image file:
ATTACH -f
The currently supported tape image file formats are:
SIMH
E11
TPC
P7B
SIMH simulator format
E11 simulator format
TPC format
Pierce simulator 7-track format
The tape format can also be set with the SET command prior to ATTACH:
SET FORMAT=
ATT
The format of an attached file can be displayed with the SHOW command:
SHOW FORMAT
For Telnet-based terminal emulators, the ATTACH command associates the master unit with a TCP/IP port:
ATTACH
The port is a decimal number between 1 and 65535 that is not used by standard TCP/IP protocols.
For Ethernet emulators, the ATTACH command associates the simulated Ethernet with a physical Ethernet
device:
ATTACH
The DETACH (abbreviation DET) command breaks the association between a unit and a file, port, or network
device:
DETACH ALL
DETACH
detach all units
detach specified unit
The EXIT command performs an automatic DETACH ALL.
3.5 Examining and Changing State
There are four commands to examine and change state:
-
EXAMINE (abbreviated E) examines state
DEPOSIT (abbreviated D) changes state
IEXAMINE (interactive examine, abbreviated IE) examines state and allows the user to
interactively change it
IDEPOSIT (interactive deposit, abbreviated ID) allows the user to interactively change state
All four commands take the form
command {modifiers}
Source Exif Data:
File Type : PDF
File Type Extension : pdf
MIME Type : application/pdf
PDF Version : 1.4
Linearized : No
Page Count : 28
Producer : GPL Ghostscript 8.15
Create Date : 2012:05:03 17:36:47
Modify Date : 2012:05:03 17:36:47
Title : Microsoft Word - simh_doc.doc
Creator : PScript5.dll Version 5.2.2
Author : bsupnik