HABIN
HABIN, HABINP, DHABIN, DHABINP
HABIN instruction converts an ASCII code to a Hexadecimal value and saves the 16bit binary result in Destination (assigned device address).
DHABIN and DHABINP are Double Word (32bit).
| |
S | Source (Hexadecimal ASCII code) |
D | Starting device address of the Destination |
Instruction | Device address | No. of Steps | Flag | |||||||||||||||
M | X | Y | K | L | F | T | C | S | Z | D | @D | Int. |
| Error | Zero | Carry | ||
HABIN(P) DHABIN(P) | S | o | o | o | o | o | o | o | o | - | o | o | o | o | 3 | o | - | - |
D | o | - | o | o | o | - | o | o | - | o | o | o | - |
HABIN(P)
The HABIN instruction converts an ASCII code to a Hexadecimal value and places the 16bit binary result in the Destination.
The range of Hexadecimal data is 0000H ~ FFFFH.
If BIN data is +, sign is saved as 20H(space) and if BIN data is -, sign is saved as 2DH(-).
Example)
If the ASCII code of S is 5A8DH, its hexadecimal value is saved in D.
Example)
If X01 is ON, HABIN converts an ASCII code of D0~D1 to a hexadecimal value(HA63F) and save the decimal value -272977 in D20.
DHABIN(P)
The DHABIN instruction converts 32bit ASCII code to a hexadecimal value and places the result in the Destination.
The range of Hexadecimal data is 00000000H ~ FFFFFFFFH.
Example)
If the ASCII code of S is 5CB807E1H, its hexadecimal value is saved in D and D+1.
Example)
If X01 is ON, DHABIN converts an ASCII code of D0~D3 to a hexadecimal value and save the decimal value 1339197264 in D20 and D21.