public class

RegisterDescriptionEntry

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.processor.RegisterDescriptionEntry

Class Overview

Description of a processor register.

Summary

Public Constructors
RegisterDescriptionEntry(int number, String name, int bitsize, RegisterEncoding encoding, String alternateName, RegisterType type, int offset)
Full constructor.
Public Methods
RegisterDescriptionEntry addName(String name)
Add a name for this register.
RegisterDescriptionEntry enc(RegisterEncoding encoding)
int getBitend()
int getBitsize()
Get the register size in bits.
int getBitstart()
RegisterDescriptionEntry getContainer()
RegisterEncoding getEncoding()
long getId()
Opaque register id used by processor objects.
String getName()
Get the primary name.
List<String> getNames()
Get all the names for the register.
int getNumber()
Get the optional register number used to locate the register in its bank.
int getOffset()
Get the optional offset in a block of registers, meaningful in the context of the layout this entry belongs to.
long getPureId()
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).
RegisterDescriptionEntry getSlice(int bitstart, int bitend)
List<RegisterDescriptionEntry> getSlices()
RegisterType getType()
RegisterDescriptionEntry grp(int grp, int idx)
Defines the group from which register belongs.
boolean hasName(String candidateName, boolean caseSensitive)
Determine if this register uses the provided name.
boolean hasName(Collection<String> candidateNames, boolean caseSensitive)
Determine if this register uses any of the provided names.
boolean hasName(String candidateName)
Determine if this register uses the provided name (case-insensitive).
boolean hasName(Collection<String> candidateNames)
Determine if this register uses any of the provided names (case-insensitive).
boolean isPhysicalRegister()
boolean isRegisterSlice()
void setOffset(int offset)
RegisterDescriptionEntry sl(String name, int bitsize)
Define a slice of a RegisterDescriptionEntry, with bitstart at 0.
RegisterDescriptionEntry sl(String name, int bitstart, int bitend)
Define a slice of a RegisterDescriptionEntry
String toString()
RegisterDescriptionEntry typ(RegisterType type)
void verifyPhysicalRegister()
void verifyRegisterSlice()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public RegisterDescriptionEntry (int number, String name, int bitsize, RegisterEncoding encoding, String alternateName, RegisterType type, int offset)

Full constructor.

Parameters
number mandatory
name mandatory
bitsize mandatory
encoding optional
alternateName optional
type optional
offset optional

Public Methods

public RegisterDescriptionEntry addName (String name)

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)

public int getBitend ()

public int getBitsize ()

Get the register size in bits.

public int getBitstart ()

public RegisterDescriptionEntry getContainer ()

public RegisterEncoding getEncoding ()

Returns
  • never null

public long getId ()

Opaque register id used by processor objects.

Returns
  • the id

public String getName ()

Get the primary name.

Returns
  • non-null, non-empty

public List<String> 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

public int getNumber ()

Get the optional register number used to locate the register in its bank.

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

public long getPureId ()

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).

public RegisterDescriptionEntry getSlice (int bitstart, int bitend)

public List<RegisterDescriptionEntry> getSlices ()

public RegisterType getType ()

Returns
  • never null

public RegisterDescriptionEntry grp (int grp, int idx)

Defines the group from which register belongs.

Returns
  • the register entry (NOT the defined group)

public boolean hasName (String candidateName, boolean caseSensitive)

Determine if this register uses the provided name.

public boolean hasName (Collection<String> candidateNames, boolean caseSensitive)

Determine if this register uses any of the provided names.

public boolean hasName (String candidateName)

Determine if this register uses the provided name (case-insensitive).

public boolean hasName (Collection<String> candidateNames)

Determine if this register uses any of the provided names (case-insensitive).

public boolean isPhysicalRegister ()

public boolean isRegisterSlice ()

public void setOffset (int offset)

public RegisterDescriptionEntry sl (String name, int bitsize)

Define a slice of a RegisterDescriptionEntry, with bitstart at 0. Use sl(String, int, int) if bitstart is different.

Parameters
name name of the slice register
bitsize bitsize of the slice. Must be <= to current bitsize.
Returns
  • the register entry (NOT the defined slice)

public RegisterDescriptionEntry sl (String name, int bitstart, int bitend)

Define a slice of a RegisterDescriptionEntry

Parameters
bitstart start bit
bitend end bit (excluded)
Returns
  • the register entry (NOT the defined slice)

public String toString ()

public RegisterDescriptionEntry typ (RegisterType type)

Returns
  • the register entry (NOT the defined type)

public void verifyPhysicalRegister ()

public void verifyRegisterSlice ()