H. Peter Anvin [Sat, 2 Jun 2007 02:26:21 +0000 (02:26 +0000)]
Fix the [U]INT*_C() creation macros
The [U]INT*_C() macros were broken, because ## takes precedence over
macro resolution.
H. Peter Anvin [Sat, 2 Jun 2007 00:05:35 +0000 (00:05 +0000)]
For platforms that don't have them, provide <inttypes.h> for common models.
Apparently, some platforms (*cough* MSVC *cough*) haven't figured out what
year it is and are behind the curve. Provide <inttypes.h> for common
memory models. We can add more if there are odd platforms which don't
have "long long" for 64 bits, too.
H. Peter Anvin [Wed, 30 May 2007 22:21:11 +0000 (22:21 +0000)]
Fix the handling of the \313 code.
\313 indicates a fixed 64-bit address size. It was incorrectly
documented and incorrectly implemented in the assembler, and was
unimplemented in the disassembler.
H. Peter Anvin [Wed, 30 May 2007 22:20:01 +0000 (22:20 +0000)]
Machine-generated \321->\324 corrections
Use a script to find \321's that should be \324's. This is not in any
way guaranteed to be an exhaustive list, however, I have manually verified
that all the items that *were* changed *should* be changed.
Frank Kotler [Wed, 30 May 2007 21:22:33 +0000 (21:22 +0000)]
update "version" to 0.99.02
H. Peter Anvin [Wed, 30 May 2007 20:30:15 +0000 (20:30 +0000)]
Correct the generation of 67 prefixes.
The recent switch from register numbers (with -1 meaning "none") to
register flags (with 0 meaning "none") broke the generation of 67
prefixes, especially in 64-bit mode.
H. Peter Anvin [Wed, 30 May 2007 18:30:18 +0000 (18:30 +0000)]
Update dependencies.
Frank Kotler [Wed, 30 May 2007 16:34:29 +0000 (16:34 +0000)]
update cvs server name in misc/release script
H. Peter Anvin [Wed, 30 May 2007 04:28:50 +0000 (04:28 +0000)]
Avoid magic values; we have more than 124 registers now
There was a magic hard-coded constant that register numbers were between
1 and 124. Well, we have about 150 registers now, and that broke.
H. Peter Anvin [Wed, 30 May 2007 04:27:58 +0000 (04:27 +0000)]
Remove bogus redundant tests
Remove tests that are bogus (they trigger for legitimate instructions.)
The failure cases are okay anyway since they will be trapped by the
REX generation logic.
H. Peter Anvin [Wed, 30 May 2007 03:44:50 +0000 (03:44 +0000)]
More \321 -> \324
More \321 that should be \324...
H. Peter Anvin [Wed, 30 May 2007 03:44:02 +0000 (03:44 +0000)]
Remove bogus check for 64-bitness
Remove a bogus check for 64-bit operands. If appropriate, we will
detect this during REX generation and will bail then. However, there
are other instructions (floating point, MMX, ...) which are legitimately
64 bits in non-64-bit mode.
H. Peter Anvin [Wed, 30 May 2007 03:25:21 +0000 (03:25 +0000)]
Get rid of magic open-coded "register numbers"
Get rid of magic open-coded register numbers. We now keep track of
a total of three different kinds of register numbers: the register
enumeration (regs.h), the x86 register value, and the register flags.
That has all the information we need.
Additionally, do massive revamping of the EA generation code and the
REX generation logic.
H. Peter Anvin [Wed, 30 May 2007 02:48:51 +0000 (02:48 +0000)]
MOV reg64,reg64 takes \324 (64 bit with REX) not \321 (32 bit)
H. Peter Anvin [Wed, 30 May 2007 00:18:26 +0000 (00:18 +0000)]
Rename REGNORM to REG_EA
Rename REGNORM to REG_EA to make the distinction between REG_GPR and
REG_EA clearer.
H. Peter Anvin [Wed, 30 May 2007 00:15:25 +0000 (00:15 +0000)]
More instruction flag surgery
H. Peter Anvin [Wed, 30 May 2007 00:05:00 +0000 (00:05 +0000)]
More cleanup of operand flags/register classes
H. Peter Anvin [Tue, 29 May 2007 23:57:12 +0000 (23:57 +0000)]
Clean up the existing operand flag definitions, and document
H. Peter Anvin [Tue, 29 May 2007 21:44:55 +0000 (21:44 +0000)]
Run "make alldeps"
Frank Kotler [Thu, 24 May 2007 22:33:07 +0000 (22:33 +0000)]
update version number to 0.99.01
H. Peter Anvin [Tue, 15 May 2007 04:33:43 +0000 (04:33 +0000)]
regs.dat: fix comment
H. Peter Anvin [Fri, 4 May 2007 18:47:16 +0000 (18:47 +0000)]
16-bit relocations are standard in ELF64 (at my request, incidentally)
Chuck Crayne [Fri, 4 May 2007 02:16:08 +0000 (02:16 +0000)]
Addition of elf32 and elf64 output formats.
Addition of ! as unary operator in expression evaluation.
Allow numeric constants in DQ directive.
Chuck Crayne [Wed, 2 May 2007 04:21:26 +0000 (04:21 +0000)]
Allow '!' to be used in expressions with same meaning as in C.
Chuck Crayne [Wed, 2 May 2007 01:59:16 +0000 (01:59 +0000)]
Add %IFN and %ELIFN as per RFE #786286
Chuck Crayne [Mon, 30 Apr 2007 22:26:58 +0000 (22:26 +0000)]
Accept responsibility for support of outelf64.c
Chuck Crayne [Sun, 29 Apr 2007 20:57:53 +0000 (20:57 +0000)]
Clarify comments about relocation entries.
Chuck Crayne [Sun, 29 Apr 2007 00:28:24 +0000 (00:28 +0000)]
Allow ELF32 to be invoked either as -f elf or -f elf32
Chuck Crayne [Sat, 28 Apr 2007 22:18:04 +0000 (22:18 +0000)]
Eliminate shift count warnings when building on 32-bit systems
Remove define for DEBUG
Chuck Crayne [Sat, 28 Apr 2007 06:18:48 +0000 (06:18 +0000)]
Initial support for ELF64
H. Peter Anvin [Wed, 18 Apr 2007 02:27:18 +0000 (02:27 +0000)]
Fix the handling of \324 for computing the length
\324 means REX.W is mandatory, but that doesn't mean add a byte to the
output! Instead, force REX.W set, and let the REX logic deal with the
length.
Keith Kanios [Wed, 18 Apr 2007 02:24:34 +0000 (02:24 +0000)]
Fixed RDF/2 to comply with "maxbits" use.
H. Peter Anvin [Tue, 17 Apr 2007 20:23:11 +0000 (20:23 +0000)]
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.
Keith Kanios [Mon, 16 Apr 2007 18:16:46 +0000 (18:16 +0000)]
MEM_OFFSET Instructions Fixed.
Keith Kanios [Mon, 16 Apr 2007 15:46:46 +0000 (15:46 +0000)]
Fixed 64-bit Mode Segment Selection.
Keith Kanios [Mon, 16 Apr 2007 14:31:54 +0000 (14:31 +0000)]
Fixed distinction between [LOCAL]SYMBOL/IMMEDIATE for RIP-relative addressing.
Keith Kanios [Mon, 16 Apr 2007 14:05:01 +0000 (14:05 +0000)]
Fixed long mode MEM_OFFS issue.
Keith Kanios [Mon, 16 Apr 2007 13:54:49 +0000 (13:54 +0000)]
Filled in all RIP Register Flags.
H. Peter Anvin [Mon, 16 Apr 2007 05:26:29 +0000 (05:26 +0000)]
More \321 -> \324 for 64-bit instructions
The assembler doesn't seem to care, but for the disassembler, it's
vitally important that we get our operand-size hints correctly. We
probably need to audit insns.dat for this kinds of errors.
Keith Kanios [Mon, 16 Apr 2007 04:56:06 +0000 (04:56 +0000)]
Fixed 64-bit offset generation.
H. Peter Anvin [Mon, 16 Apr 2007 02:39:56 +0000 (02:39 +0000)]
More 64-bit ndisasm fixes.
In particular, now we should handle A0-A3 instructions.
H. Peter Anvin [Mon, 16 Apr 2007 02:02:06 +0000 (02:02 +0000)]
Fixes for 64-bit ndisasm.
This fixes some of the most glaring bugs in ndisasm 64-bit mode. We're
still getting redundant prefixes for unknown reason, however.
H. Peter Anvin [Mon, 16 Apr 2007 01:21:29 +0000 (01:21 +0000)]
Use + instead of * for extension; it feels cleaner with the new meaning.
We used to use * to mean substitute in 0-7. Now it means that it should
be incremented 8 times. Using a different character feels cleaner.
H. Peter Anvin [Mon, 16 Apr 2007 01:18:30 +0000 (01:18 +0000)]
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.
H. Peter Anvin [Sun, 15 Apr 2007 23:12:17 +0000 (23:12 +0000)]
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.
H. Peter Anvin [Sun, 15 Apr 2007 23:10:26 +0000 (23:10 +0000)]
Remove @GCCFLAGS@
Remove the now obsolete @GCCFLAGS@.
H. Peter Anvin [Sun, 15 Apr 2007 23:09:23 +0000 (23:09 +0000)]
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.
H. Peter Anvin [Sun, 15 Apr 2007 23:03:28 +0000 (23:03 +0000)]
Get rid of @GCCFLAGS@
Get rid of the now-obsolete @GCCFLAGS@.
H. Peter Anvin [Sun, 15 Apr 2007 22:45:25 +0000 (22:45 +0000)]
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.
Keith Kanios [Sun, 15 Apr 2007 22:08:30 +0000 (22:08 +0000)]
Fixed distinction between RIP relative symbols and immediate values.
H. Peter Anvin [Sun, 15 Apr 2007 05:40:43 +0000 (05:40 +0000)]
Fix the register number for CR7 (it was using the same number as CR15).
H. Peter Anvin [Sun, 15 Apr 2007 05:32:18 +0000 (05:32 +0000)]
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.
Keith Kanios [Sun, 15 Apr 2007 01:37:13 +0000 (01:37 +0000)]
Fixed regdis.c generation.
Keith Kanios [Sat, 14 Apr 2007 18:54:52 +0000 (18:54 +0000)]
Added DQ constants for all BITS modes.
H. Peter Anvin [Sat, 14 Apr 2007 08:03:02 +0000 (08:03 +0000)]
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.
Keith Kanios [Sat, 14 Apr 2007 03:52:05 +0000 (03:52 +0000)]
Fixed support for DQ constants in long mode.
Keith Kanios [Sat, 14 Apr 2007 03:44:31 +0000 (03:44 +0000)]
Hopefully it is actually fixed this time :P
Keith Kanios [Sat, 14 Apr 2007 01:49:07 +0000 (01:49 +0000)]
Fixed structure initialization issue.
Keith Kanios [Sat, 14 Apr 2007 01:44:35 +0000 (01:44 +0000)]
Refixed uninitialized data.
Keith Kanios [Sat, 14 Apr 2007 01:40:24 +0000 (01:40 +0000)]
Fixed uninitialized structure data.
Keith Kanios [Sat, 14 Apr 2007 01:24:14 +0000 (01:24 +0000)]
c99 printf/fprintf compliance.
Keith Kanios [Sat, 14 Apr 2007 00:46:25 +0000 (00:46 +0000)]
Placated unreferenced types.
Keith Kanios [Sat, 14 Apr 2007 00:10:59 +0000 (00:10 +0000)]
c99 printf/fprintf compliance.
Keith Kanios [Fri, 13 Apr 2007 23:09:18 +0000 (23:09 +0000)]
Added outmacho.* to static makefile.
Keith Kanios [Fri, 13 Apr 2007 22:24:46 +0000 (22:24 +0000)]
Fixed REGRIP -> RIPREG to match regs.dat.
Keith Kanios [Fri, 13 Apr 2007 22:07:53 +0000 (22:07 +0000)]
Fixed obj_fwrite() declaration to match "static" definition.
Keith Kanios [Fri, 13 Apr 2007 22:03:24 +0000 (22:03 +0000)]
Added appropriate "void" prototypes.
Keith Kanios [Fri, 13 Apr 2007 22:00:42 +0000 (22:00 +0000)]
Replaced str(n)casecmp with more standard str(n)icmp.
H. Peter Anvin [Fri, 13 Apr 2007 20:06:41 +0000 (20:06 +0000)]
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.
H. Peter Anvin [Fri, 13 Apr 2007 19:59:20 +0000 (19:59 +0000)]
When compiling with gcc, compile with -W -Wall for maximum warnings.
H. Peter Anvin [Fri, 13 Apr 2007 19:58:42 +0000 (19:58 +0000)]
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.
Keith Kanios [Fri, 13 Apr 2007 16:47:53 +0000 (16:47 +0000)]
Fixed distinction between char and int8_t data types.
Keith Kanios [Fri, 13 Apr 2007 01:17:45 +0000 (01:17 +0000)]
Comment "REX.I" should have been "REX.X"
Keith Kanios [Fri, 13 Apr 2007 00:52:54 +0000 (00:52 +0000)]
Fixed c99 data-types after removal of typedefs.
Keith Kanios [Fri, 13 Apr 2007 00:43:50 +0000 (00:43 +0000)]
Added Dev-Cpp Makefile
Keith Kanios [Fri, 13 Apr 2007 00:38:29 +0000 (00:38 +0000)]
*** empty log message ***
H. Peter Anvin [Thu, 12 Apr 2007 17:58:02 +0000 (17:58 +0000)]
Remove redundant inclusion of <inttypes.h>
"hash.h" includes <inttypes.h>, no need to do it again.
H. Peter Anvin [Thu, 12 Apr 2007 16:54:50 +0000 (16:54 +0000)]
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.
H. Peter Anvin [Thu, 12 Apr 2007 16:25:58 +0000 (16:25 +0000)]
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.
Keith Kanios [Thu, 12 Apr 2007 16:23:11 +0000 (16:23 +0000)]
Fixed c99 support for RDOFF Tools
H. Peter Anvin [Thu, 12 Apr 2007 16:12:09 +0000 (16:12 +0000)]
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.
Keith Kanios [Thu, 12 Apr 2007 02:40:54 +0000 (02:40 +0000)]
General push for x86-64 support, dubbed 0.99.00.
Eric Christopher [Thu, 2 Mar 2006 18:35:09 +0000 (18:35 +0000)]
Add VMX instructions.
Eric Christopher [Sat, 4 Feb 2006 00:23:30 +0000 (00:23 +0000)]
Fix documentation building for non-srcdir builds. Still bugs in .ps implementation.
Add Mach-O documentation.
Eric Christopher [Thu, 2 Feb 2006 21:50:47 +0000 (21:50 +0000)]
2006-02-02 Eric Christopher <echristo@apple.com>
Wade Tregaskis <wtregaskis@apple.com>
* output/outmacho.c (macho_cleanup): Depend on symbols
existing.
Eric Christopher [Fri, 9 Dec 2005 00:27:26 +0000 (00:27 +0000)]
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.
Eric Christopher [Mon, 5 Dec 2005 23:17:17 +0000 (23:17 +0000)]
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.
Eric Christopher [Thu, 20 Oct 2005 19:46:34 +0000 (19:46 +0000)]
Allow CFLAGS to be overridden from make.
Eric Christopher [Fri, 7 Oct 2005 22:30:56 +0000 (22:30 +0000)]
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.
Eric Christopher [Mon, 26 Sep 2005 22:13:42 +0000 (22:13 +0000)]
Break macho_cleanup into separate functions.
Eric Christopher [Thu, 22 Sep 2005 21:41:17 +0000 (21:41 +0000)]
Run misc/Nindent on outmacho.c
Eric Christopher [Thu, 22 Sep 2005 21:22:33 +0000 (21:22 +0000)]
Add basic support for Mach-O file format.
Frank Kotler [Wed, 8 Jun 2005 16:41:10 +0000 (16:41 +0000)]
fix outobj.c bug - every 256th extern crashed nasm
-
Frank Kotler [Mon, 9 May 2005 16:34:43 +0000 (16:34 +0000)]
Jindrich Novy's buffer overrun patch to outieee.c
-
Frank Kotler [Thu, 10 Mar 2005 02:03:11 +0000 (02:03 +0000)]
add John Coffman's optimizer documentation
Frank Kotler [Fri, 4 Feb 2005 22:17:49 +0000 (22:17 +0000)]
Update "version" to 0.98.40
Frank Kotler [Mon, 17 Jan 2005 05:30:47 +0000 (05:30 +0000)]
update my address in AUTHORS
H. Peter Anvin [Sat, 15 Jan 2005 22:15:51 +0000 (22:15 +0000)]
Apply Nindent to all .c and .h files
H. Peter Anvin [Fri, 14 Jan 2005 23:05:31 +0000 (23:05 +0000)]
Update dependencies
H. Peter Anvin [Fri, 14 Jan 2005 23:03:42 +0000 (23:03 +0000)]
Fix comment