15. Instruction sets¶
Both the HP and Jacobs-DeArras instruction sets are supported. The tools will use HP by default.
The reason for that there are two popular instruction sets is that HP did not originally publish its instruction set. Based on available fragments of information and a tremendous work by the user community, the instruction set was figured out.
Jim DeArras even went on to document the disassembled listings of the HP-41 firmware and when HP realized that the community was succeeding, they released the original listings.
However, the momentum was ongoing and we ended up with two popular instruction sets.
Why choose one over the other? The main reason to choose the HP instruction set is that it makes it easier to read the available source code listings. The main reason to choose the Jacobs-DeArras instruction set is that it is very popular.
No matter which you choose, you will most likely end up having a decent knowledge of the other instruction set as well. This section will take you through the main differences.
15.1. Non-local jumps¶
The 64K conditional jump and jump to subroutine instructions are named differently.
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
HP uses variants gsubnc and golnc which typically used after a
test instruction (that sets carry) to say that we do care about the
carry here not to be set. The gosub and golong variants are
used when we know the carry will be clear and the instruction is meant
to be unconditional (the carry auto-resets after each instruction that
does otherwise affect it).
15.2. Local branches¶
Short branches also have different names.
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
Similar to non-local jumps, the gonc instruction is used after a
test when we want to make it clear that we branch on carry not set.
15.3. Other jump and subroutine instructions¶
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
15.4. Page relocatable jumps¶
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
15.5. Pointer instructions¶
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
15.6. Arithmetic instructions¶
These are mostly the same in both the instruction sets. There are a couple of differences as follows:
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
HP favors alphabetic order in the exchange instructions, while Jacobs-DeArras favors the more versatile register first.
The operand field to the arithmetic instructions shows more variation:
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HP has the benefit of using only letters, which makes it easier to parse them as register fields in expressions (used in the debugger).
15.7. Flag instructions¶
This is a significant areas where the instruction sets differ. Also
note that st=0 exists in both instruction sets, but are
used for different instructions.
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15.8. Data memory¶
This is another area of significant differences in naming.
HP |
Jacobs-DeArras |
|---|---|
|
|
|
|
|
|
|
|
|
|