A-27
Appendices
CP2E CPU Unit Software User’s Manual(W614)
A-1 Instruction Functions
App
A-1-10 Conversion Instructions
ASCII CON-
VERT
ASC @ Converts 4-bit hexadecimal digits in the source word into their
8-bit ASCII equivalents.
DI: Digit Designator
ASCII TO HEX HEX @ Converts up to 4 bytes of ASCII data in the source word to their
hexadecimal equivalents and writes these digits in the specified
destination word.
DI: Digit Designator
Instruction Mnemonic Variations Symbol/Operand Function
ASC(086)
S
Di
D
S: Source word
Di: Digit designator
D: 1st destination word
Di
Right (0)Left (1)
First digit to convert
Number of
digits (n+1)
Specifies the first digit in S to be converted (0 to 3).
Number of digits to be converted (0 to 3)
0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits
First byte of D to be used.
0: Rightmost byte
1: Leftmost byte
Parity 0: None
1: Even
2: Odd
Digit number: 3 2 1 0
HEX(162)
S
Di
D
S: 1st source word
Di: Digit designator
D: Destination word
C: 0021
Di
Number of digits (n+1)
Right (0)Left (1)
First byte to convert
First digit to write
Digit number: 3 2 1 0
Specifies the first digit in D to receive converted
data (0 to 3).
Number of bytes to be converted (0 to 3)
0: 1 digit
1: 2 digits
2: 3 digits
3: 4 digits
0: Rightmost byte
1: Leftmost byte
Parity 0: None
1: Even
2: Odd
First byte of S to be converted.