PDA

View Full Version : Bitwise Operations



rossfree
- 5th November 2004, 13:33
I need some clarification please. I know I've seen another entry on this but can't seem to find it with my searches.

I have the need to manipulate individual bits of eight individual byte sized variables... such as change bit 3 of "mouse" to a one and bit five of "cat" to a one without changing any other bits in "mouse" or "cat".

mouse var byte
cat var byte
mouse = 0
cat = 0

Main:
mouse.3 = 1
portd = mouse
pause 1000
cat.5 = 1
portd = cat
end

Is this written correctly?

Thank you,

Ross

mister_e
- 5th November 2004, 13:58
Hi ross. yes it's write correctly