[Instruction] Contents

[Instruction] Contents [Instruction] Contents

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

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

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

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

Saved successfully!

Ooh no, something went wrong!