bipush <n><n> is an integer >= -128 and <= 127 that is
Stack
|
B
efore
|
After
|
|
...
|
<n>
|
|
...
|
...
|
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 stackBytecode
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>
|
d2fStack
|
B
efore
|
After
|
|
double-word1
|
float-result
|
|
double-word2
|
...
|
|
...
|
|
Pops a two-word double precision floating point number off of the operand stack, casts it into a single precision float, and pushes the resulting float back onto the stack. There is a loss of precision and range in the result.
This conversion is done in accordance with IEEE 754 specifications, with rounding using IEEE 754 round-to-
The sign of the value if preserved. A value which is too small to be represented as a float is converted to positive or negative zero. A value that is too large to be represented as a float is converted to positive infinity or negative infinity. If the value was NaN, the result is NaN.
Bytecode
|
Type
|
Description
|
|
u1
|
d2f opcode = 0x90 (144)
|
d2i , d2l
d2iStack
|
B
efore
|
After
|
|
double-word1
|
integer-result
|
|
double-word2
|
...
|
|
...
|
|
Pops a two-word double precision floating point number off of the operand stack, casts it into a 32-bit int, and pushes the resulting int onto the stack.
Rounding is done using IEEE 754 round-to-
If the original double value is NaN, the result is 0. If the value is too large to be represented as an integer, or if it is positive infinity, the result is the largest possible integer 0x7FFFFFFF. If the value is too small (i.e. a negative value of large magnitude, or negative infinity) then the result is the most negative integer 0x80000000.
Bytecode
|
Type
|
Description
|
|
u1
|
d2i opcode = 0x8E (142)
|
d2l , d2f
d2lStack
|
B
efore
|
After
|
|
double-word1
|
long-word1
|
|
double-word2
|
long-word2
|
|
...
|
...
|
Pops a two-word double precision floating point number off of the operand stack, converts it into a 64-bit long integer, and pushes the resulting two-word long onto the stack.
Rounding is done using IEEE 754 round-to-
If the original double value is NaN, the result is 0. If the value is too large to be represented as an integer, or if it is positive infinity, the result is the largest possible long integer Long.MAX_VALUE. If the value is too small (i.e. a negative value of large magnitude, or negative infinity) then the result is the most negative long integer Long.MIN_VALUE.
In some
void d2l(double d, int &l_high, int &l_low)
{
l_low = (unsigned int)d;
l_high = (unsigned int)(d / 2**32);
}
where l_low and l_high are respectively the least significant and most significant 32-bit words of the long.
Bytecode
|
Type
|
Description
|
|
u1
|
d2l opcode = 0x8F (143)
|
d2i , d2f