Just use & to mask bits and shift right appropriately. If this isn't
enough, please consult a book about bit shifting - I'm not going to
give you an answer for every single possible thing you might want to do
with bit shifting.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.