|Question about writing assemblers email@example.com (Maliha Samad) (2000-02-15)|
|Re: Question about writing assemblers firstname.lastname@example.org (David Lindauer) (2000-02-15)|
|Re: Question about writing assemblers email@example.com (Sean Case) (2000-02-16)|
|Re: Question about writing assemblers firstname.lastname@example.org (Ian Lance Taylor) (2000-02-16)|
|Re: Question about writing assemblers email@example.com (2000-02-19)|
|From:||David Lindauer <firstname.lastname@example.org>|
|Date:||15 Feb 2000 22:13:42 -0500|
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 Lindauer mailto:email@example.com 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)
Return to the
Search the comp.compilers archives again.