EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #522 background imageLoading...
Page #522 background image
TSET loc16,#16bit
6-365
TSET loc16,#16bit Test and Set Specified Bit
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
TSET loc16,#16bit 0101 0110 0000 1101
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 set the same bit to 1:
TC = [loc16(bit)];
[loc16(bit)] = 1;
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).
TSET 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: ;

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals