dsp56800 Freescale Semiconductor, Inc, dsp56800 Datasheet - Page 281

no-image

dsp56800

Manufacturer Part Number
dsp56800
Description
16-bit Digital Signal Controllers
Manufacturer
Freescale Semiconductor, Inc
Datasheet
BFSET
Operation:
1 → (<bit field> of destination)
1 → (<bit field> of destination)
Description: Test all selected bits of the destination operand. If all selected bits are set, C is set; otherwise, C is
Usage:
Example:
Explanation of Example:
Condition Codes Affected:
Note:
Freescale Semiconductor
cleared. Then set the selected bits, and store the result in the destination memory location. The bits to
be tested are selected by a 16-bit immediate value in which every bit set is to be tested and set. This
instruction performs a read-modify-write operation on the destination and requires two destination ac-
cesses.
This instruction is very useful in performing I/O and flag bit manipulation.
BFSET
Prior to execution, the 16-bit X memory location X:$FFE2 contains the value $8921. Execution of the
instruction tests the state of bits 10, 12, 13, 14, and 15 in X:$FFE2; does not set C (because not all of
the bits specified in the immediate mask were set); and then sets the bits.
For destination operand SR:
For other destination operands:
If all bits in the mask are set to zero, the destination is unchanged, and the C bit is set. Refer to
Table A-9 on page A-13 when the destination is the SR register.
Before Execution
X:$FFE2
LF
15
SR
14
*
?
L
C
13
*
— Set as defined in the field and if specified in the field
— Set if data limiting occurred during 36-bit source move
— Set if all bits specified by the mask are set
#$F400,X:<<$FFE2
12
8921
0000
*
MR
Cleared if not all bits specified by the mask are set
11
*
Test Bit Field and Set
10
*
Instruction Set Details
I1
9
Assembler Syntax:
BFSET
BFSET
I0
8
SZ
7
L
6
5
E
After Execution
X:$FFE2
#iiii,X:<ea>
#iiii,D
U
4
CCR
SR
N
3
2
Z
FD21
0000
V
1
C
0
BFSET
A-51

Related parts for dsp56800