# aget<kind>

## Purpose

Perform the identified array operation at the identified index of the given array, storing into the value register.

## Details

Op & Format | Mnemonic / Syntax | Arguments
--- | --- | ---
44..51 23x | arrayop vAA, vBB, vCC 44: aget 45: aget-wide 46: aget-object 47: aget-boolean 48: aget-byte 49: aget-char 4a: aget-short | `A:` dest value register or pair; (8 bits) `B:` array register (8 bits) `C:` index register (8 bits)

## Constraints

- A, B and C must be valid register indices in the current stackframe.
- For the aget-wide variant, also A+1 must be a valid register index in the current stackframe.
- Register vB must contain an array reference. The component type of the array must match the variant of the instruction.
- Register vC must contain an integer value.

## Behavior

- For all but the -wide variant, the array element at the given index is moved into register vA, that is, vA'=array[index].
- For the -wide variant, the array element at the given index is moved into registers vA and v(A+1) as follows:
  - vA'=array[index] >> 0x20
  - v(A+1)'=array[index] & 0xffffffff;
- If v(A-1) is the lower half of a register pair, v(A-1)' becomes undefined.
- For all but the -wide variant, if v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined.
- For the -wide variant, if v(A+2) is the upper half of a register pair, v(A+2)' becomes undefined.

## Exceptions

- NullPointerException if vB=null.
- ArrayIndexOutOfBoundsException if vC < 0 or vC >= array.length.