summaryrefslogtreecommitdiff
path: root/DevTools
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-07 21:34:58 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-07 22:44:58 +0200
commit934f0b999e257d34849c7dfd5a0417eec01630b3 (patch)
treeec43203c6c461be682cd38b4980e7b545cfe7acb /DevTools
parentd0dbf92c8d23abec5a42ca505a40c0055db532ea (diff)
downloadserenity-934f0b999e257d34849c7dfd5a0417eec01630b3.zip
UserspaceEmulator: Add arithmetic CPU flags
Diffstat (limited to 'DevTools')
-rw-r--r--DevTools/UserspaceEmulator/SoftCPU.cpp5
-rw-r--r--DevTools/UserspaceEmulator/SoftCPU.h21
2 files changed, 24 insertions, 2 deletions
diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp
index 717ab37430..a404d8d141 100644
--- a/DevTools/UserspaceEmulator/SoftCPU.cpp
+++ b/DevTools/UserspaceEmulator/SoftCPU.cpp
@@ -46,8 +46,9 @@ SoftCPU::SoftCPU(Emulator& emulator)
void SoftCPU::dump() const
{
- printf("eax: %08x ebx: %08x ecx: %08x edx: %08x\n", m_eax, m_ebx, m_ecx, m_edx);
- printf("ebp: %08x esp: %08x esi: %08x edi: %08x\n", m_ebp, m_esp, m_esi, m_edi);
+ printf("eax=%08x ebx=%08x ecx=%08x edx=%08x ", m_eax, m_ebx, m_ecx, m_edx);
+ printf("ebp=%08x esp=%08x esi=%08x edi=%08x ", m_ebp, m_esp, m_esi, m_edi);
+ printf("o=%u s=%u z=%u a=%u p=%u c=%u\n", m_of, m_sf, m_zf, m_af, m_pf, m_cf);
}
void SoftCPU::AAA(const X86::Instruction&) { TODO(); }
diff --git a/DevTools/UserspaceEmulator/SoftCPU.h b/DevTools/UserspaceEmulator/SoftCPU.h
index 23c00f51f2..30174bd3de 100644
--- a/DevTools/UserspaceEmulator/SoftCPU.h
+++ b/DevTools/UserspaceEmulator/SoftCPU.h
@@ -510,6 +510,20 @@ public:
private:
Emulator& m_emulator;
+ bool get_of() const { return m_of; }
+ bool get_sf() const { return m_sf; }
+ bool get_zf() const { return m_zf; }
+ bool get_af() const { return m_af; }
+ bool get_pf() const { return m_pf; }
+ bool get_cf() const { return m_cf; }
+
+ void set_of(bool value) { m_of = value; }
+ void set_sf(bool value) { m_sf = value; }
+ void set_zf(bool value) { m_zf = value; }
+ void set_af(bool value) { m_af = value; }
+ void set_pf(bool value) { m_pf = value; }
+ void set_cf(bool value) { m_cf = value; }
+
u32* m_reg32_table[8];
u32 m_eax { 0 };
@@ -520,6 +534,13 @@ private:
u32 m_ebp { 0 };
u32 m_esi { 0 };
u32 m_edi { 0 };
+
+ bool m_of { false };
+ bool m_sf { false };
+ bool m_zf { false };
+ bool m_af { false };
+ bool m_pf { false };
+ bool m_cf { false };
};
}