ASCII to HEX (ATH)
The ASCII TO HEX instruction converts a table of ASCII
230
values to a specified table of HEX values. ASCII values are
240
two digits and their HEX equivalents are one digit.
250-1
260
This means an ASCII table of four V-memory locations would only require two V-memory
locations for the equivalent HEX table. The function parameters are loaded into the
DS
Used
accumulator stack and the accumulator by two additional instructions. Listed below are the
HPP
N/A
steps necessary to program an ASCII to HEX table function. The example on the following
page shows a program for the ASCII to HEX table function.
Step 1: Load the number of V-memory locations for the ASCII table into the first level of the
accumulator stack.
Step 2: Load the starting V-memory location for the ASCII table into the accumulator. This
parameter must be a HEX value.
Step 3: Specify the starting V-memory location (Vaaa) for the HEX table in the ATH instruction.
Helpful hint: — For parameters that require HEX values when referencing memory locations,
the LDA instruction can be used to convert an octal address to the HEX equivalent and load
the value into the accumulator.
In the example on the following page, when X1 is ON the constant (K4) is loaded into the
accumulator using the Load instruction and will be placed in the first level of the accumulator
stack when the next Load instruction is executed. The starting location for the ASCII table
(V1400) is loaded into the accumulator using the Load Address instruction. The starting
location for the HEX table (V1600) is specified in the ASCII to HEX instruction. The table
below lists valid ASCII values for ATH conversion.
Chapter 5: Standard RLL Instructions - Number Conversion
Operand Data Type
DL250-1 Range
V-memory
V
All (See page 3 - 55)
ASCII Values Valid for ATH Conversion
ASCII
Hex Value
30
0
31
1
32
2
33
3
34
4
35
5
36
6
37
7
DL205 User Manual, 4th Edition, Rev. B
DL260 Range
aaa
aaa
All (See page 3 - 56)
ASCII Value
Hex Value
38
39
41
42
43
44
45
46
ATH
V
aaa
8
9
A
B
C
D
E
F
5–137
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Need help?
Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?