HP 67 emulator Quick user guide
(version 2.5, January 2013)
Many thanks to Eric Smith, Bernhard Engl, François Roulet and Greg Sydney-Smith for their help.
Resize your browser's window so that the "Debug" and "Card" pop ups are outside the main panel.
You can use the ROM emulator in "debug" mode (check "debug"
The "Card" button (1) used to pull a card is available in both mode (at the right of the debugger) or on the calculator panel (top right Label E).
Here is the emulator in "debug" mode off.
1) Put a break point at the start of the code you
want to trace (address 0217 - "keys ->a" instruction- is a good place
to start : you can intercept all keys pressed on the keyboard and trace
- the value appears in the white box,
- "set" the BP,
- "enable" it (red light on),
2) Press "ON" on the debug panel (or switch the slide to "ON" on the Calculator panel) : the simulator is running the HP 67 ROM.
Note the OFF/ON switch on the calculator acts as in the real machine : ON restarts the emulation and makes the firmware 'goto' 0000,
3) Enter your key,
3) You should stop at address 0217,
6) Now turn on "trace" and "regs", depending on
your need: trace alone or trace with registers.
7) I have added to the usual interface a window several facilities:
"CARD" (sign 1 on the photo - available on the calculator and on the debugger) : simulates a magnetic card insertion when requested by the user or the firmware. Pushing this button pulls the card (The microprocessor is routinely asking the Card Reader Circuit : Is there a card inserted? This button answer yes and the card is pulled in).
A card for the emulator is a valid asci text in the Card window.
If will first check before eating it its size and format.
If something is incorrect, you will receive an error message in the "Debug" window.
When in PRGM mode, pressing "CARD" stores the program steps in the
CARD Window, Ctr a and Ctr C allows you to save it in a text
editor.
Pressing "CARD" in RUN mode loads the program, into the CARD
window.
Here is a demo CARD
: a small program computing the area of a circle (enter the radius and
press the A key) - Ctrl A in the browser to be sure to select all the content.
Paste the content into the Card window,
Check the calcultor is in RUN mode,
Read the card (button 1),
Then enter 10 and press A, the result "314.16" should appear (DISP 2).
Cards must be a pure text file and can be stored on your PC or
MAC.
A valid card consists 35 lines of 7 hex digits separated by a space (0x20).
Here is the image of an example (just paste it in the card window):
Line 0 (7 zeros) is for the hardware to sync.
Line 1 is HP-67 and card status.
Last line the check sum.
Starting line 2 the PRGM or DATAs : 32 lines
(32 * 7) / 2 = 112 program steps or 16 data registers.
0 0 0 0 0 0 0
3 1 1 0 2 2 2
0 0 0 0 0 0 0
0 0 e 0 7 f a
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
3 1 f 0 a 1 c
Entered as :
LBL A
ln x
RTN
Internally coded as 0xfa, 0x07, 0x0e.
The last line is the check sum: 0x3110222 + 0x00e07fa
In the emulator a parser is checking the length of the data in the card's window and is filtering non hexadecimal values and line terminators.
Only digits 0,1,2...A,b,c,d,e,f are accepted, as in the real thing.
The HP-67's firmware in the ROM is doing the rest, reading and checksuming the data.
Note : there is a line terminator after each line.
Should the content length be wrong a message is written in the debug window, with the actual length found.
If 2 cards are requested, the emulator displays "Crd" to prompt you for side 2 (more than 112 steps) : repeat the procedure.
For Data, the function "f W/DATA" is doing the same thing as on the real HP-67, saving data registers for future use.
To save data press "f W/DATA" and the simulator
will prompt you for one or two cards (if secondary registers are not
empty).
To load a data card in the simulator, paste the text in the Card Window
and press "CARD".
To use the "Merge" function refer to the HP-67 manual.
There are a few example cards on the site.
The "h" key is bringing the black labels on the right keys, for better visibility.
Other buttons in this version :
MP : dumps the whole program memory to the applet window,
MD : dumps the whole data memory,
You can dump only one register by placing its address in the break point input zone. For example, STO 1 will place X in Ram register 1. Placing 1 in BP input zone and pressing MD, shows the register's content in the debug window.
Clr : clears the break point input zone,
Clrcd : clears the "Card" window bringing the 2 applet windows to the front of the window
stack, in case the are hidden.
Stat : dumps the status register of the HP67.
8) You can also point in the Trace window, do a select all (Ctrl A) then
a copy (Ctrl C) and save (Ctrl V) in your Text editor to study a trace.
On a Mac (replace the Ctrl key by the Apple key) and if you use TextEdit
select the Text Format not the default RTF ; you can also use TextMate or UltraEdit.
9) When a key enters its subroutine a beep is emitted (at the keys
->a" instruction) and the display is turned off by the ROM code.
When processing is over, the display is back showing the result.
Meanwhile, the keyboard is ignored. So take care in "slow" or "trace"
modes, since -in these cases- the simulator is slower.
To avoid that, put a break point at the beginning of the routine you
want to study, go in "run" mode, type in your number(s) and press the
function key.
I'll publish progressively tables of routine addesses.
When processing is stopped at BP, turn on "trace" and "regs" modes and
press "run" again. The trace of the routine run will be saved to the
capture window.
Jacques Laporte,
Jan 2013
Version 2.5 Notes
Loading card not in DEBUG mode is possible : < mark (right of x<>y default key)
'Debug off' mode hides and changes color on the debug pop up window
Better visibility for Trace and Next
Single register MD dump (between 077 and 001) : enter value in BPinput
New 'ClrCd' to clear both debug and Crd windows
clr is now only for BP input and MD zone
No more 'd' , 'image' and 'himage' parameters in HTML page
Rom image in signed JAR (Java 7 compatibility)
Reg14 to displays status register
filter non ascii flow to reader
non bcd rendering in display
TTF LED font
ON OFF switch (ON restarts calc)
BUGS corrected :
- don't try to read zero byte card
- ENG format well displayed