bit shifting with avr-gcc

Status
Not open for further replies.

arnab.bhaumik

Member level 5
Joined
Sep 20, 2006
Messages
81
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,288
Location
Kolkata, India
Activity points
1,835
avr bit shift

hi all,

in a typical application i want to declair an unsigned char and then put a value in it.



say


unsigned char p;

now

p= 0x20;

now i want to bit shift operation on it(may be left or may be right). but with every bit shift operation i want to move the msb to a port pin say pd7,


how come i do that??????



in sdcc with at89c52 what i will do

unsigned char at (0x21) rotor;

bit at(0x21) rotor_msb;

then i will right shift it and access the wanted bit with rotor_msb, but wondering how to do it with atmega8 and avr-gcc.

hope i made my prob clear enaugh............

please reply,

arnab/vu2bpw
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…