📄 instrumenttype.h
字号:
#pragma once
#include <map>
#include <set>
#include <string>
#include "InstrumentInformation.h"
#include "RegisterType.h"
#include "ALUOp.h"
#include "GeneralRegister.h"
#include "CPUData.h"
#include <vector>
using namespace std;
class InstrumentType
{
int d, s, t, i, h;
static map<string, InstrumentInformation>& infoTable;
InstrumentInformation infoCurrentSentence;
vector<string> AsmCode;
string BinaryCode;
RegisterType CodeRegister;
set<string> lableInstrument;
set<string> zeroExtendInstrument;
static int extend(int immValue, int length, string& name);
static int RegisterToInt(string name, char com );
static string IntToString(int num);
static string IntToName(int id, char com );
static int StringToInt(string& str);
void TranslateCodeToBinary();
void TranslateBinaryToCode();
bool equal(string a, string b);
public:
InstrumentType(void);
static map<string, InstrumentInformation>& InitInfoTable(string ininame = "Instrument.ini");
static int ArgumentNumOfInstrument(string name);
void SetAsmCode(vector<string>& asmCode);
void SetBinaryCode(string& binaryCode);
void SetCodeRegister(RegisterType &Code);
string TranslateAsmToBinary();
string TranslateBinaryToAsm();
void Run(CPUData& Data);
string GetAsmCode();
string GetBinaryCode();
RegisterType GetCodeRegister();
friend class CPU;
friend class AsmManager;
friend class Manager;
friend class BinaryManager;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -