summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms0980/tms0980d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms0980/tms0980d.cpp')
-rw-r--r--src/devices/cpu/tms0980/tms0980d.cpp72
1 files changed, 46 insertions, 26 deletions
diff --git a/src/devices/cpu/tms0980/tms0980d.cpp b/src/devices/cpu/tms0980/tms0980d.cpp
index ea72ba9be2e..371047b0a79 100644
--- a/src/devices/cpu/tms0980/tms0980d.cpp
+++ b/src/devices/cpu/tms0980/tms0980d.cpp
@@ -11,7 +11,8 @@
#include "tms0980.h"
-enum e_mnemonics {
+enum e_mnemonics
+{
zA10AAC=0, zA6AAC, zA8AAC, zAC1AC, zACACC, zACNAA, zALEC, zALEM, zAMAAC, zBRANCH, zCALL, zCCLA,
zCLA, zCLO, zCOMC, zCOMX, zCOMX8, zCPAIZ, zCTMDYN, zDAN, zDMAN, zDMEA, zDNAA,
zDYN, zIA, zIMAC, zIYC, zKNEZ, zLDP, zLDX, zLDX3, zLDX4, zMNEA, zMNEZ,
@@ -22,7 +23,8 @@ enum e_mnemonics {
zILL
};
-static const char *const s_mnemonic[] = {
+static const char *const s_mnemonic[] =
+{
"A10AAC", "A6AAC", "A8AAC", "AC1AC", "ACACC", "ACNAA", "ALEC", "ALEM", "AMAAC", "BRANCH", "CALL", "CCLA",
"CLA", "CLO", "COMC", "COMX", "COMX8", "CPAIZ", "CTMDYN", "DAN", "DMAN", "DMEA", "DNAA",
"DYN", "IA", "IMAC", "IYC", "KNEZ", "LDP", "LDX", "LDX", "LDX", "MNEA", "MNEZ",
@@ -37,7 +39,8 @@ static const char *const s_mnemonic[] = {
#define _OVER DASMFLAG_STEP_OVER
#define _OUT DASMFLAG_STEP_OUT
-static const UINT32 s_flags[] = {
+static const UINT32 s_flags[] =
+{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, _OVER, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -49,11 +52,13 @@ static const UINT32 s_flags[] = {
};
-enum e_addressing {
+enum e_addressing
+{
zB0=0, zI2, zI3, zI4, zB7
};
-static const UINT8 s_addressing[] = {
+static const UINT8 s_addressing[] =
+{
zB0, zB0, zB0, zI4, zI4, zI4, zI4, zB0, zB0, zB7, zB7, zB0,
zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0, zB0,
zB0, zB0, zB0, zB0, zB0, zI4, zI2, zI3, zI4, zB0, zB0,
@@ -65,7 +70,25 @@ static const UINT8 s_addressing[] = {
};
-static const UINT8 tms0980_mnemonic[512] = {
+static const UINT8 tms0980_i2_value[4] =
+{
+ 0, 2, 1, 3
+};
+static const UINT8 tms0980_i3_value[8] =
+{
+ 0, 4, 2, 6, 1, 5, 3, 7
+};
+static const UINT8 tms0980_i4_value[16] =
+{
+ 0x0, 0x8, 0x4, 0xc, 0x2, 0xa, 0x6, 0xe, 0x1, 0x9, 0x5, 0xd, 0x3, 0xb, 0x7, 0xf
+};
+
+
+
+// opcode luts
+
+static const UINT8 tms0980_mnemonic[512] =
+{
/* 0x000 */
zCOMX, zALEM, zYNEA, zXMA, zDYN, zIYC, zCLA, zDMAN,
zTKA, zMNEA, zTKM, zILL, zILL, zSETR, zKNEZ, zILL,
@@ -151,7 +174,8 @@ static const UINT8 tms0980_mnemonic[512] = {
};
-static const UINT8 tms1000_mnemonic[256] = {
+static const UINT8 tms1000_mnemonic[256] =
+{
/* 0x00 */
zCOMX, zA8AAC, zYNEA, zTAM, zTAMZA, zA10AAC, zA6AAC, zDAN,
zTKA, zKNEZ, zTDO, zCLO, zRSTR, zSETR, zIA, zRETN,
@@ -191,7 +215,8 @@ static const UINT8 tms1000_mnemonic[256] = {
};
-static const UINT8 tms1100_mnemonic[256] = {
+static const UINT8 tms1100_mnemonic[256] =
+{
/* 0x00 */
zMNEA, zALEM, zYNEA, zXMA, zDYN, zIYC, zAMAAC, zDMAN,
zTKA, zCOMX, zTDO, zCOMC, zRSTR, zSETR, zKNEZ, zRETN,
@@ -233,21 +258,11 @@ static const UINT8 tms1100_mnemonic[256] = {
};
-static const UINT8 tms0980_i2_value[4] =
-{
- 0x00, 0x02, 0x01, 0x03
-};
-static const UINT8 tms0980_i3_value[8] =
-{
- 0x00, 0x04, 0x02, 0x06, 0x01, 0x05, 0x03, 0x07
-};
-static const UINT8 tms0980_i4_value[16] =
-{
- 0x00, 0x08, 0x04, 0x0C, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x0F
-};
+// disasm
-CPU_DISASSEMBLE( tms0980 ) {
+CPU_DISASSEMBLE( tms0980 )
+{
char *dst = buffer;
UINT16 op, instr;
int pos = 0;
@@ -259,7 +274,8 @@ CPU_DISASSEMBLE( tms0980 ) {
dst += sprintf( dst, "%-8s ", s_mnemonic[instr] );
- switch( s_addressing[instr] ) {
+ switch( s_addressing[instr] )
+ {
default:
case zB0:
break;
@@ -278,7 +294,8 @@ CPU_DISASSEMBLE( tms0980 ) {
}
-CPU_DISASSEMBLE( tms1000 ) {
+CPU_DISASSEMBLE( tms1000 )
+{
char *dst = buffer;
UINT8 op, instr;
int pos = 0;
@@ -290,7 +307,8 @@ CPU_DISASSEMBLE( tms1000 ) {
dst += sprintf( dst, "%-8s ", s_mnemonic[instr] );
- switch( s_addressing[instr] ) {
+ switch( s_addressing[instr] )
+ {
default:
case zB0:
break;
@@ -309,7 +327,8 @@ CPU_DISASSEMBLE( tms1000 ) {
}
-CPU_DISASSEMBLE( tms1100 ) {
+CPU_DISASSEMBLE( tms1100 )
+{
char *dst = buffer;
UINT8 op, instr;
int pos = 0;
@@ -321,7 +340,8 @@ CPU_DISASSEMBLE( tms1100 ) {
dst += sprintf( dst, "%-8s ", s_mnemonic[instr] );
- switch( s_addressing[instr] ) {
+ switch( s_addressing[instr] )
+ {
default:
case zB0:
break;