13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Advanced Function <strong>Instruction</strong>FUN104 D PT_SWPBLOCK TABLE SWAPFUN104 D PT_SWPTa : Starting register of Table aTb : Starting register of Table bL : Lengths of Table a and bTs, Rd may combine with V, Z, P0~P9 to serveindirect address applicationOperandRangeWY WM WS TMR CTR HR OR SR ROR DR K XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095Ta ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○Tb ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○L ○ ○* ○ ○2∣256V、ZP0~P9• This instruction swaps the contents of Tables a and b, so the table must be the same length, and the registersin the table must of write able. Since a complete swap is done with each time the instruction is executed, nopointer is needed.• When move control "EN" = 1 or "EN↑" ( P instruction) have a transition from 0 to 1, the contents of Table aand Table b will be completely swapped.• This instruction will swap all the registers specified in L each time the instruction is executed, so if the tablelength is big, it will be very time consuming, therefor P instruction should be used.X0104P.T_SWPEN TS : R 0Td : R 10L : 10• The diagram at left below is the status before execution.When X0 from 0→1, the contents of R0~R9 in Ts table willswap with R10~R19.Ta Tb Ta TbR0 0000 R10 1111 R0 1111 R10 0000R1 0000 R11 1111 R1 1111 R11 0000R2 0000 R12 1111 R2 1111 R12 0000R3 0000 R13 1111 X0= R3 1111 R13 0000R4 0000 R14 1111 R4 1111 R14 0000R5 0000 R15 1111 R5 1111 R15 0000R6 0000 R16 1111 R6 1111 R16 0000R7 0000 R17 1111R7 1111 R17 0000R8 0000 R18 1111 R8 1111 R18 0000R9 0000 R19 1111 R9 1111 R19 0000Before executedAfter executed7-88

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!