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 52 D PSHFRSHIFT RIGHTFUN 52 D PSHFRD : Register to be shiftedN : Number of bits to be shiftedD, 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 shift control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, will shift the data of Dregister towards the right by N successive bits (in descending order). After the highest bits, B15 or B31 ( Dinstruction) have been shifted right, their positions will be replaced by the shift-in bit INB, while shift-out bitB0 will appear at shift-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 shifts the data in R0 registerX052P.SHFREN D : R 0N : 15INBOTBERRY0towards the right by 15 successive bits. Theresults are shown below.INB B15 R0 B0 Y00 → 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 →△ * X0=INB B15 R0 B0 Y00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0△ △ △ △ △ △ △ △ △ △ △ △ △ △ △ △ *7-27

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

Saved successfully!

Ooh no, something went wrong!