Class BaseStatement

java.lang.Object
edu.iu.jrsalata.Statement
edu.iu.jrsalata.BaseStatement
Direct Known Subclasses:
ExtendedStatement, RegisterStatement, SicStatement, SingleStatement

public abstract class BaseStatement extends Statement
The BaseStatement class is an abstract class that extends the Statement class. It represents an assembled statement with an opcode, location, and format. This class provides constructors to initialize the opcode, location, and format, as well as getter and setter methods for the location.
  • Field Details

    • opcode

      protected HexNum opcode
      stores the operation code of this statement
    • location

      protected HexNum location
      stores the location of this statement
    • format

      protected int format
      stores the format (1,2,3,4) that this statement represents
  • Constructor Details

    • BaseStatement

      protected BaseStatement()
      Constructs a new BaseStatement object with default values. Initializes the location and opcode as new HexNum objects, sets the format to 1, and initializes the size as a new HexNum object with the format value.
    • BaseStatement

      protected BaseStatement(HexNum location, HexNum opcode)
      Constructs a BaseStatement with the specified location and opcode.
      Parameters:
      location - the memory location of the statement
      opcode - the operation code of the statement
  • Method Details

    • getLocation

      public HexNum getLocation()
      Retrieves the location of this statement.
      Returns:
      the location as a HexNum object.
    • setLocation

      public void setLocation(HexNum location)
      Sets the location of this BaseStatement.
      Parameters:
      location - the HexNum representing the new location