Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

6502 cpu + memory test

Name: Extern 2006-12-16 1:42

Any 6502 architecture runs on pretty old hardware.  Having a reset routine that would completely test all CPU/ROM/RAM would be beneficial to any new applications that run on 6502 architectures.

Let's try to write a routine that can absolutely confirm that as much of the actual 6502 CPU plus any found ROM or RAM is working as is possible.  It'd be more of a challenge than you'd initially think because you cannot use a component such as a register or memory location in the test until you confirm that it works.

Assume this routine exists in ROM and that there is guaranteed to be RAM at $180-$1FF.  Locations of RAM and ROM should ideally be available in a lookup table if this is possible.

Name: Anonymous 2006-12-16 1:49 (sage)

do your own homework

Name: Anonymous 2006-12-16 4:11

Yeah, what >>2 said. Also, is it guaranteed that there is RAM at $00-$FF? I mean, a 6502's pretty useless without the zero page. What with the indirection and all, unless you want to go self-modifying and I know a bunch of people who'll kill you for suggesting such a thing.

Name: Anonymous 2006-12-16 4:24

>>3
Routine is in ROM.  Self modify won't work.  And, self-modifying 6502 kicks ass (remember, this is before pipelines/caches/register renaming/supervisor/user mode/MTRRs and all that good stuff)

I was thinking of Atari 2600 architecture, where $180-$1FF is mirrored with $80-$FF.  However, let's use labels.

ZP0, ZP1, ZP2, ZP3 are four bytes of zero-page RAM
and we can use the top four bytes of the stack $1FC-$1FF.

General plan:
1) Test CPU
2) Test ROM
3) Test RAM

Some thoughts:
1) It gets complicated because to do some tests on CPU and ROM, we need some RAM, but we need to test those RAM locations first.

2) The test routine is in ROM, but what if the locations of ROM that the test routine is in is itself corrupted?  Is there any way to make the code robust enough to survive a few corrupt bytes?

Name: Anonymous 2006-12-27 21:54

Um, read trough the C64 KERNAL?
Then read the 1541 ROM listing?
All here: http://www.the-dreams.de/aay.html

For a simple memory test of one byte:
;First we check if the byte returns all bits set
LDX #$FF
STX $00
LDX $00
DEX
BNE Fail
;Then we check if the byte returns all bits clear
STX $00
LDX $00
BNE Fail
JMP NextTest
Fail:
JSR EmitFail
JMP *

For more than one memory cell modify it as you see fit.

Name: Anonymous 2006-12-28 4:40

>>5
Well, it's more involved than just writing a simple loop that STA's then LDA's from memory.  I want a COMPLETELY ROBUST test, that means:

 - the CPU itself is tested and established as working.
 - the ROM that contains the test is itself tested and established as working as well.
 - the problem of testing the ROM itself - It seems like sort of a chicken and egg problem to me; you can't test RAM or even CPU until you establish that the CPU is working, however, the program that does so is in ROM and therefore you'd have to establish the ROM is working beforehand.

I would like to write something that tests and logically verifies as much as possible, even though some stuff will have to be assumed, etc.

Furthermore I want to test for addressing errors as well, so it's a bit more involved.

Name: Anonymous 2006-12-28 10:23

Name: Anonymous 2009-01-14 14:36

WTF

Name: Anonymous 2009-03-06 9:24

because I thought I   should let you   know of something   like 3 4   1 1 4   1 5 5   0 0 4   or later and   assume as little   prior exposure to   languages With combination   of these two   things compared to   how much you   will six months   lots of stuff   that passes for   modern technology there.

Name: Anonymous 2010-12-27 8:02

Name: Anonymous 2011-02-03 7:31

Name: Anonymous 2011-11-28 5:46

SHIT DICK

Name: Sgt.Kabu�kimanᄆ繋 2012-05-28 21:18

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List