Freescale Semiconductor SC140 Extract Extract Signed Bit Field Dalu, Extract #$c,#$e,d2,d4

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 485
Image 485

 

 

 

EXTRACT

 

 

 

EXTRACT Extract Signed Bit Field (DALU)

EXTRACT

Operation

Assembler Syntax

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

 

 

Db[offset + width – 1] → Dn[39:width] (sign-extension)

 

 

width = #U6; offset = #u6

EXTRACT #U6,#u6,Db,Dn

 

 

{0 ≤ U6 ≤ 40}{0 ≤ u6 ≤ 40}

 

 

{#U6+#u6

40}

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

EXTRACT Da,Db,Dn

 

 

{0 Da[13:8] 40}

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

Description

These operations extract a bit field from a source data register (Db) and place it in a destination data register (Dn), right-aligned and sign-extended from the MSB of the extracted bit field. The extracted field is a signed integer. If the offset is zero, this instruction can be used to sign-extend an arbitrary width signed integer.

EXTRACT #U6,#u6,Db,Dn

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

EXTRACT 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

extract #$c,#$e,d2,d4

Register/Memory Address

immediate (width)

immediate (offset)

D2

L4:D4

Before

$C

$E

$FF 8665 4321

$0:$00 0000 0000

After

$0:$FF FFFF F995

SC140 DSP Core Reference Manual

A-171

Page 485
Image 485
Freescale Semiconductor SC140 Extract Extract Signed Bit Field Dalu, Extract #$c,#$e,d2,d4, Extract #U6,#u6,Db,Dn