public final short getRegisterCountUnit() {
    int registerCount = getRegisterCount();

    if ((registerCount & ~0xffff) != 0) {
      throw new DexException("Register count out of range: " + Hex.u8(registerCount));
    }

    return (short) registerCount;
  }
Gets the register count, as a code unit. This will throw if the value is out of the range of an
unsigned code unit.
android/android_framework/dex-maker/src/main/java/com/android/dx/io/instructions/DecodedInstruction.java