diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-11 22:33:01 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-11 23:57:14 +0200 |
commit | 6c7ae794ce9b796e37c3a46d65c73847c6f853c0 (patch) | |
tree | a58b4b9057dd0afd281b387582748c0882ed581f /DevTools | |
parent | 321ee72fe72ac2a4e93090aacc6def4bb1dea645 (diff) | |
download | serenity-6c7ae794ce9b796e37c3a46d65c73847c6f853c0.zip |
UserspaceEmulator: Implement the 32-bit LEAVE instruction
The 16-bit variant is a bit weird. Let's wait until someone needs it.
Diffstat (limited to 'DevTools')
-rw-r--r-- | DevTools/UserspaceEmulator/SoftCPU.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index ae993db5af..58b98ddfeb 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -716,7 +716,13 @@ void SoftCPU::LAR_reg32_RM32(const X86::Instruction&) { TODO(); } void SoftCPU::LDS_reg16_mem16(const X86::Instruction&) { TODO(); } void SoftCPU::LDS_reg32_mem32(const X86::Instruction&) { TODO(); } void SoftCPU::LEAVE16(const X86::Instruction&) { TODO(); } -void SoftCPU::LEAVE32(const X86::Instruction&) { TODO(); } + +void SoftCPU::LEAVE32(const X86::Instruction&) +{ + u32 new_ebp = read_memory32({ ss(), ebp() }); + set_esp(ebp() + 4); + set_ebp(new_ebp); +} void SoftCPU::LEA_reg16_mem16(const X86::Instruction& insn) { |