[Top][All Lists]

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

Re: [avr-gcc-list] SBI an CBI optimizations

From: Alex Wenger
Subject: Re: [avr-gcc-list] SBI an CBI optimizations
Date: Thu, 07 Jul 2005 17:02:41 +0200
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)


Trampas schrieb:
I am using WinAvr GCC 3.4.3 so this may have been fixed in 4.0, but I have
noticed that the compiler does not optimize the following:

#define DISABLE_INTO_ISR() {GIMSK=GIMSK & ~(1<<INT0);}

176:rs485.c       ****  DISABLE_INTO_ISR();
 247                    .LM24:
 248 0086 8BB7                  in r24,91-0x20
 249 0088 8F7B                  andi r24,lo8(-65)
 250 008a 8BBF                  out 91-0x20,r24

That is unless I am mistaken this can be done with a CBI instruction?

no, when you write: GIMSK=GIMSK & ~(1<<INT0);
you mean read, modify, write.
you should write GIMSK &= ~(1<<INT0);
then it should work.


reply via email to

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