public abstract class

AbstractRegisterBank

extends Object
implements IRegisterBank
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.asm.processor.arch.AbstractRegisterBank
Known Direct Subclasses

Class Overview

Base implementation of a registers bank layout.

It is preferred to use AbstractRegisterBank2 to define register banks.

Summary

Constants
int REG_GRP_GP Group for general-purpose registers: always 0.
int REG_GRP_SPECIAL Group for non-GP registers and registers not fitting in other user-created groups.
Public Constructors
AbstractRegisterBank()
Public Methods
String format(int type)
Format the register bank as a string.
Collection<RegisterDescriptionEntry> getAllDescriptionEntries()
Get the list of all (full and slices) register entries.
int getCountOfDescriptionEntries()
Get the number of fill register entries.
Collection<RegisterDescriptionEntry> getDescriptionEntries()
Get the list of full register entries.
RegisterDescriptionEntry getDescriptionEntry(int regnum)
Get a full register entry by index (do not confuse with id).
RegisterDescriptionEntry getDescriptionEntryById(long id)
Get a register entry (full or slice) by id (do not confuse with index).
RegisterDescriptionEntry getDescriptionEntryByName(Collection<String> names)
Get a register entry (full or slice) by name, using a list of candidate names.
RegisterDescriptionEntry getDescriptionEntryByName(String name)
Get a register entry (full or slice) by name.
RegisterDescriptionEntry getDescriptionEntryByType(RegisterType type)
Get a full register entry by type.
abstract Map<Integer, RegisterDescriptionEntry> getDescriptionEntryMap()
String toString()
Protected Methods
static RegisterDescriptionEntry add(Map<Integer, RegisterDescriptionEntry> entries, int bitsize, String name, String altname)
static RegisterDescriptionEntry add(Map<Integer, RegisterDescriptionEntry> entries, int bitsize, String name, String altname, RegisterEncoding encoding, RegisterType type)
static RegisterDescriptionEntry add(Map<Integer, RegisterDescriptionEntry> entries, int bitsize, String name)
Creates a RegisterDescriptionEntry based on its name and its bitsize
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.units.code.asm.processor.IRegisterBank

Constants

public static final int REG_GRP_GP

Group for general-purpose registers: always 0.

Constant Value: 0 (0x00000000)

public static final int REG_GRP_SPECIAL

Group for non-GP registers and registers not fitting in other user-created groups.

Constant Value: 1 (0x00000001)

Public Constructors

public AbstractRegisterBank ()

Public Methods

public String format (int type)

Format the register bank as a string.

Parameters
type 0: short-form (i.e., toString()), 1: user-friendly long-form
Returns
  • the formatted bank

public Collection<RegisterDescriptionEntry> getAllDescriptionEntries ()

Get the list of all (full and slices) register entries.

public int getCountOfDescriptionEntries ()

Get the number of fill register entries. Slices are not counted.

public Collection<RegisterDescriptionEntry> getDescriptionEntries ()

Get the list of full register entries. Slices are not returned.

public RegisterDescriptionEntry getDescriptionEntry (int regnum)

Get a full register entry by index (do not confuse with id). Slices cannot be retrieved.

public RegisterDescriptionEntry getDescriptionEntryById (long id)

Get a register entry (full or slice) by id (do not confuse with index).

public RegisterDescriptionEntry getDescriptionEntryByName (Collection<String> names)

Get a register entry (full or slice) by name, using a list of candidate names. Useful when a register goes by different names.

Parameters
names candidate names

public RegisterDescriptionEntry getDescriptionEntryByName (String name)

Get a register entry (full or slice) by name.

public RegisterDescriptionEntry getDescriptionEntryByType (RegisterType type)

Get a full register entry by type. Slices cannot be retrieved.

public abstract Map<Integer, RegisterDescriptionEntry> getDescriptionEntryMap ()

Returns
  • a map of full registers: key=index, value=full register entry

public String toString ()

Protected Methods

protected static RegisterDescriptionEntry add (Map<Integer, RegisterDescriptionEntry> entries, int bitsize, String name, String altname)

protected static RegisterDescriptionEntry add (Map<Integer, RegisterDescriptionEntry> entries, int bitsize, String name, String altname, RegisterEncoding encoding, RegisterType type)

protected static RegisterDescriptionEntry add (Map<Integer, RegisterDescriptionEntry> entries, int bitsize, String name)

Creates a RegisterDescriptionEntry based on its name and its bitsize

Parameters
entries global map
bitsize bitsize of the register
name name of the register