Java Virtual Machine (Java Series)

prev next contents
bipush

push one-byte signed integer

Jasmin Syntax

bipush <n> <n> is an integer >= -128 and <= 127 that is pushed onto the stack.

Stack

Before

After
... <n>
... ...
Description

bipush takes a single parameter, <n> (an 8-bit signed integer), sign extends it to a 32-bit int, and pushes the resulting int value onto the operand stack.

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

Example

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

The bipush opcode is followed in the bytecode by an 8-bit signed byte specifying the integer value to push.

Type

Description
u1 bipush opcode = 0x10 (16)
s1 <n>
See Also

sipush, ldc, ldc_w, ldc2_w, aconst_null, iconst_m1, iconst_<n>, lconst_<l>, fconst_<f>, dconst_<d>


prev next contents
Java Virtual Machine, by Jon Meyer and Troy Downing, O'Reilly Associates

Категории