Add set_flag(int flag, uint32_t flag_type) func and a minor upate

This commit is contained in:
tuz358
2018-03-05 11:25:03 +09:00
parent 47352b68f2
commit ca332915c8
2 changed files with 11 additions and 0 deletions

View File

@@ -5,9 +5,12 @@
#include "memory.h"
#include "utils.h"
const uint32_t ZF = 1 << 6;
class Instructions{
private:
void init_instructions();
void set_flag(int flag, uint32_t flag_type);
public:
Memory memory;
uint32_t registers[8]; // eax, ecx, edx, ebx, esp, ebp, esi, edi

View File

@@ -251,3 +251,11 @@ void Instructions::opcode_ff(){
break;
}
}
void Instructions::set_flag(int flag, uint32_t flag_type){
if (flag) {
this->eflags &= ~flag_type;
} else {
this->eflags |= flag_type;
}
}