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>FUN 46 PSWAPBYTE SWAPFUN 46 PSWAPD : Register for byte data swapD may combine with V, Z, P0~P9 to serve indirect addressapplicationOperandRangeWY WM WS TMR CTR HR OR SR ROR DR XRWY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095V、ZP0~P9D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○• When swap control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, swap the data of the lowbyte, Byte 0 (B0~B7), and the high byte, Byte 1 (B8~B15), in the 16 bit register specified by D.B15 B8 B7 B0Byte 1(high) Byte 0(low)X0EN46PSWAP R 0• The instruction at left swaps the data of the low byte(B0~B7) and the high byte (B8~B15) in R0. The resultsare as follows:Byte1Byte0D R0 0 0 1 1 0 0 1 1 1 1 1 1 0 0 0 0B15 B8 B7 B0 X0=B15 B0D R0 1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 17-21

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

Saved successfully!

Ooh no, something went wrong!