3 ms·
Had to read the title 3 times. It's... actually readable? For example https://gitlab.brokenpipe.de/stettberger/avremu/-/blob/master/source/simple-testsuite.tex
by leonheld 2y ago
Had to read the title 3 times.
It's... actually readable? For example https://gitlab.brokenpipe.de/stettberger/avremu/-/blob/master/source/simple-testsuite.tex https://gitlab.brokenpipe.de/stettberger/avremu/-/blob/maste... hits me as a very usual pattern to write emulators.
- Lerc 2y agoI made an AVR emulator in Haxe/JavaScript. It turned out to be more awkward than I expected. Most 8-bit processors have instructions fairly clearly specified in the first byte. So the bulk of the decoding work can be done with a small jump table. The avr is more bit packed. Due to the way I progressively implemented the instructions I ended up with a kind-of tree of case statements. At some stage I'd like to go back and have a converter to a larger but easier to decode format. Instructions being in ROM(ish) and being easy to detect when updated means AOT is easy enough to do. It might only need 32 bits per instruction. Opcode in the first byte and then byte aligned operands.
- deleted 2y ago[deleted]