This is the mail archive of the
mailing list for the binutils project.
Re: May need to update avr-as [Was: [Solved] GAS: Register equates ?]
- From: Erik Christiansen <dvalin at internode dot on dot net>
- To: binutils at sourceware dot org
- Date: Sun, 19 May 2013 22:51:52 +1000
- Subject: Re: May need to update avr-as [Was: [Solved] GAS: Register equates ?]
- References: <20130518054245827615 dot e692b26e at gpio dot dk> <20130518064813645924 dot e7189647 at gpio dot dk> <20130518075428 dot GA1915 at ratatosk> <20130518111621366401 dot a6feb2ad at plustv dot dk> <20130518105010 dot GB1915 at ratatosk> <20130518185416191753 dot 95a69630 at plustv dot dk>
- Reply-to: dvalin at internode dot on dot net
On 18.05.13 18:54, Jens Bauer wrote:
> Hi Erik.
> Are you sure this works ?
> Try using the register...
Ahhh ... err, let's check a little more thoroughly. The example didn't
actually try it as a register. First, directly confirming Andreas'
ldi 17,42 ; = r17 , immediate value.
produces this in the objdump:
154: 1a e2 ldi r17, 0x2A ; 42
So AVR is one of those which accept plain numbers for
registers, thereby allowing (almost) arbitrarily named registers.
But you're right, as this:
rColor = 17
Error: register name or number from 0 to 31 required
The parser grammar apparently wants a recognised register name if it
begins with r/R. (That's what I incorrectly thought had been fixed.)
There is an unintrusive workaround, at the cost of an extra keystroke:
_rColor = 17
That does produce the same result, shown by objdump.
It would take a lexer tweak to do better than that, I figure.
(One unlikely to be favoured for a multi-target assembler, I'm
Looking more closely at the:
.equ r0, 0
.equ r31, 31
in the include file I've used for many years, I realise that they are
not being used in simple assembler commands, but I needed them
"To allow (r16, r16+1) in macros". (I had convinced myself that they
were effective in more than the macro invocations. :(
That just leaves the question whether _rColor is close enough for your
Wizards had always known that the act of observation changed the thing that
was observed, and sometimes forgot that it also changed the observer too.
Terry Pratchett - Interesting times