public interface

IRegisterData

com.pnfsoftware.jeb.core.units.code.asm.processor.IRegisterData
Known Indirect Subclasses

Class Overview

Processor registers data, consisting of a register bank and their concrete values.

Summary

Public Methods
abstract IRegisterBank getBank()
Get the layout used by this register bank.
abstract int getBitsize(int regnum)
Get the register size in bits.
abstract Endianness getEndianness()
Get the byte ordering used by the registers of this bank.
abstract long getFlags()
This convenience method returns the value of the general purpose flag.
abstract String getName(int regnum)
Get the common name of a register.
abstract long getProgramCounter()
This convenience method returns the value of the program counter register.
abstract byte[] getValue(int regnum)
Get the binary value of a register.
abstract Long getValueAsLong(int regnum)
Get the value of a register that does not exceed 64 bits, as a long, using the bank's set byte ordering.
abstract boolean setValue(int regnum, byte[] bytes)
Set the binary value of a register.
abstract boolean setValueAsLong(int regnum, long value)
Set the value of a register, if it does not exceed 64 bits.
abstract int size()
Retrieve the number of registers defined in the layout used by this register bank.

Public Methods

public abstract IRegisterBank getBank ()

Get the layout used by this register bank.

Returns
  • non-null layout

public abstract int getBitsize (int regnum)

Get the register size in bits. Convenience method.

Parameters
regnum register number

public abstract Endianness getEndianness ()

Get the byte ordering used by the registers of this bank.

Returns
  • non-null endianness

public abstract long getFlags ()

This convenience method returns the value of the general purpose flag. Which register(s) that value maps to is processor-dependent.

Returns
  • the flags value
Throws
CannotReadRegisterException on error

public abstract String getName (int regnum)

Get the common name of a register. Convenience method.

Parameters
regnum register number

public abstract long getProgramCounter ()

This convenience method returns the value of the program counter register. The value should be interpreted as an unsigned 64-bit integer.

Returns
  • the PC value
Throws
CannotReadRegisterException on error

public abstract byte[] getValue (int regnum)

Get the binary value of a register. This method returns null if the value is not available. The bytes are laid out in the target processor byte order.

Note: If the register size is not a multiple of 8, the resulting integer value should be masked to discard the irrelevant upper bits.

Parameters
regnum register number
Returns
  • raw bytes (regardless of byte ordering); null if no value was set for the register

public abstract Long getValueAsLong (int regnum)

Get the value of a register that does not exceed 64 bits, as a long, using the bank's set byte ordering.

Parameters
regnum register number
Returns
  • null on error (eg, no value set for given register, value does not fit on 64-bit)

public abstract boolean setValue (int regnum, byte[] bytes)

Set the binary value of a register.

Parameters
regnum register number
bytes raw bytes (regardless of byte ordering)
Returns
  • success indicator

public abstract boolean setValueAsLong (int regnum, long value)

Set the value of a register, if it does not exceed 64 bits.

Parameters
regnum register number
value register value
Returns
  • success indicator

public abstract int size ()

Retrieve the number of registers defined in the layout used by this register bank. Convenience method.