[Instruction] Contents
[Instruction] Contents [Instruction] Contents
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
- Page 78 and 79: Basic Function InstructionRST D PSy
- Page 80 and 81: Basic Function InstructionFUN 0MCSy
- Page 82 and 83: Basic Function InstructionFUN 1MCES
- Page 84 and 85: Basic Function InstructionFUN 2SKPS
- Page 86 and 87: Basic Function InstructionFUN 4DIFU
- Page 88 and 89: Basic Function InstructionFUN 6 D P
- Page 90 and 91: Basic Function InstructionFUN 7 DUD
- Page 92 and 93: Basic Function InstructionFUN 9 D P
- Page 94 and 95: Basic Function InstructionFUN 11 D
- Page 96 and 97: Basic Function InstructionFUN 13 D
- Page 98 and 99: Basic Function InstructionFUN 14 D
- Page 100 and 101: Basic Function InstructionFUN 15 D
- Page 102 and 103: Basic Function InstructionFUN 17 D
- Page 104 and 105: Basic Function InstructionFUN 19 D
- Page 106 and 107: Basic Function InstructionFUN 21 D
- Page 108 and 109: Advanced Function InstructionFUN22
- Page 110 and 111: Advanced Function InstructionFUN 24
- Page 112 and 113: Advanced Function InstructionFUN 26
- Page 114 and 115: Advanced Function InstructionFUN 28
- Page 116 and 117: Advanced Function InstructionFUN 30
- Page 118 and 119: Advanced Function InstructionFUN32A
- Page 120 and 121: Advanced Function InstructionFUN 36
- Page 122 and 123: Advanced Function InstructionFUN 40
- Page 124 and 125: Advanced Function InstructionFUN 42
- Page 126 and 127: Advanced Function InstructionFUN 44
- Page 130 and 131: Advanced Function InstructionFUN 48
- Page 132 and 133: Advanced Function InstructionFUN50
- Page 134 and 135: Advanced Function InstructionFUN 52
- Page 136 and 137: Advanced Function InstructionFUN 54
- Page 138 and 139: Advanced Function InstructionFUN55
- Page 140 and 141: Advanced Function InstructionFUN56
- Page 142 and 143: Advanced Function InstructionFUN 58
- Page 144 and 145: Advanced Function InstructionFUN 59
- Page 146 and 147: Advanced Function InstructionFUN 59
- Page 148 and 149: Advanced Function InstructionFUN 61
- Page 150 and 151: Advanced Function InstructionFUN 63
- Page 152 and 153: Advanced Function InstructionFUN 64
- Page 154 and 155: Advanced Function InstructionEND PR
- Page 156 and 157: Advanced Function InstructionFUN 66
- Page 158 and 159: Advanced Function InstructionFUN 68
- Page 160 and 161: Advanced Function InstructionFUN 70
- Page 162 and 163: Advanced Function InstructionFUN 74
- Page 164 and 165: Advanced Function InstructionFUN 76
- Page 166 and 167: Advanced Function InstructionFUN 78
- Page 168 and 169: Advanced Function InstructionFUN 79
- Page 170 and 171: Advanced Function InstructionFUN 81
- Page 172 and 173: Advanced Function InstructionFUN 82
- Page 174 and 175: Advanced Function InstructionFUN 84
- Page 176 and 177: Advanced Function InstructionFUN 86
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