astore_<n>


Operation

astore_<n>


Store reference into local variable

Forms astore_0 = 75 (0x4b)

astore_1 = 76 (0x4c)

astore_2 = 77 (0x4d)

astore_3 = 78 (0x4e)

Stack ..., objectref ...

Description The <n> must be a valid index into the local variables of the current frame (§3.6). The objectref on the top of the operand stack must be of type returnAddress or of type reference. It is popped from the operand stack, and the value of the local variable at <n> is set to objectref.

Notes An astore_<n> instruction is used with an objectref of type returnAddress when implementing Java's finally keyword (see Section 7.13, "Compiling finally"). An aload_<n> instruction cannot be used to load a value of type returnAddress from a local variable onto the operand stack. This asymmetry with the corresponding astore_<n> instruction is intentional.

Each of the astore_<n> instructions is the same as astore with an index of <n>, except that the operand <n> is implicit.