Bitwise Shifting in C

Posted by user313943 on Stack Overflow See other posts from Stack Overflow or by user313943
Published on 2010-04-11T15:09:56Z Indexed on 2010/04/11 15:13 UTC
Read the original article Hit count: 279

Filed under:
|
|
|
|

I've recently decided to undertake an SMS project for sending and receiving SMS though a mobile.

The data is sent in PDU format - I am required to change ASCII characters to 7 bit GSM alphabet characters. To do this I've come across several examples, such as http://www.dreamfabric.com/sms/hello.html

This example shows Rightmost bits of the second septet, being inserted into the first septect, to create an octect.

Bitwise shifts do not cause this to happen, as >> will insert to the left, and << to the right. As I understand it, I need some kind of bitwise rotate to create this - can anyone tell me how to move bits from the right handside and insert them on the left?

Thanks,

© Stack Overflow or respective owner

Related posts about bitwise

Related posts about rotate