-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathutility_flag_set.hpp
32 lines (22 loc) · 1.08 KB
/
utility_flag_set.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef UTILITY_FLAG_SET_H
#define UTILITY_FLAG_SET_H
#include <string>
#include <stdlib.h>
#include <iomanip>
#include "register.hpp"
using std::string;
// Set OF, SF, ZF,and PF
void setFlags(uint32_t operand1, uint32_t operand2, uint32_t result, int msb, RegisterBank *rb);
// Set CF, OF, SF, ZF, AF, and PF in Addition
void setFlagsAdd(uint32_t operand1, uint32_t operand2, uint32_t result, int msb, RegisterBank *rb);
// Set CF, OF, SF, ZF, AF, and PF in Substraction
void setFlagsSub(uint32_t operand1, uint32_t operand2, uint32_t result, int msb, RegisterBank *rb);
// OF, CF, SF, ZF, PF in Logical AND
void setFlagsAnd(uint32_t operand1, uint32_t operand2, uint32_t result, int msb, RegisterBank *rb);
// Set CF, OF, SF, ZF, and PF in Logical OR
void setFlagsOr(uint32_t operand1, uint32_t operand2, uint32_t result, int msb, RegisterBank *rb);
// OF, SF, ZF, AF, and PF in Dec
void setFlagsDec(uint32_t operand1, uint32_t result, int msb, RegisterBank *rb);
// Set AF, OF, SF, ZF, and PF in Inc
void setFlagsInc(uint32_t operand1, uint32_t result, int msb, RegisterBank *rb);
#endif