Commit Graph

577 Commits

Author SHA1 Message Date
H. Peter Anvin
0ee014231f Initial 64-bit support for ndisasm. Still a work in progress.
64-bit support for ndisasm.  This is very much an initial attempt, and
there are guaranteed to be bugs in the code.  However, some *very*
preliminary testing seems to indicate it's not completely off-base.
2007-04-16 01:18:30 +00: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
H. Peter Anvin
2b8f5d2b80 Remove @GCCFLAGS@
Remove the now obsolete @GCCFLAGS@.
2007-04-15 23:10:26 +00:00
H. Peter Anvin
e2eb92d055 CR8 is not special in any way as far as the assembler is concerned.
CR8 is not special in any way as far as the assembler is concerned.  It's
listed as having a special form in the Intel documentation, but that is
only because there are no other CRs which require a REX prefix.

MOV to CR8 is special in the sense that it's a non-serializing
instruction, but that's irrelevant to the assembler.

Furthermore, it's totally unclear how TRs should be handled in long mode;
there are no CPUs which uses TRs which also have long mode, so the easiest
is to simply mark those instructions NOLONG.

Finally, add PRIV to some privileged instructions.
2007-04-15 23:09:23 +00:00
H. Peter Anvin
876c8a13d9 Get rid of @GCCFLAGS@
Get rid of the now-obsolete @GCCFLAGS@.
2007-04-15 23:03:28 +00:00
H. Peter Anvin
1ed0387476 Cleaner way to add gcc options
We can actually test for the options being accepted, rather than try
to test for gcc; this handles differences between gcc versions as well
as compilers with a similar command line set.
2007-04-15 22:45:25 +00:00
Keith Kanios
3faf938f79 Fixed distinction between RIP relative symbols and immediate values. 2007-04-15 22:08:30 +00:00
H. Peter Anvin
6303c87c45 Fix the register number for CR7 (it was using the same number as CR15). 2007-04-15 05:40:43 +00:00
H. Peter Anvin
7e1b8e909b More perl-like idioms for generating regdis.c
- Don't use an advancing counter through an array to do a push().
- An empty array is written as (), not 0.
2007-04-15 05:32:18 +00:00
Keith Kanios
b7314d83f1 Fixed regdis.c generation. 2007-04-15 01:37:13 +00:00
Keith Kanios
61ff53c80d Added DQ constants for all BITS modes. 2007-04-14 18:54:52 +00:00
H. Peter Anvin
f4ba92577e outmacho.c: stylistic cleanups
- No need to cast (int32_t)NULL for a sentinel; just write 0.
- Fix weird formatting of a structure.
- Remove redundant parantheses.
2007-04-14 08:03:02 +00:00
Keith Kanios
b2a0380eb8 Fixed support for DQ constants in long mode. 2007-04-14 03:52:05 +00:00
Keith Kanios
c8ef68bba9 Hopefully it is actually fixed this time :P 2007-04-14 03:44:31 +00:00
Keith Kanios
3e7bb1e046 Fixed structure initialization issue. 2007-04-14 01:49:07 +00:00
Keith Kanios
a2e9b953f8 Refixed uninitialized data. 2007-04-14 01:44:35 +00:00
Keith Kanios
df12db1f13 Fixed uninitialized structure data. 2007-04-14 01:40:24 +00:00
Keith Kanios
47776ac525 c99 printf/fprintf compliance. 2007-04-14 01:24:14 +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
0899e21289 Added outmacho.* to static makefile. 2007-04-13 23:09:18 +00:00
Keith Kanios
567ee739f8 Fixed REGRIP -> RIPREG to match regs.dat. 2007-04-13 22:24:46 +00:00
Keith Kanios
8b2a72881c Fixed obj_fwrite() declaration to match "static" definition. 2007-04-13 22:07:53 +00:00
Keith Kanios
68d52b7737 Added appropriate "void" prototypes. 2007-04-13 22:03:24 +00:00
Keith Kanios
2a3311b546 Replaced str(n)casecmp with more standard str(n)icmp. 2007-04-13 22:00:42 +00:00
H. Peter Anvin
c40f89e1c2 AIf we have config.h, we should actually include it!!
Apparently configure was generating config.h, and nothing ever actually
included it.  Include it in nasm.h as well as compiler.h, and in
rdoff/rdlar.h which uses these macros.

There appears to be no use of HAVE_* macros in any file that doesn't
have nasm.h included; in fact, so far the only use has been in
rdoff/rdlar.h.
2007-04-13 20:06:41 +00:00
H. Peter Anvin
1a4440ac58 When compiling with gcc, compile with -W -Wall for maximum warnings. 2007-04-13 19:59:20 +00:00
H. Peter Anvin
c1494ac5ab Macroize any compiler-specific code; macros defined in "compiler.h"
Move anything compiler-specific to "compiler.h".

