154.

prev next contents
ldc2_w

push two-word constant onto stack

Jasmin Syntax
     ldc2_w <value> 
<value> is a long integer or a double-precision floating point number.

Stack

Before

After
...
<value>-word1

<value>-word2

...
Description

ldc2_w pushes a two-word constant value onto the operand stack. ldc2_w takes a single parameter, <value>, which is the two-word item to push. The following Java types can be pushed using ldc2_w:

long
double

Example

 ldc2_w 10             ; push the long integer 10 ldc2_w 1.54           ; push the double precision float 1.54 
Bytecode

In bytecode, the ldc2_w opcode is followed by a 16-bit unsigned integer. This integer is the index of an entry in the constant pool. The entry is tagged either as a CONSTANT_Double or a CONSTANT_Long entry, and has a data field which contains <value>.

Type

Description
u1
ldc2_w opcode = 0x14 (20)
u2
index
See Also

bipush, sipush, ldc, ldc_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


Java Virtual Machine
Java Virtual Machine (Java Series)
ISBN: 1565921941
EAN: 2147483647
Year: 1996
Pages: 171

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net