Mnemonic: | JUN (Jump unconditional) |
1st word OPR OPA: | 0100 A3 A3 A3 A3 |
2nd word OPR OPA: | A2 A2 A2 A2 Al Al Al Al |
Symbolic: | Al Al Al Al --> PL, A2 A2 A2 A2 --> PM, A3 A3 A3 A3 --> PH |
Description: | Program control is unconditionally transferred to the instruction locater at the address A3 A3 A3 A3, A2 A2 A2 A2, Al Al Al Al. |
Mnemonic: | JMS (Jump to Subroutine) |
1st word OPR OPA: | 0101 A3 A3 A3 A3 |
2nd word OPR OPA: | A2 A2 A2 A2 A1 A1 A1 A1 |
Symbolic: | Al Al Al Al --> PL, A2 A2 A2 A2 --> PM, A3 A3 A3 A3 --> PH |
Description: | The address of the next instruction in sequence following JMS (return address) is saved in the push down stack. Program control is transferred to the instruction located at the 12 bit address (A3A3A3A3A2A2A2A2A1A1A1A1). Execution of a return instruction (BBL) will cause the saved address to be pulled out of the stack, therefore, program control is transferred to the next sequential instruction after the last JMS.
The push down stack has 4 registers. One of them is used as the program counter, therefore nesting of JMS can occur up to 3 levels. |
EXAMPLE: |
| Stack | | Stack | |
No JMS -> received |
| -> JMS#1 -> received |
| -> |
| Stack | | Stack | |
JMS#2 -> received |
| -> JMS#3 -> received |
PC | Rtn addr#3 | Rtn addr#2 | Rtn addr#1 |
| -> |
| Stack | | Stack | |
JMS#4 -> received |
Rtn addr#4 | Rtn addr#3 | Rtn addr#2 | PC |
| -> BBL -> received |
| |
The deepest return address is lost. |
|
Mnemonic: | JCN (Jump conditional) |
1st word OPR OPA: | 0001 C1C2C3C4 |
2nd word OPR OPA: | A2 A2 A2 A2 A1 A1 A1 A1 |
Symbolic: | If C1C2C3C4 is true, A2A2A2A2 --> PM A1A1A1A1 --> PL, PH unchanged if C1C2C3C4 is false, (PH) --> PH, (PM) --> PM, (PL + 2) --> PL |
Description: | If the designated condition code is true, program control is transferred to the instruction located at the 8 bit address A2A2A2A2, A1A1A1A1 on the same page (ROM) where JCN is located. If the condition is not true the next instruction in sequence after JCN is executed. The condition bits are assigned as follows: C1 = 0 Do not invert jump condition C1 = 1 Invert jump condition C2 = 1 Jump if the accumulator content is zero C3 = 1 Jump if the carry/link content is 1 C4 = 1 Jump if test signal (pin 10 on 4004) is zero. |
Example: | OPR OPA ------ ------ 0001 0110 Jump if accumulator is zero or carry = 1
Several conditions can be tested simutaneously.
The logic equation describing the condition for a jump is give below:
JUMP = ~C1 . ((ACC = 0) . C2 + (CY = 1) . C3 + ~TEST . C4) + C1 . ~((ACC = 0) . C2 + (CY = 1) . C3 + ~TEST . C4) |
EXCEPTIONS: | If JCN is located on words 254 and 255 of a ROM page, when JCN is executed and the condition is true, program control is transferred to the 8-bit address on the next page where JCN is located. |
Mnemonic: | ISZ (Increment index register skip if zero) |
1st word OPR OPA: | 0111 RRRR |
2nd word OPR OPA: | A2 A2 A2 A2 A1 A1 A1 A1 |
Symbolic: | (RRRR) + 1 --> RRRR, if result = 0 (PH) --> PH, (PM) --> PM, (PL + 2) --> PL: if result <> 0 (PH) --> PH, A2A2A2A2 --> PM, A1A1A1A1 --> PL |
Description: | The content of the designated index register is incremented by 1. The accumulator and carry/link are unaffected. If the result is zero, the next instruction after ISZ is executed. If the result is different from 0, program control is transferred to the instruction located at the 8 bit address A2A2A2A2, A1A1A1A1 on the same page (ROM) where the ISZ instruction is located. |
EXCEPTIONS: | If ISZ is located on words 254 and 255 of a ROM page, when ISZ is executed and the result is not zero, program control is transferred to the 8-bit address located on the next page in sequence and not on the same page where ISZ is located. |
Mnemonic: | FIM (Fetched immediate from ROM) |
1st word OPR OPA: | 0010 RRR0 |
2nd word OPR OPA: | D2 D2 D2 D2 D1 D1 D1 D1 |
Symbolic: | D2D2D2D2 --> RRR0, D1D1D1D1 --> RRR1 |
Description: | The 2nd word represents 8-bits of data which are loaded into the designated index register pair. |
|