[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] efficiency of assigning bits
From: |
Parthasaradhi Nayani |
Subject: |
Re: [avr-gcc-list] efficiency of assigning bits |
Date: |
Sun, 13 Mar 2005 07:12:25 -0800 (PST) |
--- Jamie Morken <address@hidden> wrote:
> Hi,
>
> I am trying to turn two bits off on a port as
> quickly as possible, how do these two methods
> compare:
>
> PORTD = (PORTD & ~PD1) & ~PD4;
>
> or:
>
> cbi(PORTD, PD1);
> cbi(PORTD, PD4);
>
Hello,
To turn two bits off, the method I would adopt is
PORTD &= 0B11101101;
This is the fastest method.
The cbi and sbi instructions are removed in the latest
version of winavr and can not be used. Moreover the
two instructions take more time and more space
compared to the above example.
Nayani
__________________________________
Do you Yahoo!?
Make Yahoo! your home page
http://www.yahoo.com/r/hs
- Re: [avr-gcc-list] efficiency of assigning bits, (continued)
- Re: [avr-gcc-list] efficiency of assigning bits, David Willmore, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, Erik Walthinsen, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, Jesper Hansen, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, E. Weddington, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, Erik Walthinsen, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits (OT), Hugo González Monteverde, 2005/03/15
- Re: [avr-gcc-list] efficiency of assigning bits, Dave Hansen, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits, Christof Krueger, 2005/03/14
- Fwd: Re: [avr-gcc-list] efficiency of assigning bits, Royce & Sharal Pereira, 2005/03/14
- Re: [avr-gcc-list] efficiency of assigning bits,
Parthasaradhi Nayani <=
- Re: [avr-gcc-list] efficiency of assigning bits, Parthasaradhi Nayani, 2005/03/13
- Re: [avr-gcc-list] efficiency of assigning bits, Parthasaradhi Nayani, 2005/03/13