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

right_shift function

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
helmudt



Joined: 11 Jan 2005
Posts: 1

View user's profile Send private message

right_shift function
PostPosted: Tue Jan 11, 2005 4:53 am     Reply with quote

Hi guys,

How do you tell the compiler to use the “Carry” data when you use the right_shift() function. The ASM code generated when I use the right_shift command is “RRNCF”
P.s I'm using the Pic18F452

Thanks
Helmudt
Ttelmah
Guest







Re: right_shift function
PostPosted: Tue Jan 11, 2005 7:25 am     Reply with quote

helmudt wrote:
Hi guys,

How do you tell the compiler to use the “Carry” data when you use the right_shift() function. The ASM code generated when I use the right_shift command is “RRNCF”
P.s I'm using the Pic18F452

Thanks
Helmudt

This is the difference between a 'shift', and a 'rotate'. Look at 'rotate_right', instead of 'shift_right'.

Best Wishes
densimitre



Joined: 21 Dec 2004
Posts: 45

View user's profile Send private message

PostPosted: Thu Jan 13, 2005 6:05 pm     Reply with quote

rotate_left() puts carry in LSB

shift_left(a,b,c) puts c on LSB, carry it doesn't matter.

C can be 0 or 1, as you wich.


Bye
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