Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: Best tools for writing an assembler? Date: Wed, 19 Feb 2014 04:25:33 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 21 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-02-020@comp.compilers> References: <14-02-018@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1392848519 93590 64.57.183.58 (19 Feb 2014 22:21:59 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Wed, 19 Feb 2014 22:21:59 +0000 (UTC) Keywords: assembler Posted-Date: 19 Feb 2014 17:21:59 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:1099 tpphysik@gmail.com wrote: > 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. The easiest way to write an assembler is to write macros for an existing macro assembler that will generate the appropriate bytes. (Assuming memory is byte oriented.) That also gives you a macro facility without extra work. You don't say if you need macros, though. Otherwise, it should be pretty easy with flex/bison. -- glen