Class EncodedMemoryAreaUtil

java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.processor.memory.EncodedMemoryAreaUtil

public class EncodedMemoryAreaUtil extends Object
Utility routines for IEncodedMemoryArea.
  • Method Details

    • signExtendInt

      public static int signExtendInt(byte[] code, IEncodedMemoryArea memoryAreas)
      Decode and sign-extend an encoded area as an integer.
      Parameters:
      code - instruction bytes
      memoryAreas - encoded memory area
      Returns:
      sign-extended value
    • signExtendLong

      public static long signExtendLong(byte[] code, IEncodedMemoryArea memoryAreas)
      Decode and sign-extend an encoded area as a long.
      Parameters:
      code - instruction bytes
      memoryAreas - encoded memory area
      Returns:
      sign-extended value
    • zeroExtend

      public static int zeroExtend(byte[] code, IEncodedMemoryArea memoryArea)
      Decode and zero-extend an encoded area as an integer.
      Parameters:
      code - instruction bytes
      memoryArea - encoded memory area
      Returns:
      zero-extended value
    • zeroExtendLong

      public static long zeroExtendLong(byte[] code, IEncodedMemoryArea... memoryAreas)
      Decode and zero-extend several adjacent encoded areas as a long.
      Parameters:
      code - instruction bytes
      memoryAreas - 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 bytes
      index - bit index
      length - length in bits
      Returns:
      zero-extended value