sipush

Push short

The sipush opcode is followed in the bytecode by a 16-bit signed short specifying the integer value to push.

Type Description
u1 sipush opcode = 0x11 (17)
s2 <n>

Stack ... => ..., value

Description

<n> is a signed integer in the range -32768 to 32767.sipush takes a single parameter, <n> (a 16-bit signed integer), sign extends it to a 32-bit int, and pushes the resulting int onto the operand stack.

sipush is typically more efficient than ldc. It also occupies fewer bytes in the class file.

Example

sipush    0x10    ; push the value 0x10 (16)
                  ; onto the operand stack