Bit Manipulation
| Author | Message | ||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3368 |
Hi John, The AND operator actually does a bitwise and operation. So, to get the low byte you can do: &B0011000011000000 AND &B11111111 and you should get &B11000000 as the result. If you are shifting right you should use the integer divide operator (\) ie, a back slash. This will discard any fractional value as a result of the divide. So, to get the high byte you can do: &B0011000011000000 \ 256 and you should get &B00110000 as the result. Geoff Geoff Graham - http://geoffg.net |
||||