First page Back Continue Last page Overview Graphics
Bit Modify Instructions
Mask indicates the bit to be set or cleared
All addressing modes are allowed. Mask indicates the bits to be operated on. Bit positions that contain a one are affected.
Which logic operations must be performed to complete a BCLR instruction?
Which is performed for a BSET instruction?
The BCLR instruction clears any bits whose positions are designated by a 1 in the mask. The BSET instruction sets any bits whose positions are designated by a 1 in the mask. The following code sets bit 7 of location VAR1, then clears the same bit.
VAR1: DC.B $3C
BSET VAR1,$80 ; set bit 7 = OR VAR1 and $80
BCLR VAR1,$80 ; clear bit 7 = AND VAR1 and $7F