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

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

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


From: David Brown
Subject: [avr-gcc-list] Re: cbr and negative numbers
Date: Wed, 10 Sep 2008 23:15:47 +0200
User-agent: Thunderbird 2.0.0.16 (Windows/20080708)

Ruud Vlaming wrote:
Suppose you compile the (nonsense) code below under
'standard' settings (see below for my settings, but is does not really matter for now) Then there is no problem. However, if you activate the 8 bit integer option -mint8 you get an error:
  code_Test.s:75: Error: number must be less than 256

  void TestCBR(void) __attribute__ ((naked, used));
  void TestCBR(void)
{ asm volatile ( "cbr r31, 0xC0 \n\t" /* This value passes */
     "cbr r31,%[_A_]        \n\t" /* This value passes          */
     "sbr r31,%[_B_]        \n\t" /* This value passes          */
     "cbr r31,%[_B_]        \n\t" /* This may generate an error */
"ret \n\t" "" ::
     [_A_] "i" (0x70),
     [_B_] "i" (0xC0)); }


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.





reply via email to

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