* TinkerDifferent *
Retro Computing Community
Home | Forums | What's New | Search | Settings
6o6: virtualizing the 6502 on the 6502

Forums > Vintage Commodore > 8-bit Micro's

ClassicHasClass
Tinkerer
--------
Joined: Aug 30, 2022
Posts: 386
Likes: 215
Apr 28, 2024 - #1
This is something I've literally tinkered with for over twenty years, so it's time to clean it up and open source it, along with the Incredible KIMplement 1.0, its original demonstration application (a KIM-1 emulator that runs on a Commodore 64).

6o6 "6502-on-6502" presents a full NMOS 6502 to software, virtualizing the ALU for speed so that we get correct results and flags "for free." It has a completely abstracted memory model and can trap illegal instructions and faults. Depending on the complexity of the kernel and harness it runs about 50 host instructions for every guest instruction, which translates to something around 30-50 times slower than native code depending on instruction mix. It requires no special hardware.

It is comprehensive enough to pass Klaus Dormann's functional test and can even virtualize itself ... virtualizing itself.

Four demonstrations are included. The first three can run on a C64 or C128 (in C64 mode), or on an Apple IIe/c/gs with at least 64K of memory. One is a simple hello world, one is an "inception" demo that virtualizes hello world, then virtualizes itself virtualizing hello world, then virtualizes itself virtualizing itself virtualizing hello world, and one is a simple two-task kernel. The fourth requires a C64 with a geoRAM or compatible expander. It presents a full 64K addressing space of the RC2014 computer with a 6502 CPU, but the entirety of the guest runs completely within the geoRAM.

A more indepth discussion: https://oldvcr.blogspot.com/2024/04/virtualizing-6502-with-6o6-and.html

Liked by trag,Nixontheknight,warmechand 2 others

lauland
Tinkerer
--------
Joined: Dec 12, 2023
Posts: 39
Likes: 28
May 10, 2024 - #2
"Yo dawg, I heard you liked 6502's...so I put a 6502 in..."...oh wait, you already did that...

You didn't mention if you implemented the classic 6502 bugs...bet you were tempted!

Celebrating The 6502 With Song

In a wonderful ode to tech nostalgia, The Taylor and Amy Show, comprised of YouTubers [Taylor] and [Amy], have released a new video "THE 6502 SONG". This song had me singing along in roughly ...
[Image: hackaday.com] hackaday.com
Attachments:
hackaday.com [View]
hackaday.com [View]

Liked by Kai Robinson

ClassicHasClass
Tinkerer
--------
Joined: Aug 30, 2022
Posts: 386
Likes: 215
May 10, 2024 - #3
I thought about it, and it does implement the same NMOS behaviour for things like jmp ($xxff), but eventually I'd like to have it cover CMOS as well.

trag
Tinkerer
--------
Joined: Oct 25, 2021
Posts: 303
Likes: 151
May 14, 2024 - #4
IIRC, the VHDL text book my class used way back when contained the VHDL code for a 6502 in the back as an appendix. Of course, that would be for FPGAs, but thought I'd mention it.

Later Edit: 6805, not 6502. So completely irrelevant. Sorry.

Page 1 of 1

Home | Forums | What's New | Search | Bookmarks | RSS | Original | Settings
XenForo Retro Proxy by TinkerDifferent.com