[comp.compilers] 8051 assembler

hgw@rht32.PCS.COM (h.-g. willers) (03/13/91)

As I have seen from the latest issue of "The C Users Journal", they have a
8051 Assembler (among others) in source form. I'll quote from the
announcement:

> CUG335 Frankenstein Cross Assemblers
>
> Mark Zenier (WA) has submitted a collection of cross-assemblers
> written in the combination of Yacc and C. Inspired by Will Coley's
> cross-assemblers ( .. ) for 8- and 16-bit microcomputers: RCS 1802-1805,
> Signetics/Phillips 2650, Hitachi 6301-6303, Mos Technology/Rockwell
> 6502, Motorola 6805, 6809, 68hc11-6801-6800, Texas Instruments tms7000,
> Intel 8041-8048, 8051, 8085, 8096, Zilog Z8, Z80.

The C Users Group Library is the world's largets holding of public domain and
Shareware C software and is composed primarily of submissions by members.

The editor of "The C Users Journal" is currently P.J. Plauger
(pjp@plauger.uunet.com). Contributing editors are Rex Jaesche, Kenneth Pugh,
Dan Saks, Don Libes, Victor Volkman and Sydney Weinstein.

Contact The C Users Group
	2601 Iowa, Lawrence
	KS 66046
	(913)841-1631


    Hans-Guenther

--
H.-G. Willers       PCS-Mail: hgw       internal phone ( -271 )
DOMAIN:  hgw@rht32.pcs.de   (EUR) or  hgw@rht32.pcs.com    (US)
BANG:    ..unido!pcsbst!hgw (EUR) or  ..pyramid!pcsbst!hgw (US)
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

dik@cwi.nl (Dik T. Winter) (03/15/91)

 > > CUG335 Frankenstein Cross Assemblers

(For a lot of machines.)
These have been posted to alt.sources.  Check an archive site for alt.sources
(a.o. wuarchive.wustl.edu).
--
dik t. winter, cwi, amsterdam, nederland
dik@cwi.nl
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

mzenier@polari.UUCP (Mark Zenier) (03/16/91)

In article <m0jG6l5-0003uFC@rht32.pcs.com> h.-g. willers <hgw@rht32.PCS.COM> writes:
>As I have seen from the latest issue of "The C Users Journal", they have a
>8051 Assembler (among others) in source form. I'll quote from the
>announcement:
>
>> CUG335 Frankenstein Cross Assemblers
>> Mark Zenier (WA) has submitted a collection of cross-assemblers
>> written in the combination of Yacc and C. 

But not Lex or Flex.  The implementation of include files at the
yacc grammar level caused a such a messy conflict with the lookahead
in both Flex and Decus Lex, that I ended up rewriting the the lexical 
analyzer by hand.  Lex source isn't portable, especially if you
play with the input() macro.

They were posted to alt.sources December 4-6 1990.  I'd recommend
sci.electronics, comp.realtime, or alt.sources.d for any further
discussion.  I have no definite information on what sites they 
are archived on.

Mark Zenier  markz@ssc.uucp  mzenier@polari.uucp

-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.

bart@cs.uoregon.edu (Barton Christopher Massey) (03/20/91)

In article <3502@polari.UUCP> mzenier@polari.UUCP (Mark Zenier) writes:
...
> But not Lex or Flex.  The implementation of include files at the
> yacc grammar level caused a such a messy conflict with the lookahead
> in both Flex and Decus Lex, that I ended up rewriting the the lexical 
> analyzer by hand.  Lex source isn't portable, especially if you
> play with the input() macro.

Hmm.  The Motorola 56000 family assembly language has the interesting
property that label addresses may be used in preprocessor expressions(!).
In spite of this, I recently completed a 56K assembler written using LEX and
YACC -- it's actually compatible with LEX or FLEX, and YACC, BISON, or BYACC
(obviously, I tend to use FLEX and BYACC, but it needed to be portable to
some weird environments, such as Stanford's V OS).

It required some ifdefs, but other than that, the lexer was actually quite
straightforward.  I had no serious trouble modifying the input routines
to switch between raw input and input from preprocessor output buffers.
It meant that the lexer only looked ahead a line at a time, but that's
about the best one can do anyhow, I think...

Pushing information back through the *parser*, on the other hand, was a
real nightmare, and still isn't quite right.  Unfortunately, 56K expression
syntax is non-trivial, and having a machine-generated operand parser was
a real win.

Anyhow, although I sympathise with the above-quoted paragraph, I strongly
recommend using a FLEX lexer for an assembler -- my experience was much more
positive.

					Bart Massey
					bart@cs.uoregon.edu
-- 
Send compilers articles to compilers@iecc.cambridge.ma.us or
{ima | spdcc | world}!iecc!compilers.  Meta-mail to compilers-request.