Just for fun, I made a blinky robot with a PIC32 emulating a 6502. Pictures and description on my blog.
The PIC32 is running a 65C02 emulator I wrote in MIPS assembly. Partly to test the emulator, I got Tali Forth 2 running on it and now use QEMU for MIPS so I can have Tali Forth 2 in my Linux terminal (blog post here). MIPS assembly is now my favorite assembly of all and a lot of fun to use.
The 65C02 program running inside the emulator is itself a 65C02 emulator (GitHub link). On the code I tested, it emulates at about 1/20th the speed of the real thing. When this emulator starts, it points to its own program code so you get an emulator in an emulator. Each new emulator emulates another emulator until it's five levels deep. The fifth level of emulation runs a tight loop blinking the LED eyes on and off as fast as possible. All the layers of emulation combine to reduce the execution speed down to a few hertz so the blink rate is once every 2 seconds or so.
Emulator 1 (MIPS) -> Emulator 2 (65C02) -> Emulator 3 (65C02) -> Emulator 4 (65C02) -> Emulator 5 (65C02) -> Emulator 6 (65C02) -> Blinky (65C02)
Blinky robot with emulated 6502
Re: Blinky robot with emulated 6502
Most obscure way to manage a timing loop!
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: Blinky robot with emulated 6502
Yes, but can it brew beer?
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: Blinky robot with emulated 6502
BigEd wrote:
Most obscure way to manage a timing loop!
Brilliantly perverse.
Makes me think of the omni-computer in the Douglas Adams books, "Hitchhiker's Guide To the Galaxy." Could it have been because of nested emulations that Deep Thought took centuries to deliver the enigmatic answer, forty-two?
-- Jeff
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
https://laughtonelectronics.com/Arcana/ ... mmary.html
Re: Blinky robot with emulated 6502
Hehe, could be, Dr Jefyll! I was thinking more like the movie Inception or The Matrix if the humans in the matrix had invented machines again and the machines made a matrix in that matrix.