MAX

Selecting the highest value

MAX

MAXimum value select


[Syntax]

MAX src, dest

 

[Operation]

if ( src > dest )

dest = src;

 

[Function]

-

This instruction compares src and dest as signed values and places whichever is greater in dest.

 

[Instruction Format]

Syntax

Processng Size

src

dest

Code size

(Byte)

MAX src, dest

L

#SIMM:8

Rd

4

L

#SIMM:16

Rd

5

L

#SIMM:24

Rd

6

L

#IMM:32

Rd

7

L

Rs

Rd

3

L

[Rs].memex

Rd

3 (memex == UB)

4 (memex != UB)

L

dsp:8[Rs].memex

Rd

4 (memex == UB)

5 (memex != UB)

L

dsp:16[Rs].memex

Rd

5 (memex == UB)

6 (memex != UB)

[Flag Change]

-

This instruction does not affect the states of flags.

 

[Description Example]

MAX #10, R2

MAX R1, R2

MAX [R1], R2

MAX 3[R1].B, R2