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.



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to