summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/tms32010/32010dsm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/tms32010/32010dsm.cpp')
-rw-r--r--src/devices/cpu/tms32010/32010dsm.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/devices/cpu/tms32010/32010dsm.cpp b/src/devices/cpu/tms32010/32010dsm.cpp
index a1dfade63b4..4601498ce64 100644
--- a/src/devices/cpu/tms32010/32010dsm.cpp
+++ b/src/devices/cpu/tms32010/32010dsm.cpp
@@ -26,7 +26,10 @@
#include "emu.h"
#include "32010dsm.h"
+
#include <ctype.h>
+#include <stdexcept>
+
const char *const tms32010_disassembler::arith[4] = { "*" , "*-" , "*+" , "??" } ;
const char *const tms32010_disassembler::nextar[4] = { ",AR0" , ",AR1" , "" , "" } ;
@@ -174,16 +177,15 @@ tms32010_disassembler::tms32010_disassembler()
case 'r':
case 's':
case 'w':
- bit --;
+ bit--;
break;
- default: fatalerror("Invalid instruction encoding '%s %s'\n",
- ops[0],ops[1]);
+ default:
+ throw std::logic_error(util::string_format("Invalid instruction encoding '%s %s'\n", ops[0],ops[1]));
}
}
if (bit != -1 )
{
- fatalerror("not enough bits in encoding '%s %s' %d\n",
- ops[0],ops[1],bit);
+ throw std::logic_error(util::string_format("not enough bits in encoding '%s %s' %d\n", ops[0],ops[1],bit));
}
while (isspace((uint8_t)*p)) p++;
Op.emplace_back(mask, bits, *p, ops[0], ops[1]);
@@ -258,7 +260,7 @@ offs_t tms32010_disassembler::disassemble(std::ostream &stream, offs_t pc, const
case 'w': w <<=1; w |= ((code & (1<<bit)) ? 1 : 0); bit--; break;
case ' ': break;
case '1': case '0': bit--; break;
- case '\0': fatalerror("premature end of parse string, opcode %x, bit = %d\n",code,bit);
+ case '\0': throw std::logic_error(util::string_format("premature end of parse string, opcode %x, bit = %d\n",code,bit));
}
cp++;
}
@@ -290,7 +292,7 @@ offs_t tms32010_disassembler::disassemble(std::ostream &stream, offs_t pc, const
case 'S': sprintf(num,",%d",s); break;
case 'W': sprintf(num,"%04Xh",w); break;
default:
- fatalerror("illegal escape character in format '%s'\n",Op[op].fmt);
+ throw std::logic_error(util::string_format("illegal escape character in format '%s'\n",Op[op].fmt));
}
stream << num;
}