Enhance "Assemble Opcode" to be pre-populated by existing instruction. (#2244)

This commit is contained in:
Russ K 2018-01-13 19:47:00 -06:00 committed by Robert Neumann
parent 4aa25c4971
commit 43d0bd99cb
2 changed files with 9 additions and 1 deletions

View File

@ -779,7 +779,7 @@ void CtrlDisassemblyView::onPopupClick(wxCommandEvent& evt)
break;
}
case ID_DISASM_ASSEMBLE:
assembleOpcode(curAddress,"");
assembleOpcode(curAddress, disassembleCurAddress());
break;
default:
wxMessageBox( L"Unimplemented.", L"Unimplemented.", wxICON_INFORMATION);
@ -1206,6 +1206,13 @@ std::string CtrlDisassemblyView::disassembleRange(u32 start, u32 size)
return result;
}
std::string CtrlDisassemblyView::disassembleCurAddress()
{
DisassemblyLineInfo line = DisassemblyLineInfo();
manager.getLine(curAddress, displaySymbols, line);
return line.name + (line.params.length() > 0 ? " " + line.params : "");
}
void CtrlDisassemblyView::copyInstructions(u32 startAddr, u32 endAddr, bool withDisasm)
{
if (!wxTheClipboard->Open())

View File

@ -61,6 +61,7 @@ private:
void toggleBreakpoint(bool toggleEnabled);
void updateStatusBarText();
std::string disassembleRange(u32 start, u32 size);
std::string disassembleCurAddress();
void copyInstructions(u32 startAddr, u32 endAddr, bool withDisasm);
void disassembleToFile();
void editBreakpoint();