Hi, On Wed, 05 Jul 2006 17:57:50 +0530, <[EMAIL PROTECTED]> wrote: > I'm a total newbie to avr-gcc and just compiled a first program. It merely > fits the program memory so I've started to optimize.. > > In my code there lots of places where 1-2-3 bits are flipped in I/O port: > > > > My suggestion is to optimize the case when 2 bits are set into 2 sbi > commands, and when 2 bits are cleared into 2 cbi commands. It's quite > easy to count number of 1s or 0s in the mask - and if there are exacly > 2, apply this optimization.
Wherever you require this, just use 2 separate bit setting/ clearing statements in your C code itself. --Royce. -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list