51h MT$BTOF convert ascii to floating point
Input X register - address of start of input string.
D register - address of target floating-point number.
Output Floating-point representation of input string.
X points to terminator at end of input string.

Converts the numeric ascii string at X to the floating-point number at D. The string may be terminated by any character which is not numeric (and not by ".", "E" or "e" unless these have previously occurred in the input string).

The floating-point result is returned in the 8 bytes following the address given by D on entry (D should be preserved before calling this routine, as there is no pointer to the result on exit from it).

The STR to NUM Error is returned if:

  • The exponent is greater than 99 or less than -99 (irrespective of the value of the mantissa)
  • The input string contains more than 12 significant digits (not including leading or trailing zeros)
  • The total of significant digits + trailing zeros exceeds 44
  • There are no valid numeric digits in the mantissa (eg. .E5)
  • There are no valid numeric digits in the exponent (eg. 6E)

See also: technical manual > utility system services > floating point numbers

Errors 252 - String to floating-point failed (STR to NUM Error)