AddressingMode
class AddressingMode
Represents an addressing mode, which defines how an instruction's operands are specified and encoded.
class Argument
Represents an argument for the instruction, which can have a specific type and an optional default value.
constructor Argument
Default constructor for Argument.
| Argument | ( | ); |
constructor Argument
Initialize an argument with a specific type and an optional default value.
| Argument | ( | const ArgumentType * type, | |
| std::optional< Value > default_value = {} | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the argument. |
default_value |
The optional default value of the argument. |
member default_value
The optional default value of the argument.
member type
The type of the argument.
class Notation
Represents a notation for an instruction, which defines the syntax of the instruction.
It includes a sequence of punctuation, reserved words, and arguments.
class Element
Represents an element in the notation, which can be punctuation, reserved word, or argument.
constructor Element
Initialize an element in the notation with a specific type and symbol.
| Element | ( | Type type, | |
| Symbol symbol | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the element. |
symbol |
The symbol corresponding to the element, or the name of the argument. |
method is_argumentconst
Check if the element is an argument.
| bool is_argument | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member symbol
The symbol corresponding to the element, or the name of the argument.
member type
The type of the element.
enum Type
The type of an element in the notation.
| VALUE | DESCRIPTION |
|---|---|
ARGUMENT |
The element is an argument, corresponding to an operand of the instruction. |
PUNCTUATION |
The element is punctuation. |
RESERVED_WORD |
The element is a reserved word. |
method compute_argument_names
Compute the names of the arguments in the notation.
This method populates the argument_names vector based on the elements in the notation.
| void compute_argument_names | ( | ); |
member argument_names
The names of the arguments in the notation, in order.
member elements
The elements that make up the notation.
method add_notation
Add a notation to the addressing mode.
| void add_notation | ( | Notation notation | ); |
| PARAMETER | DESCRIPTION |
|---|---|
notation |
The notation to add. |
method argumentconst
Get the argument with the specified name.
| const Argument * argument | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the argument. |
| RETURNS | DESCRIPTION |
|---|---|
const Argument * |
A pointer to the argument if it exists, nullptr otherwise. |
method has_argumentconst
Check if the instruction has an argument with the specified name.
| bool has_argument | ( | Symbol name | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
name |
The name of the argument. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
method operator<const
Compare two addressing modes based on their priority.
| bool operator< | ( | const AddressingMode & other | ) const; |
| PARAMETER | DESCRIPTION |
|---|---|
other |
The other addressing mode to compare with. |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member arguments
The arguments of the addressing mode.
member encoding
The encoding of the addressing mode.
member notations
The notations that define the syntax of instructions with this addressing mode.
member priority
The priority of the addressing mode, which determines the order in which addressing modes are considered.
member uses_pc
Indicates whether the addressing mode uses the program counter (PC) in its encoding.
class Argument
Represents an argument for the instruction, which can have a specific type and an optional default value.
constructor Argument
Default constructor for Argument.
| Argument | ( | ); |
constructor Argument
Initialize an argument with a specific type and an optional default value.
| Argument | ( | const ArgumentType * type, | |
| std::optional< Value > default_value = {} | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the argument. |
default_value |
The optional default value of the argument. |
member default_value
The optional default value of the argument.
member type
The type of the argument.
class Notation
Represents a notation for an instruction, which defines the syntax of the instruction.
It includes a sequence of punctuation, reserved words, and arguments.
class Element
Represents an element in the notation, which can be punctuation, reserved word, or argument.
constructor Element
Initialize an element in the notation with a specific type and symbol.
| Element | ( | Type type, | |
| Symbol symbol | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the element. |
symbol |
The symbol corresponding to the element, or the name of the argument. |
method is_argumentconst
Check if the element is an argument.
| bool is_argument | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member symbol
The symbol corresponding to the element, or the name of the argument.
member type
The type of the element.
enum Type
The type of an element in the notation.
| VALUE | DESCRIPTION |
|---|---|
ARGUMENT |
The element is an argument, corresponding to an operand of the instruction. |
PUNCTUATION |
The element is punctuation. |
RESERVED_WORD |
The element is a reserved word. |
method compute_argument_names
Compute the names of the arguments in the notation.
This method populates the argument_names vector based on the elements in the notation.
| void compute_argument_names | ( | ); |
member argument_names
The names of the arguments in the notation, in order.
member elements
The elements that make up the notation.
class Element
Represents an element in the notation, which can be punctuation, reserved word, or argument.
constructor Element
Initialize an element in the notation with a specific type and symbol.
| Element | ( | Type type, | |
| Symbol symbol | ); |
| PARAMETER | DESCRIPTION |
|---|---|
type |
The type of the element. |
symbol |
The symbol corresponding to the element, or the name of the argument. |
method is_argumentconst
Check if the element is an argument.
| bool is_argument | ( | ) const; |
| RETURNS | DESCRIPTION |
|---|---|
bool |
|
member symbol
The symbol corresponding to the element, or the name of the argument.
member type
The type of the element.