Add Executor
This commit is contained in:
parent
fb99662ae8
commit
ba43d2ade6
2 changed files with 36 additions and 0 deletions
16
RamExecutor.cpp
Normal file
16
RamExecutor.cpp
Normal file
|
@ -0,0 +1,16 @@
|
|||
#include "RamExecutor.h"
|
||||
|
||||
RamExecutor::RamExecutor(RamInstruction code) {
|
||||
|
||||
this->pc = 0;
|
||||
this->sourcecode = code;
|
||||
|
||||
}
|
||||
|
||||
int RamExecutor::getPC() {
|
||||
return this->pc;
|
||||
}
|
||||
|
||||
void RamExecutor::setPC(int newPC) {
|
||||
this->pc = newPC;
|
||||
}
|
20
RamExecutor.h
Normal file
20
RamExecutor.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef RAMEXECUTOR_H
|
||||
#define RAMEXECUTOR_H
|
||||
#include "RamInstruction.h"
|
||||
#include <map>
|
||||
|
||||
class RamExecutor {
|
||||
|
||||
private:
|
||||
RamInstruction sourcecode;
|
||||
std::map<int, int> registers;
|
||||
int pc;
|
||||
|
||||
public:
|
||||
RamExecutor(RamInstruction code);
|
||||
int getPC();
|
||||
void setPC(int newPC);
|
||||
|
||||
};
|
||||
|
||||
#endif // RAMEXECUTOR_H
|
Loading…
Reference in a new issue