3 ms·
Shameless plug: My Rust 6502 emulator used macros for opcode decoding as well. CPU emulation is an ideal use case for Lispy macros: the addressing mode and opco
by pcwalton 13y ago
Shameless plug: My Rust 6502 emulator used macros for opcode decoding as well. CPU emulation is an ideal use case for Lispy macros: the addressing mode and opcode combinations have a lot of closely related code that's amenable to macro factoring, and having the interpreter, JIT (if present), and disassembler share code is a nice application as well.
- redline6561 13y agoHi, Patrick! Sprocketnes has been helpful reading as I've worked on my own emulator. Ian Piumarta's lib6502 uses plain C macros. It's even almost as short as cl-6502...though I don't think it's quite as readable. ;) Keep up the great work on Rust, been waiting on the gc/scheduler stuff to shake out a little bit. Looking forward to 0.8!
- jevinskie 13y agoLLVM invented the tablegen language to do this in C++.