These vectors convert ASCII to floating point or integers.
QDOS | SMSQ | Vector | Action |
CN_DTOF | CV_DECFP | $100 | Converts Decimal to Floating Point |
CN_DTOI | CV_DECIW | $102 | Converts Decimal to Integer |
CN_BTOIB | CV_BINIB | $104 | Converts Binary to Integer (byte) |
CN_BTOIW | CV_BINIW | $106 | Converts Binary to Integer (word) |
CN_BTOIL | CV_BINIL | $108 | Converts Binary to Integer (long) |
CN_HTOIB | CV_HEXIB | $10A | Converts Hexadecimal to Integer (byte) |
CN_HTOIW | CV_HEXIW | $10C | Converts Hexadecimal to Integer (word) |
CN_HTOIL | CV_HEXIL | $10E | Converts Hexadecimal to Integer (long) |
Parameters
Call Parameters | Return Parameters |
D0.L | Unused | D0.L | Error code. |
D1.L | Unused | D1.L | Corrupted. |
D2.L | Unused | D2.L | Corrupted. |
D3.L | Unused | D3.L | Corrupted. |
D7.L | 0 or pointer to buffer end | D7.L | Preserved. |
A0.L | Pointer to buffer | A0.L | Updated. |
A1.L | Pointer to stack | A1.L | Updated. |
A2.L | Unused | A2.L | Corrupted. |
A3.L | Unused | A3.L | Corrupted. |
ERR_XP | Error in expression. |
The example below shows how to convert an ASCII decimal number to a word integer.
; It is assumed that A6 points to the data space and that the first
; 30 bytes are set as working space and for the answer with the
; following bytes holding the number for conversion.
buf equ #30
convert lea buf,a0 ; Pointer to ASCII number
lea buf,a1 ; Pointer to the end of the buffer
move.l a0,d7 ; Set a maximum . .
addq.l #5,d7 ; . . of 5 characters
movea.w CN_DTOI,a2 ; Vector address
jsr (a2) ; Convert
; Now A1 = buf - 2 and (A1,A6.L) points to the converted number.