And then it passes to the handle function: int handle_instruction ( char* instruction, intmax_t data, size_t size ) Addresses and user variables is hold in hash tables (UThash is used).Įach instruction user wrote is converted to the specific form, like DJNZ %#.2x in this example (if Bison was able to form the string and it is correct). The first one there is only dry run in order to calculate labels' offsets, expand macroses etc. Source code is parsed by means of GNU Bison/Flex two times. The table itself is the same for assembler and disassembler. I created a table describing each instruction I found on the Net: typedef struct I want to know whether my idea is weird, wrong, bad by design or not so bad. I have never hacked others' assembler source codes as I want to do it the way I imagine it. I want to implement all known instructions, like LD D, RES 0, (IX + n) even if it will never be used. So I started from assembler/disassembler for Linux, though there is a lot of Z assemblers. One of my wishes not only make hardware, but software too. I have a long-term project: DIY computer with various processors.
0 Comments
Leave a Reply. |