2015-06-24 19:26:19 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2016-11-21 22:34:47 -05:00
|
|
|
#include <unordered_map>
|
2015-08-28 21:01:18 -04:00
|
|
|
#include "CPU.h"
|
2015-06-24 19:26:19 -04:00
|
|
|
|
2016-11-22 22:38:14 -05:00
|
|
|
class LabelManager;
|
|
|
|
|
2015-06-24 19:26:19 -04:00
|
|
|
class DisassemblyInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static string OPName[256];
|
|
|
|
static AddrMode OPMode[256];
|
2017-03-04 16:18:28 -05:00
|
|
|
static uint8_t OPSize[256];
|
|
|
|
static bool IsUnofficialCode[256];
|
2015-06-24 19:26:19 -04:00
|
|
|
|
|
|
|
private:
|
2017-03-11 21:03:45 -05:00
|
|
|
uint8_t _byteCode[3];
|
2016-02-13 22:19:42 -05:00
|
|
|
bool _isSubEntryPoint = false;
|
2016-11-21 22:34:47 -05:00
|
|
|
bool _isSubExitPoint = false;
|
2015-06-24 19:26:19 -04:00
|
|
|
uint32_t _opSize = 0;
|
|
|
|
AddrMode _opMode;
|
2017-03-09 23:50:20 -05:00
|
|
|
|
2015-06-24 19:26:19 -04:00
|
|
|
public:
|
2017-08-05 17:18:09 -04:00
|
|
|
DisassemblyInfo();
|
2016-02-13 22:19:42 -05:00
|
|
|
DisassemblyInfo(uint8_t* opPointer, bool isSubEntryPoint);
|
2015-06-24 19:26:19 -04:00
|
|
|
|
2016-02-13 22:19:42 -05:00
|
|
|
void SetSubEntryPoint();
|
2016-11-21 22:34:47 -05:00
|
|
|
|
2017-03-04 15:18:00 -05:00
|
|
|
int32_t GetEffectiveAddress(State& cpuState, MemoryManager* memoryManager);
|
|
|
|
|
2017-03-09 23:50:20 -05:00
|
|
|
void GetEffectiveAddressString(string &out, State& cpuState, MemoryManager* memoryManager, LabelManager* labelManager);
|
2018-02-14 21:46:24 -05:00
|
|
|
int32_t GetMemoryValue(State& cpuState, MemoryManager* memoryManager);
|
2017-03-09 23:50:20 -05:00
|
|
|
void ToString(string &out, uint32_t memoryAddr, MemoryManager* memoryManager, LabelManager* labelManager);
|
|
|
|
void GetByteCode(string &out);
|
2015-06-24 19:26:19 -04:00
|
|
|
uint32_t GetSize();
|
2016-11-27 19:43:17 -05:00
|
|
|
uint16_t GetOpAddr(uint16_t memoryAddr);
|
2016-11-21 22:34:47 -05:00
|
|
|
|
|
|
|
bool IsSubEntryPoint();
|
|
|
|
bool IsSubExitPoint();
|
2015-06-24 19:26:19 -04:00
|
|
|
};
|
|
|
|
|