• Please review our updated Terms and Rules here

6o6: virtualizing the 6502 on the 6502 (and KIMplement 1.0)

ClassicHasClass

Veteran Member
Joined
Mar 22, 2013
Messages
1,818
Location
(not so) sunny (No) So Cal
Source code is, after twenty years (!), available. 6o6 provides a virtual NMOS 6502 on a 6502, 65C02 or 65816 in 8-bit mode. It completely abstracts memory access, allowing memory to be remapped, and it uses the host ALU for accurate results and flags. It supports all documented opcodes, can pass Klaus Dormann's functional test, and can virtualize itself ... virtualizing itself. The ratio of guest to host instructions varies, but is about 50 depending on the complexity of the harness and kernel, running about 30-50 times slower than actual code depending on opcode mix.

This isn't (primarily) intended for people developing their own hardware, although it can serve that purpose, and it can be engineered to use hardware assist (like external memory, MMUs, etc.). Instead, it's meant for simpler systems or extant NMOS/CMOS machines that lack memory management but still need a controlled environment to run code.

Sample binaries of the four example programs are available for the C64 (all four) and the Apple IIe/c/gs (three of the four). These examples include a basic hello world, virtualizing itself virtualizing itself virtualizing hello world, a simple two-task kernel, and (C64 only) running the RC2014-6502 ROM with EhBASIC and monitor completely from an external geoRAM.

6o6 was originally written for the Incredible KIMplement, which emulates a KIM-1 on a C64. That is now open source as well.

Further discussion: https://oldvcr.blogspot.com/2024/04/virtualizing-6502-with-6o6-and.html
Github for 6o6 and pre-built binaries: https://github.com/classilla/6o6
KIMplement main page: https://www.floodgap.com/retrobits/kim-1/emu.html
Github for KIMplement: https://github.com/classilla/kimplement/
 
Back
Top