Insert, Insert bit field (dalu), Description – Freescale Semiconductor StarCore SC140 User Manual

Page 517: Status and conditions that affect instruction, Operation assembler syntax

Advertising
background image

INSERT

SC140 DSP Core Reference Manual

A-203

INSERT

Insert Bit Field (DALU)

INSERT

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.

Status and Conditions that Affect Instruction

None.

Status and Conditions Changed by Instruction

Example

insert #12,#22,d6,d7

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}

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).

Register Address

Bit Name

Description

Ln

L

Clears the Ln bit in the destination register.

Register/Memory Address

Before

After

D6

$FF AF6C 3465

L7:D7

$0:$00 0000 000F

$0:$01 1940 000F

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

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 1 1 1

0

1
6

3
2

3
9

D6

D7

OFFSET = 22

WIDTH = 12

Advertising