2015-06-24 19:26:19 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2016-11-21 22:34:47 -05:00
|
|
|
#include <unordered_map>
|
2020-04-19 19:36:47 -04:00
|
|
|
#include "Types.h"
|
2015-06-24 19:26:19 -04:00
|
|
|
|
2018-07-01 15:21:05 -04:00
|
|
|
class MemoryManager;
|
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:
|
2020-04-19 19:36:47 -04: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;
|
2020-04-19 19:36:47 -04:00
|
|
|
AddrMode _opMode = AddrMode::None;
|
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();
|
2019-01-02 22:40:21 -05:00
|
|
|
DisassemblyInfo(uint8_t* opPointer, bool isSubEntryPoint);
|
2015-06-24 19:26:19 -04:00
|
|
|
|
2019-01-02 22:40:21 -05:00
|
|
|
void Initialize(uint8_t * opPointer, bool isSubEntryPoint);
|
2020-04-19 19:36:47 -04:00
|
|
|
void Initialize(uint16_t addr, MemoryManager* memoryManager, bool isSubEntryPoint);
|
2018-07-25 00:41:52 -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);
|
2019-01-03 14:49:30 -05:00
|
|
|
uint16_t GetJumpDestination(uint16_t pc, MemoryManager* memoryManager);
|
2019-01-02 21:27:52 -05:00
|
|
|
uint16_t GetIndirectJumpDestination(MemoryManager* memoryManager);
|
2018-05-26 01:14:37 -04:00
|
|
|
void ToString(string &out, uint32_t memoryAddr, MemoryManager* memoryManager, LabelManager* labelManager, bool extendZeroPage);
|
2017-03-09 23:50:20 -05:00
|
|
|
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
|
|
|
};
|
|
|
|
|