convert some defines to enum

This commit is contained in:
Stanislav Shwartsman 2014-01-31 19:40:34 +00:00
parent 785b4bed1b
commit ef130ca145

View File

@ -26,51 +26,59 @@
// <TAG-DEFINES-DECODE-START> // <TAG-DEFINES-DECODE-START>
// segment register encoding // segment register encoding
#define BX_SEG_REG_ES 0 enum {
#define BX_SEG_REG_CS 1 BX_SEG_REG_ES = 0,
#define BX_SEG_REG_SS 2 BX_SEG_REG_CS = 1,
#define BX_SEG_REG_DS 3 BX_SEG_REG_SS = 2,
#define BX_SEG_REG_FS 4 BX_SEG_REG_DS = 3,
#define BX_SEG_REG_GS 5 BX_SEG_REG_FS = 4,
BX_SEG_REG_GS = 5
};
// NULL now has to fit in 3 bits. // NULL now has to fit in 3 bits.
#define BX_SEG_REG_NULL 7 #define BX_SEG_REG_NULL 7
#define BX_NULL_SEG_REG(seg) ((seg) == BX_SEG_REG_NULL) #define BX_NULL_SEG_REG(seg) ((seg) == BX_SEG_REG_NULL)
#define BX_16BIT_REG_AX 0 enum {
#define BX_16BIT_REG_CX 1 BX_16BIT_REG_AX,
#define BX_16BIT_REG_DX 2 BX_16BIT_REG_CX,
#define BX_16BIT_REG_BX 3 BX_16BIT_REG_DX,
#define BX_16BIT_REG_SP 4 BX_16BIT_REG_BX,
#define BX_16BIT_REG_BP 5 BX_16BIT_REG_SP,
#define BX_16BIT_REG_SI 6 BX_16BIT_REG_BP,
#define BX_16BIT_REG_DI 7 BX_16BIT_REG_SI,
BX_16BIT_REG_DI
};
#define BX_32BIT_REG_EAX 0 enum {
#define BX_32BIT_REG_ECX 1 BX_32BIT_REG_EAX,
#define BX_32BIT_REG_EDX 2 BX_32BIT_REG_ECX,
#define BX_32BIT_REG_EBX 3 BX_32BIT_REG_EDX,
#define BX_32BIT_REG_ESP 4 BX_32BIT_REG_EBX,
#define BX_32BIT_REG_EBP 5 BX_32BIT_REG_ESP,
#define BX_32BIT_REG_ESI 6 BX_32BIT_REG_EBP,
#define BX_32BIT_REG_EDI 7 BX_32BIT_REG_ESI,
BX_32BIT_REG_EDI
};
#define BX_64BIT_REG_RAX 0 enum {
#define BX_64BIT_REG_RCX 1 BX_64BIT_REG_RAX,
#define BX_64BIT_REG_RDX 2 BX_64BIT_REG_RCX,
#define BX_64BIT_REG_RBX 3 BX_64BIT_REG_RDX,
#define BX_64BIT_REG_RSP 4 BX_64BIT_REG_RBX,
#define BX_64BIT_REG_RBP 5 BX_64BIT_REG_RSP,
#define BX_64BIT_REG_RSI 6 BX_64BIT_REG_RBP,
#define BX_64BIT_REG_RDI 7 BX_64BIT_REG_RSI,
BX_64BIT_REG_RDI,
#define BX_64BIT_REG_R8 8 BX_64BIT_REG_R8,
#define BX_64BIT_REG_R9 9 BX_64BIT_REG_R9,
#define BX_64BIT_REG_R10 10 BX_64BIT_REG_R10,
#define BX_64BIT_REG_R11 11 BX_64BIT_REG_R11,
#define BX_64BIT_REG_R12 12 BX_64BIT_REG_R12,
#define BX_64BIT_REG_R13 13 BX_64BIT_REG_R13,
#define BX_64BIT_REG_R14 14 BX_64BIT_REG_R14,
#define BX_64BIT_REG_R15 15 BX_64BIT_REG_R15
};
#if BX_SUPPORT_X86_64 #if BX_SUPPORT_X86_64
# define BX_GENERAL_REGISTERS 16 # define BX_GENERAL_REGISTERS 16
@ -5425,10 +5433,13 @@ IMPLEMENT_EFLAG_SET_ACCESSOR (DF, 10)
IMPLEMENT_EFLAG_SET_ACCESSOR_IF( 9) IMPLEMENT_EFLAG_SET_ACCESSOR_IF( 9)
IMPLEMENT_EFLAG_SET_ACCESSOR_TF( 8) IMPLEMENT_EFLAG_SET_ACCESSOR_TF( 8)
#define BX_TASK_FROM_CALL 0 // hardware task switching
#define BX_TASK_FROM_IRET 1 enum {
#define BX_TASK_FROM_JUMP 2 BX_TASK_FROM_CALL = 0,
#define BX_TASK_FROM_INT 3 BX_TASK_FROM_IRET = 1,
BX_TASK_FROM_JUMP = 2,
BX_TASK_FROM_INT = 3
};
// exception types for interrupt method // exception types for interrupt method
enum { enum {