17. Jacobs-DeArras instruction set¶
This chapter summarizes the Jacobs-DeArras instruction set without going into deep details.
17.1. Non-local jump instructions¶
These instructions will jump to an absolute address within the 64K
memory space. They are used for calling entries in the mainframe ROM
and some fixed page located ROMs, typically in the address range
0000–7FFF.
Mnemonic |
Operand |
Description |
|---|---|---|
|
expr |
Absolute jump to subroutine |
|
expr |
Absolute jump to subroutine on carry set |
|
expr |
Absolute jump |
|
expr |
Absolute jump on carry set |
17.2. Local branches¶
Local branch instructions are position independent branches. They are rather short distance, -63 to 64 words.
Mnemonic |
Operand |
Description |
|---|---|---|
|
expr |
Synonym for
|
|
expr |
Short branch on carry set |
17.3. Page relocatable jumps¶
These instructions take 3 words and are made up by a 2-word non-local
?ncxq to a mainframe routine that reads the third word and uses
that as part of the destination. They work inside a 4K ROM page.
As they are implemented with the ?ncxq instruction, you need to
ensure that the carry flag is not set when executing the instruction,
otherwise the ?ncxq will be skipped and you end up executing the
third (page offset) word as an instruction, which is probably not what
you intended.
The linker will pick the appropriate mainframe routine to use depending on the jump location and its destination.
Mnemonic |
Operand |
Description |
|---|---|---|
|
expr |
4K page relocatable jump to subroutine |
|
expr |
4K page relocatable jump |
17.4. Other jump and subroutine instructions¶
Mnemonic |
Description |
|---|---|
|
Jump to address
in |
|
Push |
|
Pop stack to
|
|
Pop stack and discard value |
|
Return from subroutine |
|
Return from subroutine if carry clear |
|
Return from subroutine if carry set |
17.5. Pointer instructions¶
There are two pointers, P and Q. They are used to describe which part of a 56-bit register to operate on, but they can also be used as counters. One pointer register is active at any given time.
Mnemonic |
Operand |
Description |
|---|---|---|
|
Select pointer P |
|
|
Select pointer Q |
|
|
Test if P and Q pointers are equal |
|
|
Decrement current pointer |
|
|
Increment current pointer |
|
|
expr |
Set current pointer |
|
expr |
Test if current pointer equals value |
17.6. Arithmetic instructions¶
Arithmetic instructions take a field argument describing which part of the register to operate on.
Field |
Description |
|---|---|
|
At pointer |
|
Exponent |
|
Word up to pointer |
|
Word |
|
Between pointers |
|
Exponent sign |
|
Mantissa |
|
Sign of mantissa |
Mnemonic |
Operand |
Description |
|---|---|---|
|
field |
Clear (part of) |
|
field |
Clear (part of) |
|
field |
Clear (part of) |
|
field |
Exchange (part of) |
|
field |
Move (part of) |
|
field |
Exchange (part of) |
|
field |
Move (part of) |
|
field |
Exchange (part of) |
|
field |
Move (part of) |
|
field |
Add (part of) register |
|
field |
Add (part of) register |
|
field |
Increment (part of) register |
|
field |
Subtract (part of) register |
|
field |
Decrement (part of) register |
|
field |
Subtract (part of) register |
|
field |
Bit shift left (part of) |
|
field |
Add (part of) register |
|
field |
Synonym for previous instruction |
|
field |
Increment (part of) register |
|
field |
Subtract (part of) register |
|
field |
Decrement (part of) register |
|
field |
One complement (part of ) register |
|
field |
Two complement (part of) register |
|
field |
Test if (part of) |
|
field |
Test if (part of) |
|
field |
Test if (part of) |
|
field |
Test if (part of) |
|
field |
Test if (part of) |
|
field* |
Test if (part of) |
|
field* |
Nibble shift (part of) |
|
field* |
Nibble shift (part of) |
|
field* |
Nibble shift (part of) |
|
field |
Nibble shift (part of) |
17.7. Flag instructions¶
Mnemonic |
Operand |
Description |
|---|---|---|
|
expr |
Clear flag |
|
expr |
Set flag |
|
expr |
Test flag |
|
Clear flags
|
|
|
Copy |
|
|
Copy flags
|
|
|
Exchange
|
17.8. RAM memory instructions¶
RAM comes in units of 16 registers. You select a register to operate on and then read or write that particular register. It is also possible to access registers within the same 16 register unit, 1 but in practise, this is only useful for the very first 16 registers.
Footnotes
- 1
Reading register
0is special because it does not exist. Instead that opcode is used forc=data, read the current selected register.
Mnemonic |
Operand |
Description |
|---|---|---|
|
Select RAM memory register location |
|
|
Write |
|
|
Read from selected
RAM location to
|
|
|
register |
Write |
|
register |
Read given RAM
register to
|
Register number |
Alternative |
|---|---|
0 |
|
1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
17.9. ROM memory instructions¶
Mnemonic |
Description |
|---|---|
|
Read word from ROM memory |
|
Write to simulated MLDL ROM |
|
Enable ROM bank 1 |
|
Enable ROM bank 2 |
|
Enable ROM bank 3 |
|
Enable ROM bank 4 |
17.10. Keyboard instructions¶
Mnemonic |
Description |
|---|---|
|
Read keycode to
|
|
Put keycode into
low part of
|
|
Reset keyboard |
|
Test if key is down |
17.11. Miscellaneous instructions¶
Mnemonic |
Operand |
Description |
|---|---|---|
|
No operation |
|
|
Stop CPU |
|
|
expr |
Load 4-bit value to |
|
expr |
Load 10-bits immediate to
|
|
expr |
Select smart peripheral |
|
expr |
Test if I/O flag is pulled |
|
expr |
Rotate |
|
Set binary arithmetic mode |
|
|
Set BCD arithmetic mode |
|
|
Move |
|
|
Move |
|
|
Exchange |
|
|
Move |
|
|
Move |
|
|
Exchange |
|
|
Move |
|
|
Move |
|
|
Exchange |
|
|
Move status byte to tone register |
|
|
Move tone register to status byte |
|
|
Exchange tone register and status byte |
|
|
Low level detect, check for low battery |
|
|
Bitwise or |
|
|
Bitwise and |
|
|
Clear |
|
|
Select peripheral |
17.12. Hepax instructions¶
Mnemonic |
Operand |
Description |
|---|---|---|
|
Move ROM block |
|
|
Toggle write protection |
17.13. NEWT specific instructions¶
NEWT specific instructions are recognized if you specify the command
line option --core newt.
Mnemonic |
Operand |
Description |
|---|---|---|
|
Write command |
17.14. Peripheral instructions¶
Refer to the sections describing Peripheral instructions in the HP instructions chapter for the peripheral specific instructions recognized, as they are the same in both instructions sets (they were never defined for the Jacobs-DeArras instruction set).