Package edu.iu.jrsalata
Class BaseStatement
java.lang.Object
edu.iu.jrsalata.Statement
edu.iu.jrsalata.BaseStatement
- Direct Known Subclasses:
ExtendedStatement
,RegisterStatement
,SicStatement
,SingleStatement
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 Summary
Modifier and TypeFieldDescriptionprotected int
stores the format (1,2,3,4) that this statement representsprotected HexNum
stores the location of this statementprotected HexNum
stores the operation code of this statementFields inherited from class edu.iu.jrsalata.Statement
block, controlSection, line, size
-
Constructor Summary
ModifierConstructorDescriptionprotected
Constructs a new BaseStatement object with default values.protected
BaseStatement
(HexNum location, HexNum opcode) Constructs a BaseStatement with the specified location and opcode. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the location of this statement.void
setLocation
(HexNum location) Sets the location of this BaseStatement.Methods inherited from class edu.iu.jrsalata.Statement
accept, assemble, getBlock, getControlSection, getLine, getSize, setBlock, setControlSection, setLine
-
Field Details
-
opcode
stores the operation code of this statement -
location
stores the location of this statement -
format
protected int formatstores 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
Constructs a BaseStatement with the specified location and opcode.- Parameters:
location
- the memory location of the statementopcode
- the operation code of the statement
-
-
Method Details
-
getLocation
Retrieves the location of this statement.- Returns:
- the location as a HexNum object.
-
setLocation
Sets the location of this BaseStatement.- Parameters:
location
- the HexNum representing the new location
-