# filled-new-array/range

## Purpose

Construct an array of the given type and size, filling it with the supplied contents. Clarifications and restrictions are the same as filled-new-array, described above.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
25 3rc | filled-new-array/range {vCCCC .. vNNNN}, type@BBBB | `A:` array size and argument word count (8 bits) `B:` type index (16 bits) `C:` first argument register (16 bits) `N = A + C - 1`

## Constraints

- vN must be a valid register index in the current stack frame (this means everything below vN is valid, too).
- For all values I in the interval [C .. N] the following must hold:
  - vI must not be part of a register pair
  - If the array type is a simple type, vI must be a simple type, too.
  - If the array type is a reference type, vI must be a reference type, too.
- B must be a valid index into the type pool.
- The type denoted by B must be an array type.
- The element size of the type denoted by B must be no larger than 32 bits.

## Behavior

- An attempt is made to get a reference to the type T the name of which is contained in type pool entry B.
- If T has not been loaded and resolved before, it is being loaded and resolved. All exceptions that are possible during class loading can occur at this point.
- An attempt is made to create a new instance J of type T and length vA. All exceptions that are possible during instantiation can occur at this point.
- The elements of R are filled according to the following rules:
  - J[0] = vC
  - J[1] = v(C+1)
  - ...
  - J[vA] = vN
- No reference to J is stored in any register. Instead, J can be accessed by a move-result-object instruction immediately following this filled-new-array instruction.

## Exceptions

- NegativeArraySizeException if vA < 0