|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.core.Register
The Register
class represents a register available on the AVR instruction set. All registers
in the instruction set architecture are represented as objects that have a name and a number. Those objects
are singletons and are public static final fields of this class.
Register
class contains sets of registers that are used in verifying the
operand constraints of each individual instruction as defined in the AVR instruction set reference. An
example of an operand constraint is that ldi (load immediate) takes as operands one of the general purpose
registers {r17...r31} and an immediate. Other instructions take certain subsets of the instructions. Those
register sets are allocated once here and are exposed as static fields in this class.
Operand
,
Instr
Nested Class Summary | |
static class |
Register.Set
The Set class represents a set of registers. |
Field Summary | |
static Register.Set |
ADR_set
|
static Register.Set |
EGPR_set
|
static Register.Set |
GPR_set
|
static Register.Set |
HGPR_set
|
static Register.Set |
MGPR_set
|
static Register |
R0
|
static Register |
R1
|
static Register |
R10
|
static Register |
R11
|
static Register |
R12
|
static Register |
R13
|
static Register |
R14
|
static Register |
R15
|
static Register |
R16
|
static Register |
R17
|
static Register |
R18
|
static Register |
R19
|
static Register |
R2
|
static Register |
R20
|
static Register |
R21
|
static Register |
R22
|
static Register |
R23
|
static Register |
R24
|
static Register |
R25
|
static Register |
R26
|
static Register |
R27
|
static Register |
R28
|
static Register |
R29
|
static Register |
R3
|
static Register |
R30
|
static Register |
R31
|
static Register |
R4
|
static Register |
R5
|
static Register |
R6
|
static Register |
R7
|
static Register |
R8
|
static Register |
R9
|
static Register.Set |
RDL_set
|
static Register |
X
|
static Register |
Y
|
static Register.Set |
YZ_set
|
static Register |
Z
|
static Register.Set |
Z_set
|
Method Summary | |
java.lang.String |
getName()
The getName() method returns the name of the instruction as a string. |
int |
getNumber()
The getNumber() method returns the "number" of this register, meaning the offset into the
register file. |
static Register |
getRegisterByName(java.lang.String name)
The getRegisterByName() method retrieves a reference to the Register instance
with the given string name. |
static Register |
getRegisterByNumber(int num)
The getRegisterByNumber() method retrieves a reference to the Register
instance with the given offset in the register file. |
int |
getWidth()
The getWidth() method returns the width of the register in bits. |
int |
hashCode()
The hashCode() computes the hash code of this register so that registers can be inserted
in hashmaps and hashsets. |
Register |
nextRegister()
The nextRegister() method returns a reference to the register that immediately follows
this register in the register file. |
java.lang.String |
toString()
The toString() method coverts this register to a string. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Register R0
public static final Register R1
public static final Register R2
public static final Register R3
public static final Register R4
public static final Register R5
public static final Register R6
public static final Register R7
public static final Register R8
public static final Register R9
public static final Register R10
public static final Register R11
public static final Register R12
public static final Register R13
public static final Register R14
public static final Register R15
public static final Register R16
public static final Register R17
public static final Register R18
public static final Register R19
public static final Register R20
public static final Register R21
public static final Register R22
public static final Register R23
public static final Register R24
public static final Register R25
public static final Register R26
public static final Register R27
public static final Register R28
public static final Register R29
public static final Register R30
public static final Register R31
public static final Register X
public static final Register Y
public static final Register Z
public static final Register.Set GPR_set
public static final Register.Set HGPR_set
public static final Register.Set MGPR_set
public static final Register.Set EGPR_set
public static final Register.Set ADR_set
public static final Register.Set RDL_set
public static final Register.Set YZ_set
public static final Register.Set Z_set
Method Detail |
public static Register getRegisterByName(java.lang.String name)
getRegisterByName()
method retrieves a reference to the Register
instance
with the given string name. This method is not case sensitive.
name
- the name of the register as a string
Register
object representing the register if a register of that
name exists; null otherwisepublic static Register getRegisterByNumber(int num)
getRegisterByNumber()
method retrieves a reference to the Register
instance with the given offset in the register file.
num
- the integer number of the register to retrieve
Register
object representing the chosen registerpublic int hashCode()
hashCode()
computes the hash code of this register so that registers can be inserted
in hashmaps and hashsets. This implementation of register simply uses the hash code of the name of the
register as its hash code.
public java.lang.String toString()
toString()
method coverts this register to a string. This implementation simply
returns the name of the register.
public java.lang.String getName()
getName()
method returns the name of the instruction as a string.
public int getNumber()
getNumber()
method returns the "number" of this register, meaning the offset into the
register file.
public int getWidth()
getWidth()
method returns the width of the register in bits.
public Register nextRegister()
nextRegister()
method returns a reference to the register that immediately follows
this register in the register file. This is needed when treating multiple registers as a single value,
etc.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |