Hi,
I need a conversion from ASCII to INT. This works, but...
Basically what I have is 3 byte's representing a temparature from 0 to 200 degrees celcius.
In this example: If you have 063 degrees for example, then I have 0 in the first byte, 6 in the second and 3 in the third, these are ASCII characters. As you know from the ASCII table, 1 ascii = 49 dec, so 6 = 54 and 3 = 51
54 - 48 and 51 - 48 gives us 6 and 3. The six is the second byte and is multiplied by 10. then you have 60 + 3. That's basically how I convert.
BUT
I didn't use BTI, and it works... ??? Why do you need BTI then ?
I need a conversion from ASCII to INT. This works, but...
Basically what I have is 3 byte's representing a temparature from 0 to 200 degrees celcius.
In this example: If you have 063 degrees for example, then I have 0 in the first byte, 6 in the second and 3 in the third, these are ASCII characters. As you know from the ASCII table, 1 ascii = 49 dec, so 6 = 54 and 3 = 51
54 - 48 and 51 - 48 gives us 6 and 3. The six is the second byte and is multiplied by 10. then you have 60 + 3. That's basically how I convert.
BUT
I didn't use BTI, and it works... ??? Why do you need BTI then ?
Code:
L #DBnr
T #DBxx
OPN DB [#DBxx]
L DBB 34 // A
L 48
-I
L 100
*I
T #A1
L DBB 35
L 48
-I
L 10
*I
T #A2
L DBB 36
L 48
-I
T #A3
L #A1
L #A2
+I
L #A3
+I
T #A_Val