13.07.2015 Views

[Instruction] Contents

[Instruction] Contents

[Instruction] Contents

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Advanced Function <strong>Instruction</strong>FUN 54 D PROTRROTATE RIGHTFUN 54 D PROTRD : Register to be rotatedN : Number of bits to be rotatedD, N may combine with V, Z, P0~P9 to serveindirect address applicationOperandRangeWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D40951 1∣ or ∣16 32P0~P9D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○N ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○V、Z• When rotate control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, will rotate the bit data ofD register towards the right by N successive bits (in descending order, ie. in a 16-bit instruction, B15→B14,B14→B13, .... , B1→B0, B0→B15. In a 32-bit instruction, B31→B30, B30→B29, .... , B1→B0, B0→B31). Atthe same time, the status of the rotated out B0 bits will appear at the rotate-out bit "OTB".• If the operand is 16 bit, the effective range of N is 1~16. For 32 bits ( D instruction) operand, it is 1~32.Beyond this range, will set the N value error flag "ERR" to 1, and do not carry out this instruction.• The instruction at left rotates data from R0 registerX054P.ROTREN D : R 0 OTBY0towards the right 8 successive bits. The results areshown below.N : 8ERRB15 R0 B01 1 1 1 0 0 0 0 1 0 1 0 1 0 1 0* X0=Y0B15 R0 B01 0 1 0 1 0 1 0 1 1 1 1 0 0 0 0*Y0 1*7-29

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

Saved successfully!

Ooh no, something went wrong!