BMCnd
|
Conditional bit transfer
|
BMCnd
|
Bit Move Conditional
|
[Syntax]
BMCnd src, dest
[Operation]
(1)When dest is a memory location:
unsigned char dest;
if ( Cnd )
dest |= ( 1 << ( src & 7 ));
else
dest &= ~( 1 << ( src & 7 ));
(2)When dest is a register:
register unsigned long dest;
if ( Cnd )
dest |= ( 1 << ( src & 31 ));
else
dest &= ~( 1 << ( src & 31 ));
[Function]
- | This instruction moves the truth-value of the condition specified by Cnd to the bit of dest, which is specified by src; that is, 1 or 0 is transferred to the bit if the condition is true or false, respectively. |
- | The following table lists the types of BMCnd. |
BCnd
|
|
|
|
BMGEU,
BMC
|
|
|
|
BMEQ,
BMZ
|
|
|
|
BMGTU
|
|
|
|
BMPZ
|
|
|
|
BMGE
|
|
|
|
BMGT
|
|
|
|
BMO
|
|
|
|
BMLTU,
BMNC
|
|
|
|
BMNE,
BMNZ
|
|
|
|
BMLEU
|
|
|
|
BMN
|
|
|
|
BMLE
|
|
|
|
BMLT
|
|
|
|
BMNO
|
|
|
|
- | 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]
|
|
|
|
|
BMCnd src, dest
|
|
#IMM:3
|
[Rd].B
|
|
|
#IMM:3
|
dsp:8[Rd].B
|
|
|
#IMM:3
|
dsp16[Rd].B
|
|
|
#IMM:5
|
Rd
|
|
[Flag Change]
This instruction does not affect the states of flags.
[Description Example]
BMC #7, [R2]
BMZ #31, R2