The Museum of HP Calculators

HP Articles Forum

[Return to the Index ]
[ Previous | Next ]


HP Calculator Opcode Map

Posted by George Weigt on 14 Dec 2000, 5:48 p.m.

HP Calculator Opcode Map

To find the opcode for a particular instruction, or-together the coordinate bit strings, treating xxxx as 0000. This map was created with the help of Eric Smith's assembler and may be used to help understand the HP-45 simulator.

xxxx000000 xxxx000100 xxxx001000 xxxx001100 xxxx010000 xxxx010100 xxxx011000 xxxx011100
0000xxxx00 no operation 1 -> s0 . 0 -> p select rom 0 if s0 = 0 load constant 0 p - 1 -> p
0001xxxx00 buffer -> rom address 1 -> s1 . 1 -> p . if s1 = 0 load constant 1 .
0010xxxx00 memory insert 1 -> s2 . 2 -> p select rom 1 if s2 = 0 load constant 2 .
0011xxxx00 . 1 -> s3 . 3 -> p keys -> rom address if s3 = 0 load constant 3 .
0100xxxx00 mark and search 1 -> s4 . 4 -> p select rom 2 if s4 = 0 load constant 4 .
0101xxxx00 . 1 -> s5 . 5 -> p . if s5 = 0 load constant 5 .
0110xxxx00 memory delete 1 -> s6 . 6 -> p select rom 3 if s6 = 0 load constant 6 .
0111xxxx00 . 1 -> s7 . 7 -> p . if s7 = 0 load constant 7 .
1000xxxx00 rom address -> buffer 1 -> s8 . 8 -> p select rom 4 if s8 = 0 load constant 8 .
1001xxxx00 . 1 -> s9 . 9 -> p . if s9 = 0 load constant 9 .
1010xxxx00 search for label 1 -> s10 . 10 -> p select rom 5 if s10 = 0 . .
1011xxxx00 . 1 -> s11 . 11 -> p . if s11 = 0 . .
1100xxxx00 pointer advance . . 12 -> p select rom 6 . . .
1101xxxx00 . . . 13 -> p . . . .
1110xxxx00 . . . 14 -> p select rom 7 . . .
1111xxxx00 . . . 15 -> p . . . .

xxxx100000 xxxx100100 xxxx101000 xxxx101100 xxxx110000 xxxx110100 xxxx111000 xxxx111100
0000xxxx00 . 0 -> s0 display toggle if p # 0 return clear status . p + 1 -> p
0001xxxx00 . 0 -> s1 . if p # 1 . delayed select rom 0 . .
0010xxxx00 . 0 -> s2 c exchange m if p # 2 . . . .
0011xxxx00 . 0 -> s3 . if p # 3 . delayed select rom 1 . .
0100xxxx00 . 0 -> s4 c ->stack if p # 4 . . . .
0101xxxx00 . 0 -> s5 . if p # 5 . delayed select rom 2 . .
0110xxxx00 . 0 -> s6 stack -> a if p # 6 . . . .
0111xxxx00 . 0 -> s7 . if p # 7 . delayed select rom 3 . .
1000xxxx00 . 0 -> s8 display off if p # 8 . delayed select group 0 . .
1001xxxx00 . 0 -> s9 . if p # 9 c -> data address delayed select rom 4 . .
1010xxxx00 . 0 -> s10 m -> c if p # 10 . delayed select group 1 . .
1011xxxx00 . 0 -> s11 . if p # 11 c -> data delayed select rom 5 data -> c .
1100xxxx00 . . down rotate if p # 12 . . . .
1101xxxx00 . . . if p # 13 . delayed select rom 6 . .
1110xxxx00 . . clear registers if p # 14 . . . .
1111xxxx00 . . . if p # 15 . delayed select rom 7 . .

