summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/arm/armdasm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/arm/armdasm.cpp')
-rw-r--r--src/devices/cpu/arm/armdasm.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/devices/cpu/arm/armdasm.cpp b/src/devices/cpu/arm/armdasm.cpp
index 81bd4c8dc6e..047fb2b3f70 100644
--- a/src/devices/cpu/arm/armdasm.cpp
+++ b/src/devices/cpu/arm/armdasm.cpp
@@ -245,27 +245,32 @@ offs_t arm_disassembler::disassemble(std::ostream &stream, offs_t pc, const data
}
}
+ int memreg = (opcode >> 16) & 0xf;
WritePadding(stream, start_position);
- util::stream_format( stream, "R%d, [R%d",
- (opcode>>12)&0xf, (opcode>>16)&0xf );
+ util::stream_format(stream, "R%d, [R%d", (opcode >> 12) & 0xf, memreg);
if( opcode&0x02000000 )
{
/* register form */
- WriteRegisterOperand1( stream, opcode );
- util::stream_format( stream, "]" );
+ WriteRegisterOperand1(stream, opcode);
+ util::stream_format(stream, "]");
}
else
{
/* immediate form */
- util::stream_format( stream, "]" );
+ util::stream_format(stream, "]");
+ uint16_t displacement = opcode & 0xfff;
if( opcode&0x00800000 )
{
- util::stream_format( stream, ", #$%x", opcode&0xfff );
+ util::stream_format(stream, ", #$%x", displacement);
+ if (memreg == 15)
+ util::stream_format(stream, " ; [$%x]", pc + 8 + displacement);
}
else
{
- util::stream_format( stream, ", -#$%x", opcode&0xfff );
+ util::stream_format(stream, ", -#$%x", displacement);
+ if (memreg == 15)
+ util::stream_format(stream, " ; [$%x]", pc + 8 - displacement);
}
}
}