|Writing Assembler! email@example.com (Khoo Kiak Wei) (1997-05-13)|
|Re: Writing Assembler! firstname.lastname@example.org (1997-05-14)|
|Re: Writing Assembler! email@example.com (Clark L. Coleman) (1997-05-16)|
|Re: Writing Assembler! firstname.lastname@example.org (1997-05-17)|
|Re: Writing Assembler! email@example.com (Ben Bullock) (1997-05-17)|
|Re: Writing Assembler! firstname.lastname@example.org (1997-05-17)|
|Re: Writing Assembler! email@example.com (Mr J R Hall) (1997-05-22)|
|Re: Writing Assembler! firstname.lastname@example.org (JUKKA) (1997-05-22)|
|Re: Writing Assembler! email@example.com (Charles Fiterman) (1997-05-22)|
|Re: Writing Assembler! firstname.lastname@example.org (1997-05-25)|
|Re: Writing Assembler! email@example.com (1997-05-25)|
|[12 later articles]|
|From:||Ben Bullock <firstname.lastname@example.org>|
|Date:||17 May 1997 00:09:16 -0400|
|Organization:||University of Cambridge, England|
Khoo Kiak Wei wrote:
> I am planning to write a generic assembler, as a work of learning
> flex and bison. However, after reading a book on Lex and Yacc, I am
> still confused on how should I start!?
Is it actually necessary or useful to use bison to write an assembler?
I can't think of where you need to use recursion, unless it's for some
kind of preprocessing.
Also, if you try and make a generic assembler, you are actually
dealing with several different languages.
This doesn't sound like a good place to use flex to me, because you
don't know what patterns you want to match at compile-time.
If you wanted to make an assembler for just one particular instruction
set it might be more useful to use flex.
> If any of you know of any sample code on assembler or good books talking
> on the assembler construction, I would like to hear from you please!
There are several freely available assemblers. One is the gnu generic
assembler gas. Another one is nasm, for intel x86 chips. Neither of
these use things like flex or bison though, except gas uses bison
somewhere for one particular chip (even then it says in the comments
that that is overkill).
Ben Bullock @ Cavendish Laboratory, University of Cambridge, UK.
* FOAM = Fast Operating Algebraic Manipulator - read about it at
the foampage : http://pcae.hep.phy.cam.ac.uk/ben/foam/foam.html
download it : ftp://pcae.hep.phy.cam.ac.uk/pub/bullock/foam.tar.gz *
Return to the
Search the comp.compilers archives again.