Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!news.misty.com!news.iecc.com!.POSTED!nerds-end From: noitalmost Newsgroups: comp.compilers Subject: Re: Best tools for writing an assembler? Date: Sun, 23 Feb 2014 11:22:34 -0500 Organization: Compilers Central Lines: 21 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-02-030@comp.compilers> References: <14-02-018@comp.compilers> <14-02-021@comp.compilers> <14-02-023@comp.compilers> NNTP-Posting-Host: news.iecc.com Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: miucha.iecc.com 1393172946 95335 64.57.183.58 (23 Feb 2014 16:29:06 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sun, 23 Feb 2014 16:29:06 +0000 (UTC) Keywords: assembler Posted-Date: 23 Feb 2014 11:29:06 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1109 Since it hasn't come up in the discussion, I'd like to mention linking and loading. You should at least be aware of what they do, especially the loader. I wouldn't bother with any generation tools like flex or bison, unless you want to gain experience with those tools for some other project. Since it's your own architecture, which has no native tools, you'll be cross-compiling so speed of the assembler won't matter. It'll be a long time before you write a program for your architecture that'll take longer than a second to compile, even if you use Perl. So the language you use should be the one you know best. My bias is toward C++, but it really won't matter in your case. I think that by hand-writing your own scanner and parser, you'll get to know your assembly syntax better. And unless you have something really strange, simple recursive descent will work fine for the parser. First, just get something that works for a simple assembly program. That'll give you the encouragement to add a few more features. Then you're off and running.