When you have a set of flag variables where "false" is indicated by $00 and "true" is indicated by a non-zero value, as long as you use the same non-zero value (such as $01) for all of your "true" variables, then AND will work just fine. For example, the high level statement:
IF (FV1 AND FV2 AND FV3) THEN BRANCH
becomes:
Code:
LDA FV1
AND FV2
AND FV3
BNE LABEL
Also, the high level statement:
IF (FV1 OR FV2 OR FV3) THEN BRANCH
becomes:
Code:
LDA FV1
ORA FV2
ORA FV3
BNE LABEL
In fact, the OR routine will branch if any of the FVs are non-zero, even if those non-zero values are different.
The AND doesn't work quite the same way. The simplest thing to do just pick a non-zero value and use it as "true" for all of your flags, but AND will also work as bit K (K can be any bit from 0 to 7) is a 1 in all "true" flags.
For example, if you have two flag variables, FV1 and FV2, where FV1 "true" is $01 and FV2 "true" is $02, then ORA works, but AND always returns zero.
Another example: if you have three flags, FV1, FV2 and FV3, where FV1 "true" is $04, FV2 "true" is $05, and FV3 "true" is $0C, then AND works because bit 2 of all three "true" values ($04, $05, and $0C) is 1. (ORA also works, of course.)
$FF is typically the most useful "true" value, because it allows you to use AND with one flag whose "true" value is not $FF. At least one of the bits in any non-$FF, non-zero value is 1, and that bit of $FF will be a also 1 (since all of the bits of $FF are 1).