Commit Graph

782 Commits

Author SHA1 Message Date
H. Peter Anvin
6745d722f4 Test of some addressing modes in 64-bit mode. 2007-10-28 23:23:24 -07:00
H. Peter Anvin
b0c5462694 Fix bogus flagging of effective addresses as invalid
Ah, what a difference a single ~ makes... such as flagging invalid EAs
as valid and vice versa.
2007-10-28 23:21:46 -07:00
H. Peter Anvin
ff9e7e34a1 Actually shut up the warning in rdfload.c
Shut the warning in rdfload.c up properly...
2007-10-28 23:10:34 -07:00
H. Peter Anvin
cb583b9435 Clean up stealth whitespace
Remove stealth whitespace
2007-10-28 22:04:42 -07:00
H. Peter Anvin
577f247be4 Fix warning about cast to pointer in rdfload.c
Fix warning in rdfload.c about cast to pointer of different size when
compiling on 64 bits.  Of course, rdfload is probably useless on 64
bits, but it's pretty useless in the first place.
2007-10-28 22:04:00 -07:00
H. Peter Anvin
de4b89bb3e 64-bit addressing and prefix handling changes
Revamp the address- and prefix-handling code to make more sense in
64-bit mode.  We are now a lot closer to where we want to be, but
we're not quite there yet.

ndisasm may very well have problems, or give counterintuitive output.
However, checking it in so we can make forward progress.
2007-10-28 22:04:00 -07:00
Charles Crayne
d1cf2de1c0 Adjust stabs symbol index to match symbol table.
Add data length info to symbol table when stabs is active.
2007-10-28 15:29:54 -07:00
H. Peter Anvin
083f0c32e7 readnum(): handle prefix-suffix collision like "0h"
Suffixed versions of zero will look like both a prefix and a suffix.
Reject the prefixed version as being too short to decode.
2007-10-26 21:38:02 -07:00
H. Peter Anvin
c13d31a907 Better handling of platforms which hide "extended" functionality
Some platforms apparently feel -std=c99, which defines
__STRICT_ANSI__, should also hide a bunch of function prototypes.
This rather sucks.  At least try to deal with it.

MinGW and DJGPP both have this problem, in particular.
2007-10-26 18:49:29 -07:00
Charles Crayne
31600d6988 Merge branch 'master' of /home/chuck/development/gitnasm/ 2007-10-24 15:51:40 -07:00
Charles Crayne
650dc9d004 Update sections about debug info formats 2007-10-24 15:30:17 -07:00
H. Peter Anvin
c2df282092 Fix the handling of floating-point tokens in the preprocessor
Correct the handling of floating-point tokens in the preprocessor.
The preprocessor scanner and the main scanner really are painfully
divergent for no good reason.
2007-10-24 15:29:51 -07:00
Charles Crayne
f6816b25bf Fix bugs item #1817677 2007-10-23 19:28:39 -07:00
H. Peter Anvin
30b795fd10 Slightly simplify the radix-detection code
(pradix && pradix > sradix) etc. is unnecessary since pradix and
sradix cannot be negative, so zero is always the smallest value.

Put in a comment explaining why making the default radix == 10 doesn't
need any additional error checking.
2007-10-23 00:08:58 -07:00
H. Peter Anvin
50620f4a3f Unbreak particularly tricky hex constants
Unbreak hex constants which contain 'b' or 'd' in potentially tricky
places.
2007-10-22 19:48:06 -07:00
H. Peter Anvin
f41aef273b Decimal floating point can also start with 0. 0e 0E
A floating point number starting with 0. 0e or 0E is still decimal.
Make it easier by falling back to the standard decimal conversion
routine for anything not recognized as a radix prefix.
2007-10-22 19:37:36 -07:00
H. Peter Anvin
c65a2f634b Support binary and octal floating-point
For consistency, support binary and octal floating-point, and accept
a "0d" or "0t" prefix for decimal floating-point.  However, we do not
accept a binary exponent (p) for a decimal mantissa, or vice versa.
2007-10-22 17:34:10 -07:00
H. Peter Anvin
bea0bbb62c More consistent handling of radix letters
Allow any radix letter from the set [bydtoqhx] to be used either
"Intel-style" (0...x) or "C-style" (0x...).  In Intel style, the
leading 0 remains optional as long as the first digit is in the range
0-9.

As a consequence, allow the prefix "0h" for hexadecimal floating
point.
2007-10-22 16:53:48 -07:00
H. Peter Anvin
3b2ad1bc37 float.c: correct exponent capping
Actually enforce the exponent capping, as opposed to only enforcing it
to within a factor of 10.  Furthermore, continue to scan the string in
order to check for invalid characters.

