INSERT

INSERT

Insert Bit Field (DALU)

INSERT

Operation

Assembler Syntax

Db[(width – 1):0] → Dn[(offset + width – 1):offset]

 

width = #U6; offset = #u6

INSERT #U6,#u6,Db,Dn {0 U6 40}

 

{0 u6 40}[#U6 + #u6 ≤ 40]

width = Da[13:8]; offset = Da[5:0]

INSERT Da,Db,Dn {0 Da[5:0] 40}

 

{0 Da[13:8] 16}{Da[13:8] + Da[5:0]

 

40}

Description

These operations insert a bit field from a source data register (Db) into the destination data register (Dn). The bits outside of the inserted field in the destination register are unchanged. In addition, the source register is unchanged.

INSERT #U6,#u6,Db,Dn

Uses two immediate unsigned 6-bit integers for the width (#U6) and offset (#u6).

INSERT Da,Db,Dn

Uses a supplemental data register Da for the width (bits 13:8) and the offset (bits 5:0).

Status and Conditions that Affect Instruction

None.

Status and Conditions Changed by Instruction

Register Address

Bit Name

Description

Ln

L

Clears the Ln bit in the destination register.

Example

insert #12,#22,d6,d7

Register/Memory Address

 

Before

D6

 

 

 

$FF AF6C 3465

L7:D7

 

 

 

$0:$00 0000 000F

 

3

3

 

9

2

After

$0:$01 1940 000F

1

0

6

D6

1 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 0 1 1 0 0 0 0 1 1 0 1 0 0 0 1 1 0 0 1 0 1

WIDTH = 12

OFFSET = 22

D7

0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 11 1

SC140 DSP Core Reference Manual

A-203

Page 517
Image 517
Freescale Semiconductor SC140 Insert Bit Field Dalu, Insert #12,#22,d6,d7, Insert #U6,#u6,Db,Dn, Insert Da,Db,Dn