istore

Store int into local variable

Bytecode

For local variable numbers in the range 0-255, use:

Type Description
u1 istore opcode = 0x36 (54)
u1 <varnum>

There is also a wide format for this instruction, which supports access to all local variables from 0 to 65535:

Type Description
u1 wide opcode = 0xC4 (196)
u1 istore opcode = 0x36 (54)
u2 <varnum>

Stack ..., value => ...

Description

Pops an in off the stack and stores it in local variable <varnum>. The <varnum> is an unsigned byte (short) that must be a valid index into the local variables of the current fram. The value on the top of the operand stack must be of type int. It is popped from the operand stack, and the value of the local variable at <varnum> is set to value.

Notes
The istore opcode can be used in conjunction with the wide instruction to access a local variable using a two-byte unsigned index.