[Instruction] Contents
[Instruction] Contents [Instruction] Contents
Advanced Function InstructionFUN 48 PDISTNIBBLE DISTRIBUTEFUN 48 PDISTS : Source data to be distributedN : Number of nibbles to be distributedD : Starting register storing distribution dataS, N, D may combine with V, Z, P0~P9 toserve indirect 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∣D409516-bit+/-numberP0~P9S ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○N ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ 1~4 ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When distribution control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, will take Nsuccessive nibbles starting from the lowest nibble NB0 within S, and distribute them in ascending order intothe 0 nibbles of N registers starting from D. The nibbles other than NB0 in each of the registers within D areall set to zero. (A nibble is comprised by 4 bits. Starting from the lowest bit in a register, B0, each successive4 bits form a nibble, so B0~B3 form nibble 0, B4~B7 form nibble 1, etc...)• This instruction only provides WORD (16 bit) operand. Therefore there are usually only 4 nibbles can beinvolved, so the effective value of N is 1~4. Beyond this range, will set the N value error flag "ERR" to 1, anddo not carry out this instruction.X048P.DISTEN S : WY 0N : 3D : R 0ERR• The instruction at left writes NB0~NB2 from the WX0register into the NB0 of the 3 consecutive registersR0~R2.N=3 NB3 NB2 NB1 NB0X15 X11 X0 B15 B0S WX0 0000010000100001 D R0 0000 0000 0000 0001NB3 NB2 NB1 NB0 D+1 R1 0 0 0 0 0000 0000 0010X0=D+2 R2 0 0 0 0 0000 0000 0100NB1~NB3 are all set a "0 "7-23
Advanced Function InstructionFUN49 PBUNITBYTE UNITEFUN49 PBUNITExecution controlENLadder symbol49P.BUNITS :N :D :S :Starting address of source register to be unitedN :Number of bytes to be unitedD :Registers to store the united dataS, N, D may associate with V、Z、P0~P9 index register toserve the indirect addressing applicationOperandRangeHR ROR DR KR0∣R3839R5000∣R8071D0∣D4095S ○ ○ ○N ○ ○ ○ 1~256D ○ ○* ○●●●When execution control "EN"=1 or "EN↑"( P instruction)changes from 0→1, it will perform the bytecombination starting from S, length by N, and then store the results into D registers.This instruction will not act if invalid range of length.When communicating with intelligent peripheral in binary data format, this instruction may be applied to dobyte combination for following word data processing.Example:M249P.BUNITEN S : R 1500N : R 999D : R 2500Description:When M2 changes from 0→1, it will perform the byte combination starting from R1500, the length isassigned by R999, and then store the results into registers starting from R2500.It is supposed R999=10, the results of combination will store into R2500~R2504.SDHigh Byte Low Byte High Byte Low ByteR1500 Don’t care Byte-0 R2500 Byte-0 Byte-1R1501 Don’t care Byte-1 R2501 Byte-2 Byte-3R1502 Don’t care Byte-2 R2502 Byte-4 Byte-5R1503 Don’t care Byte-3 R2503 Byte-6 Byte-7R1504 Don’t care Byte-4 R2504 Byte-8 Byte-9R1505 Don’t care Byte-5R1506 Don’t care Byte-6R1507 Don’t care Byte-7R1508 Don’t care Byte-8R1509 Don’t care Byte-97-24
- 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 128 and 129: Advanced Function InstructionFUN 46
- 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
- Page 178 and 179: Advanced Function InstructionFUN 86
Advanced Function <strong>Instruction</strong>FUN 48 PDISTNIBBLE DISTRIBUTEFUN 48 PDISTS : Source data to be distributedN : Number of nibbles to be distributedD : Starting register storing distribution dataS, N, D may combine with V, Z, P0~P9 toserve indirect 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∣D409516-bit+/-numberP0~P9S ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○N ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ ○ 1~4 ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When distribution control "EN" = 1 or "EN↑" ( P instruction) has a transition from 0 to 1, will take Nsuccessive nibbles starting from the lowest nibble NB0 within S, and distribute them in ascending order intothe 0 nibbles of N registers starting from D. The nibbles other than NB0 in each of the registers within D areall set to zero. (A nibble is comprised by 4 bits. Starting from the lowest bit in a register, B0, each successive4 bits form a nibble, so B0~B3 form nibble 0, B4~B7 form nibble 1, etc...)• This instruction only provides WORD (16 bit) operand. Therefore there are usually only 4 nibbles can beinvolved, so the effective value of N is 1~4. Beyond this range, will set the N value error flag "ERR" to 1, anddo not carry out this instruction.X048P.DISTEN S : WY 0N : 3D : R 0ERR• The instruction at left writes NB0~NB2 from the WX0register into the NB0 of the 3 consecutive registersR0~R2.N=3 NB3 NB2 NB1 NB0X15 X11 X0 B15 B0S WX0 0000010000100001 D R0 0000 0000 0000 0001NB3 NB2 NB1 NB0 D+1 R1 0 0 0 0 0000 0000 0010X0=D+2 R2 0 0 0 0 0000 0000 0100NB1~NB3 are all set a "0 "7-23