Advance Information
UM-TM57PE10_E
8-Bit Microcontroller
36
tenx technology inc.
Preliminary
Rev 1.4, 2012/01/19
BCF
Clear "b" bit of "f"
Syntax
BCF f [,b]
Operands
f : 00h ~ 3Fh, b : 0 ~ 7
Operation
(f.b) ← 0
Status Affected
-
OP-Code
01 000b bbff ffff
Description
Bit 'b' in register 'f' is cleared.
Cycle
1
Example
BCF FLAG_REG, 7
B : FLAG_REG = 0xC7
A : FLAG_REG = 0x47
BSF
Set "b" bit of "f"
Syntax
BSF f [,b]
Operands
f : 00h ~ 3Fh, b : 0 ~ 7
Operation
(f.b) ← 1
Status Affected
-
OP-Code
01 001b bbff ffff
Description
Bit 'b' in register 'f' is set.
Cycle
1
Example
BSF FLAG_REG, 7
B : FLAG_REG = 0x0A
A : FLAG_REG = 0x8A
BTFSC
Test "b" bit of "f", skip if clear(0)
Syntax
BTFSC f [,b]
Operands
f : 00h ~ 3Fh, b : 0 ~ 7
Operation
Skip next instruction if (f.b) = 0
Status Affected
-
OP-Code
01 010b bbff ffff
Description
If bit 'b' in register 'f' is 1, then the next instruction is executed. If bit 'b' in
register 'f' is 0, then the next instruction is discarded, and a NOP is
executed instead, making this a 2nd cycle instruction.
Cycle
1 or 2
Example
LABEL1 BTFSC FLAG, 1
TRUE GOTO SUB1
FALSE ...
B : PC = LABEL1
A : if FLAG.1 = 0, PC = FALSE
if FLAG.1 = 1, PC = TRUE
BTFSS
Test "b" bit of "f", skip if set(1)
Syntax
BTFSS f [,b]
Operands
f : 00h ~ 3Fh, b : 0 ~ 7
Operation
Skip next instruction if (f.b) = 1
Status Affected
-
OP-Code
01 011b bbff ffff
Description
If bit 'b' in register 'f' is 0, then the next instruction is executed. If bit 'b' in
register 'f' is 1, then the next instruction is discarded, and a NOP is
executed instead, making this a 2nd cycle instruction.
Cycle
1 or 2
Example
LABEL1 BTFSS FLAG, 1
TRUE GOTO SUB1
FALSE ...
B : PC = LABEL1
A : if FLAG.1 = 0, PC = TRUE
if FLAG.1 = 1, PC = FALSE