CSB ACC
SYNTAX OPTIONS
CSB ACC
Operands
ACC
Description
Flags and
N
Modes
Z
TC
Repeat
Example
; Normalize the contents of VarA:
MOVL
CSB
LSLL
MOVL
Accumulator register
Count the sign bits in the ACC register by determining the number of leading 0s
or 1s in the ACC register and storing the result, minus one, in the T register:
T = 0, 1 sign bit
T = 1, 2 sign bits
.
.
T = 31, 32 sign bits
Note:
The count sign bit operation is often used in normalization operations and is particularly
useful for algorithms such as; calculating Square Root of a number, calculating the
inverse of a number, searching for the first "1" bit in a word.
N is set if bit 31 of ACC is 1, else N is cleared.
Z is set if ACC is 0, else Z is cleared.
The TC bit will reflect the state of the sign bit after the operation (TC=1 for
negative).
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
ACC,@VarA
ACC
ACC,T
@VarA,ACC
OPCODE
0101 0110 0011 0101
; Load ACC with contents of VarA
; Count sign bits
; Logical shift left ACC by T(4:0)
; Store result into VarA
CSB ACC
Count Sign Bits
OBJMODE
RPT
CYC
1
−
1
6-83
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?