There was an unguarded use of __attribute__(()) in outmacho.c; also
require gcc 4+ for __builtin_ctlz().  Speed up the open-coded version, too.
2007-04-13 19:58:42 +00:00
Keith Kanios
a6dfa78b78 Fixed distinction between char and int8_t data types. 2007-04-13 16:47:53 +00:00
Keith Kanios
2cc61b34f0 Comment "REX.I" should have been "REX.X" 2007-04-13 01:17:45 +00:00
Keith Kanios
c1c5a2d96f Fixed c99 data-types after removal of typedefs. 2007-04-13 00:52:54 +00:00
Keith Kanios
ea13537d83 Added Dev-Cpp Makefile 2007-04-13 00:43:50 +00:00
Keith Kanios
94a4d99cf0 *** empty log message *** 2007-04-13 00:38:29 +00:00
H. Peter Anvin
adb9d55678 Remove redundant inclusion of <inttypes.h>
"hash.h" includes <inttypes.h>, no need to do it again.
2007-04-12 17:58:02 +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
H. Peter Anvin
2030bd21f4 autogen.sh script to create configure, et al.
It's become custom to create a script called autogen.sh, which creates
all the auto-generated files using all the appropriate auto* tools when
run, so one doesn't have to worry about checking them into the repository.
This seems like a good idea, follow suit.
2007-04-12 16:25:58 +00:00
Keith Kanios
82e15cd5b3 Fixed c99 support for RDOFF Tools 2007-04-12 16:23:11 +00:00
H. Peter Anvin
58421f9697 outmacho.c: Don't assume __builtin_ctzl exists for gcc < 4
__builtin_ctzl exists for all architectures on gcc 4, but not for all
versions of gcc 3 and lower.  For simplicity, make the cutoff gcc 4.
2007-04-12 16:12:09 +00:00
Keith Kanios
b7a89544d0 General push for x86-64 support, dubbed 0.99.00. 2007-04-12 02:40:54 +00:00
Eric Christopher
aa348dec7d Add VMX instructions. 2006-03-02 18:35:09 +00:00
Eric Christopher
1e0de6e913 Fix documentation building for non-srcdir builds. Still bugs in .ps implementation.
Add Mach-O documentation.
2006-02-04 00:23:30 +00:00
Eric Christopher
a5f0000db0 2006-02-02 Eric Christopher <echristo@apple.com>
Wade Tregaskis  <wtregaskis@apple.com>

	* output/outmacho.c (macho_cleanup): Depend on symbols
	existing.
2006-02-02 21:50:47 +00:00
Eric Christopher
5eb2d2b094 2005-12-08 Wade Tregaskis <wtregaskis@apple.com>
* nasm/nasm/output/outmacho.c (struct section): Added "align" field.
	(sectmap): Added ".rodata" section.
	(exact_log2): New.
	(macho_section): Added support for section attributes.
        "align=" and "data" specifically.
	(macho_write_segment): Write out section alignment to Mach-O file.
2005-12-09 00:27:26 +00:00
Eric Christopher
5547e191fe 2005-12-05 Eric Christopher <echristo@apple.com>
* nasm/nasm/output/outmacho.c (macho_write_section): Don't add
        section offset to the symbol to be relocated.
        (add_reloc): Update comment.
2005-12-05 23:17:17 +00:00
Eric Christopher
8e5abdeeb9 Allow CFLAGS to be overridden from make. 2005-10-20 19:46:34 +00:00
Eric Christopher
a485fbdd37 Added section attributes, in particular S_ATTR_SOME_INSTRUCTIONS and update .text.
Change symbols from saa to explicitly allocated.
macho_layout_symbols: new function to sort symbols and renumber.
adjust symtab output accordingly
fixup relocs after renumbering
add relocation debugging routines.
2005-10-07 22:30:56 +00:00
Eric Christopher
d3179b6ce0 Break macho_cleanup into separate functions. 2005-09-26 22:13:42 +00:00
Eric Christopher
5508a4c7fc Run misc/Nindent on outmacho.c 2005-09-22 21:41:17 +00:00
Eric Christopher
1b8a72ae7c Add basic support for Mach-O file format. 2005-09-22 21:22:33 +00:00
Frank Kotler
f3071da71e fix outobj.c bug - every 256th extern crashed nasm
-
2005-06-08 16:41:10 +00:00