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