PDA

View Full Version : Bit testing/setting syntax when we code pmSystems



David Rabiner
01-06-2005, 08:09 PM
Hello, all.

How do we code to test or set a bit. Say x04FE .7 (which I see is
read-only, but I'm pretending).

To set it, it would be something like: x04FE = x04FE + x80 ???

To check it, it would be something like: if x04FE and x80 then .... ???

What is the exact syntax for both of these?

Warm regards,
David

Enrico Schiratti
01-07-2005, 08:38 AM
Hi,

I hope I understood you right... things are much simpler than that...

04FE .7 ThisIsMyBit

To set it... use

ThisIsMyBit = 1

To reset it use

ThisIsMyBit = 0

Nothing simpler... if ThisIsMyBit is defined as a bit, you handle it as a
bit. If it is defined as a byte or word, then you would have to manipulate
it as you describe below... but it is not necessary.

Ciao

Enrico


"David Rabiner" wrote in message
news:281848.56024@wb.onvix.com...
> Hello, all.
>
> How do we code to test or set a bit. Say x04FE .7 (which I see is
> read-only, but I'm pretending).
>
> To set it, it would be something like: x04FE = x04FE + x80 ???
>
> To check it, it would be something like: if x04FE and x80 then .... ???
>
> What is the exact syntax for both of these?
>
> Warm regards,
> David
>