6509 questions

From: Rhialto <rhialto_at_falu.nl>
Date: Tue, 16 May 2023 21:17:09 +0200
Message-ID: <ZGPWtW7OkEah/+Z5_at_falu.nl>
I was just trying to update some 6509 P/B CBM-II 6x0 7x0 (what shall we
call it) code in Vice, and I came across the following things.

About the banking of the 6509: If you use the STA (zp),Y instruction to
the effective address $0000 or $0001, does it store in the banking
register, or does it store in RAM? E.g, with the following program:

.C:1000  A9 00       LDA #$00
         85 08       STA $08
         85 09       STA $09
         A9 00       LDY #$00
         B1 08       LDA ($08),Y
         91 08       STA ($08),Y
         00          BRK

accessing address $0000 in some bank, does this store in RAM or in the
banking register? And does the 6509-replacement do this correctly?

The second one: There is for more than a decade an open bug against VICE
https://sourceforge.net/p/vice-emu/bugs/147/
where the B128 burnin program cbm2-burnin.d80.gz (which can be found at
https://sourceforge.net/p/vice-emu/bugs/147/ ) reports a broken CIA
timer.

And because I have overhauled a lot of VIA and CIA emulation details
"recently", I just had to look at this when it was pointed out to me.

I tried to analyze the test program, to understand what it's actually
trying to test. As far as I can see, the test that fails sets timer A to
$8888 and starts it. Then 2 nested loops time how long it takes until the
Timer A bit in the ICR appears. Expected are 0x0A outer loops + 0xDB
inner loops, but actual was for me 0x0B outer loops + 4F inner loops.
Look at the annotations near $2575 in the file which I attached to the
bug.

This is not just a case of "almost correct but off by a small number";
this seems to be a difference of around 5-10% that the timer takes too
long. I am at a loss to explain this. Either the timer is much too slow,
or the cpu is much too fast...

Can somebody think of an explanation for this?

-Olaf.
-- 
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl_at_rhialto


Received on 2023-05-16 22:00:03

Archive generated by hypermail 2.3.0.