
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
670 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
2.8.1 BFC and BFI
Bit Field Clear and Bit Field Insert.
2.8.1.1
Syntax
BFC{
cond
}
Rd
, #
lsb
, #
width
BFI{
cond
}
Rd
,
Rn
, #
lsb
, #
width
where:
cond
is an optional condition code, see
Section 34–2.3.7 “Conditional execution”
.
Rd
is the destination register.
Rn
is the source register.
lsb
is the position of the least significant bit of the bitfield.
lsb
must be in the range 0 to 31.
width
is the width of the bitfield and must be in the range 1 to 32
−
lsb
.
2.8.1.2
Operation
BFC
clears a bitfield in a register. It clears
width
bits in
Rd
, starting at the low bit position
lsb
. Other bits in
Rd
are unchanged.
BFI
copies a bitfield into one register from another register. It replaces
width
bits in
Rd
starting at the low bit position
lsb
, with
width
bits from
Rn
starting at bit[0]. Other bits in
Rd
are unchanged.
2.8.1.3
Restrictions
Do not use SP and do not use PC.
2.8.1.4
Condition flags
These instructions do not affect the flags.
2.8.1.5
Examples
BFC
R4, #8, #12
; Clear bit 8 to bit 19 (12 bits) of R4 to 0
BFI
R9, R2, #8, #12
; Replace bit 8 to bit 19 (12 bits) of R9 with
; bit 0 to bit 11 from R2