xxxx000010 xxxx000110 xxxx001010 xxxx001110 xxxx010010 xxxx010110 xxxx011010 xxxx011110
0000xxxx10 if b[p] = 0 if b[m] = 0 if b[x] = 0 if b[w] = 0 if b[wp] = 0 if b[ms] = 0 if b[xs] = 0 if b[s] = 0
0001xxxx10 if a >= c[p] if a >= c[m] if a >= c[x] if a >= c[w] if a >= c[wp] if a >= c[ms] if a >= c[xs] if a >= c[s]
0010xxxx10 b -> c[p] b -> c[m] b -> c[x] b -> c[w] b -> c[wp] b -> c[ms] b -> c[xs] b -> c[s]
0011xxxx10 0 -> c[p] 0 -> c[m] 0 -> c[x] 0 -> c[w] 0 -> c[wp] 0 -> c[ms] 0 -> c[xs] 0 -> c[s]
0100xxxx10 shift left a[p] shift left a[m] shift left a[x] shift left a[w] shift left a[wp] shift left a[ms] shift left a[xs] shift left a[s]
0101xxxx10 a - c -> c[p] a - c -> c[m] a - c -> c[x] a - c -> c[w] a - c -> c[wp] a - c -> c[ms] a - c -> c[xs] a - c -> c[s]
0110xxxx10 c -> a[p] c -> a[m] c -> a[x] c -> a[w] c -> a[wp] c -> a[ms] c -> a[xs] c -> a[s]
0111xxxx10 a + c -> c[p] a + c -> c[m] a + c -> c[x] a + c -> c[w] a + c -> c[wp] a + c -> c[ms] a + c -> c[xs] a + c -> c[s]
1000xxxx10 if a >= b[p] if a >= b[m] if a >= b[x] if a >= b[w] if a >= b[wp] if a >= b[ms] if a >= b[xs] if a >= b[s]
1001xxxx10 shift right c[p] shift right c[m] shift right c[x] shift right c[w] shift right c[wp] shift right c[ms] shift right c[xs] shift right c[s]
1010xxxx10 shift right b[p] shift right b[m] shift right b[x] shift right b[w] shift right b[wp] shift right b[ms] shift right b[xs] shift right b[s]
1011xxxx10 shift right a[p] shift right a[m] shift right a[x] shift right a[w] shift right a[wp] shift right a[ms] shift right a[xs] shift right a[s]
1100xxxx10 a - b -> a[p] a - b -> a[m] a - b -> a[x] a - b -> a[w] a - b -> a[wp] a - b -> a[ms] a - b -> a[xs] a - b -> a[s]
1101xxxx10 a - c -> a[p] a - c -> a[m] a - c -> a[x] a - c -> a[w] a - c -> a[wp] a - c -> a[ms] a - c -> a[xs] a - c -> a[s]
1110xxxx10 a + b -> a[p] a + b -> a[m] a + b -> a[x] a + b -> a[w] a + b -> a[wp] a + b -> a[ms] a + b -> a[xs] a + b -> a[s]
1111xxxx10 a + c -> a[p] a + c -> a[m] a + c -> a[x] a + c -> a[w] a + c -> a[wp] a + c -> a[ms] a + c -> a[xs] a + c -> a[s]

