Developers Manual March, 2003 B-13

Intel® 80200 Processor based on Intel® XScale Microarchitecture
Optimization Guide
B.3.2 Bit Field Manipulation

The Intel® 80200 processor shift and logical operations provide a useful way of manipulating bit

fields. Bit field operations can be optimized as follows:

;Set the bit number specified by r1 in register r0
mov r2, #1
orr r0, r0, r2, asl r1
;Clear the bit number specified by r1 in register r0
mov r2, #1
bic r0, r0, r2, asl r1
;Extract the bit-value of the bit number specified by r1 of the
;value in r0 storing the value in r0
mov r1, r0, asr r1
and r0, r1, #1
;Extract the higher order 8 bits of the value in r0 storing
;the result in r1
mov r1, r0, lsr #24