CARD DECKS
"Punch Card Decks" are files with the extension ".pcd" that
are used to represent decks of punch cards on this simulator.
Simple concatination may be used to combine decks in any order.
The H2000 Card Reader/Punch allso allows "stacking" of multiple PCD files
in the hopper, eliminating the need to manage large, static, concatinated files.
Note that a card deck may be "duplicated" simply by using it multiple
times (in concatination or in the hopper).
Decks for sample programs are in "hw2000/prorgams/bin" on the github repository.
A bootable deck for the monitor is in "hw2000/monitor/bin" on the github repository.
Source code for these decks is located in the associated "src" subdirectory.
All of this source code uses the "as200" and companion binutils tools
located in the "tools" directory on the github repository.
CARD MONITOR B
This implementation of Card Monitor B is not totally complete, some
features are not implemented. These features are represented via the
communications area, which is located at 0100-0233 (octal).
The following are functional to the extent described here.
NOTE! When making changes to the communication area, existing
punctuation MUST be preserved.
- Program Name
- Locations 0104-0111 (octal) in the communications area contain
the program name of the last segment card loaded.
For search features, this field may be set to the desired program name to be loaded.
- Segment Name
- Locations 0112-0113 (octal) in the communications area contain
the segment name of the last segment card loaded.
For search features, this field may be set to the desired segment name to be loaded.
- Revision Number
- Locations 0101-0103 (octal) in the communications area contain
the revision number of the last segment card loaded.
- Return for Normal Call
- A program may branch to location 0202 (octal), in 3-char address mode,
to effectively exit and return to monitor control.
The monitor will start loading the next program, according to parameters
in the comunications area.
- General Return Address
- A program may branch to the address in location 0213 (octal), in 3-char address mode,
to effectively exit and return to monitor control.
The monitor will halt and await operator instructions/actions.
- Fixed Start 0
- A program may branch to location 0126 (octal), in 3-char address mode,
to effectively exit and return to monitor control.
The monitor will halt and await operator instructions/actions.
This is also a convenient way to return to the monitor from the front panel (or console).
For example, type "A 77 0000126" on the console, press 3-char address mode, and press RUN.
- Search Mode
- Location 0157 (octal) in the communications area contains
the search mode key. It defaults to 077 (octal) and is reset by the
General Return. The following search mode keys (octal) are implemented:
- 077 - Load next segment.
- 001 - Load Nth segment, as specified by the Relative Position field.
- anything else - Load the segment that matches
the Program Name and Segment Name fields.
- Relative Position
- Location 0156 (octal) in the communications area contains
the relative position for Search Mode 001.
Default is 001, which indicates that the next segment is to be loaded
(same effect as Search Mode 077).
- Start Mode
- Location 0160 (octal) in the communications area contains
the start mode key. This directs the monitor what to do after
loading a segment. The following are implemented:
- 'N' - (045 octal) Branch to the starting location of the program.
- 'R' - (051 octal) Return to the calling program
(only valid when using Return for Normal Call).
- anything else - Halt with SR=starting location of the program (non-standard behavior).
- Halts
- The following halts are implemented:
- 3 - (AAR=0 BAR=017002) Monitor is awaiting commands.
Alter communication area if desired, load BRF decks if needed, press RUN.
- 8 - (AAR=0 BAR=014011) Monitor encountered the "1EOF " card
while searching for a program segment to load
(or before the last BRF card of a segment).
Load BRF deck(s) and press RUN.
Note that conditions normally associated with "halt 9" will
cause "halt 8" instead.
BOOTSTRAP
The card deck containing Card Monitor B and the bootstrap routines
is named "brdboot.pcd".
- Insert "brdboot.pcd" in the hopper.
This must be the first/next deck in the hopper.
- Add any additional BRF program decks and the "1eof.pcd" terminator (optional).
- Press INITIALIZE
- Enter 041 in Control and 0001620 in Address and press BOOTSTRAP,
or on the console type "B 41 0001620".
- Press RUN.
At this point, the system should halt with AAR=0 and BAR=017002 (octal).
The monitor is now ready for operation.
EXAMPLE
This example uses a set of "Hello World" programs, each having a different
name that corresponds to its relative position in the card deck
("HELLO1" is the first, "HELLO5" is the 5th/last).
All these programs have the segment name "01".
These programs are assembled into the card deck "hellos.pcd".
Images for this example are found on the web site
downloads page.
This example uses the console "control mode", but the equivalent tasks may
be performed using the front panel.
- Load "brdboot.pcd", "hellos.pcd", "hellos.pcd", and "1eof.pcd" in the hopper.
Note, "hellos.pcd" is intentionally loaded twice.
- Press INITIALIZE.
- Type "B 41 0001620".
- Press RUN.
- (optional) Confirm "halt 3" by typing "P 70" and seeing "0017002".
- Press RUN.
The message "HELLO WORLD, I AM HELLO1/01" should be printed on the console.
- Press RUN.
The message "HELLO WORLD, I AM HELLO2/01" should be printed on the console.
This demonstrates the default mode, where the next program is loaded and run
each time RUN is pressed.
- Setup search to run the third next program.
- Type "A 00 0000156"
- Type "103" to enter 03 into the Relative Position (and keep WM).
- Type "101" to enter 01 into the Search Mode (and keep WM).
Press RETURN.
- Press RUN.
The message "HELLO WORLD, I AM HELLO5/01" should be printed on the console.
- Setup search to run the program named "HELLO3".
- Type "A 00 0000157"
- Type "120" to enter 20 into the Search Mode (and keep WM).
Press RETURN.
- Type "A 00 0000111"
- Type "003" to enter '3' into the last character of program name.
Press RETURN.
- Press RUN.
The message "HELLO WORLD, I AM HELLO3/01" should be printed on the console.
PROGRAMS
The following example programs are provided:
- chain.pcd
- A demo program that reads a program name (and optional segment)
on the console and then sets up a search for that program
and does a Return for Normal Call to start the search.
The searched program will be run when it is loaded.
Typical use is to add "chain.pcd" after "brdboot.pcd"
and before the program deck(s), then press RUN after booting the monitor.
The prompt "ENTER PROGRAM: " will be printed on the console,
where the operator then enters the program name. If a segment name is
to be included, the program name must be padded to 6 characters.
- hellos.pcd
- Five "hello world" programs, named HELLO1 through HELLO5.
This program will print a "hello" message on the console that includes the
Program Name and Segment Name from the communication area.
- mcetests.pcd
- A program that was used to test the MCE
(Move Characters and Edit) instruction.
It runs the various examples given in the programmer's manual.
Output is printed on the Line Printer.
- recurs.pcd
- An example/proof-of-concept for using index registers
to implement a traditional stack/frame for function calls.
This example uses recursion to demonstrate the stack.
The function recurses until 5 levels are reached, and then
returns up the stack. Messages are printed on the console showing
entry and exit from each level.
- machin.pcd
- A version of the famous Pi computation program,
written for 3-char address mode and use with the monitors.
Prints 776 digits of Pi on the line printer, as each digit is computed.
Uses over 16K of memory (560 elements) for the "terms" array, in order to
compute Pi past the Feynman point.
Uses the decimal multiply and divide instructions,
and 10-digit decimal variables and constants throughout.
Program size is about the same as the original 2K "space optimized" version,
and run time seems on-par.
APPENDIX
Comparison of memory usage by monitors: