Freescale Semiconductor SC140 specifications Sign-Extension Dalu, Sxt.b d3,d0, Sxt.w d3,d2

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 714
Image 714

SXT.x

SXT.x

Sign-Extension (DALU)

SXT.x

Operation

 

Assembler Syntax

 

Da[7:0] → Dn[7:0]; Da[7] → Dn[39:8]

SXT.B Da,Dn

 

Da[15:0] → Dn[15:0]; Da[15] → Dn[39:16]

SXT.W Da,Dn

 

Dn[31] → Dn[39:32]

 

SXT.L Dn

 

Description

These operations sign-extend a data register. The sign bit (bit 7 in a byte, bit 15 in a word, and bit 31 in a long word) is copied to the upper bits in a 40-bit data register.

SXT.B Da,Dn

Sign-extends a byte from a source data register (Da[7:0]) into a destination data register (Dn).

SXT.W Da,Dn

Sign-extends a word from a source data register (Da[15:0]) into a destination data register (Dn).

SXT.L Dn

Sign-extends a long word from a source data register (Dn[31:0]) into a destination data register (Dn).

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 1

sxt.b d3,d0

Register/Memory Address

D3

L0:D0

Example 2

sxt.w d3,d2

Register/Memory Address

D3

Before

$FF FE34 A086

Before

$00 0000 7056

After

$0:$FF FFFF FF86

After

A-400

SC140 DSP Core Reference Manual

Page 714
Image 714
Freescale Semiconductor SC140 specifications Sign-Extension Dalu, Sxt.b d3,d0, Sxt.w d3,d2