View Single Post
Old 28th Jul 2020, 10:03 pm   #103
Karen O
Rest in Peace
 
Join Date: Jul 2011
Location: Bridgnorth, Shropshire, UK.
Posts: 787
Default Re: SC/MP timing and microcode information

I've had something of an insight regarding PC-relative addressing which I think Dom would find useful. There are two circumstances: jump instructions and indexed instructions. In the former case, a displacement of zero corresponds to the first byte of the next instruction hence 90FE (JMP -2(P0)) will form the classic infinite loop.

For indexed instructions, a zero displacement corresponds to the operand field. Hence C800 (ST 0(P0)) actually over-writes the operand! So to answer a longstanding question yes, this is a STI (store immediate) instruction!

My emulator gets all this right because the PC (Pointer 0) is pointing at the operand when the displacement is added. Consequently, a zero displacement behaves as described for indexed instructions.

And jumps work because of the PC PRE-INCREMENT before instruction fetch.

I hope this is interesting for to our resident clone emulator
Karen O is offline