Advanced Function Instruction
7 -8 8
FUN104
D
P
T_SWP
BLOCK TABLE SWAP
FUN104
D
P
T_SWP
Ta : Starting register of Table a
Tb : Starting register of Table b
L : Lengths of Table a and b
Ts, Rd may combine with V, Z, P0~P9 to serve
indirect address application
WY
WM
WS
TMR
CTR
HR
OR
SR
ROR
DR
K
XR
Range
Ope-
rand
WY0
∣
WY240
WM0
∣
WM1896
WS0
∣
WS984
T0
∣
T255
C0
∣
C255
R0
∣
R3839
R3904
∣
R3967
R3968
∣
R4167
R5000
∣
R8071
D0
∣
D4095
2
∣
256
V
、
Z
P0~P9
Ta
○
○
○
○
○
○
○
○
*
○
*
○
○
Tb
○
○
○
○
○
○
○
○
*
○
*
○
○
L
○
○
*
○
○
z
This instruction swaps the contents of Tables a and b, so the table must be the same length, and the registers
in the table must of write able. Since a complete swap is done with each time the instruction is executed, no
pointer is needed.
z
When move control "EN" = 1 or "EN
↑
" (
P
instruction) have a transition from 0 to 1, the contents of Table a
and Table b will be completely swapped.
z
This instruction will swap all the registers specified in L each time the instruction is executed, so if the table
length is big, it will be very time consuming, therefor P instruction should be used.
X0
EN
T
S
: R 0
Td : R 10
L :
10
104P.T_SWP
z
The diagram at left below is the status before execution.
When X0 from 0
→
1, the contents of R0~R9 in Ts table will
swap with R10~R19.
Ta Tb
Ta
Tb
R0
0 0 0 0
R10
1 1 1 1
R0
1 1 1 1
R10
0 0 0 0
R1
0 0 0 0
R11
1 1 1 1
R1
1 1 1 1
R11
0 0 0 0
R2
0 0 0 0
R12
1 1 1 1
R2
1 1 1 1
R12
0 0 0 0
R3
0 0 0 0
R13
1 1 1 1
R3
1 1 1 1
R13
0 0 0 0
R4
0 0 0 0
R14
1 1 1 1
R4
1 1 1 1
R14
0 0 0 0
R5
0 0 0 0
R15
1 1 1 1
R5
1 1 1 1
R15
0 0 0 0
R6
0 0 0 0
R16
1 1 1 1
R6
1 1 1 1
R16
0 0 0 0
R7
0 0 0 0
R17
1 1 1 1
X0
=
Ö
R7
1 1 1 1
R17
0 0 0 0
R8
0 0 0 0
R18
1 1 1 1
R8
1 1 1 1
R18
0 0 0 0
R9
0 0 0 0
R19
1 1 1 1
R9
1 1 1 1
R19
0 0 0 0
Before executed
After executed