# fill-array-data

## Purpose

Fill the given array with the indicated data. The reference must be to an array of primitives, and the data table must match it in type and size.

Note: The address of the table is guaranteed to be even (that is, 4-byte aligned). If the code size of the method is otherwise odd, then an extra code unit is inserted between the main code and the table whose value is the same as a nop.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
| 26 31t | fill-array-data vAA, +BBBBBBBB (with supplemental data as specified below in "`fill-array-data` Format") | `A:` array reference (8 bits) `B:` signed "branch" offset to table data (32 bits)

## Constraints

- A must be a valid register index in the current stack frame.
- vA must be a reference-bearing register (according to data flow) and contain an array-reference.
- B must be branch offset in the same method.
- The target address (PC+B) must be 4-byte aligned.
- The target address must hold the pseudo-opcode 0x300.
- The table entry size must match the size of the data type of the array.
- The table size must be equal or smaller than the array length.

## Behavior

- The contents of the array referenced by vA are filled with the table data, starting from array index 0 and in the given order.
- If there are less elements in the table than the array provides space for, the remaining array elements stay untouched.

## Exceptions

- NullPointerException if vA is null.