6502 simulator

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

6502 simulator

Post by nroff-man » Fri Feb 27, 2015 12:58 am

Hi :-)

Contrary to my upgrade of the chipKIT Pi to the MX270 at 48 MHz now
I demonstrate how we can slow down the chipKIT Pi by simulating an
8-bit MPU (micro-processing unit) from yesteryear.

The chosen device is a 6502, mostly because I am familiar with it and
also because I started work on this before and now this project is
concluded.

The method to do this on the chipKIT Pi is documented here:
http://wiki.kewl.org/dokuwiki/projects:ape65

Once up and running you can connect using `picocom' to the virtual
MPU which has an assembly code monitor interface which you may
or may not be familiar with (this depends on how ancient you are) :-)

Have fun, bye bye

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: 6502 simulator

Post by Jacob Christ » Mon Mar 02, 2015 5:13 am

Way cool... Can you emulate the Antic chip of an Atari 800 next?

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: 6502 simulator

Post by nroff-man » Mon Mar 02, 2015 8:18 pm

hi
Jacob Christ wrote:Way cool... Can you emulate the Antic chip of an Atari 800 next?

Jacob
I am sorry to say that I hardly know a thing about the ATARI Antic and have no
idea how to emulate it.

What I do know is I had an 800XL which was among a number of computers I threw
to the rubbish or gave away over 10 years ago which does make me sad. The
only 8-bit computer I have now is a Commodore plus/4 which I got on eB*y.

This simulator on the ChipKIT Pi emulates the MPU and an 8-bit
I/O port for the LEDs and the switch input and few GPIOs. It could be possible
to extend it for video, perhaps the plus/4 TED chip but it would take
the work of someone really dedicated, I am not sure that sounds like me :-)

Thanks, bye-bye

User avatar
Jacob Christ
Posts: 723
Joined: Sat May 28, 2011 6:34 am
Location: Southern California
Contact:

Re: 6502 simulator

Post by Jacob Christ » Mon Mar 02, 2015 9:01 pm

It was a tongue in cheek request...

I have an Atari 128XL and an Atari 1040ST holding down some cardboard on some shelves in my garage.

Jacob
PONTECH Quick240 an industrial form factor platform for chipKIT and Arduino users.

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: 6502 simulator

Post by nroff-man » Mon Mar 02, 2015 9:49 pm

Hi
Jacob Christ wrote:It was a tongue in cheek request...
At the very least my copy of the `Programmer's Reference Guide the ATARI 400/800 Computers" got
pulled off the book shelf for the first time in years :-)

The book doesn't seem to go into great detail about the ANTIC.
I have an Atari 128XL and an Atari 1040ST holding down some cardboard on some shelves in my garage.

Jacob
I have never used them but did program the ANTIC successor, called the COPPER on an Amiga.

Simulating the 68000 MPU does sound interesting, it's a legendary MPU and anyone
exposed to it would have loved programming it.

Hmm.

Bye-bye :-)

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: 6502 simulator

Post by nroff-man » Tue Mar 03, 2015 1:36 am

Hi.

I am not a great fan of BASIC but of course used it when young
and have now added EhBASIC for 6502 to the PIC32 versions
of this simulator.

EhBASIC was written in 6502 assembly code and runs on the virtual
MPU. It seems to work as expected but not much testing done as yet.

I will add some documentation to my wiki later.

Here is a demo.

Code: Select all

MCS 6502 Simulator & Debugger.
------------------------------
D.M.Broad.(c)
August 1989 & February 2015.

EhBASIC at $FF80 by Lee Davison

APE65 - Enter ? for HELP
APE65 - Enter GFF80 for BASIC

   PC  SR AC XR YR SP NV.BDIZC
; 0000 30 00 00 00 FF ..11....
GFF80

6502 EhBASIC [C]old/[W]arm ?

Memory size ? 8192

7423 Bytes free

Enhanced BASIC 2.22

Ready
10 PRINT "CHIPKIT RULEZ OK ";
20 GOTO 10
RUN
CHIPKIT RULEZ OK CHIPKIT RULEZ OK CHIPKIT RULEZ OK
Break in line 10
Ready

nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: 6502 simulator

Post by nroff-man » Mon Mar 09, 2015 1:19 pm

hi

@majenko

this simulator now works on the SDXL board and is loaded
using via usb boot loader and is not stand-alone.

I have not completed work on this as yet. there is no virtual i/o port.
for example, and this will come later.

the console is on UART2 as before, it would be good to somehow
reuse the virtual com port from the boot loader but I have no
idea about that as yet.

bye-bye

pito
Posts: 193
Joined: Sun May 22, 2011 9:37 pm

Re: 6502 simulator

Post by pito » Mon Mar 16, 2015 7:08 pm


nroff-man
Posts: 40
Joined: Wed Oct 01, 2014 6:05 pm

Re: 6502 simulator

Post by nroff-man » Mon Mar 16, 2015 9:08 pm

lo
That seems to be something called FAKE6502 and it looks buggy.

Try this test suite, see how it goes.
https://github.com/Klaus2m5/6502_65C02_functional_tests

Bye-bye

User avatar
majenko
Site Admin
Posts: 2181
Joined: Wed Nov 09, 2011 7:51 pm
Location: UK
Contact:

Re: 6502 simulator

Post by majenko » Mon Mar 16, 2015 10:38 pm

I know it's not 6502, but the vastly superior Z80, but all this talk of retro home computers gave me a yearning...

So I knocked up this little animation on a MAX32 ;)

https://youtu.be/eon64wl8hY0
Why not visit my shop? http://majenko.co.uk/catalog
Universal IDE: http://uecide.org
"I was trying to find out if it was possible to only eat one Jaffa Cake. I had to abandon the experiment because I ran out of Jaffa Cakes".

Post Reply