prev next contents
iaload

retrieve integer from array

Jasmin Syntax


    iaload

Stack

Before

After
index
value
arrayref
...
...

Description

Retrieves an entry from a int array and places it on the stack. arrayref is a reference to an array of ints. index is an int. The arrayref and index are removed from the stack, and the int value at the given index in the array is pushed onto the stack.

Example



; get x[1], where x is an int array stored in local variable 1
aload_1          ; push an integer array onto the stack
iconst_1         ; push the integer 1 onto the stack
iaload           ; get the int at index 1 from the array

                 ; the top item on the stack is now x[1]

Exceptions

NullPointerException - arrayref is null

ArrayIndexOutOfBoundsException - index is < 0 or >= arrayref.length

Bytecode

Type

Description
u1
iaload opcode = 0x2E (46)
See Also

laload, faload, daload, aaload, baload, caload, saload, iastore, lastore, fastore, dastore, aastore, bastore, castore, sastore

Notes

Array indices start at 0 (the first entry in the array is at index 0).


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates