mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
UserspaceEmulator: Break out of emulation when hitting a RET
Until we learn more instructions, we'll have to exit somewhere, so let us exit when we hit a RET instruction for now.
This commit is contained in:
parent
8d8bb07476
commit
d0dbf92c8d
1 changed files with 5 additions and 4 deletions
|
@ -43,15 +43,16 @@ int Emulator::exec(X86::SimpleInstructionStream& stream, u32 base)
|
|||
size_t offset = 0;
|
||||
while (!m_shutdown) {
|
||||
auto insn = X86::Instruction::from_stream(stream, true, true);
|
||||
out() << "instruction: " << insn.to_string(base + offset);
|
||||
out() << "\033[33;1m" << insn.to_string(base + offset) << "\033[0m";
|
||||
|
||||
// FIXME: Remove this hack once it's no longer needed :^)
|
||||
if (insn.mnemonic() == "RET")
|
||||
break;
|
||||
|
||||
(m_cpu.*insn.handler())(insn);
|
||||
m_cpu.dump();
|
||||
|
||||
offset += insn.length();
|
||||
|
||||
if (insn.mnemonic() == "RET")
|
||||
break;
|
||||
}
|
||||
return m_exit_status;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue