Minor updates to new page on SIMH PDP-11 simulation.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Tue, 5 Jan 2021 11:57:23 +0000 (03:57 -0800)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Tue, 5 Jan 2021 11:57:23 +0000 (03:57 -0800)
data/development/pdp-11/modern_c_software_development/pdp11-simulator-simh.md

index f2d71b3..ef3eaf6 100644 (file)
@@ -83,7 +83,7 @@ executed. For example, if we have the PDP-11 CPU execute a tight infinite loop,
 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
@@ -112,20 +112,20 @@ executed.
     
     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 ##
@@ -161,7 +161,19 @@ image file in the following 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 ##
@@ -179,8 +191,8 @@ compiler. This binary can then be converted by `bin2load` and loaded into SIMH.
     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
@@ -270,8 +282,8 @@ Note that the program writes the value `0123456` to address `0140000` and then
 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 \
@@ -305,7 +317,7 @@ in this task.
 
 ## 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.