Texas Instruments TMS320C28x Reference Manual page 518

Dsp cpu and instruction set
Table of Contents

Advertisement

TCLR loc16,#bit
SYNTAX OPTIONS
TCLR loc16,#bit
Operands
loc16,
#bit
Description
Flags and
N
Modes
Z
TC
Repeat
Example
; if( VarA.Bit4 = 1 )
;
; else
;
TBIT
SB
TSET
SB
$10:
TCLR
$20:
Addressing mode (see Chapter 5)
Immediate constant bit index from 0 to 15
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.
If (loc16 = @AX) and bit 15 (MSB) of @AX is 1, then N flag is set..
If (loc16 = @AX) and @AX gets zeroed out, then Z flag is set.
If the bit tested is 1, TC is set; if the bit tested is 0, TC is cleared.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
VarB.Bit6 = 1;
VarB.Bit6 = 0;
@VarA,#4
$10,NTC
@VarB,#6
$20,UNC
@VarB,#6
OPCODE
0101 0110 0000 1001
0000 BBBB LLLL LLLL
; Test bit 4 of VarA contents
; Branch if TC = 0
; Set bit 6 of VarB contents
; Branch unconditionally
;
; Clear bit 6 of VarB contents
;
TCLR loc16,#bit
Test and Clear Specified Bit
OBJMODE
RPT
1
CYC
1
6-361

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C28x and is the answer not in the manual?

Table of Contents

Save PDF