Finally, 16384 is too tight of a bound for a binary exponent: it's a
tight bound, but the shift added due to the digit string can move the
cap into the active region (±16383).  Thus, change it to 20000 to be
on the safe side.
2007-10-21 15:33:01 -07:00
Charles Crayne
b0e1d423dd Clean up elf symbol table section 2007-10-21 14:21:43 -07:00
H. Peter Anvin
449e04b330 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.
2007-10-19 18:33:57 -07:00
H. Peter Anvin
2d25ce4555 Scripts to remove stealth whitespace
Scripts to remove stealth whitespace from files and patches,
respectively.
2007-10-19 14:43:22 -07:00
H. Peter Anvin
7065309739 Formatting: kill off "stealth whitespace"
"Stealth whitespace" makes it harder to read diffs, and just generally
cause unwanted weirdness.  Do a source-wide pass to get rid of it.
2007-10-19 14:42:29 -07:00
H. Peter Anvin
31420e76d1 test/floatx.asm: fix test case
"dq" should have been "dt"
2007-10-19 14:26:52 -07:00
H. Peter Anvin
513e3c1bd2 uscore.asm: Fix test case
"$1e+16" was missing, instead "$1e16" was duplicated
2007-10-19 14:19:52 -07:00
H. Peter Anvin
3514ad0e6c float.c: mark read_exponent() static
read_exponent() is not used outside float.c; mark static
2007-10-19 14:17:51 -07:00
H. Peter Anvin
37d88e4125 Don't confuse suffixed hexadecimal with floating-point
1e30 is a floating-point constant, but 1e30h is not.  The scanner
won't know that until it sees the "h", so make sure we keep enough
state to be able to distinguish "1e30" (a possible hex constant) from
"1.e30", "1e+30" or "1.0" (unabiguously floating-point.)
2007-10-19 14:10:35 -07:00
H. Peter Anvin
f5f3d70d6d Anchor filename locations in .gitignore
In particular, "Makefile" matched "test/Makefile" without the anchor.
2007-10-19 13:17:24 -07:00
H. Peter Anvin
487a087066 test/Makefile: Use -Ox instead of -O999 2007-10-19 13:16:51 -07:00
H. Peter Anvin
361584882e Test of underscored constants 2007-10-19 13:14:06 -07:00
H. Peter Anvin
2ef4aac272 Allow underscores in numbers; better detection of FP
- Allow underscores as group separators in numbers, for example:
  0x1234_5678 is now a legal number.  The underscore is just ignored,
  it adds no meaning.
- Recognize dotless floating-point numbers, such as "1e30".  This
  entails distinguishing hexadecimal numbers in the scanner, since
  e.g. 0x1e30 is a perfectly legitimate hex constant.
2007-10-19 13:10:46 -07:00
H. Peter Anvin
a8eace2b79 Modernize nasm.spec.in and make it closer to the Fedora version 2007-10-19 10:52:31 -07:00
Charles Crayne
f3eea3d539 Suppress datarootdir warnings from configure 2007-10-18 23:33:06 -07:00
Charles Crayne
46b31b0f08 Suppress signedness warnings in disassembler 2007-10-18 21:17:20 -07:00
H. Peter Anvin
26573020d8 Cleaner solution for MinGW handling of __STRICT_ANSI__
If MinGW is detected, undefine __STRICT_ANSI__ in compiler.h instead.
2007-10-18 19:14:08 -07:00
H. Peter Anvin
8088815922 configure: Undefine __STRICT_ANSI__ for mingw's benefit
mingw makes a bunch of prototypes unavailable if __STRICT_ANSI__ is
defined.  However, they are still detected by configure, which causes
us pain.
2007-10-18 19:14:08 -07:00
H. Peter Anvin
684f98b636 Fix invocation of readnum()
readnum() takes a boolean for error.
2007-10-18 19:14:07 -07:00
Charles Crayne
192d5b5e9c Suppress a few signedness warnings 2007-10-18 19:02:42 -07:00
root
2674b04d88 Avoid unnecessary warning on redefinition of section (bug 801180) 2007-10-18 17:04:10 -07:00
Charles Crayne
f23a5b042c Generate stabs entries for any executable section 2007-10-17 17:55:45 -07:00
H. Peter Anvin
e911708790 NASM 0.99.05 2007-10-16 22:59:09 -07:00
H. Peter Anvin
a366cac2a6 Tests of obscenely large exponents 2007-10-16 15:46:04 -07:00
H. Peter Anvin
9563910747 Comma-separate contents of __FLOAT__ 2007-10-16 14:42:32 -07:00
H. Peter Anvin
f6c9e65d4f Implement floating-point option control directive
New directive [FLOAT] with associated standard macros; allows the
setting to be saved and restored.
2007-10-16 14:40:27 -07:00
H. Peter Anvin
fab3a6c9de Floating-point warning fixes; fix round-to-overflow
Actually generate the appropriate floating-point warnings, and only
one per assembly, pretty please.

Correct the round-to-overflow condition; as written all numbers with a
positive exponent were considered overflows!
2007-10-16 11:48:07 -07:00
H. Peter Anvin
125c878e96 Handle rounding of denorms correctly; make fp overflow a warning
- Handle rounding of denorms correctly
- Make fp overflow a warning, not an error (produces Inf)
- Make fp warnings controllable
2007-10-16 11:32:58 -07:00
H. Peter Anvin
630b52013a Additional entries for .gitignore 2007-10-16 10:35:02 -07:00
H. Peter Anvin
4da5b8c2dd Refactor floating-point formatting code; fix 80-bit denorms
Refactor the floating-point formatting code so that the 80-bit format
can be supported with common code.  This fixes 80-bit denorms as a
side effect; the shift value in 80-bit denorms was completely wrong.
2007-10-16 10:32:57 -07:00
H. Peter Anvin
61872221ad Add 1.5 as a test case: representative of an exact fraction
1.5 is an exactly representable fraction, useful for test.
2007-10-16 10:31:16 -07:00
H. Peter Anvin
b2f6fef421 Recognize 'd', 't' and 'y' as radix suffixes
'd', 't' and 'y' now recognized as radix suffixes.
2007-10-15 20:06:06 -07:00