-
Notifications
You must be signed in to change notification settings - Fork 1
/
modmr.hpp
52 lines (41 loc) · 1.11 KB
/
modmr.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef MODRM_H
#define MODRM_H
#include <string>
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include "reader.hpp"
#include "memory.hpp"
#include "register.hpp"
#include "sib.hpp"
using std::string;
using std::cout;
using std::endl;
enum OperandRegisterType
{
REGISTER_32,
REGISTER_16,
REGISTER_8,
REGISTER_MM,
REGISTER_XMM
};
struct ModMrDecodeInputArguments{
bool is_first_operand_reg;
bool is_second_operand_reg;
bool has_second_operand;
enum OperandRegisterType rm_operand_register_type;
enum OperandRegisterType reg_operand_register_type;
};
struct ModMrDecodeOutputArguments{
bool is_first_operand_register;
bool is_second_operand_register;
uint32_t first_operand_effective_addr;
uint32_t second_operand_effective_addr;
string first_operand_register;
string second_operand_register;
string decoded_print_string_op1;
string decoded_print_string_op2;
};
ModMrDecodeOutputArguments* decodeModeMrByte(ModMrDecodeInputArguments* inputs, Reader *reader, RegisterBank *rb, Memory *memory);
void printModRm(ModMrDecodeOutputArguments* outputs);
#endif