![]() I remember writing my own assemblers and disassembled back in the 80s. The parsing itself for a simple assembler would then be a matter of a few hours of work, even if you've never done it before. Now you'd have alternatives for this, of course: you can implement a very basic assembler with a very simple parser, and then support constants and macros using an existing preprocessor to preprocess the input assembly code. It's not ultra difficult, certainly, but if you've never implemented that before, it will probably be much harder to get right than you initially thought. But now if you want to support complex expressions - needed for defining constants, for instance, or for implementing some kind of macro-assembler, then it becomes a bit more complex. Merely translating assembly code is easy. (Or you may reply that it does, but it's such a simple "parser" of binary data that it wouldn't make sense to use a classic parser for this.) For an assembler, you'll need a parser, and then its complexity will largely depend on what you really want to support in your assembler. Of course a disassembler alone (which was the original topic) doesn't require any kind of parser. But, in any case, it also depends on what exactly you want to implement. Now if OTOH, you master those tools, and are actually less inclined to write a parser yourself, then why not. then it's not just overkill, but also a huge waste of time IMHO. Unless you actually want to take such a project as an opportunity to learn lex/yacc/bison.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |