First page Back Continue Last page Overview Graphics
Checking Bits using Logic Instructions
BITA, BITB - The bit instruction performs an AND operation but does not change the destination register. Only flags are modified.
- LDAA PORTT
- BITA #$01
- BNE BitZero
- BITA #$02
- BNE BitOne
The BIT instructions are useful when performing several tests in succession, since the original value in the register will not be modified. If the AND instruction was used in the above example, register A would have to be reloaded after each of the tests.