Re: Question about writing assemblers

David Lindauer <camille@bluegrass.net>
15 Feb 2000 22:13:42 -0500

          From comp.compilers

Related articles
Question about writing assemblers maliha032@yahoo.com (Maliha Samad) (2000-02-15)
Re: Question about writing assemblers camille@bluegrass.net (David Lindauer) (2000-02-15)
Re: Question about writing assemblers gsc@zip.com.au (Sean Case) (2000-02-16)
Re: Question about writing assemblers ian@zembu.com (Ian Lance Taylor) (2000-02-16)
Re: Question about writing assemblers nr@wally.eecs.harvard.edu (2000-02-19)
| List of all articles for this month |

From: David Lindauer <camille@bluegrass.net>
Newsgroups: comp.compilers
Date: 15 Feb 2000 22:13:42 -0500
Organization: Bluegrass Net
References: 00-02-069
Keywords: assembler

Maliha Samad wrote:


> I am very confused as to whether I should write a hand coded assembler
> or should I use the existing tools like lex and yacc. The instruction
> set is written by my professor with almost 80 instructions. Can you
> please help me with this giving details of the pros and cons of


A lot depends on the specification of the assembly language. LEX would
probably provide a good foundation for the parsing process... but the
limited scope of an assembly language instruction kind of limits the
usefulness of YACC. If you have a lot of no-operand instructions you are
probably going to spend more time designing for YACC than you would just
coding it by hand. However, if you have lots of directives or a rich set
of addressing modes you can use YACC to good effect to do the parsing for
you... and that might save you time.


Two points - YACC and LEX are designed to be able to handle complicated
grammars, and most assembly languages are relatively simple grammar-wise.
Also you should factor in the time it will take you to learn to use these
tools effectively vs the amount of time it would take to code without them.


David
--
---------------------------------------------------------------
David Lindauer mailto:camille@bluegrass.net ICQ: 38422156
http://www.members.tripod.com/~ladsoft/index.htm (computer page)
http://www.members.tripod.com/~ladsoft/para/index.htm (awareness page)
http://www.members.tripod.com/~ladsoft/ttc/index.htm (tao te ching)


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.