Class EncodedMemoryAreaUtil
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.memory.EncodedMemoryAreaUtil
Utility routines for
IEncodedMemoryArea.-
Method Summary
Modifier and TypeMethodDescriptionstatic intsignExtendInt(byte[] code, IEncodedMemoryArea memoryAreas) Decode and sign-extend an encoded area as an integer.static longsignExtendLong(byte[] code, IEncodedMemoryArea memoryAreas) Decode and sign-extend an encoded area as a long.static longzeroExtend(byte[] code, int index, int length) Extract and zero-extend bits from instruction bytes.static intzeroExtend(byte[] code, IEncodedMemoryArea memoryArea) Decode and zero-extend an encoded area as an integer.static longzeroExtendLong(byte[] code, IEncodedMemoryArea... memoryAreas) Decode and zero-extend several adjacent encoded areas as a long.
-
Method Details
-
signExtendInt
Decode and sign-extend an encoded area as an integer.- Parameters:
code- instruction bytesmemoryAreas- encoded memory area- Returns:
- sign-extended value
-
signExtendLong
Decode and sign-extend an encoded area as a long.- Parameters:
code- instruction bytesmemoryAreas- encoded memory area- Returns:
- sign-extended value
-
zeroExtend
Decode and zero-extend an encoded area as an integer.- Parameters:
code- instruction bytesmemoryArea- encoded memory area- Returns:
- zero-extended value
-
zeroExtendLong
Decode and zero-extend several adjacent encoded areas as a long.- Parameters:
code- instruction bytesmemoryAreas- encoded memory areas, from most significant to least significant- Returns:
- zero-extended value
-
zeroExtend
public static long zeroExtend(byte[] code, int index, int length) Extract and zero-extend bits from instruction bytes.- Parameters:
code- instruction bytesindex- bit indexlength- length in bits- Returns:
- zero-extended value
-