The key code tokens
Since the HP35 is a serial machine based on a 56 bit word, the main 56 bit system counter is delivering synchronization signals to the different part of the logic.
It is also used to scan the 5 columns and the 8 rows of the keyboard matrix. The block diagram below shows the logic.
When a key is hit, the appropriate row and column line is detected and a “key down” signal is raised while the state of the counter is saved in a buffer.
This 6 bit code will be completed with two leading “0” bits and transferred to the ROM to become the starting address of the routine serving the key (e.g. key “ln” generates a code key “00000011” = 3 and branches to ROM address 003.
The key codes are acting like a “token” that is to say a displacement to be added to 0000 to build the entry point address of the code serving the key. In other words, the first 68 lines of the ROM are key code entry points. The photo below shows the arrangement of the column-row matrix versus key codes.
Note that for rows 4 to 7, there are only 4 columns.
A table of key codes is also reproduced in my article dedicated to the ROM.
The following table is a listing of the entry point of the HP35 ROM (at the start of rom 0) form address 00000 to 00101 (Octal):
- Col 1 is the
address (octal),
- Col 2 is the label,
- Col 3 the instruction (often a goto or a jsb),
- Col 4 the key addressed.
00000 | jsb 00067 | Key CLR | |
00001 | go to 00277 | Error go to blinking display | |
00002 | 0 -> s8 | Key e^x | |
00003 | go to 00005 | Key ln | |
00004 | 1 -> s5 | Key log | |
00005 | 1 -> s9 | ||
00006 | 1 -> s2 | Key x^y | |
00007 | goto 02010 | ||
00010 | jsb 00264 | Key RCL | |
00011 | go to 00376 | ||
00012 | go to 00027 | Key STO | |
00013 | go to 00060 | Key ! (rdwn) | |
00014 | stack -> a | Key x <> y | |
00015 | go to 00331 | ||
00016 | 0 -> a[w] | Key 1/x | |
00017 | a + 1 -> a[p] | ||
00020 | 0 -> b[w] | ||
00021 | select rom 1 | goto asn12 | |
00022 | dig6 | a + 1 -> a[x] | Key "6" |
00023 | dig5 | a + 1 -> a[x] | Key "5" |
00024 | dig4 | a + 1 -> a[x] | Key "4" |
00025 | go to dig3 | ||
00026 | jsb 00232 | Key "+" | |
00027 | c exchange m | Relay to "STO" routine | |
00030 | m -> c | ||
00031 | go to 00077 | ||
00032 | dig3 | a + 1 -> a[x] | Key "3" |
00033 | dig2 | a + 1 -> a[x] | Key "2" |
00034 | dig1 | a + 1 -> a[x] | Key "1" |
00035 | return | ||
00036 | 3 -> p | Key "*" (mult) | |
00037 | 0 - c -> c[x] | ||
00040 | stack -> a | ||
00041 | go to 00020 | ||
00042 | go to 00164 | Key PI | |
00043 | 3 -> p | Key "," (dec. Point) | |
00044 | return | Key "0' | |
00045 | no operation | ||
00046 | go to 00040 | Key "/" | |
00047 | 1 -> s5 | Relay for "cos" | |
00050 | 1 -> s1 | Key ""tan" | |
00051 | go to 00056 | ||
00052 | 1 -> s9 | Key "cos" | |
00053 | go to 00047 | ||
00054 | 1 -> s10 | Key "sin" | |
00055 | go to 00302 | ||
00056 | 0 -> b[w] | Key SQR | |
00057 | goto 01060 | ||
00060 | down rotate | Relay for rotate | |
00061 | go to 00333 | ||
00062 | dig9 | a + 1 -> a[x] | Key "9" |
00063 | dig8 | a + 1 -> a[x] | Key "8" |
00064 | dig7 | a + 1 -> a[x] | Key "7" |
00065 | go to dig6 | ||
00066 | go to sub0 | Key "-" (sub) | |
00067 | clear registers | Relay for PWO and CLR | |
00070 | jsb of12 | Key Clx | |
00071 | go to fst2zx | ||
00072 | go to eex2 | Key EEX | |
00073 | shift right a[w] | Key CHS | |
00074 | 1 -> s3 | ||
00075 | go to 00166 | ||
00076 | c -> stack | Key ENTER | |
00077 | clear status | ||
00100 | shift right a[w] | ||
00101 | jsb fst2zx |
J.Laporte
Thursday, 23 February 2006