dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 424

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
BRSET
Operation:
Branch if <bitfield> of destination is all ones (no parallel move)
Description: Test all selected bits of the destination operand. If all the selected bits are set, C is set, and program
Usage:
Example:
Explanation of Example:
Condition Codes Affected:
Note:
A-80
execution continues at the location in program memory at PC + displacement. Otherwise, C is cleared,
and execution continues with the next sequential instruction. A 16-bit immediate value is used to spec-
ify which bits are tested. Those bits that are set in the immediate value are the same bits that are tested
in the destination; those bits that are cleared in the immediate value are ignored in the destination.
This instruction is useful in performing I/O flag polling.
LABEL
Prior to execution, the 16-bit X memory location X:$5000 contains the value $0FF0. Execution of the
BRSET instruction tests the state of bits 8 and 10 in X:$5000 and sets the C bit (because all the mask
bits were set). Since C is set, program execution is then transferred to the address offset from the cur-
rent program counter by the displacement that is specified in the instruction.
For destination operand SR:
For other destination operands:
L
C
If all bits in the mask are cleared, C is set and the branch is taken.
Before Execution
X:$5000
LF
15
— Bits 14–10 of the mask operand must be cleared.
— Set if data limiting occurred during 36-bit source move
— Set if all bits specified by the mask are set
SR
P4
14
Cleared if at least 1 bit specified by the mask is not set
BRSET
INC.W
INC.W
ADD
13
P3
P2
12
0FF0
0300
MR
DSP56800E Core Reference Manual
P1
11
#$0500,X:$5000,LABEL
A
A
B,A
Branch if Bits Set
P0
10
I1
9
Assembler Syntax:
I0
8
SZ
7
6
L
5
E
After Execution
X:$5000
BRSET #<MASK8>,X:<ea>,AA
BRSET #<MASK8>,D,AA
U
4
CCR
; next two instructions
; are bypassed
SR
N
3
2
Z
0FF0
0301
Freescale Semiconductor
V
1
C
0
BRSET

Related parts for dsp56800e