java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.arch.RegisterUtil

public class RegisterUtil extends Object
Utility methods for IRegisterBank and IRegisterData, including methods to create standard register ids.
  • Constructor Details

    • RegisterUtil

      public RegisterUtil()
  • Method Details

    • getBank

      public static IRegisterBank getBank(ProcessorType proctype)
      Convenience method to retrieve a register bank used by a well-known processor type.

      It is recommended to use RegisterBankService directly.

      Parameters:
      proctype - a processor type
      Returns:
      null if not found
    • createRegisterId

      public static long createRegisterId(int index, int grp, int bitsize)
      Create a standard register id (full or slice).
      Parameters:
      index -
      grp -
      bitsize -
      Returns:
    • createRegisterId

      public static long createRegisterId(int index, int grp, int bitsize, int bitstart)
      Create a standard register id (full or slice).
      Parameters:
      index -
      grp -
      bitsize -
      bitstart -
      Returns:
    • createPureRegisterId

      public static long createPureRegisterId(int index, int grp)
      Create a pure register id, i.e. an id always representing a full register, without indicators such as bit size or bit start.
      Parameters:
      index -
      grp -
      Returns:
    • createRegisterIdFromPureId

      public static long createRegisterIdFromPureId(long pure, int bitsize, int bitstart)
    • isPureId

      public static boolean isPureId(long id)
    • getPureId

      public static long getPureId(long id)
    • getRegisterIndex

      public static int getRegisterIndex(long id)
    • getRegisterGroup

      public static int getRegisterGroup(long id)
    • getRegisterBitsize

      public static int getRegisterBitsize(long id)
    • getRegisterBitstart

      public static int getRegisterBitstart(long id)
    • getEntryByType

      public static RegisterDescriptionEntry getEntryByType(IRegisterBank bank, RegisterType type)
    • getEntryByType

      public static RegisterDescriptionEntry getEntryByType(IRegisterData bank, RegisterType type)
    • getEntryByName

      public static RegisterDescriptionEntry getEntryByName(IRegisterBank bank, String name)
    • getEntryByName

      public static RegisterDescriptionEntry getEntryByName(IRegisterData bank, String name)
    • getValueByName

      public static byte[] getValueByName(IRegisterData bank, String name)
    • getValueByNameAsLong

      public static Long getValueByNameAsLong(IRegisterData bank, String name)
    • setValueByName

      public static boolean setValueByName(IRegisterData bank, String name, byte[] bytes)
    • setValueByNameAsLong

      public static boolean setValueByNameAsLong(IRegisterData bank, String name, long value)
    • byteArrayToHex

      public static String byteArrayToHex(Endianness endianness, byte[] data)
    • byteArrayToHex

      public static String byteArrayToHex(Endianness endianness, byte[] data, int pos, int end)