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];
|
|
|
|
static uint32_t OPSize[256];
|
|
|
|
|
|
|
|
private:
|
2016-11-22 03:34:47 +00:00
|
|
|
string _byteCode;
|
2015-06-24 23:26:19 +00:00
|
|
|
uint8_t *_opPointer = nullptr;
|
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;
|
|
|
|
|
2016-11-22 03:34:47 +00:00
|
|
|
uint16_t _opAddr;
|
2015-06-24 23:26:19 +00:00
|
|
|
|
|
|
|
public:
|
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
|
|
|
|
|
|
|
int32_t GetEffectiveAddress(State& cpuState, shared_ptr<MemoryManager> memoryManager);
|
2016-11-23 03:38:14 +00:00
|
|
|
string GetEffectiveAddressString(State& cpuState, shared_ptr<MemoryManager> memoryManager, shared_ptr<LabelManager> labelManager);
|
2016-11-22 03:34:47 +00:00
|
|
|
|
2016-11-23 03:38:14 +00:00
|
|
|
string ToString(uint32_t memoryAddr, shared_ptr<MemoryManager> memoryManager, shared_ptr<LabelManager> labelManager);
|
2016-11-22 03:34:47 +00:00
|
|
|
string GetByteCode();
|
2015-06-24 23:26:19 +00:00
|
|
|
uint32_t GetSize();
|
2016-11-22 03:34:47 +00:00
|
|
|
|
|
|
|
bool IsSubEntryPoint();
|
|
|
|
bool IsSubExitPoint();
|
2015-06-24 23:26:19 +00:00
|
|
|
};
|
|
|
|
|