May 08, 2017
10:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 08, 2017
10:43 PM
hi every body,
if anybody works on this. can i get details?
when i used 89xx uc. there INTRINS extern unsigned char _crol_ (unsigned char, unsigned char); viz.
temp=_crol_(temp,1);/*Shift D7 BIT TO D0*/
SDA = (temp&0x01);/*SEND D0 BIT TO SDA*/
or how to implement this function.
Labels
2 Replies
May 10, 2017
09:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 10, 2017
09:13 AM
Something like this ?
unsigned char _crol(unsigned char value, int shift)
{ if ((shift &= 7) == 0)
return value;
return (value << shift) | (value >> (8 - shift));
}
Anonymous
Not applicable
May 10, 2017
04:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 10, 2017
04:25 PM
Here's a post with more information if you are interested:
http://stackoverflow.com/questions/10134805/bitwise-rotate-left-function