3 ms·
> So currently I don’t see how JIT-ing could work with reasonable programming effort and performance for emulating entire 8-bit computer systems. I don't know
by mikepavone 9y ago
> So currently I don’t see how JIT-ing could work with reasonable programming effort and performance for emulating entire 8-bit computer systems.
I don't know about the reasonable effort part, but I was able to get decent performance with this approach in BlastEm. It takes about 33.5s to run zexdoc on my laptop, which is faster than even the "instruction granularity" version in the article (~37.5s) despite running on a slower machine (2.2GHz base clock vs 2.8GHz base clock). It can pause both at the beginning of an instruction and at any non-instruction fetch memory access. Unfortunately, it can't currently accommodate wait-states on instruction fetch.
Fixing that is on my to-do list and I have a decent idea of how to do it without killing performance. I'm also flirting with a re-write of that will enable better performance generally. My current approach is pretty naive (doesn't even do redundant flag calculation elimination), but my handling of self-modifying code makes it hard to safely improve that without some fairly major changes.