public BlackboxIf(int cycleNumber, int programCounter) { super(cycleNumber, null); this.exMem = null; Data.setProgramCounter(programCounter); // this.programCounter = programCounter; this.nextProgramCounter = 0; }
public BlackboxIf(int cycleNumber, OpcodeHexBin instruction, int programCounter) { super(cycleNumber, instruction); this.exMem = null; Data.setProgramCounter(programCounter); // this.programCounter = programCounter; this.nextProgramCounter = 0; }
@Override public void run() { // IF/ID.IR <- MEM[PC] this.setInstruction(Data.getInstance().getMemoryCodeSegment(Data.getProgramCounter())); // IF/ID.NPC, PC <- if ((EX/MEM.opcode == branch) && EX/MEM.cond) // { EX/MEM.ALUoutput } // else { PC + 4 } if (exMem != null && "BEQ" .contains(exMem.getInstruction().getInstruction().getInstruction().split(" ")[0].trim()) && exMem.isCondition()) { this.nextProgramCounter = exMem.getArithmeticLogicUnit().intValue(); Data.setProgramCounter(exMem.getArithmeticLogicUnit().intValue()); } else { this.nextProgramCounter = Data.getProgramCounter() + 1; Data.setProgramCounter(this.nextProgramCounter); } }
public void setProgramCounter(int programCounter) { Data.setProgramCounter(programCounter); }
public BlackboxIf() { super(); this.exMem = null; Data.setProgramCounter(0); this.nextProgramCounter = 0; }