xxxx100010 xxxx100110 xxxx101010 xxxx101110 xxxx110010 xxxx110110 xxxx111010 xxxx111110
0000xxxx10 0 -> b[p] 0 -> b[m] 0 -> b[x] 0 -> b[w] 0 -> b[wp] 0 -> b[ms] 0 -> b[xs] 0 -> b[s]
0001xxxx10 if c[p] >= 1 if c[m] >= 1 if c[x] >= 1 if c[w] >= 1 if c[wp] >= 1 if c[ms] >= 1 if c[xs] >= 1 if c[s] >= 1
0010xxxx10 0 - c -> c[p] 0 - c -> c[m] 0 - c -> c[x] 0 - c -> c[w] 0 - c -> c[wp] 0 - c -> c[ms] 0 - c -> c[xs] 0 - c -> c[s]
0011xxxx10 0 - c - 1 -> c[p] 0 - c - 1 -> c[m] 0 - c - 1 -> c[x] 0 - c - 1 -> c[w] 0 - c - 1 -> c[wp] 0 - c - 1 -> c[ms] 0 - c - 1 -> c[xs] 0 - c - 1 -> c[s]
0100xxxx10 a -> b[p] a -> b[m] a -> b[x] a -> b[w] a -> b[wp] a -> b[ms] a -> b[xs] a -> b[s]
0101xxxx10 c - 1 -> c[p] c - 1 -> c[m] c - 1 -> c[x] c - 1 -> c[w] c - 1 -> c[wp] c - 1 -> c[ms] c - 1 -> c[xs] c - 1 -> c[s]
0110xxxx10 if c[p] = 0 if c[m] = 0 if c[x] = 0 if c[w] = 0 if c[wp] = 0 if c[ms] = 0 if c[xs] = 0 if c[s] = 0
0111xxxx10 c + 1 -> c[p] c + 1 -> c[m] c + 1 -> c[x] c + 1 -> c[w] c + 1 -> c[wp] c + 1 -> c[ms] c + 1 -> c[xs] c + 1 -> c[s]
1000xxxx10 b exchange c[p] b exchange c[m] b exchange c[x] b exchange c[w] b exchange c[wp] b exchange c[ms] b exchange c[xs] b exchange c[s]
1001xxxx10 if a[p] >= 1 if a[m] >= 1 if a[x] >= 1 if a[w] >= 1 if a[wp] >= 1 if a[ms] >= 1 if a[xs] >= 1 if a[s] >= 1
1010xxxx10 c + c -> c[p] c + c -> c[m] c + c -> c[x] c + c -> c[w] c + c -> c[wp] c + c -> c[ms] c + c -> c[xs] c + c -> c[s]
1011xxxx10 0 -> a[p] 0 -> a[m] 0 -> a[x] 0 -> a[w] 0 -> a[wp] 0 -> a[ms] 0 -> a[xs] 0 -> a[s]
1100xxxx10 a exchange b[p] a exchange b[m] a exchange b[x] a exchange b[w] a exchange b[wp] a exchange b[ms] a exchange b[xs] a exchange b[s]
1101xxxx10 a - 1 -> a[p] a - 1 -> a[m] a - 1 -> a[x] a - 1 -> a[w] a - 1 -> a[wp] a - 1 -> a[ms] a - 1 -> a[xs] a - 1 -> a[s]
1110xxxx10 a exchange c[p] a exchange c[m] a exchange c[x] a exchange c[w] a exchange c[wp] a exchange c[ms] a exchange c[xs] a exchange c[s]
1111xxxx10 a + 1 -> a[p] a + 1 -> a[m] a + 1 -> a[x] a + 1 -> a[w] a + 1 -> a[wp] a + 1 -> a[ms] a + 1 -> a[xs] a + 1 -> a[s]

xxxx000001 xxxx000101 xxxx001001 xxxx001101 xxxx010001 xxxx010101 xxxx011001 xxxx011101
0000xxxx01 jsb 0 jsb 1 jsb 2 jsb 3 jsb 4 jsb 5 jsb 6 jsb 7
0001xxxx01 jsb 16 jsb 17 jsb 18 jsb 19 jsb 20 jsb 21 jsb 22 jsb 23
0010xxxx01 jsb 32 jsb 33 jsb 34 jsb 35 jsb 36 jsb 37 jsb 38 jsb 39
0011xxxx01 jsb 48 jsb 49 jsb 50 jsb 51 jsb 52 jsb 53 jsb 54 jsb 55
0100xxxx01 jsb 64 jsb 65 jsb 66 jsb 67 jsb 68 jsb 69 jsb 70 jsb 71
0101xxxx01 jsb 80 jsb 81 jsb 82 jsb 83 jsb 84 jsb 85 jsb 86 jsb 87
0110xxxx01 jsb 96 jsb 97 jsb 98 jsb 99 jsb 100 jsb 101 jsb 102 jsb 103
0111xxxx01 jsb 112 jsb 113 jsb 114 jsb 115 jsb 116 jsb 117 jsb 118 jsb 119
1000xxxx01 jsb 128 jsb 129 jsb 130 jsb 131 jsb 132 jsb 133 jsb 134 jsb 135
1001xxxx01 jsb 144 jsb 145 jsb 146 jsb 147 jsb 148 jsb 149 jsb 150 jsb 151
1010xxxx01 jsb 160 jsb 161 jsb 162 jsb 163 jsb 164 jsb 165 jsb 166 jsb 167
1011xxxx01 jsb 176 jsb 177 jsb 178 jsb 179 jsb 180 jsb 181 jsb 182 jsb 183
1100xxxx01 jsb 192 jsb 193 jsb 194 jsb 195 jsb 196 jsb 197 jsb 198 jsb 199
1101xxxx01 jsb 208 jsb 209 jsb 210 jsb 211 jsb 212 jsb 213 jsb 214 jsb 215
1110xxxx01 jsb 224 jsb 225 jsb 226 jsb 227 jsb 228 jsb 229 jsb 230 jsb 231
1111xxxx01 jsb 240 jsb 241 jsb 242 jsb 243 jsb 244 jsb 245 jsb 246 jsb 247

