This shows you the differences between two versions of the page.

Link to this comparison view

qdosmsq:vectors:decfp [2009/02/13 18:12]
george.gwilt created
qdosmsq:vectors:decfp [2009/02/14 11:58] (current)
george.gwilt Example added and some rewording
Line 1: Line 1:
 +====== CN_DTOF.../CV_DECFP... - Vectors $100 to $10E  ======
 +These vectors convert ASCII to floating point or integers. 
 +==== List of Vectors ====
 +|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.|
 +===== Errors =====
 +|ERR_XP|Error in expression.|
 +===== Notes =====
 +  * All registers not shown above are not used on entry and are preserved on exit.
 +  * The last character converted is that just before the first invalid one unless D7 is non zero and points to an earlier character in which case the last character converted is that just before the character to which D7 points.
 +  * At entry (A0,A6.L) points to the start of the ASCII characters.
 +  * After successful conversion (A0,A6.L) points to the character just after the last one converted. 
 +  * At entry (A1,A6.L) points to the end of the buffer in which the result will be placed.
 +  * After successful conversion A1 will have been decremented by 1 for byte results, 2 for word results 4 for long results and 6 for floating point results. Hence (A1,A6.L) points to the result.
 +  * For the decimal conversions up to about 30 bytes of buffer space are used. For the others there should be at least four bytes available.
 +  * If there is an error neither A0 nor A1 is changed.
 +  * Only the first two of these vectors can be used with QDOS versions 1.03 or earlier.
 +===== Example =====
 +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.
  • qdosmsq/vectors/decfp.txt
  • Last modified: 2009/02/14 11:58
  • by george.gwilt