![]() The disassembler can be generated completely. The fields are: opcode, nemonic, addressing mode, instruction bytes, cycles to execute, effected flags. I formatted the data is formatted as csv - python has built-in functions to manipulate CSV. The scripts are written in python tested in python 2. Then assuming the source data is correct, the generated data will also be correct. I wrote a file full of data about the opcodes, and wrote scripts to generate several different things. So I tried an approach to try to get the best of both worlds - straightforward, clean code but with the mistake avoidance of the macro approach. At first, I thought that the people that wrote them were trying to be clever and avoid duplicate code, but the cleverness greatly obfuscated complicated the code. If you examine the source code of a lot of different emulators, they are usually a big morass of embedded macros.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |