~registry/dolphin-emu/triforce

« back to all changes in this revision

Viewing changes to Source/Core/Common/Src/x64Analyzer.h

  • Committer: Sérgio Benjamim
  • Date: 2015-02-13 05:54:40 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20150213055440-ey2rt3sjpy27km78
Dolphin Triforce branch from code.google, commit b957980 (4.0-315).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2013 Dolphin Emulator Project
 
2
// Licensed under GPLv2
 
3
// Refer to the license.txt file included.
 
4
 
 
5
#ifndef _X64ANALYZER_H_
 
6
#define _X64ANALYZER_H_
 
7
 
 
8
#include "CommonTypes.h"
 
9
 
 
10
struct InstructionInfo
 
11
{
 
12
        int operandSize; //8, 16, 32, 64
 
13
        int instructionSize;
 
14
        int regOperandReg;
 
15
        int otherReg;
 
16
        int scaledReg;
 
17
        bool zeroExtend;
 
18
        bool signExtend;
 
19
        bool hasImmediate;
 
20
        bool isMemoryWrite;
 
21
        u64 immediate;
 
22
        s32 displacement;
 
23
};
 
24
 
 
25
struct ModRM
 
26
{
 
27
        int mod, reg, rm;
 
28
        ModRM(u8 modRM, u8 rex)
 
29
        {
 
30
                mod = modRM >> 6;
 
31
                reg = ((modRM >> 3) & 7) | ((rex & 4)?8:0);
 
32
                rm = modRM & 7;
 
33
        }
 
34
};
 
35
 
 
36
enum AccessType
 
37
{
 
38
        OP_ACCESS_READ = 0,
 
39
        OP_ACCESS_WRITE = 1
 
40
};
 
41
 
 
42
bool DisassembleMov(const unsigned char *codePtr, InstructionInfo *info);
 
43
 
 
44
#endif // _X64ANALYZER_H_