CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

shift_left command

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
WHUNG.JOHN
Guest







shift_left command
PostPosted: Thu Jul 31, 2008 10:46 am     Reply with quote

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








PostPosted: Thu Jul 31, 2008 11:31 am     Reply with quote

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.....
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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