the simulation never naturally ends, but we can pause it, allowing us to exit.
sim> go
- <Press Ctrl-e>
+ <Simulation runs until user presses Ctrl-e.>
Simulation stopped, PC: 004166 (BR 4166)
sim> quit
Goodbye
PDP-11 simulator V3.9-0
Just set address 01000 to the instruction 'BRANCH 01000'.
-
+ <Simulation runs until user presses Ctrl-e.>
Simulation stopped, PC: 001000 (BR 1000)
sim> quit
Goodbye
-Since this program is an infinite loop, we pressed `Ctrl-e` to pause the
+Because this program is an infinite loop, we pressed `Ctrl-e` to pause the
simulation and allow us to quit.
# SIMH Loader #
Since we're trying to run bare-metal code on this simulated PDP-11, we don't
-need to bother with disk images; instead we will load a binary directly into
-the PDP-11's memory using SIMH's `load` command.
+need to bother with disk images; we will load a binary directly into the
+PDP-11's memory using SIMH's `load` command.
## Loader Format ##
If you don't want to generate this format yourself, use the utility
[bin2load](https://git.subgeniuskitty.com/pdp11-bin2load/.git) which converts a
binary image into a SIMH compatible loader format. See the `README.md` file for
-installation instructions.
+installation instructions. For example:
+
+ $ git clone git://git.subgeniuskitty.com/pdp11-bin2load
+ $ cd pdp11-bin2load
+ $ make install
+ $ export PATH=$HOME/bin:$PATH
+ $ bin2load -h
+ bin2load v2 (www.subgeniuskitty.com)
+ Usage: bin2load -i <file> -o <file> [-a <address>]
+ -i <file> Raw binary file to be written to tape.
+ For example, output from 'pdp11-aout-objdump' (see README.md).
+ -o <file> Output file created by bin2load containing tape image for use with SIMH.
+ -a <address> (optional) Address on PDP-11 at which to load tape contents.
## Load and Execute ##
sim> go
If we pass a starting address to `bin2load` with the `-a` flag (as shown
-above), then SIMH configures the simulation so that execution starts at address
-`01000` when the `go` command is entered.
+above), then SIMH configures the simulation to begin execution at the passed
+address.
The `load <file>` and `go` command may also be included in the SIMH
configuration file, automatically loading and executing whenever the simulator
prints the string `Hello, World!` to the console SLU before halting.
We can compile and execute this program with the following sequence of
-commands. Note that after the program halts, we are able to examine address
-`0140000` and see the value `0123456` written by the program.
+commands. After the program halts, we are able to examine address `0140000` and
+see the value `0123456` written by the program.
% pdp11-aout-as -o bootstrap.o bootstrap.s
% pdp11-aout-gcc -c -Wall -Wno-unused-function -O0 -ffreestanding \
## Line Printer ##
-The DEC LP11 line printer is emulated by SIMH and its output is saved to a text
+The DEC LP11 line printer is simulated by SIMH and its output saved to a text
file during the simulation. To save output as `line_printer.txt`, execute the
following command in SIMH.