#include <instruction.h>
Public Types | |
| enum | Type { TMR0, OPTION_REG, PCL, STATUS, FSR, PORTA, TRISA, PORTB, TRISB, EEDATA, EECON1, EEADR, EECON2, PCLATH, INTCON, WORKING, GPR, none } |
| enum | Banks { Bank0 = 1 << 0, Bank1 = 1 << 1 } |
Public Member Functions | |
| Register (Type type=none) | |
| Register (const QString &name) | |
| Register (const char *name) | |
| bool | operator< (const Register ®) const |
| bool | operator== (const Register ®) const |
| uchar | banks () const |
| bool | bankDependent () const |
| QString | name () const |
| Type | type () const |
| bool | affectsExternal () const |
Protected Attributes | |
| QString | m_name |
| Type | m_type |
Definition at line 45 of file instruction.h.
| Register::Register | ( | Type | type = none |
) |
Creates a register of the given type, giving it the appropriate name. Note that this constructor should not be used for GPR.
Definition at line 34 of file instruction.cpp.
References m_name, and m_type.
Referenced by Register().
| Register::Register | ( | const QString & | name | ) |
Construct a Register with the given name. If the name is not recognized, then it is assumed to be a GPR register.
Definition at line 95 of file instruction.cpp.
| Register::Register | ( | const char * | name | ) |
Construct a Register with the given name. If the name is not recognized, then it is assumed to be a GPR register.
Definition at line 135 of file instruction.cpp.
References Register().
| bool Register::operator< | ( | const Register & | reg | ) | const |
Definition at line 141 of file instruction.cpp.
| bool Register::operator== | ( | const Register & | reg | ) | const |
Definition at line 150 of file instruction.cpp.
| uchar Register::banks | ( | ) | const |
Definition at line 159 of file instruction.cpp.
References m_type.
Referenced by bankDependent().
| bool Register::bankDependent | ( | ) | const |
Convenience function.
Definition at line 188 of file instruction.cpp.
References banks().
Referenced by Instr_bsf::behaviour(), Instr_bcf::behaviour(), Instr_xorwf::behaviour(), Instr_swapf::behaviour(), Instr_subwf::behaviour(), Instr_rrf::behaviour(), Instr_rlf::behaviour(), Instr_movwf::behaviour(), Instr_movf::behaviour(), Instr_iorwf::behaviour(), Instr_incf::behaviour(), Instr_decfsz::behaviour(), Instr_decf::behaviour(), Instr_clrf::behaviour(), and Instr_addwf::behaviour().
| QString Register::name | ( | ) | const [inline] |
Returns the name of the register, or the alias for the GPR.
Definition at line 117 of file instruction.h.
References m_name.
Referenced by Instr_btfss::code(), Instr_btfsc::code(), Instr_bsf::code(), Instr_bcf::code(), Instr_xorwf::code(), Instr_swapf::code(), Instr_subwf::code(), Instr_rrf::code(), Instr_rlf::code(), Instr_movwf::code(), Instr_movf::code(), Instr_iorwf::code(), Instr_incf::code(), Instr_decfsz::code(), Instr_decf::code(), Instr_clrf::code(), Instr_andwf::code(), Instr_addwf::code(), operator<(), and operator==().
| Type Register::type | ( | ) | const [inline] |
Definition at line 121 of file instruction.h.
References m_type.
Referenced by Instr_btfss::behaviour(), Instr_btfsc::behaviour(), Instr_addwf::generateLinksAndStates(), operator<(), and operator==().
| bool Register::affectsExternal | ( | ) | const |
From the Optimizer's perspective, it is OK to remove, change or add any instruction so long as there are no visible external changes that go against the original intention of the microbe source (a general guiding principle). Therefore, this function returns true for PORT and TRIS registers, false for everything else.
Definition at line 194 of file instruction.cpp.
References m_type.
Referenced by Optimizer::optimizeInstructions().
1.5.1