summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/i386/i386dasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/i386/i386dasm.cpp')
-rw-r--r--src/devices/cpu/i386/i386dasm.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/src/devices/cpu/i386/i386dasm.cpp b/src/devices/cpu/i386/i386dasm.cpp
index 780cda0ba1d..0e39a2edfe8 100644
--- a/src/devices/cpu/i386/i386dasm.cpp
+++ b/src/devices/cpu/i386/i386dasm.cpp
@@ -102,10 +102,10 @@ enum
struct I386_OPCODE {
const char *mnemonic;
- UINT32 flags;
- UINT32 param1;
- UINT32 param2;
- UINT32 param3;
+ uint32_t flags;
+ uint32_t param1;
+ uint32_t param2;
+ uint32_t param3;
offs_t dasm_flags;
};
@@ -114,8 +114,8 @@ struct GROUP_OP {
const I386_OPCODE *opcode;
};
-static const UINT8 *opcode_ptr;
-static const UINT8 *opcode_ptr_base;
+static const uint8_t *opcode_ptr;
+static const uint8_t *opcode_ptr_base;
static const I386_OPCODE i386_opcode_table1[256] =
{
@@ -1980,20 +1980,20 @@ static int operand_size;
static int address_prefix;
static int operand_prefix;
static int max_length;
-static UINT64 pc;
-static UINT8 modrm;
-static UINT32 segment;
+static uint64_t pc;
+static uint8_t modrm;
+static uint32_t segment;
static offs_t dasm_flags;
static char modrm_string[256];
-static UINT8 rex, regex, sibex, rmex;
-static UINT8 pre0f;
-static UINT8 curmode;
+static uint8_t rex, regex, sibex, rmex;
+static uint8_t pre0f;
+static uint8_t curmode;
#define MODRM_REG1 ((modrm >> 3) & 0x7)
#define MODRM_REG2 (modrm & 0x7)
#define MODRM_MOD ((modrm >> 6) & 0x3)
-static inline UINT8 FETCH(void)
+static inline uint8_t FETCH(void)
{
if ((opcode_ptr - opcode_ptr_base) + 1 > max_length)
return 0xff;
@@ -2002,9 +2002,9 @@ static inline UINT8 FETCH(void)
}
#if 0
-static inline UINT16 FETCH16(void)
+static inline uint16_t FETCH16(void)
{
- UINT16 d;
+ uint16_t d;
if ((opcode_ptr - opcode_ptr_base) + 2 > max_length)
return 0xffff;
d = opcode_ptr[0] | (opcode_ptr[1] << 8);
@@ -2014,9 +2014,9 @@ static inline UINT16 FETCH16(void)
}
#endif
-static inline UINT32 FETCH32(void)
+static inline uint32_t FETCH32(void)
{
- UINT32 d;
+ uint32_t d;
if ((opcode_ptr - opcode_ptr_base) + 4 > max_length)
return 0xffffffff;
d = opcode_ptr[0] | (opcode_ptr[1] << 8) | (opcode_ptr[2] << 16) | (opcode_ptr[3] << 24);
@@ -2025,7 +2025,7 @@ static inline UINT32 FETCH32(void)
return d;
}
-static inline UINT8 FETCHD(void)
+static inline uint8_t FETCHD(void)
{
if ((opcode_ptr - opcode_ptr_base) + 1 > max_length)
return 0xff;
@@ -2033,9 +2033,9 @@ static inline UINT8 FETCHD(void)
return *opcode_ptr++;
}
-static inline UINT16 FETCHD16(void)
+static inline uint16_t FETCHD16(void)
{
- UINT16 d;
+ uint16_t d;
if ((opcode_ptr - opcode_ptr_base) + 2 > max_length)
return 0xffff;
d = opcode_ptr[0] | (opcode_ptr[1] << 8);
@@ -2044,9 +2044,9 @@ static inline UINT16 FETCHD16(void)
return d;
}
-static inline UINT32 FETCHD32(void)
+static inline uint32_t FETCHD32(void)
{
- UINT32 d;
+ uint32_t d;
if ((opcode_ptr - opcode_ptr_base) + 4 > max_length)
return 0xffffffff;
d = opcode_ptr[0] | (opcode_ptr[1] << 8) | (opcode_ptr[2] << 16) | (opcode_ptr[3] << 24);
@@ -2055,7 +2055,7 @@ static inline UINT32 FETCHD32(void)
return d;
}
-static char *hexstring(UINT32 value, int digits)
+static char *hexstring(uint32_t value, int digits)
{
static char buffer[20];
buffer[0] = '0';
@@ -2066,7 +2066,7 @@ static char *hexstring(UINT32 value, int digits)
return (buffer[1] >= '0' && buffer[1] <= '9') ? &buffer[1] : &buffer[0];
}
-static char *hexstring64(UINT32 lo, UINT32 hi)
+static char *hexstring64(uint32_t lo, uint32_t hi)
{
static char buffer[40];
buffer[0] = '0';
@@ -2077,15 +2077,15 @@ static char *hexstring64(UINT32 lo, UINT32 hi)
return (buffer[1] >= '0' && buffer[1] <= '9') ? &buffer[1] : &buffer[0];
}
-static char *hexstringpc(UINT64 pc)
+static char *hexstringpc(uint64_t pc)
{
if (curmode == 64)
- return hexstring64((UINT32)pc, (UINT32)(pc >> 32));
+ return hexstring64((uint32_t)pc, (uint32_t)(pc >> 32));
else
- return hexstring((UINT32)pc, 0);
+ return hexstring((uint32_t)pc, 0);
}
-static char *shexstring(UINT32 value, int digits, int always)
+static char *shexstring(uint32_t value, int digits, int always)
{
static char buffer[20];
if (value >= 0x80000000)
@@ -2097,11 +2097,11 @@ static char *shexstring(UINT32 value, int digits, int always)
return buffer;
}
-static char* handle_sib_byte( char* s, UINT8 mod )
+static char* handle_sib_byte( char* s, uint8_t mod )
{
- UINT32 i32;
- UINT8 scale, i, base;
- UINT8 sib = FETCHD();
+ uint32_t i32;
+ uint8_t scale, i, base;
+ uint8_t sib = FETCHD();
scale = (sib >> 6) & 0x3;
i = ((sib >> 3) & 0x7) | sibex;
@@ -2123,10 +2123,10 @@ static char* handle_sib_byte( char* s, UINT8 mod )
static void handle_modrm(char* s)
{
- INT8 disp8;
- INT16 disp16;
- INT32 disp32;
- UINT8 mod, rm;
+ int8_t disp8;
+ int16_t disp16;
+ int32_t disp32;
+ uint8_t mod, rm;
modrm = FETCHD();
mod = (modrm >> 6) & 0x3;
@@ -2157,7 +2157,7 @@ static void handle_modrm(char* s)
if( mod == 1 ) {
disp8 = FETCHD();
if (disp8 != 0)
- s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) );
+ s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) );
} else if( mod == 2 ) {
disp32 = FETCHD32();
if (disp32 != 0)
@@ -2177,7 +2177,7 @@ static void handle_modrm(char* s)
if( mod == 1 ) {
disp8 = FETCHD();
if (disp8 != 0)
- s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) );
+ s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) );
} else if( mod == 2 ) {
disp32 = FETCHD32();
if (disp32 != 0)
@@ -2195,7 +2195,7 @@ static void handle_modrm(char* s)
case 6:
if( mod == 0 ) {
disp16 = FETCHD16();
- s += sprintf( s, "%s", hexstring((unsigned) (UINT16) disp16, 0) );
+ s += sprintf( s, "%s", hexstring((unsigned) (uint16_t) disp16, 0) );
} else {
s += sprintf( s, "bp" );
}
@@ -2205,26 +2205,26 @@ static void handle_modrm(char* s)
if( mod == 1 ) {
disp8 = FETCHD();
if (disp8 != 0)
- s += sprintf( s, "%s", shexstring((INT32)disp8, 0, TRUE) );
+ s += sprintf( s, "%s", shexstring((int32_t)disp8, 0, TRUE) );
} else if( mod == 2 ) {
disp16 = FETCHD16();
if (disp16 != 0)
- s += sprintf( s, "%s", shexstring((INT32)disp16, 0, TRUE) );
+ s += sprintf( s, "%s", shexstring((int32_t)disp16, 0, TRUE) );
}
}
s += sprintf( s, "]" );
}
-static char* handle_param(char* s, UINT32 param)
+static char* handle_param(char* s, uint32_t param)
{
- UINT8 i8;
- UINT16 i16;
- UINT32 i32;
- UINT16 ptr;
- UINT32 addr;
- INT8 d8;
- INT16 d16;
- INT32 d32;
+ uint8_t i8;
+ uint16_t i16;
+ uint32_t i32;
+ uint16_t ptr;
+ uint32_t addr;
+ int8_t d8;
+ int16_t d16;
+ int32_t d32;
switch(param)
{
@@ -2378,27 +2378,27 @@ static char* handle_param(char* s, UINT32 param)
case PARAM_I8:
i8 = FETCHD();
- s += sprintf( s, "%s", shexstring((INT8)i8, 0, FALSE) );
+ s += sprintf( s, "%s", shexstring((int8_t)i8, 0, FALSE) );
break;
case PARAM_I16:
i16 = FETCHD16();
- s += sprintf( s, "%s", shexstring((INT16)i16, 0, FALSE) );
+ s += sprintf( s, "%s", shexstring((int16_t)i16, 0, FALSE) );
break;
case PARAM_UI8:
i8 = FETCHD();
- s += sprintf( s, "%s", shexstring((UINT8)i8, 0, FALSE) );
+ s += sprintf( s, "%s", shexstring((uint8_t)i8, 0, FALSE) );
break;
case PARAM_UI16:
i16 = FETCHD16();
- s += sprintf( s, "%s", shexstring((UINT16)i16, 0, FALSE) );
+ s += sprintf( s, "%s", shexstring((uint16_t)i16, 0, FALSE) );
break;
case PARAM_IMM64:
if (operand_size == 2) {
- UINT32 lo32 = FETCHD32();
+ uint32_t lo32 = FETCHD32();
i32 = FETCHD32();
s += sprintf( s, "%s", hexstring64(lo32, i32) );
} else if( operand_size ) {
@@ -2531,7 +2531,7 @@ static char* handle_param(char* s, UINT32 param)
return s;
}
-static void handle_fpu(char *s, UINT8 op1, UINT8 op2)
+static void handle_fpu(char *s, uint8_t op1, uint8_t op2)
{
switch (op1 & 0x7)
{
@@ -2908,10 +2908,10 @@ static void handle_fpu(char *s, UINT8 op1, UINT8 op2)
}
}
-static void decode_opcode(char *s, const I386_OPCODE *op, UINT8 op1)
+static void decode_opcode(char *s, const I386_OPCODE *op, uint8_t op1)
{
int i;
- UINT8 op2;
+ uint8_t op2;
if ((op->flags & SPECIAL64) && (address_size == 2))
op = &x64_opcode_alt[op->flags >> 24];
@@ -3057,9 +3057,9 @@ handle_unknown:
sprintf(s, "???");
}
-int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode)
+int i386_dasm_one_ex(char *buffer, uint64_t eip, const uint8_t *oprom, int mode)
{
- UINT8 op;
+ uint8_t op;
opcode_ptr = opcode_ptr_base = oprom;
switch(mode)
@@ -3105,7 +3105,7 @@ int i386_dasm_one_ex(char *buffer, UINT64 eip, const UINT8 *oprom, int mode)
return (pc-eip) | dasm_flags | DASMFLAG_SUPPORTED;
}
-int i386_dasm_one(char *buffer, offs_t eip, const UINT8 *oprom, int mode)
+int i386_dasm_one(char *buffer, offs_t eip, const uint8_t *oprom, int mode)
{
return i386_dasm_one_ex(buffer, eip, oprom, mode);
}