Convert_Fixed_Point_String

include vmm.inc

mov ecx, Places ; number of decimal places

mov edx, String ; points to string to convert

VMMcall Convert_Fixed_Point_String

mov [Value], eax ; fixed-point value

mov [TermChar], edx ; pointer to terminating character


The Convert_Fixed_Point_String service converts a string representing a fixed-point number into a fixed-point value. This service also returns a pointer to the character in the string that marked the end of the number.

This service is only valid during initialization.

Parameters

Places

Specifies the number of digits after the decimal point to convert. If a fixed-point number has extra digits, the service skips over the digits without calculating them into the fixed-point value.

String

Points to the null-terminated string to convert. For more information about the format of the string, see the following “Comments” section.

Return Value

The EAX register contains the normalized value of fixed-point number; the actual value is computed as EAX * 10 ** (-Places). The EDX register contains the address of the character in the string marking the end of the fixed-point number.

Comments

A fixed-point number is a decimal number that consists of an integer, a fraction, or a combination of integer and fraction. The integer can be any combination of decimal digits and may be preceded by a plus sign (+) or a minus sign (-) to indicate a positive or negative fixed-point value. The fraction can be any combination of decimal digits but must be preceded with a decimal point (.).

Uses

EAX, EDX, Flags

See Also

Convert_Boolean_String, Convert_Decimal_String, Convert_Hex_String