Re: YACC grammar for 8085 assembler.

Bill Cox <bill@qswtools.com>
Fri, 14 Dec 2007 12:23:11 -0800

          From comp.compilers

Related articles
YACC grammar for 8085 assembler. wlyons@uvic.ca (Dale Lyons) (2007-12-13)
Re: YACC grammar for 8085 assembler. bill@qswtools.com (Bill Cox) (2007-12-14)
Re: YACC grammar for 8085 assembler. DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-12-14)
Re: YACC grammar for 8085 assembler. fredjscipione@alum.rpi.edu (Fred J. Scipione) (2008-01-06)
| List of all articles for this month |
From: Bill Cox <bill@qswtools.com>
Newsgroups: comp.compilers
Date: Fri, 14 Dec 2007 12:23:11 -0800
Organization: AT&T http://yahoo.sbc.com
References: 07-12-052
Keywords: parse, assembler
Posted-Date: 15 Dec 2007 14:08:02 EST

Dale Lyons wrote:
> Hi,
>
> I am looking for a YACC grammar for 8085 assembler.
>
> It does not have to be a perfect working grammar; any "starter" grammar
> which will get me on the right track will do just fine.
>
> I've search a bit, but couldn't find such a grammar. Help ?


I've written a dozen or more assemblers, and another half dozen with a
specialized YACC-like tool. The tool made the more complex assembly
codes easier to write, but wasn't *necessary* at all. The only part
where I see a grammar helping is in expression parsing. Parsing the
opcodes and arguments, outside of expressions, is very
straight-forward IMO.


In more complex languages, like 8086, there is some non-trivial
parsing of the address expressions, and alternate argument patterns.
I'd say, for the 8080, just go for it.


Have you looked at the GNU assembler? It's *very* portable, and might
offer some inspiration. Here's the doc:
http://www.gnu.org/software/binutils/manual/gas-2.9.1/html_mono/as.html


In fact, it might be easier to add the 8080/8085 to the GNU assembler,
and we would all benefit from your work. What machine are you hosting
the assembler on? Are there constraints on the output object file
format? If not, I highly recommend ELF format, possibly in a not-yet-
invented16-bit variation, since that's the address size of the 8080.



Post a followup to this message

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