Class RegisterUtil
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.arch.RegisterUtil
Utility methods for
IRegisterBank and IRegisterData, including methods to create
standard register ids.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbyteArrayToHex(Endianness endianness, byte[] data) static StringbyteArrayToHex(Endianness endianness, byte[] data, int pos, int end) static longcreatePureRegisterId(int index, int grp) Create a pure register id, i.e.static longcreateRegisterId(int index, int grp, int bitsize) Create a standard register id (full or slice).static longcreateRegisterId(int index, int grp, int bitsize, int bitstart) Create a standard register id (full or slice).static longcreateRegisterIdFromPureId(long pure, int bitsize, int bitstart) static IRegisterBankgetBank(ProcessorType proctype) Convenience method to retrieve a register bank used by a well-known processor type.static RegisterDescriptionEntrygetEntryByName(IRegisterBank bank, String name) static RegisterDescriptionEntrygetEntryByName(IRegisterData bank, String name) static RegisterDescriptionEntrygetEntryByType(IRegisterBank bank, RegisterType type) static RegisterDescriptionEntrygetEntryByType(IRegisterData bank, RegisterType type) static longgetPureId(long id) static intgetRegisterBitsize(long id) static intgetRegisterBitstart(long id) static intgetRegisterGroup(long id) static intgetRegisterIndex(long id) static byte[]getValueByName(IRegisterData bank, String name) static LonggetValueByNameAsLong(IRegisterData bank, String name) static booleanisPureId(long id) static booleansetValueByName(IRegisterData bank, String name, byte[] bytes) static booleansetValueByNameAsLong(IRegisterData bank, String name, long value)
-
Constructor Details
-
RegisterUtil
public RegisterUtil()
-
-
Method Details
-
getBank
Convenience method to retrieve a register bank used by a well-known processor type.It is recommended to use
RegisterBankServicedirectly.- 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
-
getEntryByType
-
getEntryByName
-
getEntryByName
-
getValueByName
-
getValueByNameAsLong
-
setValueByName
-
setValueByNameAsLong
-
byteArrayToHex
-
byteArrayToHex
-