English
Language : 

S912XHZ512F1VAG Datasheet, PDF (255/978 Pages) Freescale Semiconductor, Inc – Covers MC9S12XHZ384, MC9S12XHZ256
BFFO
Bit Field Find First One
Chapter 5 XGATE (S12XGATEV2)
BFFO
Operation
FirstOne (RS) ⇒ RD;
Searches the first “1” in register RS (from MSB to LSB) and writes the bit position into the destination
register RD. The upper bits of RD are cleared. In case the content of RS is equal to $0000, RD will be
cleared and the carry flag will be set. This is used to distinguish a “1” in position 0 versus no “1” in the
whole RS register at all.
CCR Effects
NZVC
0∆0∆
N: 0; cleared.
Z: Set if the result is $0000; cleared otherwise.
V: 0; cleared.
C: Set if RS = $00001; cleared otherwise.
1 Before executing the instruction
Code and CPU Cycles
Source Form
BFFO RD, RS
Address
Mode
DYA
00001
Machine Code
RD
RS
Cycles
10000
P
MC9S12XHZ512 Data Sheet, Rev. 1.06
Freescale Semiconductor
255