XiPU uROM Generator
|
This class contains atomic steps for the control unit of defined instruction. More...
#include <instruction.h>
Public Types | |
enum class | Arg { None , ABXY , AB , Val256 , Addr } |
Definitions of the instruction argument types. More... | |
enum class | Flag { Disable , Enable , Any } |
Tristate flag definition for carry and zero control bits. More... | |
Public Member Functions | |
Instruction () | |
Default constructor for creating an empty instruction. More... | |
Instruction (unsigned char opcode, Arg arg0=Arg::None, Arg arg1=Arg::None, Arg arg2=Arg::None, Flag c=Flag::Any, Flag z=Flag::Any) | |
void | addStep (const Step &step) |
unsigned char | getOpcode () const |
Arg | getArg0 () const |
Arg | getArg1 () const |
Arg | getArg2 () const |
Flag | getC () const |
Flag | getZ () const |
const QList< Step > & | getStepList () const |
Private Attributes | |
unsigned char | opcode |
Opcode of defined instruction. More... | |
Arg | arg0 |
First argument type. More... | |
Arg | arg1 |
Second argument type. More... | |
Arg | arg2 |
Third argument type. More... | |
Flag | c |
Carry flag accept status. More... | |
Flag | z |
Zero flag accept status. More... | |
QList< Step > | stepList |
Atomic list of steps for the control unit. More... | |
This class contains atomic steps for the control unit of defined instruction.
Definition at line 20 of file instruction.h.
|
strong |
Definitions of the instruction argument types.
Enumerator | |
---|---|
None | No argument. |
ABXY | Main and auxiliary registers. |
AB | Only main registers. |
Val256 | 8 bit unsigned value |
Addr | 16 bit unsigned address |
Definition at line 24 of file instruction.h.
|
strong |
Tristate flag definition for carry and zero control bits.
Enumerator | |
---|---|
Disable | Only accept the disable value. |
Enable | Only accept the enable value. |
Any | Accept both values. |
Definition at line 34 of file instruction.h.
Instruction::Instruction | ( | ) |
Default constructor for creating an empty instruction.
Definition at line 15 of file instruction.cpp.
Instruction::Instruction | ( | unsigned char | opcode, |
Arg | arg0 = Arg::None , |
||
Arg | arg1 = Arg::None , |
||
Arg | arg2 = Arg::None , |
||
Flag | c = Flag::Any , |
||
Flag | z = Flag::Any |
||
) |
Constructor using for create an instruction with a defined opcode
opcode | Opcode number |
arg0 | First argument type |
arg1 | Second argument type |
arg2 | Third argument type |
c | Which status of the carry flag is accepted |
z | Which status of the zero flag is accepted |
Definition at line 37 of file instruction.cpp.
void Instruction::addStep | ( | const Step & | step | ) |
Add step to the step list of the instruction
step | Single step of the instruction |
Definition at line 54 of file instruction.cpp.
References stepList.
Referenced by URom::URom().
Instruction::Arg Instruction::getArg0 | ( | ) | const |
Get a first argument type of the instruction
Definition at line 74 of file instruction.cpp.
References arg0.
Referenced by URomData::addInstruction().
Instruction::Arg Instruction::getArg1 | ( | ) | const |
Get a second argument type of the instruction
Definition at line 84 of file instruction.cpp.
References arg1.
Referenced by URomData::addInstruction().
Instruction::Arg Instruction::getArg2 | ( | ) | const |
Get a third argument type of the instruction
Definition at line 94 of file instruction.cpp.
References arg2.
Instruction::Flag Instruction::getC | ( | ) | const |
Get a status of accepting the carry flag
Definition at line 104 of file instruction.cpp.
References c.
Referenced by URomData::addInstruction().
unsigned char Instruction::getOpcode | ( | ) | const |
Get an opcode number of the instruction
Definition at line 64 of file instruction.cpp.
References opcode.
Referenced by URomData::addInstruction().
const QList< Step > & Instruction::getStepList | ( | ) | const |
Get a step list of the instruction
Definition at line 124 of file instruction.cpp.
References stepList.
Referenced by URomData::addInstruction().
Instruction::Flag Instruction::getZ | ( | ) | const |
Get a status of accepting the zero flag
Definition at line 114 of file instruction.cpp.
References z.
Referenced by URomData::addInstruction().
|
private |
First argument type.
Definition at line 60 of file instruction.h.
Referenced by getArg0(), and Instruction().
|
private |
Second argument type.
Definition at line 61 of file instruction.h.
Referenced by getArg1(), and Instruction().
|
private |
Third argument type.
Definition at line 62 of file instruction.h.
Referenced by getArg2(), and Instruction().
|
private |
Carry flag accept status.
Definition at line 64 of file instruction.h.
Referenced by getC(), and Instruction().
|
private |
Opcode of defined instruction.
Definition at line 58 of file instruction.h.
Referenced by getOpcode(), and Instruction().
|
private |
Atomic list of steps for the control unit.
Definition at line 67 of file instruction.h.
Referenced by addStep(), and getStepList().
|
private |
Zero flag accept status.
Definition at line 65 of file instruction.h.
Referenced by getZ(), and Instruction().