[Instruction] Contents

[Instruction] Contents [Instruction] Contents

servotechnica.ru
from servotechnica.ru More from this publisher
13.07.2015 Views

Advanced Function InstructionFUN 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

Advanced Function InstructionFUN 47 PUNITNIBBLE UNITEFUN 47 PUNITS : Starting source register to be unitedN : Number of nibbles to be unitedD : Registers storing united dataS, N, D may combine with V, Z, P0~P9 to serveindirect address applicationRangeOperandWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095P0~P9S ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○N ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○1∣4V、Z• When unite control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, take out the lowestnibbles NB0, of N successive registers starting from S, and fill them into NB0, NB1, .....NBn-1 of D inascending order. Nibbles not yet filled in D (when N is odd) are filled with 0. (A nibble is comprised by 4 bits.Starting from the lowest bit in the register, B0, each successive four bits form a nibble, so B0~B3 form nibble0, B4~B7 form nibble 1, etc...).• This instruction only provides WORD (16 bit) operand. Because of this, there are usually only 4 nibbles canbe involved. Therefore the effective range of N is 1~4. Beyond this range, will set the N value error flag"ERR" to 1, and do not carry out this instruction.X0EN47P.UNITS : R 0N : 3ERR• The instruction at left takes out NB0 from 3 registers, R0,R1 and R2, and fills them into NB0~NB2 within WY0register.D :WY 0N=3NB3 NB2 NB1 NB0D W Y00000 010000100001Y15Y0Set the not united NB as 0B15 B12 B11 B8 B7 B4 B3 B0S R0 0001N=3 S+1 R1 0010S+2 R2 0100NB3 NB2 NB1 NB0 X0=7-22

Advanced Function <strong>Instruction</strong>FUN 47 PUNITNIBBLE UNITEFUN 47 PUNITS : Starting source register to be unitedN : Number of nibbles to be unitedD : Registers storing united dataS, N, D may combine with V, Z, P0~P9 to serveindirect address applicationRangeOperandWX WY WM WS TMR CTR HR IR OR SR ROR DR K XRWX0∣WX240WY0∣WY240WM0∣WM1896WS0∣WS984T0∣T255C0∣C255R0∣R3839R3840∣R3903R3904∣R3967R3968∣R4167R5000∣R8071D0∣D4095P0~P9S ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○N ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○1∣4V、Z• When unite control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, take out the lowestnibbles NB0, of N successive registers starting from S, and fill them into NB0, NB1, .....NBn-1 of D inascending order. Nibbles not yet filled in D (when N is odd) are filled with 0. (A nibble is comprised by 4 bits.Starting from the lowest bit in the register, B0, each successive four bits form a nibble, so B0~B3 form nibble0, B4~B7 form nibble 1, etc...).• This instruction only provides WORD (16 bit) operand. Because of this, there are usually only 4 nibbles canbe involved. Therefore the effective range of N is 1~4. Beyond this range, will set the N value error flag"ERR" to 1, and do not carry out this instruction.X0EN47P.UNITS : R 0N : 3ERR• The instruction at left takes out NB0 from 3 registers, R0,R1 and R2, and fills them into NB0~NB2 within WY0register.D :WY 0N=3NB3 NB2 NB1 NB0D W Y00000 010000100001Y15Y0Set the not united NB as 0B15 B12 B11 B8 B7 B4 B3 B0S R0 0001N=3 S+1 R1 0010S+2 R2 0100NB3 NB2 NB1 NB0 X0=7-22

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

Saved successfully!

Ooh no, something went wrong!