BCLR
|
Clearing a bit
|
BCLR
|
Bit CLeaR
|
[Syntax]
BCLR src, dest
[Operation]
When dest is a memory location:
unsigned char dest;
dest &= ~( 1 << ( src & 7 ));
When dest is a register:
register unsigned long dest;
dest &= ~( 1 << ( src & 31 ));
[Function]
- | This instruction clears the bit of dest, which is specified by src. |
- | The immediate value given as src is the number (position) of the bit. |
- | The range for IMM:3 operands is 0 ≤ IMM:3 ≤ 7. The range for IMM:5 is 0 ≤ IMM:5 ≤ 31. |
[Instruction Format]
|
|
|
|
|
|
|
(1)BCLR src, dest
|
|
#IMM:3
|
-
|
[Rd].B
|
|
|
#IMM:3
|
-
|
dsp:8[Rd].B
|
|
|
#IMM:3
|
-
|
dsp:16[Rd].B
|
|
|
Rs
|
-
|
[Rd].B
|
|
|
Rs
|
-
|
dsp:8[Rd].B
|
|
|
Rs
|
-
|
dsp:16[Rd].B
|
|
(2)BCLR src, dest
|
|
#IMM:5
|
-
|
Rd
|
|
|
Rs
|
-
|
Rd
|
|
[Flag Change]
This instruction does not affect the states of flags.
[Description Example]
BCLR #7, [R2]
BCLR R1, [R2]
BCLR #31, R2
BCLR R1, R2