void Operation(string inst , Databus & DB,ProgramCounter & PC,Stack & St,Accumulator & AC,OperandRegister & Op, ALU & ALU1) { string oper=""; if (inst[ERG]=='1') { if (inst[MRG] == '0') { oper = snoop; } else { oper = inst.substr(SRG,4); } if (oper == "1100") { PC.Epc(DB); } else if (oper == "1101") { St.Esp(DB); } else if (oper == "1110") { AC.Ear(DB); } else if (oper == "1111") { Op.Eor(DB); } else strcpy(DB.DATA,value_of_register[oper].c_str()); } if (inst[LRG] == '1') { if (inst[MRG]=='0') { oper=snoop; } else { oper = inst.substr(SRG,4); } if (oper == "1100") { PC.Lpc(DB); } else if (oper == "1101") { St.Lsp(DB); } else if (oper == "1110") { AC.Lar(ALU1); } else if (oper == "1111") { Op.Lor(DB); } else { value_of_register[oper]=DB.DATA; } } return ; }