GO64! Issue 03/98: A solved secret
In part 7 of our tutorial we had a short section about ASL $D019 (aswell as INC, DEC) not working in native mode IRQ routines, (See here) but instead we had to use LDA $D019 STA $D019.
Johannes Niedermayr found the answer on the net and described it as follows:
The instruction timing of the 6510 looks like this:
> Operational diagram of LSR $D019: <#> <data> <address> <R/W> <Description>  4E PC R fetch opcode  19 PC+1 R fetch address low  D0 PC+2 R fetch opcode high  xx $D019 R read memory  xx $D019 W write the value back, rotate right  xx/2 $D019 W write the new value back
On cycle 5 the interrupt is confirmed by writing the value read in cycle 4 (same value)
to $D019. When running a standard IRQ the 6th cycle isn't needed anymore, as the IRQ is
On CMOS versions of the 6502 such as the 65c02 (and the 65c816 aswell) 2 read cycles and 1 write cycle are performed. On our 6502 just 1 read cycle and 2 write cycles are done.
That appears to be the main difference causing a native IRQ not to be confirmed properly when doing INC $D019 or alike.
< Just a quick translation, but it should have the point :) ... >
For additions please contact me at: firstname.lastname@example.org or click here.
[ Index ]