Re: Error in 64doc.txt at Bo's site?

From: Marko Mäkelä <msmakela_at_gmail.com>
Date: Sat, 22 Sep 2018 12:24:05 +0300
Message-ID: <20180922092405.GB10937@jyty>
On Thu, Sep 20, 2018 at 09:14:17PM +0200, groepaz@gmx.net wrote:
>Am Donnerstag, 20. September 2018, 09:27:59 CEST schrieb John McKenna:
>>Those internal operations were speculation.  I remember JSR being one 
>>of the more baffling instructions - Marko and I had a long discussion 
>>about it, of which I remember none of the details, except for a 
>>feeling that we hadn't ever really understood it.  Now that we have 
>>Visual6502, it should be possible to find out the truth.

I remember using the CIA as a measurement tool for some instructions, 
and in 1993 for measuring the conflict between the execution of a BRK 
instruction and the occurrence of IRQ or NMI.

Reading from the interrupt flag register ($dcxd or $ddxd) would have a 
side effect of clearing the register. One of the tricks was to write the 
instruction bytes to CIA registers and then JMPing to the CIA, to let 
the "instruction under test" to be fetched from there. Maybe I even let 
the instruction and operands to be fetched from the timer registers, so 
that based on the behaviour I would know at which cycle the read 
occurred.

Later, in 1995 or 1996, I wrote two test programs that fetch instruction 
data from open address space ($de00-$dfff or the most significant 
nibbles of the colour RAM at $d800-$dbff). The program "dadb" would 
mostly exercise the RTS instruction ($60) by filling the stack with the 
byte $da, and making the RTS jump to $dadb most of the time. I cannot 
remember if it exercised the JSR instruction.

Obviously I cannot remember details from 25 years ago very well. I would 
however be rather certain that the read and write cycles that we 
documented for the JSR instruction correspond to reality. I had no 
knowledge of the internals of the 6502 back then (such as the 
instruction decoding), so it was a result of experimenting and guessing 
on my part.

>a lot of the C64 docs from those days should be taken with a HUGE spook 
>of salt. there is often a lot of guessing and half-true things - and
>unfortunately not always it is pointed out as such. 64doc iirc also had 
>a section about illegal opcodes which is... uhm. lets say vague :=)

I do not think that I contributed to the section about undocumented 
opcodes. Maybe it was written by Jouko Valta, one of the original 
authors of x64?

	Marko
Received on 2018-09-22 12:00:06

Archive generated by hypermail 2.2.0.