prev next contents
sastore

store in short array

Jasmin Syntax


    sastore

Stack

Before

After
value
...
index

arrayref

...

Description

Takes an int from the stack, truncates it to a signed 16-bit short, and stores it in an array of shorts. arrayref is a reference to an array of 16-bit signed shorts. index is an int. value is the int to be stored in the array. arrayref, index and value are removed from the stack, and value is stored in the array at the given index.

Exceptions

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

NullPointerException - arrayref is null

Bytecode

Type

Description
u1
sastore opcode = 0x56 (86)
See Also

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

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