TCLR loc16,#bit
6-361
TCLR loc16,#bit
Test and Clear Specified Bit
SYNTAX OPTIONS
OPCODE
OBJMODE
RPT
CYC
TCLR loc16,#bit
0101 0110 0000 1001
0000 BBBB LLLL LLLL
1
−
1
Operands
loc16,
#bit
Addressing mode (see Chapter 5)
Immediate constant bit index from 0 to 15
Description
Test the specified bit of the data value in the location pointed to by the “loc16”
addressing mode and then clear that same bit to 0:
TC = [loc16(bit)];
[loc16(bit)] = 0;
The value specified for the #bit immediate operand directly corresponds to
the bit number. For example, if #bit = 0, you will access bit 0 (least significant
bit) of the addressed location; if #bit = 15, you will access bit 15 (most
significant bit).
TCLR performs a read-modify-write operation.
Flags and
Modes
N
If (loc16 = @AX) and bit 15 (MSB) of @AX is 1, then N flag is set..
Z
If (loc16 = @AX) and @AX gets zeroed out, then Z flag is set.
TC
If the bit tested is 1, TC is set; if the bit tested is 0, TC is cleared.
Repeat
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; if( VarA.Bit4 = 1 )
; VarB.Bit6 = 1;
; else
; VarB.Bit6 = 0;
TBIT @VarA,#4
; Test bit 4 of VarA contents
SB $10,NTC
; Branch if TC = 0
TSET @VarB,#6
; Set bit 6 of VarB contents
SB $20,UNC
; Branch unconditionally
$10:
;
TCLR @VarB,#6
; Clear bit 6 of VarB contents
$20:
;
Содержание TMS320C28x
Страница 30: ...1 12...
Страница 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Страница 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Страница 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Страница 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Страница 585: ...This page intentionally left blank 7 32 This page intentionally left blank...