View previous topic :: View next topic |
Author |
Message |
WHUNG.JOHN Guest
|
shift_left command |
Posted: Thu Jul 31, 2008 10:46 am |
|
|
hi. Today i read a example in book, follow as
Code: | #include <16F877.H>
#Fuses hs,nowdt
#use rs-232(baud=9600,xmit=pin_c6,rcv=pin_c7)
void main(void)
{
int8 bit_array[3];
int8 i;
bit_array[0]=0x05;
bit_array[1]=0x18;
bit_array[2]=0x64;
for (i=0;i<24;i++);
{
printf("i=%d: %x %x %x \r\n",i,bit_array[2],bit_array[1],bit_array[0]);
shift_left(bit_array,3,0);
}
while(1);
} |
book answer shall have:
i=0 : 64 18 05
i=4 : 41 80 50
i=8 : 18 50 00
i think know i=1 answer ?
i=2 answer?
i=3 answer? |
|
|
Guest
|
|
Posted: Thu Jul 31, 2008 11:31 am |
|
|
It wouldn't take you more than a couple of minutes to type in the code and try it out. The best way to answer a question is to try it yourself first, and ask if and only if you're stuck..... |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|