Skip to content

Commit a6617e5

Browse files
committed
nx8_500s disassembler: Correct decoding of some DP/USP-based addressing modes where documentation appears to be wrong
1 parent 1fd311c commit a6617e5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: src/devices/cpu/olms66k/nx8dasm.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -734,10 +734,11 @@ offs_t nx8_500s_disassembler::disassemble(std::ostream &stream, offs_t pc, const
734734
{
735735
const u8 byte2 = opcodes.r8(pc + 1);
736736
util::stream_format(stream, "%-8sA,%d", BIT(byte1, 4) ? "LB" : "L", util::sext(byte2, 7));
737+
// Documentation has these the other way around, but actual code suggests otherwise
737738
if (BIT(byte2, 7))
738-
stream << "[DP]";
739-
else
740739
stream << "[USP]";
740+
else
741+
stream << "[DP]";
741742
return 2 | SUPPORTED;
742743
}
743744

@@ -880,10 +881,11 @@ offs_t nx8_500s_disassembler::disassemble(std::ostream &stream, offs_t pc, const
880881
{
881882
const u8 byte2 = opcodes.r8(pc + 1);
882883
util::stream_format(stream, "%-8sA,%d", BIT(m_psw, 12) ? "ST" : "STB", util::sext(byte2, 7));
884+
// Documentation has these the other way around, but actual code suggests otherwise
883885
if (BIT(byte2, 7))
884-
stream << "[DP]";
885-
else
886886
stream << "[USP]";
887+
else
888+
stream << "[DP]";
887889
return 2 | SUPPORTED;
888890
}
889891

0 commit comments

Comments
 (0)