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

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

Re: [avr-gcc-list] Assembler error message


From: Robert Rozman
Subject: Re: [avr-gcc-list] Assembler error message
Date: Fri, 16 Mar 2001 16:54:46 +0100

Hello,

thanks for info. I did this and I ran acrross weird behaviour that could be
also caused by my mistake in macro.

So, I define macro:
#define CLEARBIT_CONST(var,mask) \
 asm volatile (\
  "cbr %0, %1 "\
  : /* no outputs */\
   : "r" ((u08) (var)), \
    "i" ((u08) (mask)) \
       )

and also

//IR_Status variable
#define  IR_Avail  128    // biti v IR_Status

and then in program I do this:

volatile unsigned char IR_Status = 0x20;

....

CLEARBIT_CONST(IR_Status,IR_Avail);

and it gets converted to :

 833:node3_6.c     ****         CLEARBIT_CONST(IR_Status,IR_Avail);
 3519                 .stabn 68,0,833,.LM356-main
 3520                .LM356:
 3521 ???? 8091 0000   lds r24,IR_Status
 3522                /* #APP */
 3523 ???? 8F77        cbr r24, -128
****  Error:number must be less than 256

---------End of snip

Why my IR_Avail constant of 128 gets converted to constant of -128 ?

Is everything OK with my macro definition ? Strange is, that other smaller
constants convert OK.


Thanks in advance,

Robert Rozman




reply via email to

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