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
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