summaryrefslogtreecommitdiffstats
path: root/ue3/mycpu/cinstruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ue3/mycpu/cinstruction.cpp')
-rw-r--r--ue3/mycpu/cinstruction.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/ue3/mycpu/cinstruction.cpp b/ue3/mycpu/cinstruction.cpp
index 3cbb033..12c5c74 100644
--- a/ue3/mycpu/cinstruction.cpp
+++ b/ue3/mycpu/cinstruction.cpp
@@ -49,15 +49,15 @@ void CDiv::exec(CMem& mem, vector<string>& instr)
49 49
50void CLoad::exec(CMem& mem, vector<string>& instr) 50void CLoad::exec(CMem& mem, vector<string>& instr)
51{ 51{
52 istringstream stmp ("22"); 52 istringstream stmp (mem.getMemAt(instr[2]));
53 stmp >> mem.getRegister(instr[1]); 53 stmp >> mem.getRegister(instr[1]);
54 cout <<mem.getRegister(instr[1])<<" "<< mem.getMem(instr[2])<<endl; 54
55} 55}
56 56
57 57
58void CStore::exec(CMem& mem, vector<string>& instr) 58void CStore::exec(CMem& mem, vector<string>& instr)
59{ 59{
60 mem.setMem(instr[2], mem.getRegister(instr[1])); 60 mem.setMemAt(instr[2], mem.getRegister(instr[1]));
61} 61}
62 62
63 63