xxxx100001 xxxx100101 xxxx101001 xxxx101101 xxxx110001 xxxx110101 xxxx111001 xxxx111101
0000xxxx01 jsb 8 jsb 9 jsb 10 jsb 11 jsb 12 jsb 13 jsb 14 jsb 15
0001xxxx01 jsb 24 jsb 25 jsb 26 jsb 27 jsb 28 jsb 29 jsb 30 jsb 31
0010xxxx01 jsb 40 jsb 41 jsb 42 jsb 43 jsb 44 jsb 45 jsb 46 jsb 47
0011xxxx01 jsb 56 jsb 57 jsb 58 jsb 59 jsb 60 jsb 61 jsb 62 jsb 63
0100xxxx01 jsb 72 jsb 73 jsb 74 jsb 75 jsb 76 jsb 77 jsb 78 jsb 79
0101xxxx01 jsb 88 jsb 89 jsb 90 jsb 91 jsb 92 jsb 93 jsb 94 jsb 95
0110xxxx01 jsb 104 jsb 105 jsb 106 jsb 107 jsb 108 jsb 109 jsb 110 jsb 111
0111xxxx01 jsb 120 jsb 121 jsb 122 jsb 123 jsb 124 jsb 125 jsb 126 jsb 127
1000xxxx01 jsb 136 jsb 137 jsb 138 jsb 139 jsb 140 jsb 141 jsb 142 jsb 143
1001xxxx01 jsb 152 jsb 153 jsb 154 jsb 155 jsb 156 jsb 157 jsb 158 jsb 159
1010xxxx01 jsb 168 jsb 169 jsb 170 jsb 171 jsb 172 jsb 173 jsb 174 jsb 175
1011xxxx01 jsb 184 jsb 185 jsb 186 jsb 187 jsb 188 jsb 189 jsb 190 jsb 191
1100xxxx01 jsb 200 jsb 201 jsb 202 jsb 203 jsb 204 jsb 205 jsb 206 jsb 207
1101xxxx01 jsb 216 jsb 217 jsb 218 jsb 219 jsb 220 jsb 221 jsb 222 jsb 223
1110xxxx01 jsb 232 jsb 233 jsb 234 jsb 235 jsb 236 jsb 237 jsb 238 jsb 239
1111xxxx01 jsb 248 jsb 249 jsb 250 jsb 251 jsb 252 jsb 253 jsb 254 jsb 255

