Starting the application
What you see
Choosing a presentation
Configuration options
The H-19 Terminal
The H-19 Escape Sequences
The H-19 cursor and function keys
The H-19 Graphic Characters
Activating the tape drive peripheral
Why nothing interesting happens
PAM-37 Operating Instructions
Interpreting the display
Keyboard
Alert tones
Interrupt
Options
Starting the application
The Virtual H8 application wants to "live" in C:\H8, though it can actually be put in any directory so long as:
Still, it's probably best to have followed the instructions at install time. if you did, you can start the program either by using the start menu or clicking on the desktop shortcut.
Unless you re-compiled with a modified project, the application has been linked with MSVC DLLs, so versions of the Foundation Class DLLs which are not what the program would expect to use are not an issue.
What you see
The application should open in its default mode (which is photorealistic). Depending
on what your screen resolution is set to, you will see some or all of this image:
The left is a photorealistic rendition of the H-8 computer's front panel; the right
is a photorealistic rendition of the H-19 terminal. Later I'll explain exactly what
you are looking at.
Unless your screen is set for 2046 pixels or greater in the horizontal direction (and few monitor and video card combinations will do that), the display will only show part of this image and you will have to use the scroll bar to view the H-8 and H-19 successively. You might find that inconvenient. Fortunately, there are other presentation forms which, although not photorealistic, may be more suitable for you. The next paragraph explains how to select them.
Choosing a presentation
There are four presentation styles to choose from. To select one, go to the "View" menu. By default, the program begins with "Level 3: Photorealistic". You can choose to use this one or any of the other three presentations. Here is what each presentation will look like:
You may have to compromise between what you would like to see simultaneously and what your monitor's settings will permit. But because of the scroll bars which the application provides, you can actually fit a usable subset of the display onto a screen having as few as 800x600 pixels, since the largest single area you need to view in its entirety is the H-19 screen which is 660 pixels wide by 540 pixels high.
Your choice of presentation will be saved from session to session.
Configuration options
There are configuration options for both the H-8 and the H-19 parts of the Virtual H8. For the H8, the only option at the moment is the ability to set the relationship between wall-clock time and H-8 (simulation) time. The default setting for this relationship is 2:1 (i.e.: the H-8 simulator is running half as fast as a real H-8). This can be changed to any factor between 1:1 (if your PC is fast enough!) to 5:1 (very slow indeed!).
Choose "Configure" from the menu and select "H8 Options...". This dialog:
appears.
Pick the TAU factor you want and click OK. You will get a reminder that
the Virtual H8 must be re-started for this change to become effective.
(This is because the TAU factor was already set before you could open
the configuration dialog and cannot be changed while the timer code is
running. A future version of this application might be able to change
TAU dynamically, but the current version can't.)
For configuring the H19, choose "Configure" from the menu and select
"H19 Options...". This dialog:
appears.
This lets you choose the power-up settings for the H-19
terminal part of the simulator. The default settings are
the same as the factory settings for an H-19: normal video,
white phosphor, block cursor, line wrap, no LF mapping and
unshifted keypad. (ANSI mode is grayed out at this time
because the simulator doesn't do ANSI escapes yet.)
The settings for Reverse Video and Green Phosphor options need a little more explanation. The H-19 CRT came in two versions: a white phosphor (the "classic" H-19) and later a green phosphor version (the "ZDS-19"). You can select either, as you wish. The Reverse Video option was added because the "Windows Standard" for text is black characters on a white background and some monitors produce sharper text that way. So I added an option that will flip the video polarity for the whole display.
The H-19 Terminal
The H-19 portion of the simulator emulates an H-19 terminal in Heath Escape Sequences mode except for the RESET button and the scroll lock escapes. But there are a couple of differences because this is, after all, a Windows NT application, not actual hardware. First, the "ON LINE" key of the H-19 has been emulated as an alternate-action button on the GUI rather than as a key on the keyboard. It works the same as on a real H-19: if up, the terminal is in local mode; if down the terminal sends and receives on the serial I/O connection to the computer.
Second, because I must use the PC keyboard instead of the keyboard of an H-19, several of the H-19's keys are hard to find. I solve this with the button labeled "Show Keyboard Mapping" (in Photorealism mode; in the other presentations, it's simply labeled "Key Help"). Clicking this button brings up a table showing what PC key corresponds to what H-19 key. Even though I've used the PC keyboard, I did manage to "fix" it so it works more like the H-19: the Caps Lock key now operates like it did on the H-19 -- it ORs with the Shift key on alphabetic characters instead of XORs with it.
The H-19 Escape Sequences
The H-19 terminal responds to many escape sequences. For the moment, the implementation is restricted to the Heath Mode escape sequences (and does not implement a few of those). Eventually, the simulator will support the ANSI Mode sequences as well. The following table lists all the escape sequences currently supported.
Code | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ESC @ | Enter Insert Character mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC = | Enter Alternate Keypad mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC > | Exit Alternate Keypad mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC # | Transmit page | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC A | Cursor Up, stays at same column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC B | Cursor Down, stays at same column | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC C | Cursor Forward, stays on same line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC D | Cursor Backward, stays on same line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC E | Clear page | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC F | Enter Graphics mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC G | Exit Graphic mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC H | Cursor Home | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC I | Reverse line-feed | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC J | Erase to end of page | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC K | Erase to end of line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC L | Insert line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC M | Delete line | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC N | Delete character | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC O | Exit Insert Char mode | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ESC Y row col | Direct cursor addressing | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Addressing is zero-based count of row and column.
|
| Row and column values are encoded by adding the
|
| count value to the space character. (Example:
|
| ESC Y 6 A would move the cursor to row (line)
|
| 23, column 34.
|
ESC Z | Identify (response is ESC / K which is a VT52)
|
ESC ] | Transmit 25th line
|
ESC b | Erase to Beginning of display
|
ESC j | Save cursor position
|
ESC k | Set cursor to saved position
|
ESC l | Erase entire line
|
ESC m fg bg | Set color (fg = foreground; bg = background)
|
| This is available only if the simulator is not
|
| compiled for STRICT_EMULATION. (See item 2
|
| of this paragraph for details.) The following table
|
| shows how these colors are specified:
|
| value color
|
| 0 black
|
| 1 blue
|
| 2 red
|
| 3 magenta
|
| 4 green
|
| 5 cyan
|
| 6 yellow
|
| 7 white
|
ESC n | Cursor Position Report request
|
ESC o | Erase to beginning of line
|
ESC p | Enter Reverse Video mode
|
ESC q | Exit Reverse Video mode
|
ESC t | Enter Keypad shifted mode
|
ESC u | Exit Keypad shifted mode
|
ESC v | Wrap around at end of line
|
ESC w | Discard at end of line
|
ESC x Ps | Set Mode. See table below
|
ESC y Ps | Reset Mode. See table below
|
| Ps Purpose
|
| 1 25th line is enabled (disabling also clears it)
|
| 4 cursor type is block
|
| 5 cursor is visible
|
| 6 keypad is in shifted mode
|
| 7 keypad is in alternate mode
|
| 8 linefeed is mapped to cr/lf
|
| 9 carriage return is mapped to cr/lf
|
ESC z | Reset to power-up configuration
| |
If an escape sequence is not supported but would have been recognized by the H-19 (example: there was an escape sequence to disable the keyboard), the simulator will recognize the sequence but not perform the action. On the other hand, if the sequence is something the H-19 would not have recognized, the simulator will also not recognize it but may not do exactly the same thing in response. (I.e.: there is no attempt to be "bug compatible" with the H-19 when an illegal escape sequence is received.)
The H-19 Cursor and Function Keys
The simulation intercepts the PC keystrokes and responds to them as the H-19 would, for the most part. The keyboard layout being implemented is not exactly the same physical layout as the H-19. I didn't move the ESC and '~' keys around, for example, but it is close. The program needs a "modern", US-style PC keyboard -- the 102-key version (or more, given the newer "Windows Enhanced" and "Internet Enabled" gadgets now being sold). This is because the PC keyboard evolved over time and not all keyboards send the same code for some keys, especially if the keyboard is nor for US English language use.
Four keys that the H-19 had cannot be perfectly simulated: the LINEFEED key does not exist on the PC, but CTRL+ENTER sends the correct code; the BREAK key requires that you hit CTRL+BREAK; the ONLINE button had to be implemented as a GUI control and the H-19's REPEAT button has no corresponding PC key but all keys on the PC keyboard will automatically repeat (at a slower rate than the H-19 would have) if you hold them down long enough.
The H-19 simulation uses all of the keys in the alphanumeric (typewriter) keyboard section except for ALT (and the "Windows" buttons). It also uses ESC, F1 through F10, SCROLL LOCK and BREAK from the top row. Finally, it uses twelve keys from the numeric pad: 0 through 9, period and ENTER.
NUM LOCK must be off for the keypad to be interpreted correctly. SCROLL LOCK will be ineffective (at the moment). CAPS LOCK can be on or off but will work like the H-19, rather than like the PC -- if you have CAPS LOCK on and also hold down SHIFT when you type a letter, you will still get a capital letter.
Keys struck in combination with ALT will be interpreted in Windows "System Key" mode, as usual (ALT-TAB will still activate the task manager's process selection pop-up, for example). Keys not mentioned above will be ineffective. Of course, these rules only apply while the Virtual H8 application is the one which has focus -- if you switch to another program, the usual Windows rules apply. (including the disgusting PC implementation of caps lock)
The following table shows what the numeric pad keys generate for codes in the various modes with and without SHIFT:
Key | Normal | Shift | Alternate | Alternate+Shift |
---|---|---|---|---|
ENTER | '\r' | '\r' | ESC ? M | '\r' |
SHIFT+ENTER | '\r' | '\r' | '\r' | ESC ? M |
. | . | . | ESC ? n | . |
SHIFT+. | . | . | . | ESC ? n |
0 | 0 | 0 | ESC ? p | 0 |
SHIFT+0 | 0 | 0 | 0 | ESC ? p |
1 | 1 | ESC L | ESC ? q | ESC L |
SHIFT+1 | ESC L | 1 | ESC L | ESC ? q |
2 | 2 | ESC B | ESC ? r | ESC B |
SHIFT+2 | ESC B | 2 | ESC B | ESC ? r |
3 | 3 | ESC M | ESC ? s | ESC M |
SHIFT+3 | ESC M | 3 | ESC M | ESC ? s |
4 | 4 | ESC D | ESC ? t | ESC D |
SHIFT+4 | ESC D | 4 | ESC D | ESC ? t |
5 | 5 | ESC H | ESC ? u | ESC H |
SHIFT+5 | ESC H | 5 | ESC H | ESC ? u |
6 | 6 | ESC C | ESC ? v | ESC C |
SHIFT+6 | ESC C | 6 | ESC C | ESC ? v |
7 | 7 | ESC @ or ESC O | ESC ? w | ESC @ or ESC O (note) |
SHIFT+7 | ESC @ or ESC O | 7 | ESC @ or ESC O | ESC ? w |
8 | 8 | ESC A | ESC ? x | ESC A |
SHIFT+8 | ESC A | 8 | ESC A | ESC ? x |
9 | 9 | ESC N | ESC ? y | ESC N |
SHIFT+9 | ESC N | 9 | ESC N | ESC ? y |
(Note: the "IL / 7" key toggles between sending ESC @ and ESC O.)
This table shows what the Function Keys (including ERASE, BLUE, RED and GRAY) will generate for escape sequences:
Key | Code |
---|---|
f1 | ESC S |
f2 | ESC T |
f3 | ESC U |
f4 | ESC V |
f5 | ESC W |
ERASE | ESC J |
SHIFT+ERASE | ESC E |
blue | ESC P |
red | ESC Q |
gray | ESC R |
The H-19 Graphic Characters
The H-19 does 33 line-art graphic characters. Since no Windows font represents these characters, when I implemented the Virtual H8 simulator, I used a bitmap resource as the "character generator". The H-19 emulation therefore is doing pretty much what the actual terminal did: it paints patterns of pixels from a character generator onto specific character cells in the display. Since I made my own character generator, I couldn't resist adding some new, non-standard graphical characters (if you compile with the right option, that is). There's room for a few more characters in the table, if anybody has a suggestion.
A character cell in the H-19 was eight pixels wide by ten pixels high. For the simulator, I stretch it to 20 pixels high to produce the proper aspect ratio, but it's otherwise the same. The following table describes the graphic character set.
Character | Code | Glyph | Character | Code | Glyph | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@ | 100 | ` | 140 |
A | 101 | a | 141 |
B | 102 | b | 142 |
C | 103 | c | 143 |
D | 104 | d | 144 |
E | 105 | e | 145 |
F | 106 | f | 146 |
G | 107 | g | 147 |
H | 110 | h | 150 |
I | 111 | i | 151 |
J | 112 | j | 152 |
K | 113 | k | 153 |
L | 114 | l | 154 |
M | 115 | m | 155 |
N | 116 | n | 156 |
O | 117 | o | 157 |
P | 120 | p | 160 |
Q | 121 | q | 161 |
R | 122 | r | 162 |
S | 123 | s | 163 |
T | 124 | t | 164 |
U | 125 | u | 165 |
V | 126 | v | 166 |
W | 127 | w | 167 |
X | 130 | x | 170 |
Y | 131 | y | 171 |
Z | 132 | z | 172 |
[ | 133 | { | 173 |
\ | 134 | | | 174 |
] | 135 | } | 175 |
^ | 136 | ~ | 176 |
_ | 137 | 177 | |
Note: characters with codes between 100 and 135 are only graphical when
the simulator has been compiled without STRICT_EMULATION.
To produce graphical characters, prefix the code(s) you want with the escape sequence "ESC F". Suffix with "ESC G" to return to text mode. If you select a character that has no graphical equivelent, the textual character is displayed.
Activating the tape drive peripheral
The H8-5 Tape system has its own Graphical User Interface (GUI) application which lets you select what simulated cassette to mount in the reader or recorder. There are simulated LEDs to show when the H8 is accessing the tape, but basically this GUI application simply tells the H8 part of the simulator which file to open.
To activate the Tape GUI, select "Peripherals" from the menu and click on "H8-5...". If the tapeui.exe program is in the proper directory, the program will start and the GUI window will pop up over the Virtual H8. Click on the "Load/Eject" button for the device (reader or recorder) you want to mount a tape onto. You'll get a standard Windows File Open dialog. If you are using the reader, the default file is "in.tape"; for the recorder it is "out.tape". If things got installed correctly, you should see several files in the browse window as well.
Once the file you want has been selected, click "Open". The file dialog is dismissed and the GUI shows a cassette (with the file name as its label) mounted in the device. When this has happened, the H8 has also been informed, so you could close the tape GUI at this time. Or you can simply leave it open. If the Tape GUI becomes hidden, the same menu command that launched it will bring it back. When the Virtual H8 is closed, the Tape GUI will be closed automatically as well.
Why nothing interesting happens
By now, you're ready to try out the simulator, I'm sure. So go ahead: press any key on the H8 keypad. What do you see? The display shows a three-digit octal number as long as you hold down a key (well, RESET is a little funky, because it still does a hardware reset). This isn't at all like what a real H8 would do. Is the simulator broken? What's going on here?
No, the simulator isn't broken, exactly. The display of the key code is done by executing an actual Z80 program. It's just that the keycode display program isn't the program that a real H8 would be executing if you had just powered it up. A real H8 would be executing a program called PAM-37. This program was the H8's BIOS. It was stored in a 2732 EPROM and occupied locations 000.000 through 017.377. There was a second program for controlling the H-17 floppy disks that was in a 2716 EPROM in locations 030.000 through 037.377.
The simulator has files called PAM37.ROM and H17.ROM in the "firmware" directory which it reads on start-up and loads into those address regions. Unfortunately, the contents of the actual PAM37 and H17 ROMs are copyright Heath Co. and I don't have permission (yet -- I'm working on it) to distribute their contents. So I've had to substitute a different program for the PAM37 file (the keycode display) and supply a dummy file for the H17 ROM as well. Copyright law prevents me from distributing the PAM37 or H17 ROM code, no matter what form it is encoded as, unless I get permission from the copyright holder. (The copyright holder appears to be NEC Computers, Inc., but they probably don't even realize that they own the rights.)
If you have access to the ROM listings for these programs, you could replace my dummy files with the actual code by transcribing the object code from the listing. Or if you have the actual PROMS (PAM37 was Heath Part No. 444-140; the H17 ROM was Heath Part No. 444-19.), you can extract the code from them. Finally, if you have access to a working H8 and a Toolworks C/80 compiler, I've provided programs which will dump the ROM contents to the console. This is all covered in more detail in the Accessories section.
Anyway, if you have managed to get the ROM contents and have working PAM-37 instead of my dummy file, the rest of these instructions explain how to use the PAM monitor. If you're already used to PAM-37, you can skip this material; there's no difference between the simulator and the real H8 with regards the operation of the H8's control panel. (Which was the goal of the project in the first place!)
PAM-37 Operating Instructions
The PAM-37 front panel monitor program provides the ability to inspect or modify any memory location or Z-80 register, do input or output operations on any I/O port, write to or load from cassette tape or to boot from any mass storage device. It also permits executing and debugging programs and can monitor the contents of any memory location or Z80 register while a program is executing.
Interpreting the display
The front panel provides a nine-digit LED read-out and four status indicators.
The 7-segment LED digits can display values in either octal (in a pattern of "XXX XXX XXX", as shown) or in hexadecimal (in which case, the pattern is "XX_ XX_ XX_", since it takes only two hex digits to display a byte value). When the radix for the display is octal, the address field uses a "split octal" notation. In "split octal", rather than represent 16-bit words as 000000 through 177777, the word is represented as two juxtaposed 8-bit fields (unsually with a period between them) and ranges from 000.000 to 377.377. In the panel, this would be shown as "000 000" through "377 377".
The seven-segment digits also have decimal points. The decimal points' state determine the "mode" that the PAM-37 monitor is in and therefore how to interpret the display. The decimal points can be all off (as shown), all on or moving (where each decimal point lights in succession in a right-to-left sequence).
The last three digits serve two purposes: sometimes they display a byte value ("XXX" or "XX_") and sometimes they display a register name ("SP", "AF", "bC", "dE", "HL", "IX", "IY", "Ir", "AF'", "bC'", dE'", "HL'", or "Pc").
Keyboard
The keyboard of the H-8 consists of sixteen keys
about the same size as the alphabetic keys on a
standard PC keyboard. But two PAM-37 functions
require pressing a two-key combination. Since
this is difficult to do with one mouse click, I
added a pair of extra keys specifically for these
two functions. Therefore, the simulator keypad
has eighteen keys:
All the other keys are "overloaded operators", to use a C++ term. Each key has between three and five functions, depending on the "mode" that PAM-37 is in! And some of the labels ("+", "-", "*", "/", "." and "#") serve no purpose in PAM-37: they were on the keys with the initial release of the 8080A version of the H-8 and its monitor program, PAM-8, (and served no purpose then either) and were retained for historical reasons in case some third-party software (a calculator program, maybe?) was using the key as an operator.
The larger-font legend on the key is a hexadecimal digit; I'll refer to the key labeled "BOOT 17 0 170 SP" as "the zero key", simply because that's the larger character, but often in terms of using it to perform one of its alternate functions, e.g.: "Hit the zero key to select the stack pointer register (SP)." if it's actually one of the alternate labels that is meaningful. That should, hopefully, reduce confusion.
Actually, things are less confusing than they apperar. Notice the pattern to the keytop labels: the label in the upper left corner on every key turns out to be the key's "function code"; the label in the lower right (present on most keys) is a Z80 register name; the four keys that have three-digit numbers as labels in the lower left specify an I/O port address while these same keys' upper-right labels specify a mass storage device model number (H-17, H-37, H-47 or H-67).
The keyboard modality is easy to figure out, too. When PAM-37 first starts, the keyboard is in its "home" mode: function. In this mode, the upper-left label is what the key means. Press the "F" key at this time, for example, and PAM-37 goes into "Register" mode (and all the decimal points light). Now the keyboard is interpreted as specifying a register name and the labels in the lower right are in effect. Pressing the "zero" key would then display the stack pointer contents in the address field and the legend "SP" in the data field and turn off the decimal points, indicating that PAM-37 is back in its "home" mode.
The PAM-37 modes are "function" "register", "register/alter", "memory", "memory/alter", "boot", "boot/port" and "boot/port/unit". One gets from "function" to "register" with the "F" key, selects a register with one of the keys that has a register name as its lower-right label, and then to "register/alter" (if you wish) with the "D" key. From "register/alter", you enter the new sixteen-bit value you want and then press "D" again to return to "function" mode. From this, you can see that you can also get from "function" to "memory" to "memory/alter" to "function" if you hit the "E" key, enter an address, hit the "D" key, enter data and hit the "D" key again.
Some PAM-37 operations will serve no purpose in the simulator at this release. These are the operations having to do with booting a mass storage device. Since we don't yet simulate any of these devices, if you attempt to boot (if you press "0", "1" or "2" while in PAM-37's "function" mode), you will probably cause the simulator to do something weird, requiring at least a RESET to regain control. But the operations which will currently function in the simulator are:
(Valid port numbers are currently 350-357, 360-362 and 370-371.)
These operations are all covered in detail in the paragraphs below.
Register Display/Alter:
Memory Display/Alter:
Hint: you can use register display or memory display to watch the contents of a register or a memory location while a program is running. Just select the appropriate register or memory location before you use the GO function.
Select Radix:
PAM-37 starts up in Octal mode. You can toggle between octal and hexadecimal by using the "3" key.
When you press the key (when PAM-37 is in "function" mode), the display will read "RAd H" for
a moment and then the display will go back to its previous state except the address (and data, if the
panel was displaying a memory location) will now be expressed in hexadecimal. You can return to octal
radix with the "3" key again. This time the display will read "RAd  :O" before the display
reverts.
Go:
Pressing the "4" key while in function mode will start executing from the current PC contents. (It's
therefore a good idea to be sure you first set PC to point to a program!)
Input from an I/O Port:
Output to an I/O Port:
Single Instruction:
Executing a single instruction is achieved by pressing the "7" key (while PAM is in "function" mode).
Again, the instruction being executed will be the one that PC currently points to, so be sure you
have set PC first! You can actually walk through your code an instruction at a time with this button,
but your code must not disable interrupts -- PAM-37 implements single-instruction mode by arranging
to cause an interrupt after the instruction executes.
Load Memory from Tape Reader:
Dump Memory to Tape Recorder:
Interrupt Program and Return to PAM-37 Monitor:
Pressing the "RTM" key while a program is running will interrupt the program and return control to PAM-37
(with all register contents' available for inspection). Since this feature depends on interrupts being
enabled, though, you will not be able to use the "RTM" key to gain control of a runaway program which has
executed a DI instruction.
Reset:
Pressing the RESET button does a power-on clear. You will return to PAM-37, but it will have "forgotten"
what was executing.
Alert tones
Along with the decimal points, the internal speaker of the H-8 provides feedback to the operator. Every time you press a key, a very short tone sounds (it is so short you percieve it as a click). If you hold down some keys in some PAM-37 modes ("A" and "B", for example), they automatically repeat and the key click sounds again. A slightly longer tone (short beep) sounds between the first and second byte when an address is being specified and again when the second byte is complete. A long tone sounds on "RESET" or when an operation is cancelled or an error happens.
Interrupts
PAM-37 depends on being able to both cause and detect interrupts. For the "RTM" function and also for updating the display, interrupt IRQ10 is needed (this is the 2 millisecond "tick" interrupt). For Single Instruct, IRQ20 is used. This explains why a program that disables interrupts is considered "impolite".
Options
This comes under the heading "Stupid PAM tricks". Here are a few random facts you might find useful:
MVI A,2 STA 040.010 LXI D,040.013 LXI H,SEGMENTS MVI B,9 LOOP MOV A,M INX H STAX D INX D DCR B JNZ LOOP JMP * ; or whateverwhere SEGMENTS is a table of bit patterns to be displayed in the nine LED digits. (A '1' bit turns the segment off and a '0' bit turns it on. The segment patterns for the hex digits can be discovered by reading memory locations 014.156 through 014.175. The decimal point is the high-order bit and this set of bit patterns all have the decimal point on.)
Copyright (c) 2001 - 2003 by David A. Wallace