diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-13 13:40:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-13 13:50:22 +0200 |
commit | 5ecbfd845181602da6161e22f79721b3fc0f9661 (patch) | |
tree | a25092c4136d1a0038cbf4dc16ab6fa7bbcb3a42 | |
parent | 9f293054e8e4d85ac389e2a3525092d3c5e60f3b (diff) | |
download | serenity-5ecbfd845181602da6161e22f79721b3fc0f9661.zip |
UserspaceEmulator: Add the STC/CLC and STD/CLD instructions
-rw-r--r-- | DevTools/UserspaceEmulator/SoftCPU.cpp | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index bff4057694..2ddc1ccac4 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -773,8 +773,17 @@ void SoftCPU::CALL_imm32(const X86::Instruction& insn) void SoftCPU::CBW(const X86::Instruction&) { TODO(); } void SoftCPU::CDQ(const X86::Instruction&) { TODO(); } -void SoftCPU::CLC(const X86::Instruction&) { TODO(); } -void SoftCPU::CLD(const X86::Instruction&) { TODO(); } + +void SoftCPU::CLC(const X86::Instruction&) +{ + set_cf(false); +} + +void SoftCPU::CLD(const X86::Instruction&) +{ + set_df(false); +} + void SoftCPU::CLI(const X86::Instruction&) { TODO(); } void SoftCPU::CLTS(const X86::Instruction&) { TODO(); } void SoftCPU::CMC(const X86::Instruction&) { TODO(); } @@ -1614,8 +1623,17 @@ void SoftCPU::SHR_RM8_imm8(const X86::Instruction& insn) void SoftCPU::SIDT(const X86::Instruction&) { TODO(); } void SoftCPU::SLDT_RM16(const X86::Instruction&) { TODO(); } void SoftCPU::SMSW_RM16(const X86::Instruction&) { TODO(); } -void SoftCPU::STC(const X86::Instruction&) { TODO(); } -void SoftCPU::STD(const X86::Instruction&) { TODO(); } + +void SoftCPU::STC(const X86::Instruction&) +{ + set_cf(true); +} + +void SoftCPU::STD(const X86::Instruction&) +{ + set_df(true); +} + void SoftCPU::STI(const X86::Instruction&) { TODO(); } void SoftCPU::STOSB(const X86::Instruction& insn) |