CMPEQ

CMPEQ

Compare for Equal (DALU)

CMPEQ

Operation

Assembler Syntax

If Da == Dn, then 1→ T, else 0 → T

CMPEQ Da,Dn

Description

 

CMPEQ Da,Dn

 

Compares the 40-bit contents of two data registers (Da and Dn), setting the T bit if they are equal, and clearing the T bit if they are not.

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 d2,d3

Register/Memory Address

D2

D3

SR

Before

$00 0000 0005

$00 0000 0005

$00E4 0000

After

$00E4 0002

Instruction Formats and Opcodes

Instruction

Words

Cycles

Type

CMPEQ Da,Dn

1

1

1

Note: ** indicates serial grouping encoding.

Opcode

 

 

 

15

8

7

0

 

 

0 * 1 1 0 0 F F

F 1 1 0 0 J J J

 

 

 

 

Instruction Fields

Da

JJJ

 

Single Source Data Register

 

 

 

 

000

D0

010

D2

100

D4

110

D6

 

 

 

 

 

 

 

 

 

 

001

D1

011

D3

101

D5

111

D7

 

 

 

 

 

 

 

 

Note:

This instruction

can specify D8-D15 as operands by using a prefix.

 

 

SC140 DSP Core Reference Manual

A-117

Page 431
Image 431
Freescale Semiconductor SC140 Compare for Equal Dalu, Cmpeq d2,d3, If Da == Dn, then 1→ T, else 0 → T, Cmpeq Da,Dn