macro's and local variables

Mischa Baars mjbaars1977@gmail.com
Fri Oct 19 11:41:00 GMT 2012


On 10/18/2012 08:35 PM, Mischa Baars wrote:
> On 10/18/2012 05:58 PM, John Reiser wrote:
>> On 10/18/2012 08:09 AM, Mischa Baars wrote:
>>> Sounds to me, it would be a better plan to make sure that the 
>>> assembler accepts it '<<' both with and without '.altmacro' :)
>> I agree that the assembler should accept the full syntax and all 
>> operators
>> for C expressions.  Recently I have rued the lack of unary '!' 
>> (negation of
>> truth value, including '!!' as characteristic function {true==>1, 
>> false==>0})
>> and trinary "?:" (conditional evaluation).
>>
> Same problem over here, where (taken from function.S)
>
> A               i + j, j > 0 ? N + j + 1 : i + 2
>
> is accepted, but the equivalent
>
> A               (i + j), ((j > 0) ? (N + j + 1) : (i + 2))
>
> is not accepted as valid expression.
>
> Mischa.

Here, have a look at http://www.cyberfiber.org (my work in progress), 
where I use the construct above for multiplication of unsigned integers. 
Meanwhile, I believe that the assembler could use some fine-tuning too 
at some points.

For example,

addri        i + j, ...

does not give the same answer as

addri        (i + j), ...

Regards,
Mischa.



More information about the Binutils mailing list