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

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

[avr-gcc-list] Efficient setting/clearing/checking bits in registers ?


From: Robert Rozman
Subject: [avr-gcc-list] Efficient setting/clearing/checking bits in registers ?
Date: Sat, 10 Mar 2001 16:55:40 +0100

Hello,

I have an application that frequently uses setting/clearing and checking
separate bits in data registers. In avr-gcc I'm using following macros, but
I'm not sure if that is code space efficient solution - it seems they are
not compiled to compact SBR,CBR instructions for CPU.

#define SETBIT(x,y) (x |= (y))
#define CLEARBIT(x,y) (x &= (~y))
#define CHECKBIT(x,y) (x & (y))

Any advice would be appreciated.

Thanks in advance,

Robert Rozman






reply via email to

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