6F3B0253

7. Instructions

FUN 064

TEST

Bit test

Expression

Input [ A TEST B ]Output

Function

When the input is ON, this instruction finds logical AND of A and B. Then if the result is not 0, sets the output to ON.

Execution condition

Input

 

Operation

Output

OFF

No execution

OFF

ON

Execution

When the result is not 0

ON

 

 

When the result is 0

OFF

Operand

 

Name

 

 

Device

 

 

 

 

 

 

 

Register

 

 

 

 

 

 

Constant

Index

 

 

X

Y

R

S

T.

C.

XW

YW

RW

SW

T

C

D

 

I

 

J

K

 

 

A

Source

 

 

 

 

 

 

 

 

 

B

Test data

 

 

 

 

 

 

 

 

 

Example

Logical AND operation is executed for the data of RW07 and the constant data H0FFF, and if the result is not 0, R00A is turned ON. (R00A is turned ON when any device from R070 to R07B is ON.)

If the data of RW07 is H4008, R00A is turned ON.

RW07

F E D C B A 9 8 7 6 5 4 3 2 1 0

0

1

 

0

0

0

0

 

0

0

0

0

 

0

0

1

0

 

0

0

 

4

 

 

 

0

 

 

 

0

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

AND

 

 

 

 

 

 

 

 

 

Constant

0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1

Result

0

F

F

F

0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0

Result is not 0

R00A comes ON

Basic Hardware and Function 163

Page 165
Image 165
Toshiba 6F3B0253 user manual Test, Bit test