Page 2 of 14

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 12:56 pm
by BigEd
It passes!
My mistake was not to have disabled the interrupts from the system VIA. Although I start with an SEI, the various PLP instructions will sometimes perform an implicit CLI.

Cheers
Ed

To get diagnostics in the absence of a monitor, I changed all the self-looping traps to macro calls. In my case I write out the (stacked) PC to the UART, but writing to screen RAM would be another approach.

Code: Select all

fail        macro
            jsr printPCandStop
            endm

failbne     macro
            beq skip\?
            fail
skip\?
            endm

failbeq     macro
            bne skip\?
            fail
skip\?
            endm
and so on for the other branch types.

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 1:54 pm
by Klaus2m5
BigEd wrote:
It passes!
My mistake was not to have disabled the interrupts from the system VIA. Although I start with an SEI, the various PLP instructions will sometimes perform an implicit CLI.

Cheers
Ed
Oh, good! I am currently working on a version that has an option for I-flag behavior. You can then choose to force interrupts disabled or enabled or even keep the current status of the I-flag. Of course SEI & CLI can only be tested with the old behavior as the preferred option.

And yes, the test tries to see, wether flags interfere with each other. So in the old behavior it turns all flags off (including I, enabling interrupts), runs some test instructions, turns all flags on, runs the same instructions again. The reason for this lies in the original target of this test. Emulators have to shuffle their own CPUs flags and some purely emulated flags to form the 6502 flags. A lot of things could go wrong with this...

Thanx for the good news!

cheers, Klaus

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 5:46 pm
by Mike Naberezny
BigEd wrote:
I'd also like to test Mike's py65, and my own a6502. And it would be good to test Arlet's VHDL core as well!
I'd be very interested in the results on Py65. Through the work of Ed and a few others, Py65 is complete enough to run many programs like EhBASIC but it may still have some issues. Py65 mostly uses the same memory mapped I/O as the Kowalski simulator so one binary should be able to test both.

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 6:05 pm
by BigEd
Mike Naberezny wrote:
BigEd wrote:
I'd also like to test Mike's py65, and my own a6502. And it would be good to test Arlet's VHDL core as well!
I'd be very interested in the results on Py65. Through the work of Ed and a few others, Py65 is complete enough to run many programs like EhBASIC but it may still have some issues. Py65 mostly uses the same memory mapped I/O as the Kowalski simulator so one binary should be able to test both.
I just started it running, but I'm not sure how long it might take.
Cheers
Ed

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 6:14 pm
by BigEd
oh - it's finished, and passed!
(I didn't set the ROM vector function, because py65 treats BRK as a stop, therefore BRK isn't tested.)

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 6:35 pm
by Klaus2m5
Hi all,

a new version of the source is available.

added a code switch to control, how the interrupt flag should be handled.
added a code switch to control, wether the code will be build as a single image or as separate records for zero page and data space.
Needless to say, that all options ran successfully on my little emulator.

cheers, Klaus

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 6:54 pm
by Mike Naberezny
BigEd wrote:
oh - it's finished, and passed!
Wow, that was unexpected. ;)

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 7:13 pm
by BigDumbDinosaur
Mike Naberezny wrote:
BigEd wrote:
I'd also like to test Mike's py65, and my own a6502. And it would be good to test Arlet's VHDL core as well!
I'd be very interested in the results on Py65. Through the work of Ed and a few others, Py65 is complete enough to run many programs like EhBASIC but it may still have some issues. Py65 mostly uses the same memory mapped I/O as the Kowalski simulator so one binary should be able to test both.

Speaking of the Kowalski simulator, it's now up to version 1.2.12.

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 8:08 pm
by whartung
Has anyone ported this to an assembler that doesn't run on Windows? My own assembler doesn't support the expressions (notably the logical operators), nor is it a macro assembler (but I used m4 for that). I tried another assembler, a java based one, and it just fails with an null pointer exception.

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Mon Jul 30, 2012 8:36 pm
by BigEd
I've been working exclusively on linux. I looked around for a suitable assembler, and then noticed that Klaus had given directions in the header of the file. It's not open source but it does have a binary for linux.
Cheers
Ed

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Tue Jul 31, 2012 3:35 am
by whartung
Yea I saw that too, but being on a Mac, a Linux binary doesn't do me much good.

Thanks, though.

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Tue Jul 31, 2012 5:20 am
by BigEd
Ah! A virtual machine might be the answer - VirtualBox or Qemu perhaps. (Or Parallels if $80 isn't an obstacle)

But: apparently WINE works on Mac these days - that must be the first port of call. I use WINE (on linux) even for GUI applications (such as Kowalski) but it's particularly likely to work for command line ones - I just checked and it's fine for Kingswood's as65.exe

Cheers
Ed

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Tue Jul 31, 2012 5:33 am
by BigEd
BTW, I just ran Klaus' test on Kowalski, both version 1.2.6 from last year, and the latest version as of today, and both pass. Like py65, BRK is treated as a stop, so that's not tested.
Cheers
Ed

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Tue Jul 31, 2012 7:01 am
by Klaus2m5
BigDumbDinosaur wrote:
Speaking of the Kowalski simulator, it's now up to version 1.2.12.
Tested the newest (above mentioned) version and it passed. However, in the simulator options 1st tab you can change the instruction which causes the simulator to stop to something else than BRK.

So I ran the full test and it failed in the BRK test while checking the flags pushed onto the stack by LDA from page $100, expected $30 - actual $10. It expects to see the unused bit on but it isn't.

For the test I will pick up Eds idea to implement all traps as macros, so one can change the way the test reacts to a bug or even successfull completion.

cheers, Klaus

Re: Functional Test for the NMOS 6502 - request for verifica

Posted: Tue Jul 31, 2012 5:22 pm
by BigEd
Ah, nicely found. My a6502 flags handling also needs attention, but to get to the bottom of it I need to improve the tracing control.