Commit Graph

32 Commits

Author SHA1 Message Date
Victor van den Elzen
0dd450c0ef Use fputs instead of fprintf for plain strings
LLVM's Clang warns about this. outieee.c had a real problem.
2009-08-13 15:07:59 +02:00
H. Peter Anvin
9bd1506d59 Remove function pointers in output, simplify error handling
Remove a bunch of function pointers in the output stage; they are
never changed and don't add any value.  Also make "ofile" a global
variable and let the backend use it directly.

All we ever did with these variables were stashing it in locals and
using them as-is anyway for no benefit.

Also change the global error function, nasm_error() into a true
function which invokes a function pointer internally.  That lets us
use direct calls to it.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-18 18:43:12 -07:00
H. Peter Anvin
8ee2e244eb NASM: relicense under the 2-clause BSD license
*To the best of my knowledge*, we now have authorization from everyone
who has significantly contributed to NASM in the past.  As such,
change the license to the 2-clause BSD license.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-07-06 11:09:11 -07:00
H. Peter Anvin
9e6747ccac Add copyright headers to the *.c/*.h files in the main directory
Add copyright headers to the *.c/*.h files in the main directory.  For
files where I'm sure enough that we have all the approvals, I have
given them the 2-BSD license, the others have been given the "LGPL for
now" license header.  Most of them can probably be changed after
auditing.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28 17:13:04 -07:00
H. Peter Anvin
ed37aa8070 disasm: when no instruction is found, consider a naked prefix
If we can't find a matching instruction, rather than printing it as a
"db" literal, consider first if we can disassemble it as a naked prefix.
2009-03-18 23:10:19 -07:00
H. Peter Anvin
4b9358928b Move all version strings to a single compilation unit (ver.c)
Move all the version strings to a single compilation unit, ver.c; this
does not include the version macros, which are fed into macros.c.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-10-31 16:53:49 -07:00
H. Peter Anvin
ac8f8fcb27 Use an explicit table for tolower() to avoid a function call
On some platforms, tolower() is implemented as a function call, in
order to handle locale support.  We never change locales, so can the
result of tolower() into a table, so we don't have to sit through the
function call every time.

~1.3% overall performance improvement on a macro-heavy benchmark under
Linux x86-64.
2008-06-11 15:49:41 -07:00
Beroset
095e6a2973 regularized spelling of license to match name of LICENSE file 2007-12-29 09:44:23 -05:00
H. Peter Anvin
914fdf9ba0 ndisasm: handle instructions at offset zero
Correctly handle instructions at offset zero
2007-12-20 12:24:17 -08:00
H. Peter Anvin
49da468830 ndisasm: handle the case of "no more sync points"
Handle the case of "no more sync points" explicitly, instead of saying
the next sync point is at UINT32_MAX.
2007-11-20 13:22:58 -08:00
Charles Crayne
46b31b0f08 Suppress signedness warnings in disassembler 2007-10-18 21:17:20 -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
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
87f252aaa5 Make nasm_malloc() et al available from inside ndisasm
Clean up nasmlib to remove functions irrelevant for ndisasm; make
nasm_malloc() etc usable inside ndisasm.
2007-09-19 21:40:37 -07:00
H. Peter Anvin
99f309cc07 Clean up the 64-bitification of regs.dat for 64-bit ndisasm support
64-bit support required some major changes to regs.dat; clean some of
it up (re-introduce patterns, where appropriate) and allow a single
register to belong to multiple disassembly classes; also keep track
of the x86 register number again.
2007-04-15 23:12:17 +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
Ed Beroset
602f1df356 added buffer length parameter to prevent vulnerability to buffer
overflow exploits.
2004-12-15 18:27:21 +00:00
H. Peter Anvin
090a218573 NASM 0.98.17 2002-04-30 21:04:18 +00:00
H. Peter Anvin
4cf1748e68 NASM 0.98.11 2002-04-30 21:01:38 +00:00
H. Peter Anvin
ef7468f4ec NASM 0.98p7 2002-04-30 20:57:59 +00:00
H. Peter Anvin
620515ab4e NASM 0.98p6 2002-04-30 20:57:38 +00:00
H. Peter Anvin
4836e3374e NASM 0.98p3.5 2002-04-30 20:56:43 +00:00
H. Peter Anvin
eba20a73f2 NASM 0.98p3 2002-04-30 20:53:55 +00:00
H. Peter Anvin
87bc61964c NASM 0.97 2002-04-30 20:53:16 +00:00
H. Peter Anvin
76690a12ad NASM 0.96 2002-04-30 20:52:49 +00:00
H. Peter Anvin
d7ed89eac9 NASM 0.94 2002-04-30 20:52:08 +00:00
H. Peter Anvin
ea6e34db64 NASM 0.91 2002-04-30 20:51:32 +00:00