1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

UserspaceEmulator: Implement STOSB/STOSW/STOSD

...and add a template to handle REP* instruction prefixes. This can be
further generalized, but let's go one step at a time.
This commit is contained in:
Andreas Kling 2020-07-11 22:12:37 +02:00
parent 6688ce41b2
commit 0af485dfff
2 changed files with 83 additions and 3 deletions

View file

@ -190,6 +190,7 @@ public:
bool af() const { return m_eflags & Flags::AF; }
bool pf() const { return m_eflags & Flags::PF; }
bool cf() const { return m_eflags & Flags::CF; }
bool df() const { return m_eflags & Flags::DF; }
void set_flag(Flags::Flag flag, bool value)
{
@ -205,6 +206,7 @@ public:
void set_af(bool value) { set_flag(Flags::AF, value); }
void set_pf(bool value) { set_flag(Flags::PF, value); }
void set_cf(bool value) { set_flag(Flags::CF, value); }
void set_df(bool value) { set_flag(Flags::DF, value); }
void set_flags_oszapc(u32 new_flags)
{
@ -785,6 +787,9 @@ private:
template<bool update_dest, typename Op>
void generic_reg8_RM8(Op, const X86::Instruction&);
template<bool check_zf, typename Callback>
void do_once_or_repeat(const X86::Instruction& insn, Callback);
private:
Emulator& m_emulator;