Next: Store Instructions
Up: The Instruction Set
Previous: The Instruction Set
The load instructions load a value on the operand stack.
The following instructions load a value from a local variable on the operand
stack:
- iload, fload, lload, dload, aload.
Load respectively a value of type int, float,
long, double and reference from a local variable at position
index in the local variable table onto the operand stack. Operand:
index. Stack: ... ..., value.
- iload_n>, fload_n>, lload_n>,
dload_n>, aload_n>. Load respectively a value of
type int, float, long, double and reference
from a local variable at index <n> onto the operand stack where
<n> = (0..3). These are specialized instructions,
introduced because it is often needed to access local variables at postitions
0 through 3. No operands. Stack: ...
..., value.
The following instructions load a constant on the operand stack:
- bipush. Push a byte. Operand: byte. Stack:
... ..., byte.
- sipush. Push a short. Operands: byte1, byte2. Stack:
... ..., short.
- ldc. Push an item from the constant_pool[]. Operand:
index. Stack: ... ..., item.
- ldc_w. Push an item with a wide index from the
constant_pool[]. Operands: indexbyte1, indexbyte2. Stack:
... ..., item.
- ldc2_w. Push a long or a double with a wide index from
the constant_pool[]. Operands: indexbyte1, indexbyte2.
Stack: ... ..., item.
- iconst_i>, fconst_f>, lconst_l>,
dconst_d>. Push respectively int <i>, float
<f>, long <l> and double <d> on the
operand stack, where <i> is (0..5), <f> is (0..2),
<l> is (0..1) and <d> is (0..1). No operands. Stack:
... ..., value.
- iconst_m1. Push int -1. No Operands. Stack: ...
..., -1.
- aconst_null. Push null reference. No operands.
Stack: ... ..., null.
Next: Store Instructions
Up: The Instruction Set
Previous: The Instruction Set
mark@bottom.xs4all.nl