TST

Logical test

TST

TeST logical


[Syntax]

TST src, src2

 

[Operation]

src2 & src;

[Function]

-

This instruction changes the flag states in the PSW according to the result of logical AND of src2 and src.

 

[Instruction Format]

Syntax

Processng Size

src

src2

Code size

(Byte)

TST src, src2

L

#SIMM:8

Rs

4

L

#SIMM:16

Rs

5

L

#SIMM:24

Rs

6

L

#IMM:32

Rs

7

L

Rs

Rs2

3

 

[Rs].memex

Rs2

3 (memex == UB)

4 (memex != UB)

 

dsp:8[Rs].memex

Rs2

4 (memex == UB)

5 (memex != UB)

 

dsp:16[Rs].memex

Rs2

5 (memex == UB)

6 (memex != UB)

[Flag Change]

Flag

C

Z

S

O

Change

 

 

Conditions

Z : The flag is set if the result of the operation is 0; otherwise it is cleared.

O : The flag is set if the MSB of the result of the operation is 1; otherwise it is cleared.

 

[Description Example]

TST #7, R2

TST R1, R2

TST [R1], R2

TST 1[R1].UB, R2