TEST

TEST, TESTP, DTEST, DTESTP

 

TEST instruction reads the specific bits of word source and writes its value to the Destination to set or clear the data bit.

 

 

S1

Source

S2

Bit number

D

Destination to be set or cleared

 

Instruction

Device address

No. of Steps

Flag

M

X

Y

K

L

F

T

C

S

Z

D

@D

Int.

Error

Zero

Carry

TEST(P)

DTEST(P)

S1

o

o

o

o

o

o

o

o

-

o

o

o

-

4

o

-

-

S2

o

o

o

o

o

o

o

o

-

o

o

o

o

D

o

-

o

o

o

-

o

o

-

-

-

-

-

 

TEST

TEST instruction reads the specific bits (S1)of word source(S1) and writes its value to the Destination(D) to set or clear the data bit.

  • The range of S2 is from 0 to 15 (bit0~bit15)

  • If D is 1, its bit will be turned ON and if D is 0, its bit will be turned OFF.

 

Example)

If X00 is ON, TEST instruction reads bit10 of D0.

According to the value of the bit10, M00 will be set (1) or cleared (0).

 

 

DTEST

DTEST instruction reads the specific bits (S1) of double word source (S1) and writes its value to the Destination(D) to set or clear the data bit.

  • The range of S2 is from 0 to 31 (bit0~bit31)

  • If D is 1, its bit will be turned ON and if D is 0, its bit will be turned OFF.

 

Example)

If X01 is ON, DTEST instruction reads bit19 of M10.

According to the value of the bit19, M0 will be set (1) or cleared (0).