summaryrefslogtreecommitdiff
path: root/Userland/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-12-06 17:23:04 +0100
committerAndreas Kling <kling@serenityos.org>2022-12-07 13:18:48 +0100
commitbd1f39ebaa42c3e6d570fa3e8818e84135e184c5 (patch)
treec5a70449311819727fe5a71edf44321b7bac480e /Userland/DevTools
parentb6472c250c2392daa36bcfb36edff7b6f21b7a78 (diff)
downloadserenity-bd1f39ebaa42c3e6d570fa3e8818e84135e184c5.zip
UserspaceEmulator: Implement PUSH_{CS,DS,ES,FS,GS,SS}
You can now push the segment registers on the stack! :^)
Diffstat (limited to 'Userland/DevTools')
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftCPU.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
index acad23e837..f39c6e8d7f 100644
--- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
+++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp
@@ -2409,11 +2409,30 @@ void SoftCPU::PUSHFD(const X86::Instruction&)
push32(shadow_wrap_as_initialized(m_eflags & 0x00fcffff));
}
-void SoftCPU::PUSH_CS(const X86::Instruction&) { TODO_INSN(); }
-void SoftCPU::PUSH_DS(const X86::Instruction&) { TODO_INSN(); }
-void SoftCPU::PUSH_ES(const X86::Instruction&) { TODO_INSN(); }
-void SoftCPU::PUSH_FS(const X86::Instruction&) { TODO_INSN(); }
-void SoftCPU::PUSH_GS(const X86::Instruction&) { TODO_INSN(); }
+void SoftCPU::PUSH_CS(X86::Instruction const&)
+{
+ push16(shadow_wrap_as_initialized(cs()));
+}
+
+void SoftCPU::PUSH_DS(X86::Instruction const&)
+{
+ push16(shadow_wrap_as_initialized(ds()));
+}
+
+void SoftCPU::PUSH_ES(X86::Instruction const&)
+{
+ push16(shadow_wrap_as_initialized(es()));
+}
+
+void SoftCPU::PUSH_FS(X86::Instruction const&)
+{
+ push16(shadow_wrap_as_initialized(fs()));
+}
+
+void SoftCPU::PUSH_GS(X86::Instruction const&)
+{
+ push16(shadow_wrap_as_initialized(gs()));
+}
void SoftCPU::PUSH_RM16(const X86::Instruction& insn)
{
@@ -2426,7 +2445,11 @@ void SoftCPU::PUSH_RM32(const X86::Instruction& insn)
}
void SoftCPU::PUSH_SP_8086_80186(const X86::Instruction&) { TODO_INSN(); }
-void SoftCPU::PUSH_SS(const X86::Instruction&) { TODO_INSN(); }
+
+void SoftCPU::PUSH_SS(X86::Instruction const&)
+{
+ push16(shadow_wrap_as_initialized(ss()));
+}
void SoftCPU::PUSH_imm16(const X86::Instruction& insn)
{