Ejemplo n.º 1
0
  public void MEM()
      throws IrregularStringOfBitsException, NotAlignException, MemoryElementNotFoundException,
          AddressErrorException, IrregularWriteOperationException {
    super.MEM(); // unlock the fp register in order to avoid WAW hazards
    // restoring the address from the temporary register
    long address = TR[OFFSET_PLUS_BASE].getValue();
    // For the trace file
    Dinero din = Dinero.getInstance();
    din.Load(Converter.binToHex(Converter.positiveIntToBin(64, address)), 4);
    MemoryElement memEl = memory.getCellByAddress(address);
    // reading from the memory element and saving values on LMD register
    TR[LMD_REGISTER].writeWord(memEl.readWord((int) (address % 8)));

    if (enableForwarding) {
      doWB();
    }
  }