Advanced Function Instruction
7-88
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 0000
R10
1111 R0 1111
R10
0000
R1 0000
R11
1111 R1 1111
R11
0000
R2 0000
R12
1111 R2 1111
R12
0000
R3 0000
R13
1111 R3 1111
R13
0000
R4 0000
R14
1111 R4 1111
R14
0000
R5 0000
R15
1111 R5 1111
R15
0000
R6 0000
R16
1111 R6 1111
R16
0000
R7 0000
R17
1111
X0
=
Ö
R7 1111
R17
0000
R8 0000
R18
1111 R8 1111
R18
0000
R9 0000
R19
1111 R9 1111
R19
0000
Before executed After executed