xxxx000011 xxxx000111 xxxx001011 xxxx001111 xxxx010011 xxxx010111 xxxx011011 xxxx011111
0000xxxx11 go to 0 go to 1 go to 2 go to 3 go to 4 go to 5 go to 6 go to 7
0001xxxx11 go to 16 go to 17 go to 18 go to 19 go to 20 go to 21 go to 22 go to 23
0010xxxx11 go to 32 go to 33 go to 34 go to 35 go to 36 go to 37 go to 38 go to 39
0011xxxx11 go to 48 go to 49 go to 50 go to 51 go to 52 go to 53 go to 54 go to 55
0100xxxx11 go to 64 go to 65 go to 66 go to 67 go to 68 go to 69 go to 70 go to 71
0101xxxx11 go to 80 go to 81 go to 82 go to 83 go to 84 go to 85 go to 86 go to 87
0110xxxx11 go to 96 go to 97 go to 98 go to 99 go to 100 go to 101 go to 102 go to 103
0111xxxx11 go to 112 go to 113 go to 114 go to 115 go to 116 go to 117 go to 118 go to 119
1000xxxx11 go to 128 go to 129 go to 130 go to 131 go to 132 go to 133 go to 134 go to 135
1001xxxx11 go to 144 go to 145 go to 146 go to 147 go to 148 go to 149 go to 150 go to 151
1010xxxx11 go to 160 go to 161 go to 162 go to 163 go to 164 go to 165 go to 166 go to 167
1011xxxx11 go to 176 go to 177 go to 178 go to 179 go to 180 go to 181 go to 182 go to 183
1100xxxx11 go to 192 go to 193 go to 194 go to 195 go to 196 go to 197 go to 198 go to 199
1101xxxx11 go to 208 go to 209 go to 210 go to 211 go to 212 go to 213 go to 214 go to 215
1110xxxx11 go to 224 go to 225 go to 226 go to 227 go to 228 go to 229 go to 230 go to 231
1111xxxx11 go to 240 go to 241 go to 242 go to 243 go to 244 go to 245 go to 246 go to 247

xxxx100011 xxxx100111 xxxx101011 xxxx101111 xxxx110011 xxxx110111 xxxx111011 xxxx111111
0000xxxx11 go to 8 go to 9 go to 10 go to 11 go to 12 go to 13 go to 14 go to 15
0001xxxx11 go to 24 go to 25 go to 26 go to 27 go to 28 go to 29 go to 30 go to 31
0010xxxx11 go to 40 go to 41 go to 42 go to 43 go to 44 go to 45 go to 46 go to 47
0011xxxx11 go to 56 go to 57 go to 58 go to 59 go to 60 go to 61 go to 62 go to 63
0100xxxx11 go to 72 go to 73 go to 74 go to 75 go to 76 go to 77 go to 78 go to 79
0101xxxx11 go to 88 go to 89 go to 90 go to 91 go to 92 go to 93 go to 94 go to 95
0110xxxx11 go to 104 go to 105 go to 106 go to 107 go to 108 go to 109 go to 110 go to 111
0111xxxx11 go to 120 go to 121 go to 122 go to 123 go to 124 go to 125 go to 126 go to 127
1000xxxx11 go to 136 go to 137 go to 138 go to 139 go to 140 go to 141 go to 142 go to 143
1001xxxx11 go to 152 go to 153 go to 154 go to 155 go to 156 go to 157 go to 158 go to 159
1010xxxx11 go to 168 go to 169 go to 170 go to 171 go to 172 go to 173 go to 174 go to 175
1011xxxx11 go to 184 go to 185 go to 186 go to 187 go to 188 go to 189 go to 190 go to 191
1100xxxx11 go to 200 go to 201 go to 202 go to 203 go to 204 go to 205 go to 206 go to 207
1101xxxx11 go to 216 go to 217 go to 218 go to 219 go to 220 go to 221 go to 222 go to 223
1110xxxx11 go to 232 go to 233 go to 234 go to 235 go to 236 go to 237 go to 238 go to 239
1111xxxx11 go to 248 go to 249 go to 250 go to 251 go to 252 go to 253 go to 254 go to 255

   1                                            ; the "go to" opcodes are also used for "if then" branching
   2                                            
   3   L00000:  ........11  -> L00000                go to 0               ; opcode is 3
   4                                            
   5   L00001:  11......1.                           a - b -> a[p]
   6   L00002:  ........11  -> L00000                if no carry go to 0   ; opcode is also 3
   7                                            
   8   L00003:  .....1.1..                           if s0 = 0
   9   L00004:  ........11  -> L00000                then go to 0          ; opcode is still 3
  10                                            
  11                                            ; the xxxx010100 group can also be programmed as "if s0 # 1" etc.
  12                                            
  13   L00005:  .....1.1..                           if s0 = 0             ; opcode is 20
  14                                            
  15   L00006:  .....1.1..                           if s0 # 1             ; opcode is 20
0 errors, 0 warnings

Password:

[ Return to the Message Index ]

Go back to the main exhibit hall