[Instruction] Contents
[Instruction] Contents [Instruction] Contents
Advanced Function InstructionFUN 63 P→HEXCONVERSION OF ASCII CODE TO HEXADECIMAL VALUEFUN 63 P→HEXS : Starting source register.N : Number of ASCII codes to be converted tohexadecimal values.D : The starting register that stores the result(hexadecimal value).S, N, D, can associate with V, Z, P0~P9 to do theindirect addressing application.OperandRangeWX 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~511 ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When conversion control “EN” =1 or “EN↑” ( P instruction) changes from 0→1, it will convert the Nsuccessive hexadecimal ASCII character(‘0’~’9’,’A’~’F’) convey by 16 bit registers (Low Byte is effective) intohexadecimal value, and store the result into the register starting with D. Every 4 ASCII code is stored in oneregister. The nibbles of register, which does not involve in the conversion of ASCII code will remainunchanged.• The conversion will not be performed when N is 0 or greater than 511.• When there is ASCII error (neither 30H~39H nor 41H~46H), the output “ERR” is ON.• The main purpose of this instruction is to convert the hexadecimal ASCII character (‘0’~’9’,’A’~’F’), which isreceived by communication port1 or communication port2 from the external ASCII peripherals, to thehexadecimal values that the CPU can process directly.7-43
Advanced Function InstructionFUN 63 P→HEXCONVERSION OF ASCII CODE TO HEXADECIMAL VALUEFUN 63 P→HEX〈Example 1〉When M1 from OFF→ON, ASCII code converted to hexadecimal value.M163P. HEXEN S : R0N : 1D : R100˙ Converts the ASCII code of R0 into hexadecimalvalue and store to nibble0 (nibble1~nibble3 remainunchanged) of R100Originally R100=0000HR0=0039H(9) R100=0009H〈Example 2〉When M1 is ON, ASCII code converted to hexadecimal value.M163. HEXEN S : R0N : 2D : R100˙ Converts the ASCII code of R0 and R1 intohexadecimal value and store to low byte (high byteremain unchanged) of R100R0=0039H(9)R1=0041H(A)Originally R100=0000HR100=009AH〈Example 3〉When M1 is ON, ASCII code converted to hexadecimal value.M163. HEXEN S :N :R03D : R100˙ Converts the ASCII code of R0 and R1 intohexadecimal value and store result into R100 (nibble3 remain unchanged)R0=0039H (9)R1=0041H (A)R2=0045H (E)Originally R100=0000HR100=09AEH〈Example 4〉When M1 is ON, ASCII code converted to hexadecimal value.M163. HEXEN S :N :R06D : R100˙Converts the ASCII code of R0~R5 into hexadecimalvalue and store it to R100~R101R0=0031H(1)R1=0032H(2)R2=0033H(3)R3=0034H(4)R4=0035H(5)R5=0036H(6)Originally R100=0000HR101=0000HR100=3456HR101=0012H7-44
- 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 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 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
- Page 180 and 181: Advanced Function InstructionFUN89/
- Page 182 and 183: Advanced Function InstructionFUN 90
- Page 184 and 185: Advanced Function InstructionFUN 92
- Page 186 and 187: Advanced Function InstructionFUN 94
- Page 188 and 189: Advanced Function InstructionFUN 95
- Page 190 and 191: Advanced Function InstructionTable
- Page 192 and 193: Advanced Function InstructionFUN101
- Page 194 and 195: Advanced Function InstructionFUN103
- Page 196 and 197: Advanced Function InstructionFUN105
- Page 198 and 199: Advanced Function InstructionFUN107
Advanced Function <strong>Instruction</strong>FUN 63 P→HEXCONVERSION OF ASCII CODE TO HEXADECIMAL VALUEFUN 63 P→HEXS : Starting source register.N : Number of ASCII codes to be converted tohexadecimal values.D : The starting register that stores the result(hexadecimal value).S, N, D, can associate with V, Z, P0~P9 to do theindirect addressing application.OperandRangeWX 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~511 ○D ○ ○ ○ ○ ○ ○ ○ ○* ○* ○ ○V、Z• When conversion control “EN” =1 or “EN↑” ( P instruction) changes from 0→1, it will convert the Nsuccessive hexadecimal ASCII character(‘0’~’9’,’A’~’F’) convey by 16 bit registers (Low Byte is effective) intohexadecimal value, and store the result into the register starting with D. Every 4 ASCII code is stored in oneregister. The nibbles of register, which does not involve in the conversion of ASCII code will remainunchanged.• The conversion will not be performed when N is 0 or greater than 511.• When there is ASCII error (neither 30H~39H nor 41H~46H), the output “ERR” is ON.• The main purpose of this instruction is to convert the hexadecimal ASCII character (‘0’~’9’,’A’~’F’), which isreceived by communication port1 or communication port2 from the external ASCII peripherals, to thehexadecimal values that the CPU can process directly.7-43