Conversion instructions
625
Part III FP Instructions
F72_A2HEX
ASCII -> HEX conversion
The data for two ASCII code characters is converted to two numeric digits for one word. When this
takes place, the characters of the upper and lower bytes are interchanged. Four characters are
converted as one segment of data.
CDdAB
44434241
s1[1] s1[0]
Converted
result
ASCII code character
Converted results are stored in byte units. If an odd number of characters is being converted, "0"
will be entered for bits 0 to 3 of the final data (byte) of the converted results. Conversion of odd
number of source data bytes:
s1[3] s1[2] s1[1] s1[0]
d[1] d[0]
31 46 45 44 43 42 41
1FEDCBA
10 EF CD AB
Converted result
ASCII code
7 characters (7 bytes)
F72_AHEX instruction execution
This position is filled
with “0”
Hexadecimal characters and ASCII codes:
Description
Converts the ASCII codes that express the hexadecimal characters starting from the 16-bit area
specified by s1 to hexadecimal numbers if the trigger EN is in the ON-state. s2 specifies the
number of ASCII (number of characters) to be converted. The converted result is stored in the area
starting from the 16-bit area specified by d. ASCII code requires 8 bits (one byte) to express one
hexadecimal character. Upon conversion to a hexadecimal number, the data length will thus be half
the length of the ASCII code source data.