Commit Graph

463 Commits

Author SHA1 Message Date
Frank Kotler
f20f692156 update cvs server name in misc/release script 2007-05-30 16:34:29 +00:00
H. Peter Anvin
a1abb32004 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.
2007-05-30 04:28:50 +00:00
H. Peter Anvin
34539fb1ed 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.
2007-05-30 04:27:58 +00:00
H. Peter Anvin
06bf8db596 More \321 -> \324
More \321 that should be \324...
2007-05-30 03:44:50 +00:00
H. Peter Anvin
a57e8d411a 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.
2007-05-30 03:44:02 +00:00
H. Peter Anvin
3df97a7270 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.
2007-05-30 03:25:21 +00:00
H. Peter Anvin
1cf9c9d3ab MOV reg64,reg64 takes \324 (64 bit with REX) not \321 (32 bit) 2007-05-30 02:48:51 +00:00
H. Peter Anvin
dbf130e681 Rename REGNORM to REG_EA
Rename REGNORM to REG_EA to make the distinction between REG_GPR and
REG_EA clearer.
2007-05-30 00:18:26 +00:00
H. Peter Anvin
1ffbd70af0 More instruction flag surgery 2007-05-30 00:15:25 +00:00
H. Peter Anvin
edb1428239 More cleanup of operand flags/register classes 2007-05-30 00:05: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
7a83374a9c Run "make alldeps" 2007-05-29 21:44:55 +00:00
Frank Kotler
d528759e72 update version number to 0.99.01 2007-05-24 22:33:07 +00:00
H. Peter Anvin
fb658ae61b regs.dat: fix comment 2007-05-15 04:33:43 +00:00
H. Peter Anvin
90b9417613 16-bit relocations are standard in ELF64 (at my request, incidentally) 2007-05-04 18:47:16 +00:00
Chuck Crayne
b7eea1c940 Addition of elf32 and elf64 output formats.
Addition of ! as unary operator in expression evaluation.
Allow numeric constants in DQ directive.
2007-05-04 02:16:08 +00:00
Chuck Crayne
cb9bc21374 Allow '!' to be used in expressions with same meaning as in C. 2007-05-02 04:21:26 +00:00
Chuck Crayne
60ae75d3ab Add %IFN and %ELIFN as per RFE #786286 2007-05-02 01:59:16 +00:00
Chuck Crayne
45ef7e76ee Accept responsibility for support of outelf64.c 2007-04-30 22:26:58 +00:00
Chuck Crayne
8ab0320f02 Clarify comments about relocation entries. 2007-04-29 20:57:53 +00:00
Chuck Crayne
1c270b7fe2 Allow ELF32 to be invoked either as -f elf or -f elf32 2007-04-29 00:28:24 +00:00
Chuck Crayne
6e61733e38 Eliminate shift count warnings when building on 32-bit systems
Remove define for DEBUG
2007-04-28 22:18:04 +00:00
Chuck Crayne
26d3de3217 Initial support for ELF64 2007-04-28 06:18:48 +00:00
H. Peter Anvin
8d7316a3ff 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.
2007-04-18 02:27:18 +00:00
Keith Kanios
7295e9856d Fixed RDF/2 to comply with "maxbits" use. 2007-04-18 02:24:34 +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
fd626d6770 MEM_OFFSET Instructions Fixed. 2007-04-16 18:16:46 +00:00
Keith Kanios
fd5d91383a Fixed 64-bit Mode Segment Selection. 2007-04-16 15:46:46 +00:00
Keith Kanios
e83b318017 Fixed distinction between [LOCAL]SYMBOL/IMMEDIATE for RIP-relative addressing. 2007-04-16 14:31:54 +00:00
Keith Kanios
56e3528b4a Fixed long mode MEM_OFFS issue. 2007-04-16 14:05:01 +00:00
Keith Kanios
76a83979d8 Filled in all RIP Register Flags. 2007-04-16 13:54:49 +00:00
H. Peter Anvin
ed45f4c6f2 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.
2007-04-16 05:26:29 +00:00
Keith Kanios
7a68f30dd7 Fixed 64-bit offset generation. 2007-04-16 04:56:06 +00:00
H. Peter Anvin
7cf03aff4f More 64-bit ndisasm fixes.
In particular, now we should handle A0-A3 instructions.
2007-04-16 02:39:56 +00:00
H. Peter Anvin
b061d595fb 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.
2007-04-16 02:02:06 +00:00
H. Peter Anvin
88aa185d36 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.
2007-04-16 01:21:29 +00:00
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