beautypg.com

Instructions fun 022 xchg data exchange – Toshiba 6F3B0253 User Manual

Page 141

background image

6F3B0253

Basic Hardware and Function

139

7. Instructions

FUN 022

XCHG

Data exchange

Expression

Input

[ A XCHG B ]

Output

Function

When the input is ON, the data of A and the data of B is exchanged.

Execution condition

Input

Operation

Output

OFF

No execution

OFF

ON

Execution

ON

Operand

Name

Device

Register

Constant Index

X

Y

R

S

T.

C. XW YW RW SW T

C

D

I

J

K

A Operation data

B Operation data

Example

When R005 is ON, the data of RW23 and D0100 is exchanged. If the original data of RW23 is
23456 and that of D0100 is 291, the operation result is as follows.

RW23

23456

RW23

291

D0100

291

D0100

23456

Before operation

After operation