Virtual H8 Operating Instructions

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:

  1. The tapeui.exe program is in the same directory.
  2. You pass as a command-line argument, the path to the directory that is immediately superior to the Media directory and contains the 1000_hz.wav file.

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.

back to top

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.

back to top

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.

back to top

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.

back to top

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.

back to top

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.

H-19 Escape Sequences (Heath Mode) Recognized by the Simulator
CodeDescription
ESC @Enter Insert Character mode
ESC =Enter Alternate Keypad mode
ESC >Exit Alternate Keypad mode
ESC #Transmit page
ESC ACursor Up, stays at same column
ESC BCursor Down, stays at same column
ESC CCursor Forward, stays on same line
ESC DCursor Backward, stays on same line
ESC EClear page
ESC FEnter Graphics mode
ESC GExit Graphic mode
ESC HCursor Home
ESC IReverse line-feed
ESC JErase to end of page
ESC KErase to end of line
ESC LInsert line
ESC MDelete line
ESC NDelete character
ESC OExit Insert Char mode
ESC Y row colDirect 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 ZIdentify (response is ESC / K which is a VT52)
ESC ]Transmit 25th line
ESC bErase to Beginning of display
ESC jSave cursor position
ESC kSet cursor to saved position
ESC lErase entire line
ESC m fg bgSet 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 nCursor Position Report request
ESC oErase to beginning of line
ESC pEnter Reverse Video mode
ESC qExit Reverse Video mode
ESC tEnter Keypad shifted mode
ESC uExit Keypad shifted mode
ESC vWrap around at end of line
ESC wDiscard at end of line
ESC x PsSet Mode. See table below
ESC y PsReset 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 zReset 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.)

back to top

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:

H-19 Keypad Codes (Heath Mode)
KeyNormalShiftAlternateAlternate+Shift
ENTER'\r''\r'ESC ? M'\r'
SHIFT+ENTER'\r''\r''\r'ESC ? M
...ESC ? n.
SHIFT+....ESC ? n
000ESC ? p0
SHIFT+0000ESC ? p
11ESC LESC ? qESC L
SHIFT+1ESC L1ESC LESC ? q
22ESC BESC ? rESC B
SHIFT+2ESC B2ESC BESC ? r
33ESC MESC ? sESC M
SHIFT+3ESC M3ESC MESC ? s
44ESC DESC ? tESC D
SHIFT+4ESC D4ESC DESC ? t
55ESC HESC ? uESC H
SHIFT+5ESC H5ESC HESC ? u
66ESC CESC ? vESC C
SHIFT+6ESC C6ESC CESC ? v
77ESC @ or ESC OESC ? wESC @ or ESC O (note)
SHIFT+7ESC @ or ESC O7ESC @ or ESC OESC ? w
88ESC AESC ? xESC A
SHIFT+8ESC A8ESC AESC ? x
99ESC NESC ? yESC N
SHIFT+9ESC N9ESC NESC ? 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:

H-19 Function Keys (Heath Mode)
KeyCode
f1ESC S
f2ESC T
f3ESC U
f4ESC V
f5ESC W
ERASEESC J
SHIFT+ERASEESC E
blueESC P
redESC Q
grayESC R

back to top

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.

