Freescale Semiconductor SC140 Cmpeq.W, CMPEQ.W Compare for Equal Dalu, Cmpeq.w #$5,d3

Models: SC140

1 760
Download 760 pages 48.94 Kb
Page 433
Image 433

 

 

 

CMPEQ.W

 

 

 

CMPEQ.W Compare for Equal (DALU)

CMPEQ.W

Operation

Assembler Syntax

 

If #u5 == Dn, then 1 → T, else 0 → T

CMPEQ.W #u5,Dn {0 u5 < 32}

If #s16 == Dn, then 1 → T, else 0 → T

CMPEQ.W #s16,Dn {–215

s16 < 215}

Description

CMPEQ.W #u5,Dn

Compares an immediate unsigned 5-bit value (range 0–31) with a data register (Dn) for equality. The immediate value is right-aligned and zero-extended.

CMPEQ.W #s16,Dn

Compares an immediate signed 16-bit value that has been right-aligned and sign-extended to 40 bits with a data register (Dn) for equality.

Status and Conditions that Affect Instruction

None.

Status and Conditions Changed by Instruction

Register Address

Bit Name

Description

SR[1]

T

Sets T bit if equal, otherwise cleared.

Example

cmpeq.w #$5,d3

Register/Memory Address

immediate

D3

SR

Before

$0000 0005

$00 0000 0005

$00E4 0000

After

$00E4 0002

SC140 DSP Core Reference Manual

A-119

Page 433
Image 433
Freescale Semiconductor SC140 Cmpeq.W, CMPEQ.W Compare for Equal Dalu, Cmpeq.w #$5,d3, CMPEQ.W #u5,Dn, CMPEQ.W #s16,Dn