2016-11-22 22:38:14 -05:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include <unordered_map>
|
|
|
|
using std::unordered_map;
|
|
|
|
|
|
|
|
class BaseMapper;
|
|
|
|
enum class AddressType;
|
|
|
|
|
|
|
|
class LabelManager
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
unordered_map<uint32_t, string> _codeLabels;
|
|
|
|
unordered_map<string, uint32_t> _codeLabelReverseLookup;
|
|
|
|
unordered_map<uint32_t, string> _codeComments;
|
|
|
|
|
|
|
|
shared_ptr<BaseMapper> _mapper;
|
|
|
|
|
2016-11-23 18:48:29 -05:00
|
|
|
int32_t GetLabelAddress(uint16_t relativeAddr, bool checkRegisters);
|
2016-11-22 22:38:14 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
LabelManager(shared_ptr<BaseMapper> mapper);
|
|
|
|
|
|
|
|
void SetLabel(uint32_t address, AddressType addressType, string label, string comment);
|
|
|
|
|
|
|
|
int32_t GetLabelRelativeAddress(string label);
|
|
|
|
|
2016-11-23 18:48:29 -05:00
|
|
|
string GetLabel(uint16_t relativeAddr, bool checkRegisters);
|
2016-11-22 22:38:14 -05:00
|
|
|
string GetComment(uint16_t relativeAddr);
|
|
|
|
};
|