X-Received: by 10.236.85.100 with SMTP id t64mr11817329yhe.29.1392782424019; Tue, 18 Feb 2014 20:00:24 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news.glorb.com!f11no23923382qae.1!news-out.google.com!dr7ni1022qab.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED!nerds-end From: tpphysik@gmail.com Newsgroups: comp.compilers Subject: Best tools for writing an assembler? Date: Tue, 18 Feb 2014 16:04:20 -0800 (PST) Organization: Compilers Central Lines: 17 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-02-018@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 X-Trace: miucha.iecc.com 1392782421 33499 64.57.183.58 (19 Feb 2014 04:00:21 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 19 Feb 2014 04:00:21 +0000 (UTC) Keywords: assembler, question Posted-Date: 18 Feb 2014 23:00:21 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Content-Type: text/plain; charset=ISO-8859-1 Xref: csiph.com comp.compilers:1097 Hello, I want to write an assembler for my own processor architecture. It would be of middle complexity. What language/tools would you use? I'm thinking of perl or C++, maybe with some (which?) program library. What about flex/bison, are those good for this, how hard are they to use? Once I have written a very simple assembler in C++, but now I want more functions and proper error messages as well. Thank you for your help. [An assembler isn't very different from any other compiler except that the code generator is a lot simpler. Flex and bison are well suited for most assembler syntax, write your code in C or C++ as you prefer. (You can probably guess which book I'd recommend.) There are some reasonable parser tools for Java, Perl, and python now which could make sense if you don't need your assembler to run extremely fast. -John]