Commit Graph

75 Commits

Author SHA1 Message Date
Charles Crayne
192d5b5e9c Suppress a few signedness warnings 2007-10-18 19:02:42 -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
70055964fc Additional uses of bool and enum
Proper use of bool and enum makes code easier to debug.  Do more of
it.  In particular, we really should stomp out any residual uses of
magic constants that aren't enums or, in some cases, even #defines.
2007-10-11 00:05:57 -07:00
H. Peter Anvin
6867acc18e Use the compiler-provided booleans if available, otherwise emulate
Both C and C++ have "bool", "true" and "false" in lower case; C
requires <stdbool.h> for this, in C++ it is an inherent type built
into the compiler.  Use those instead of the old macros; emulate with
a simple typedef enum if unavailable.
2007-10-10 14:58:45 -07:00
H. Peter Anvin
fd7dd11345 Create option -Ox to tell NASM to do unlimited passes
Add option -Ox to tell NASM to do as many passes as it needs, instead
of imposing a fixed number.
2007-10-10 14:06:59 -07:00
H. Peter Anvin
9d637df6da Rewrite the handling of SAA's to allow random access
SAA's were never intended to allow random access, but several backends
do random or semirandom access via saa_fread() and saa_fwrite()
anyway.  Rewrite the SAA system to allow for efficient random access.

On "label.pl 10000000" this improves performance by a factor of 12.
2007-10-04 13:42:56 -07:00
H. Peter Anvin
12e46510bc Change cloc_t to struct location, and reorder the members
Change cloc_t to struct location, and reorder the members so that it
should fit in 16 bytes instead of needing 8 bytes of extra padding on
64-bit machines.
2007-10-03 21:30:57 -07:00
H. Peter Anvin
bfc1712137 BR 1352920: change loc_t -> cloc_t
Change loc_t to cloc_t to avoid AIX conflict.
We really shouldn't use _t names at all; they are usually considered
platform types, but worry about that later.
2007-10-03 21:24:51 -07:00
H. Peter Anvin
0a98f6046d BR 1352920: Handle upper case %line 2007-10-03 21:22:16 -07:00
H. Peter Anvin
fe501957c0 Portability fixes
Concentrate compiler dependencies to compiler.h; make sure compiler.h
is included first in every .c file (since some prototypes may depend
on the presence of feature request macros.)

Actually use the conditional inclusion of various functions (totally
broken in previous releases.)
2007-10-02 21:53:51 -07:00
H. Peter Anvin
c147da0d28 Unspecified files are null strings, not null pointers
We use empty strings, not null pointers, for unspecified files, so
there is no need to compare them for nullness.
2007-10-01 11:28:32 -07:00
H. Peter Anvin
59ddd26aac Check for the most basic filename overlaps
Check for the most basic filename overlaps, in case we have the
opportunity to save the user from himself.
2007-10-01 11:26:31 -07:00
Charles Crayne
fcce07f171 modified: nasm.1 to add newer command line options
modified:   nasm.c to fully parse command line before redirecting stderr.
2007-09-30 22:15:36 -07:00
H. Peter Anvin
413fb900bf nasm option reshuffling, -E -> -Z
Old -E becomes -Z
New -E is alias for -e
Remove the obsolete -r option
2007-09-26 15:19:28 -07:00
H. Peter Anvin
97e15755f9 Fix BR 1445441: uninitialized use of "error_file" 2007-09-25 08:48:37 -07:00
H. Peter Anvin
37a321fbbe Implement the -MG option (SF RFE 1564264)
Implement the -MG option, to generate dependencies in the presence of
generated files.  In the end, we probably need to support the full
gamut of GCC-like dependency-generation options.
2007-09-24 13:41:58 -07:00
H. Peter Anvin
4408b6265c Add TY_OWORD for "DO" output 2007-09-22 21:29:41 -07:00
H. Peter Anvin
269700972c Disallow optimizing by less than 5 passes.
Disallow optimizing by less than 5 passes.  If the user requests 2-4
passes, run 5 passes anyway.
2007-09-22 18:20:49 -07:00
H. Peter Anvin
74cc5e569c Finishing touches on perfect hash tokenizer; actually turn the thing on
Finish the perfect hash tokenizer, and actually enable it.

Move stdscan() et al to a separate file, since it's not needed in any
of the clients of nasmlib other than nasm itself.

