104
Search for value in table
The function scans the table (buffer) starting with register (get X) searching for value
defined in (get Y) register. The table is searched for first occurrence of searched value or to
the end of the memory space. If the value is found, the function returns an index to the
register. Indices are calculated from 0. If not found, the function sets an error flag.
NOTICE!!!
The function can search tables of 32 bit registers though one has to be aware that index
returned is a 32 table index and not equal to the offset in the address space, as is the case
for 16 bit tables.
Example 1:
Table from XREG1 = 1, 5, 0, 100, 23, 340, 1, 100, 340, 5, 560, 23
get X (register) = XREG1
get Y (register) = 100
store result (register) = REG1
The result is REG1 = 3
Example 2:
Table from DREG1 = 1, 5, 0, -12000, 23, 340, 1, -100
get X (register) = DREG2
get Y (register) = DREG1
store result (register) = REG1
The result is REG1 = 5
Convert text to number
The function converts decimal value from text to binary. Get X defines start of the text
buffer to convert. Text characters are written to low order bytes of 16 bit registers. Get Y
defines max number of characters (registers) to convert. The function after successful
conversion writes the result in (store result) register. The result is always an integer value.
If converted value had a decimal fraction, the decimal separator is omitted and function
writes the number of digits after comma to AUX_RET2 register. This allows handling of
scaled floating point values. Recognized delimiters are '.' and ','.
Furthermore, the function writes the length of converted value. The converted value may
be a negative number provided that result storing register is a 32 bit register.
Examples:
get X
get
store result
AUX_RET1
AUX_RET2
REG1 DREG1
0abc
4
0
0 1 0
0.000abc
8
0
0 5 3
1234.56789 3
123 123 3
0
-1234.56789 7
Error -12345 7
1
+0.1234abc 10
1234
1234 7
4
abc
3
Error – number format
1234.5678900
12
Error – value too big
1234.56 7
Error
123456
7 2
0,00000012
10
12
12 10 8
.123
4
Error – number format
Summary of Contents for MT-101
Page 1: ......
Page 129: ...126 11 7 Drawings and dimensions ...