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

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

Re: [avr-gcc-list] efficiency of assigning bits


From: Jamie Morken
Subject: Re: [avr-gcc-list] efficiency of assigning bits
Date: Mon, 14 Mar 2005 01:59:08 -0800

Hi,

----- Original Message -----
From: Parthasaradhi Nayani <address@hidden>
Date: Sunday, March 13, 2005 7:12 am
Subject: Re: [avr-gcc-list] efficiency of assigning bits

> 
> Hello,
> To turn two bits off, the method I would adopt is
> 
>  PORTD &= 0B11101101;
> 
> This is the fastest method.

What does that work out to in assembly?  A cbi/sbi assembly instruction is 2 
clock cycles.  I still don't understand why these instructions would be taken 
out of winavr, they obviously are useful for them to have been included as 
opcodes in the AVR! :)

Is it possible to do inline assembly with cbi/sbi?
Something like this:

asm("sbi,x,y)"

--gives an error though

cheers,
Jamie


> 
> 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
> 





reply via email to

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