Reading the tables
src and dst are any operands the addressing modes allow (a destination only register, indexed, symbolic or absolute). Every instruction has a byte form .B
unless the table says otherwise. Flags are V N Z C; “C = !Z” means the carry is set when the result is not zero. The flags of an instruction whose destination is SR itself are replaced by the result.
The emulated names (RET, NOP, CLR …) are on their own page; the disassembler shows them by default.
Two operands (format I)
| Instruction | Opcode | Operation | Flags |
|---|---|---|---|
MOV src,dst | 4 | dst ← src. | none |
ADD src,dst | 5 | dst ← dst + src. | V N Z C |
ADDC src,dst | 6 | dst ← dst + src + C. | V N Z C |
SUBC src,dst | 7 | dst ← dst + NOT src + C (subtract with borrow: C = 1 means no borrow). | V N Z C |
SUB src,dst | 8 | dst ← dst + NOT src + 1. C = 1 means no borrow. | V N Z C |
CMP src,dst | 9 | dst − src, the result discarded. | V N Z C |
DADD src,dst | A | dst ← dst + src + C as binary-coded decimal digits (four digits in a word, two in a byte). | N Z C (V is undefined) |
BIT src,dst | B | dst AND src, discarded. V is cleared. | N Z, C = !Z, V = 0 |
BIC src,dst | C | dst ← dst AND NOT src: clears bits. | none |
BIS src,dst | D | dst ← dst OR src: sets bits. | none |
XOR src,dst | E | dst ← dst XOR src. V is set if both operands are negative. | N Z, C = !Z, V |
AND src,dst | F | dst ← dst AND src. V is cleared. | N Z, C = !Z, V = 0 |
Moving to R0 (MOV src,PC) is a jump; writing R2 (SR) changes every flag and the power mode.
One operand (format II)
| Instruction | Word | Operation | Flags |
|---|---|---|---|
RRC dst | 0x1000 | Rotate right through the carry: C into the top bit, the old bit 0 into C. | V = 0, N Z C |
SWPB dst | 0x1080 | Swap the two bytes of the word. No byte form. | none |
RRA dst | 0x1100 | Arithmetic shift right: the top bit stays, bit 0 into C. | V = 0, N Z C |
SXT dst | 0x1180 | Sign-extend bit 7 into bits 8 to 15. No byte form. | N Z, C = !Z, V = 0 |
PUSH src | 0x1200 | SP ← SP − 2, then the word (or, for .B, the byte, in a word slot) at the new SP ← src. | none |
CALL src | 0x1280 | Push the address of the next instruction, then PC ← src (the value of the operand, not what it points to for #N). No byte form. | none |
RETI | 0x1300 | Pop SR, then pop PC: the return from an interrupt. | all, from the stack |
Jumps
See the jump format: offset −512 to +511 words from the next instruction; two cycles whether taken or not. Flags are not changed.
| Instruction | Condition | Also written |
|---|---|---|
JNE | Z = 0 | JNZ |
JEQ | Z = 1 | JZ |
JLO | C = 0 (lower, unsigned) | JNC |
JHS | C = 1 (higher or same, unsigned) | JC |
JN | N = 1 | |
JGE | N = V (greater or equal, signed) | |
JL | N ≠ V (less, signed) | |
JMP | always |
Not described
- The exact flag equations and the effect of
DADDon V (the manual calls it undefined). - The behaviour of a byte operation on the stack pointer or program counter, and of an odd address.