What's new

Introduction to Dynamic Recompilation in Emulation


New member
Hi everyone!

Over 4 weeks late last year I set out to learn and discover how to create a dynamic recompiling emulator, after having completed building a basic interpretive emulator for the Chip8 system. Over this time I have learnt that making a dynamic recompiler is not an easy task - it is much more complicated than your basic interpreter emulator.

As such, I want to share what I have learnt by the way of a guiding document in conjunction with full source code of a dynarec core Chip8 emulator. The document and source code will attempt to teach you about the core ideas behind a dynarec core, such as about the translator, emitter and caches. It also dives into some problems you may encounter for the Chip8 system, such as dealing with jumps (and provides solutions).

This document is targeted at people new to dynamic recompilation in emulation. Even if you are not familiar with the Chip8 system, I still encourage you to read this if you are interested in making a dynarec emulator and are familiar with the interpretive process. If you have not made any emulator and are intersted in this, I suggest starting with making an interpreter for the Chip8 system as it is really easy to learn about.

If you have any questions or (constructive!) criticism, please send an email to me (preferred, listed in the document) or post a message on the forum. I will try to answer where I can.

Document: https://github.com/marco9999/Dynarec_Guide
Emulator: https://github.com/marco9999/Super8_jitcore/tree/edu (Edu branch is simplified over the master branch, recommended for people learning. The guide also follows this branch.)

Good luck!


New member
Logged in (for the first time in how many years) to reply here. This is excellent. I've been reading Schibo's guide to dynarec as well. Both very helpful!