summaryrefslogtreecommitdiff
path: root/float.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-19 18:33:57 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-19 18:33:57 -0700
commit449e04b33036f4cca13526c2e62070aa8421ca7e (patch)
treefaf9289c350bdd36a53d0dfa2f0fc7b4ef6cb0bd /float.c
parent2d25ce45553898e4bc915548f8cff95f7616a519 (diff)
downloadnasm-449e04b33036f4cca13526c2e62070aa8421ca7e.tar.gz
nasm-449e04b33036f4cca13526c2e62070aa8421ca7e.tar.bz2
nasm-449e04b33036f4cca13526c2e62070aa8421ca7e.zip
Allow $-prefixed hexadecimal FP as an alternative to 0x
Since we allow the prefix $ instead of 0x for integer constants, do the same for floating point. No suffix support at this time; we may want to consider if that would be appropriate.
Diffstat (limited to 'float.c')
-rw-r--r--float.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/float.c b/float.c
index 4db4bd0..db64180 100644
--- a/float.c
+++ b/float.c
@@ -659,6 +659,8 @@ static int to_float(const char *str, int sign, uint8_t * result,
} else {
if (str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
ok = ieee_flconvert_hex(str + 2, mant, &exponent);
+ else if (str[0] == '$')
+ ok = ieee_flconvert_hex(str + 1, mant, &exponent);
else
ok = ieee_flconvert(str, mant, &exponent);