This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] S12Z: gas: Fix bug when a symbol name was the single letter 'c'.


Hi John,

>      > +	st d0, c 	; c is a valid label
>      How does the assembler know that "c" here is meant to be label c 
>      and not the register c ?
> 
> Because there is no register called "c".  Also a register would be
> semantically incorrect here.

OK, so how about:

  st d0, d1

That is legal, right ?  But if there is also a symbol called "d1"
then what should the assembler do ?  [Answer - choose one, but be
consistent about it...  Also, possibly, issue a warning message].

> It is unfortunate that in this arch the conventional assembler format
> has no syntactical distinction between a register name and a
> symbol name.  Hence, all symbol names are compared against the list of
> register names before use.  Sadly this means the grammar is not context
> free.

Fair enough - patch approved.

Cheers
  Nick



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]