H-19 Graphic Characters (see note)
CharacterCodeGlyphCharacterCodeGlyph
@100`140
A101a141
B102b142
C103c143
D104d144
E105e145
F106f146
G107g147
H110h150
I111i151
J112j152
K113k153
L114l154
M115m155
N116n156
O117o157
P120p160
Q121q161
R122r162
S123s163
T124t164
U125u165
V126v166
W127w167
X130x170
Y131y171
Z132z172
[133{173
\134|174
]135}175
^136~176
_137177

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.

back to top

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.

back to top

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!)

back to top

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.

back to top

Interpreting the display

The front panel provides a nine-digit LED read-out and four status indicators.


The status indicator "ION" is lit when interrupts are enabled; "MON" is lit when PAM-37 is executing; "RUN" is lit unless the processor has halted with interrupts disabled and "PWR" indicates that the computer is powered up. (In the simulation, this light is always on.)

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").

back to top

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:


The two extra keys are "RTM" and "RESET". "RESET" does a power-on reset to the system and "RTM" causes an interrupt which will (if interrupts are enabled) return control to PAM-37 while a program is executing.

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:

  1. Press the "F" key to enter "register" mode. The decimal points in the address field light.
  2. Select the register (pair) you want by pressing "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B" or "F". The decimal points will go out.
  3. The address field will now show the two-byte register pair contents for the selected register.
  4. If you wish to alter the register contents, press "D". The decimal points start moving right-to-left.
  5. Enter new contents and press "D" when the address display has the desired value. The decimal points will go out.
  6. You can use "A" or "B" when a register is displayed but decimal points are not lit to advance to the Next or go to the Last (previous) register.

Memory Display/Alter:

  1. Press the "E" key to enter "memory" mode. The decimal points in the address and data fields light.
  2. Enter the address you want. The decimal points will go out.
  3. The address field will now show the address and the data field will show its contents.
  4. If you wish to alter the memory contents, press "D". The decimal points start moving right-to-left.
  5. Enter new contents and press "D" when the address display has the desired value. The decimal points will go out.
  6. You can use "A" or "B" when a memory location is displayed whether or not decimal points are not lit to advance to the Next or go to the Last (previous) memory location.

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:

  1. Use the procedure for displaying a memory location to set the address field such that both bytes are the port number to be read (e.g.: 350.350 to read port 350). Ignore the data field of the display.
  2. Press the "5" key.
  3. The leftmost byte of the address field will now contain the data from the specified port. (Again, you can ignore the data field of the display.)

Output to an I/O Port:

  1. Use the procedure for displaying a memory location to set the address field such that the right byte is the port number and the left byte is the data you want to write.
  2. Press the "6" key.
  3. The data will be written to the specified port. (Again, you can ignore the data field of the display.)

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:

  1. Use the Tape UI to mount a file that you wish to load into the tape reader.
  2. Press "8" while PAM-37 is in "function" mode. Depending on how much data was recorded on the tape, you may or may not notice a delay before PAM-37 returns to "function" mode.
  3. The display will show the memory location for the last byte loaded.
  4. Memory locations 040.100 and 040.101 will point to the first location loaded.
  5. The PC will be set to the starting address recorded on the tape.

Dump Memory to Tape Recorder:

  1. Use the procedure for altering memory to alter the contents of locations 040.000 and 040.001 to be the address (low-order byte first) of the start of the memory area that you want to save to tape.
  2. Use the procedure for altering a register to set PC to be the address which should be loaded into PC when the tape is read back. (Usually the starting address of the program being saved.)
  3. Use the procedure for displaying a memory location to set the address (and display the contents) of the last byte of the memory area that you want to save to tape.
  4. Use the Tape UI to be sure there's a tape in the recorder and that the tape is either newly-created or one whose contents you don't mind overwriting.
  5. Press the "9" key. Depending on how much data is written, there may be a perceptable delay before PAM-37 returns to "function" mode.

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.

back to top

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.

back to top

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".

back to top

Options

This comes under the heading "Stupid PAM tricks". Here are a few random facts you might find useful:

  1. Locations 040.033 and 040.034 are a sixteen-bit counter (Intel byte order) that increments on every 2 millisecond interrupt. You can monitor location 040.034 and watch it count up. In a real H-8 it takes 131 seconds to go through a complete cycle.
  2. You can read the keyboard codes by doing an "IN 360" instruction in a loop and watching for a keystroke. You have to do this if you want to detect multiple keys (which we don't simulate anyway!). But a better choice is to "CALL 003.260" -- this routine will read and de-bounce the key, do auto-repeat and generate the key click. The key code is returned in the A register as a binary value corresponding to the key's primary label as a hexadecimal digit.
  3. Load the A register with the number of ticks and "CALL 000.053" to delay that amount of time. (E.g: "MVI A,372" and "CALL 000.053" to delay half a second.)
  4. Load the A register as above and "CALL 002.140" to make the tone sound for that amount of time.
  5. You can make PAM display whatever you want on the LEDs with the following code:
    	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 whatever
    
    where 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.)
  6. back to top


    Copyright (c) 2001 - 2003 by David A. Wallace