Main improvements
- Index register - inclusion of an index register
- All registers can act as both an input and recipient of the output from the ALU
Together these two changes enable a host of new addressing modes and capabilities.
- Index absolute addressing mode - effective address = memory address + index register where the memory address is a 16bit absolute address that is provided as part of the instruction. This is added to the value of the index register to calculate the effective address. Example, if IX contains the value 10 then the instruction LDA 0x1000, IX would load A with the contents of 0x1010.
- Index base plus index - effective address = base register + index register where the base register is a general purpose register e.g. A or B. Example LDA B, IX.
- PC relative addressing - effective address = PC + index register
- Add and subtract values from the stack pointer. This capability is useful for supporting function stack frames for creating space on the stack for a function's local variables.
This architecture also includes placeholders for supporting interrupts. It includes an interrupt line for flagging to the control unit that an interrupt has occurred and a set of lines for the interrupt number.
Push and Pop operations are implemented using the ALU in a similar fashion to index addressing above but using the hard wired 1 input into the right side of the ALU.
Notes on operation
Index addressing is implemented using the ALU to add, or subtract, from the value in the IX register and storing the result in the MDR. The value held in MDR is then placed onto the address bus. The addition or subtraction is performed first on the low order bytes and then on the high order bytes with carry.Push and Pop operations are implemented using the ALU in a similar fashion to index addressing above but using the hard wired 1 input into the right side of the ALU.
The PC has an inbuilt counter to provide much faster operation than is possible incrementing via the ALU (which would require multiple steps to first add 1 to the least significant byte and then add any carry to the most significant byte). Jumps though are implemented by using the ALU to add, or subtract, from the PC.
No comments:
Post a Comment