Run make alldeps.
2007-08-30 22:35:34 +00:00
H. Peter Anvin
62b24d7e2f Add [default] directive
Add the [default {abs|rel}] directive, and clean up directive parsing.
2007-08-29 16:38:05 +00:00
H. Peter Anvin
99c4ecd18f Implement REL/ABS modifiers
Implement "REL" and "ABS" modifiers for offsets in 64-bit mode.  This
replaces "rip+XXX" type addressing.  The infrastructure to set the default
mode is there, but there is nothing to throw the switch just yet.
2007-08-28 23:06:00 +00:00
H. Peter Anvin
5a640e1161 Clean up the existing operand flag definitions, and document 2007-05-29 23:57:12 +00:00
H. Peter Anvin
0db11e236b Handle "LOCK as REX.R" for MOV CRx; fix warning for invalid 64-bit regs
- MOV gpr,CRx or MOV CRx,gpr can access high control registers with a LOCK
  prefix; handle that in both the assembler and disassembler.
- Get a saner error message when trying to access high resources in
  non-64-bit mode.
2007-04-17 20:23:11 +00:00
Keith Kanios
c7ae18dba1 Placated unreferenced types. 2007-04-14 00:46:25 +00:00
Keith Kanios
93f2e9a5a1 c99 printf/fprintf compliance. 2007-04-14 00:10:59 +00:00
Keith Kanios
a6dfa78b78 Fixed distinction between char and int8_t data types. 2007-04-13 16:47:53 +00:00
H. Peter Anvin
038d861ede Remove obsolete types; add <inttypes.h> where needed; header fixes
- Remove obsolete types like "uint32"; use "uint32_t" consistently.
- Make sure we include <inttypes.h> where needed.
- Header file guards should be FOO_H or SUBDIR_FOO_H; _FOO_H infringes
  on the C implementation's namespace and should only be used when
  writing libc!
- Change a few "int8_t" back to "char" where appropriate.  There are
  a lot more places where that should be done, though.
- Clean up the check for getuid/getgid in rdoff/rdlar.h.
2007-04-12 16:54:50 +00:00
Keith Kanios
b7a89544d0 General push for x86-64 support, dubbed 0.99.00. 2007-04-12 02:40:54 +00:00
H. Peter Anvin
e2c80181b6 Apply Nindent to all .c and .h files 2005-01-15 22:15:51 +00:00
H. Peter Anvin
9d5a64f00f Consistent capitalization 2005-01-14 22:56:01 +00:00
Ed Beroset
83b2809a03 changed sprintf to more secure snprintf to prevent vulnerability to buffer
overflow exploits.
2004-12-15 17:10:25 +00:00
Stanislav Karchebny
0a76a9e690 Backed out another patch =) 2003-09-26 04:20:30 +00:00
Stanislav Karchebny
d52236c00e Revert erroneous macro added and modify __OUTPUT_FORMAT__ to a string const 2003-09-25 11:43:28 +00:00
H. Peter Anvin
bb88d011e3 If we don't specify -g, actually suppress debugging output 2003-09-10 23:34:23 +00:00
H. Peter Anvin
9173ab9961 Update documentation slightly; remove weird special-casing of -O2 and -O3 2003-08-29 19:25:46 +00:00
Michael K. Ter Louw
1d392362ef Allow leading whitespace on output format specific directives. 2003-08-15 22:25:53 +00:00
Frank Kotler
d352302111 apply dborca's patch - make the "-U" switch work - finally! 2003-06-14 12:12:26 +00:00
Frank Kotler
fac9abce80 Remove "malloc.h" from rdoff/symtab.c - BSD build problem? 2003-04-01 06:42:15 +00:00
H. Peter Anvin
10101f26bc Add support for the new instructions in Prescott 2003-02-24 23:22:45 +00:00
Ed Beroset
6e61d0d3dc corrected comment above the report_error_vc function 2002-06-11 03:29:36 +00:00
H. Peter Anvin
fc869bac3d Visual C++ error format needs <space>:<space> after the parentheses. 2002-06-10 00:41:41 +00:00
Ed Beroset
fa77101245 Addressed feature request 555987 (Visual Studio integration) by adding the
requisite command line switch (-X) to select the error reporting format.
2002-06-09 20:56:40 +00:00
H. Peter Anvin
af5bc55524 Fix for BR 561137 (gcc3 compilation issue.) 2002-06-07 06:02:14 +00:00
H. Peter Anvin
3ab8de6a14 Add the JMPE instruction. 2002-05-28 01:25:06 +00:00
H. Peter Anvin
14f4d04643 Undo accidental checkin of old code 2002-05-26 21:48:18 +00:00
Debbie Wiles
f1a3f94d45 Reversed a change in 1.27 that affects ABSOLUTE. 2002-05-26 21:08:39 +00:00
John Coffman
0efaec964e Move optimizer output from '-g' switch to '-Ov' switch 2002-05-26 19:20:08 +00:00
H. Peter Anvin
d0e365d523 Make "ABSOLUTE <label>" work again; code based on 0.97. 2002-05-26 18:19:19 +00:00