Package jminusminus

Class NLIRLoad


class NLIRLoad extends NLIRInstruction
LIR instruction representing a load from memory to register.
  • Constructor Details

    • NLIRLoad

      public NLIRLoad(NBasicBlock block, int id, int offset, OffsetFrom offsetFrom, NRegister register)
      Constructs an NLIRLoad object.
      Parameters:
      block - enclosing block.
      id - identifier of the instruction.
      offset - stack offset to load from.
      offsetFrom - whether offset relative to stack pointer (sp) or frame pointer (fp).
      register - register to load to.
  • Method Details

    • toSpim

      public void toSpim(PrintWriter out)
      Translates this LIR instruction into SPIM and writes it out to the specified output stream.
      Overrides:
      toSpim in class NLIRInstruction
      Parameters:
      out - output stream for SPIM code.
    • toString

      public String toString()
      Returns a string representation of this instruction.
      Overrides:
      toString in class NLIRInstruction
      Returns:
      a string representation of this instruction.