From 59e8aef15e24d1e960ae2b4fbeb4974cfa87b52b Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 27 Aug 2023 10:52:48 -0400 Subject: cpu16dasm.cpp: Use util::sext to sign-extend 4-bit constants --- src/devices/cpu/m68hc16/cpu16dasm.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/devices/cpu/m68hc16/cpu16dasm.cpp b/src/devices/cpu/m68hc16/cpu16dasm.cpp index 84598595f52..81ea816d1d6 100644 --- a/src/devices/cpu/m68hc16/cpu16dasm.cpp +++ b/src/devices/cpu/m68hc16/cpu16dasm.cpp @@ -1294,15 +1294,7 @@ offs_t cpu16_disassembler::disassemble(std::ostream &stream, offs_t pc, const cp case mode::XYO: assert(page == 0); - util::stream_format(stream, "%-6s", info.m_name); - if (BIT(opcode, 7)) - util::stream_format(stream, "-%d, ", 8 - BIT(opcode, 4, 3)); - else - util::stream_format(stream, "%d, ", BIT(opcode, 4, 3)); - if (BIT(opcode, 3)) - util::stream_format(stream, "-%d", 8 - BIT(opcode, 0, 3)); - else - util::stream_format(stream, "%d", BIT(opcode, 0, 3)); + util::stream_format(stream, "%-6s%d, %d", info.m_name, util::sext(opcode >> 4, 4), util::sext(opcode, 4)); return 2 | SUPPORTED | info.m_flags; case mode::IND: -- cgit v1.2.3