0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

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.
This commit is contained in:
H. Peter Anvin
2007-05-30 03:25:21 +00:00
parent 1cf9c9d3ab
commit 3df97a7270
5 changed files with 310 additions and 348 deletions

View File

@@ -35,15 +35,6 @@ extern struct itemplate **itable[];
#define SEG_SIGNED 128
#define SEG_64BIT 256
/*
* REX flags
*/
#define REX_P 0x40 /* REX prefix present */
#define REX_W 0x08 /* 64-bit operand size */
#define REX_R 0x04 /* ModRM reg extension */
#define REX_X 0x02 /* SIB index extension */
#define REX_B 0x01 /* ModRM r/m extension */
#include "regdis.c"
#define getu8(x) (*(uint8_t *)(x))