avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Re: cbr and negative numbers


From: Ruud Vlaming
Subject: Re: [avr-gcc-list] Re: cbr and negative numbers
Date: Thu, 11 Sep 2008 10:42:11 +0200
User-agent: KMail/1.9.1

On Wednesday 10 September 2008 23:15, David Brown wrote:
 
> Have you tried using "M" as the constraint rather than "i" ?  I haven't 
> tried this myself, but according to 
> <http://www.nongnu.org/avr-libc/user-manual/inline_asm.html> "M" is an 
> 8-bit integer constant in the range 0 to 255.

Thank you for your willingness to contribute even with mint8. 
And: Sharp thinking! Unfortunately it does not work that way. "Under 
water" the operand is a signed integer, even if you cast it with 
something like

   [_B_] "M" ((unsigned char) 0xC0))

Thus at this point the compiler starts complaining the operand is not
within the range 0..255 and does not complete the .s file.

What wonders me though is that this problem could have an equivalent
on 16 bit level when mint8 is switched off. Now i don't know of any
instruction that takes an immediate 16 bit operand, but still. 

Anyway imho i think the compiler should not emit negative values as
operands for instructions, such as bit operator,  that clearly take a 
hexadecimal operand.


Ruud.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]