Close

Adding 6502 support

A project log for Gigatron TTL microcomputer

Just because! A home computer without microprocessor

Marcel van KervinckMarcel van Kervinck 06/13/2019 at 00:155 Comments

The computer without microprocessor is becoming dual core.

Today it ran its first 6502 program.

All of the 6502 addressing modes are implemented, and a fair amount of instructions as well. The v6502 interpreter runs in place of the standard 16-bits application vCPU. Switching between the two virtual processors vCPU and v6502 is a matter of modifying a zero page variable. The video driver dispatches at the next available scan line, so very lightweight.

The impressive thing about the 476-byte Baum-Wozniak 6502 disassembler isn't just its size: it's that it seems to be secretly designed for 26 character wide displays. Now that's quite a foresight by these gentlemen! Here you see it running on the Gigatron, disassembling it's own code:

More details on the user forum: https://forum.gigatron.io/viewtopic.php?f=4&t=128

Discussions

Dylan Brophy wrote 3 days ago point

Woa!  But the 6502 and Gigatron do not run at the same time do they?  Because you must switch between processors, or do they?  It would be quite impressive if they did.

  Are you sure? yes | no

Marcel van Kervinck wrote 3 days ago point

The 6502 code is interpreted by native Gigatron code in almost the same way the 16-bits virtual CPU works. Switching between the two is just a few native instructions, so about a microsecond.

  Are you sure? yes | no

Dylan Brophy wrote 3 days ago point

Ok, that makes more sense.  It would be cool if it could indeed have two CPUs...  But I don't think that's the direction you are trying to go.  Anyway, an idea:  What if two Gigatrons were hooked up together, one only running the interpreter, and the other running and interpreter plus everything else, and they ran a multithreaded program?  Would be interesting.

  Are you sure? yes | no

Marcel van Kervinck wrote 3 days ago point

So you can say it runs 6502 code without a 6502. Even with about half of the logic that is in a real 6502.

  Are you sure? yes | no

Marcel van Kervinck wrote 3 days ago point

[Replying from 2 levels up because of HaD bug] I haven't tried, but I see no reason input port of one system can't be hooked to the other's output. In principle the input is 8 bits as well (we have a shift register in front to support famiclone game controllers, but just remove it).

  Are you sure? yes | no