private static short codeUnit(int lowByte, int highByte) {
    if ((lowByte & ~0xff) != 0) {
      throw new IllegalArgumentException("bogus lowByte");
    }

    if ((highByte & ~0xff) != 0) {
      throw new IllegalArgumentException("bogus highByte");
    }

    return (short) (lowByte | (highByte << 8));
  }
Helper method that encodes any of the three-unit register-range formats.
android/android_framework/dex-maker/src/main/java/com/android/dx/io/instructions/InstructionCodec.java