State | Action |
0 | This is the first state for all instructions, for the
simpler ALU instructions this suffices. For single cycle instructions the fetch of the next instruction will be occurring concurrently with the instruction operation in this state. For instructions requiring the load of immediate data the LSB will be loaded here |
1 | For instructions requiring the load of 16 bits of immediate data the MSB will be loaded in this state. |
2 | A stall cycle required for
some instructions for calculations to complete. The SHIFT instruction can use many cycles in this state. |
3 | This provides a cycle for calculation at the end of all
non load/store multi-cycle instruction. The fetch for the next instruction will occur during this state concurrently with the last calculation required for the instruction. |
4 | Used to load one of the bytes when doing a 16 byte load. |
5 | Used to load a byte when doing either an 8 or a 16 bit
load. Will be the last cycle of a load instruction. (The fetch for the next instruction will have been carried out during state 0 of the instruction with the result being held in the F register). |
6 | Used to load one of the bytes when doing a 16 byte load. |
7 | Used to store a byte when doing either an 8 or a 16 bit
store. Will be the last cycle of a store instruction. (The fetch for the next instruction will have been carried out during state 0 of the instruction with the result being held in the F register). |
8 | Used to POP PS during the RETI instruction |
9 | Used to PUSH PS during TRAP |
10 | Iteration for the SQRT instruction occurs during this
state. The H register is used to count the required number of cycles. |
11 | Iteration for the DIV instruction occurs during this
state. The H register is used to count the required number of cycles. |
12 | Used to carry out the adjustment required for negative operands at the end of a signed division |
13 | Iteration for the MUL instruction occurs during this
state. The H register is used to count the required number of cycles. |
14 | Used to carry out the adjustment required for negative operands at the end of a signed multiplication |
15 | A stall cycle used for JSR absolute and TRAP. |
© 2014-2016 James Newman.