Contents | Prev | Next | IndexThe JavaTM Virtual Machine Specification


saload

Operation Load short from array

saload


Forms saload = 53 (0x35)

Stack ..., arrayref, index ..., value

Description The arrayref must be of type reference and must refer to an array whose components are of type short. The index must be of type int. Both arrayref and index are popped from the operand stack. The short value in the component of the array at index is retrieved, sign-extended to an int value, and pushed onto the top of the operand stack.

Runtime Exceptions If arrayref is null, saload throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the saload instruction throws an ArrayIndexOutOfBoundsException.


sastore

Operation

sastore


Store into short array

Forms sastore = 86 (0x56)

Stack ..., array, index, value ...

Description The arrayref must be of type reference and must refer to an array whose components are of type short. Both index and value must be of type int. The arrayref, index, and value are popped from the operand stack. The int value is truncated to a short and stored as the component of the array indexed by index.

Runtime Exceptions If arrayref is null, sastore throws a NullPointerException.

Otherwise, if index is not within the bounds of the array referenced by arrayref, the sastore instruction throws an ArrayIndexOutOfBoundsException.


sipush

Operation Push short

sipush
byte1
byte2


Forms sipush = 17 (0x11)

Stack ... ..., value

Description The immediate unsigned byte1 and byte2 values are assembled into an intermediate short where the value of the short is (byte1 << 8) | byte2. The intermediate value is then sign-extended to an int, and the resulting value is pushed onto the operand stack.


swap

Operation Swap top two operand stack words

swap


Forms swap = 95 (0x5f)

Stack ..., word2, word1 ..., word1, word2

Description The top two words on the operand stack are swapped.

The swap instruction must not be used unless each of word2 and word1 is a word that contains a 32-bit data type.

Notes Except for restrictions preserving the integrity of 64-bit data types, the swap instruction operates on untyped words, ignoring the types of the data they contain.


Contents | Prev | Next | Index

Java Virtual Machine Specification

Copyright © 1996, 1997 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to jvm@java.sun.com