wkf
wkf

Reputation: 842

How do I convert a decimal number to REAL10 in MASM assembly?

Right now I convert the string containing the decimal number to an integer (ignoring the radix point for now), load it into ST(0), and divide by the correct power of ten to account for the radix point. This seems round about, and requires I have a look up table for some of the powers of 10. Is there a better way to do this?

Upvotes: 3

Views: 793

Answers (1)

Charlie Martin
Charlie Martin

Reputation: 112376

Off the top of my head, I'm tempted by the notion of constructing the mantissa part , counting the number of digits, and setting the exponent directly instead of doing division.

Upvotes: 1

Related Questions