Class RegisterDescriptionEntry
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.RegisterDescriptionEntry
Description of a processor register.
-
Constructor Summary
ConstructorsConstructorDescriptionRegisterDescriptionEntry
(int number, String name, int bitsize, RegisterEncoding encoding, String alternateName, RegisterType type, int offset) Full constructor. -
Method Summary
Modifier and TypeMethodDescriptionAdd a name for this register.enc
(RegisterEncoding encoding) int
int
Get the register size in bits.int
long
getId()
Opaque register id used byprocessor
objects.getName()
Get the primary name.getNames()
Get all the names for the register.int
Get the optional register number used to locate the register in its bank.int
Get the optional offset in a block of registers, meaningful in the context of the layout this entry belongs to.long
int
getSize()
Get the register size in bytes, rounded up (eg, if the register is 6-bit long, the returned byte size will be 1).getSlice
(int bitstart, int bitend) getType()
grp
(int grp, int idx) Defines the group from which register belongs.boolean
Determine if this register uses the provided name (case-insensitive).boolean
Determine if this register uses the provided name.boolean
hasName
(Collection<String> candidateNames) Determine if this register uses any of the provided names (case-insensitive).boolean
hasName
(Collection<String> candidateNames, boolean caseSensitive) Determine if this register uses any of the provided names.boolean
boolean
void
setOffset
(int offset) Define a slice of aRegisterDescriptionEntry
, with bitstart at 0.Define a slice of aRegisterDescriptionEntry
toString()
typ
(RegisterType type) void
void
-
Constructor Details
-
RegisterDescriptionEntry
public RegisterDescriptionEntry(int number, String name, int bitsize, RegisterEncoding encoding, String alternateName, RegisterType type, int offset) Full constructor.- Parameters:
number
- mandatoryname
- mandatorybitsize
- mandatoryencoding
- optionalalternateName
- optionaltype
- optionaloffset
- optional
-
-
Method Details
-
sl
Define a slice of aRegisterDescriptionEntry
- Parameters:
name
-bitstart
- start bitbitend
- end bit (excluded)- Returns:
- the register entry (NOT the defined slice)
-
sl
Define a slice of aRegisterDescriptionEntry
, with bitstart at 0. Usesl(String, int, int)
if bitstart is different.- Parameters:
name
- name of the slice registerbitsize
- bitsize of the slice. Must be <= to current bitsize.- Returns:
- the register entry (NOT the defined slice)
-
isPhysicalRegister
public boolean isPhysicalRegister() -
isRegisterSlice
public boolean isRegisterSlice() -
verifyPhysicalRegister
public void verifyPhysicalRegister() -
verifyRegisterSlice
public void verifyRegisterSlice() -
getContainer
-
getNumber
public int getNumber()Get the optional register number used to locate the register in its bank.- Returns:
-
getId
public long getId()Opaque register id used byprocessor
objects.- Returns:
- the id
-
getPureId
public long getPureId() -
grp
Defines the group from which register belongs.- Parameters:
grp
-idx
-- Returns:
- the register entry (NOT the defined group)
-
getOffset
public int getOffset()Get the optional offset in a block of registers, meaningful in the context of the layout this entry belongs to.- Returns:
- -1 if unspecified
-
setOffset
public void setOffset(int offset) - Parameters:
offset
-
-
getName
Get the primary name.- Returns:
- non-null, non-empty
-
getNames
Get all the names for the register. The first entry in the list is the primary name.- Returns:
- a list containing at least one entry
-
hasName
Determine if this register uses the provided name (case-insensitive).- Parameters:
candidateName
-- Returns:
-
hasName
Determine if this register uses the provided name.- Parameters:
candidateName
-caseSensitive
-- Returns:
-
hasName
Determine if this register uses any of the provided names (case-insensitive).- Parameters:
candidateNames
-- Returns:
-
hasName
Determine if this register uses any of the provided names.- Parameters:
candidateNames
-caseSensitive
-- Returns:
-
addName
Add a name for this register.- Parameters:
name
- a name, cannot be empty or null; it can be a primary name or an alternate name- Returns:
- this object (allows chained calls)
-
getBitsize
public int getBitsize()Get the register size in bits.- Returns:
-
getBitstart
public int getBitstart() -
getBitend
public int getBitend() -
getSlices
-
getSlice
-
getSize
public int getSize()Get the register size in bytes, rounded up (eg, if the register is 6-bit long, the returned byte size will be 1).- Returns:
-
getEncoding
- Returns:
- never null
-
enc
-
getType
- Returns:
- never null
-
typ
- Parameters:
type
-- Returns:
- the register entry (NOT the defined type)
-
toString
-