The 16 bit Program Counter holds the address of the next instruction to be fetched from memory.
On fetch the PC is incremented to point to the instruction operand(s) or the next instruction to be executed.
Juno instructions consist of a single operation and zero or more operands.
In normal program flow the PC will increment unless a branch occurs in which case the PC will be loaded with the address of the instruction to be branched to.
- Enable PC count - when enabled the PC counter will increment by 1 on the next clock signal rising edge. Note that this allows the PC to be incremented in the same clock cycle as the fetch operation.
- Enable PC out Address bus - when enabled places the value of the PC counter on the 16 bit address bus.
- Enable PC(H) out Left Bus - when enabled places the high byte of the PC counter onto the left ALU bus. This enables an effective address relative to the PC to be calculated. This relative address can be placed into the MAR for example to load A value from memory into A or loaded back into the PC to perform a PC relative branch and position independent code.
- Enable PC(L) out Left Bus - when enabled places the low byte of the PC counter onto the left ALU bus. To add or subtract from the PC the low order byte should be calculated first and to set the carry flag.
- Load PC (H) - when enabled the high byte of the PC counter is loaded with the value on the input bus from the ALU on the clock signal rising edge.
- Load PC (L) - as above but for the low byte.
- Master reset (L) - when low resets the PC counter to zero. This enables the PC to be initialised to a known value at power on and reset. When reset Juno will execute the program starting at address 0.
- Clk - the master clock signal.
No comments:
Post a Comment