BFMOV

Transferring bit-fields

[V3.00.00 or later]

BFMOV

Bit Field MOVe


[Syntax]

BFMOV slsb, dlsb, width, src, dest

 

[Operation]

unsigned long tmp1, tmp2;

tmp1 = (0FFFFFFFFh >> (32-width)) << dlsb;

tmp2 = (src >> slsb) << dlsb;

dest = (tmp2 & tmp1) | (dest & ~tmp1);

 

[Function]

-

The number of bits specified by width from the bit position slsb at the location src are transferred to the number of bits specified by width from the bit position dlsb at the location dest. The values of the rest of the bits at dest are retained.

-

The range of slsb is 0 ≤ slsb ≤ 31, the range of dlsb is 0 ≤ dlsb ≤ 31, and the range of width is 1 ≤ width ≤ 31.

-

If (slsb + width) > 32 and (dlsb + width) > 32, then dest becomes undefined.

-

You can assemble assembly-language code that includes this instruction if you have specified the assembler option -isa with selection of the instruction set of the RXv3 or a later version.

 

[Instruction Format]

Syntax

Processng Size

Operand

Code Size

(Byte)

slsb

dlsb

width

src

dest

BFMOV slsb, dlsb, width, src, dest

L

#IMM:5

#IMM:5

#IMM:5

Rs

Rd

5

 

[Flag Change]

This instruction does not affect the states of flags.

 

[Description Example]

BFMOV #5, #10, #3, R1, R2