Windfall:
Quote:
MichaelM wrote:
[...]
To implement the BRK in the manner described would require a change to the microcode to fetch the byte following the BRK into memory operand register, OP1. The external interrupt controller would then apply the value of the OP1 register as an offset to the value of the BRK vector.
[...]
I think I may have to rephrase my question, because I just don't see it answered here : How is the BRK signalled to the 'interrupt controller', and what does it expect in return ?
In any way, I think things would have been easier if the core accepted the Int, and, when ready, produced a 'Gimme the vector' signal, instead of an 'I'm following the vector now' signal. The interrupt controller could then tell that it's a BRK by the absence of other (higher priority) interrupts.
BRK would be signalled to the interrupt controller by a zero detector applied to the instruction register, IR. On the cycle that IR goes to zero, the microsequencer starts the first microinstruction of BRK. The vector is loaded into the operand register pair {OP2, OP1} in parallel with the the interrupt's register push sequence: {PCH, PCL, P}. During the cycle that P is being written to the hardware stack, the {OP2, OP1} register pair is loaded into PC, and on the following cycle, that address is presented to memory in order to load the first opcode of the ISR.
The first change to the BRK processing that would be required is that an extra state at the start would be required to capture the byte following the BRK into OP1. That byte, plus the BRK signal from IR, would allow the interrupt vector controller to modify the BRK ISR's vector.
I've not stopped to think too deeply on your suggested modification regarding the signalling of the interrupt controller from the core. It appears to be a valid approach, and I think that you could easily modify the core, or add a wrapper to the core, that would perform interrupt handling just as you suggest.