Re: YACC grammar for 8085 assembler.

Bill Cox <>
Fri, 14 Dec 2007 12:23:11 -0800

          From comp.compilers

Related articles
YACC grammar for 8085 assembler. (Dale Lyons) (2007-12-13)
Re: YACC grammar for 8085 assembler. (Bill Cox) (2007-12-14)
Re: YACC grammar for 8085 assembler. (Hans-Peter Diettrich) (2007-12-14)
Re: YACC grammar for 8085 assembler. (Fred J. Scipione) (2008-01-06)
| List of all articles for this month |

From: Bill Cox <>
Newsgroups: comp.compilers
Date: Fri, 14 Dec 2007 12:23:11 -0800
Organization: AT&T
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:

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.