7.

prev next contents
fconst_<f>

push the single float 0.0, 1.0 or 2.0

Jasmin Syntax
     fconst_0 or     fconst_1 or     fconst_2 
Stack

Before

After
...
<f>

...
Description

fconst_<f> represents the series of opcodes fconst_0, fconst_1, and fconst_2 that are used to push the constant single-precision floats 0.0, 1.0 and 2.0 onto the stack.

For example, to push the single-precision float zero onto the stack, use:

     fconst_0 ; push single-precision float 0 onto the stack 
Note that you could also use:
     ldc 0.0  ; push the float 0.0 onto the stack 
although this instruction takes more space in the class file and is also less efficient.

Example

 fconst_0    ; push the float 0.0 onto the stack fconst_1    ; push the float 1.0 onto the stack fconst_2    ; push the float 2.0 onto the stack 
Bytecode

Type

Description
u1
fconst_0 opcode = 0x0B (11)
u1
fconst_1 opcode = 0x0C (12)
u1
fconst_2 opcode = 0x0D (13)
See Also

bipush, sipush, ldc, ldc_w, ldc2_w, aconst_null, iconst_m1, lconst_<l> iconst_<n>, lconst_<l>, 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