This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Solved] GAS: Register equates ?
- From: Jens Bauer <jens at plustv dot dk>
- To: dvalin at internode dot on dot net
- Cc: binutils at sourceware dot org
- Date: Sat, 18 May 2013 11:16:21 +0200
- Subject: Re: [Solved] GAS: Register equates ?
- References: <20130518054245827615 dot e692b26e at gpio dot dk> <20130518064813645924 dot e7189647 at gpio dot dk> <20130518075428 dot GA1915 at ratatosk>
Hi Erik.
Unfortunately I have to do without info. I also have to do without apt-get; I have only PowerMacs (eg. no intel).
...But regarding register equates...
On AVR, try...
rColor=17
...and you will see it does not work.
You can also try...
.equ rHasToWork,22
...This won't work either.
But try the same with...
rColor req r17
rHasToWork req r22
...and see if it does.
In other words: *ANY* equate that starts with lowercase 'r' would not work for me, when I wrote some assembly-code for AVR.
I ended up using the preprocessor #define instead (but I prefer to avoid the preprocessor now).
Love
Jens
On Sat, 18 May 2013 17:54:29 +1000, Erik Christiansen wrote:
> On 18.05.13 06:48, Jens Bauer wrote:
>>> So my question is: Is it possible to create register-equates in GAS ?
>>
>> I figured out (by going through the GAS source) that I need to use...
>>
>> myReg .req r12
>>
>> -This seems to work. :)
>
> For ARM, according to "info gas". There's a description in "9.3.4 ARM
> Machine Directives". (Is an "apt-get install binutils-doc" perhaps
> required?)
>
> For other architectures, I find that either:
>
> ; Register synonyms:
> Z = 30 ; r31:r30 (e.g. For use with adiw)
> ZL = 30 ; r30
> ZH = 31 ; r31
>
> and
>
> .equ r30, 30
> .equ r31, 31
>
> work fine on those tried.
>
> Erik
>
> --
> manual,
> n.:
> A unit of documentation. There are always three or more on a given
> item.
> One is on the shelf; someone has the
> others.
> The information you need is in the others. - Ray Simard