JVM Instructions Reference

Extracts from the website https://cs.au.dk/~mis/dOvs/jvmspec/ref-Java.html

istore

Pops an in off the stack and stores it in local variable . The istore instruction takes a single parameter, , an unsigned integer which indicates which local variable should be used. must be a valid local variable number in the current frame.

Example

bipush 10       ; push 10 onto the stack
istore 3        ; pop 10 off of the stack and store it in local variable 3

iload

Pushes the int value held in a local variable onto the operand stack. The iload instruction takes a single parameter, , an unsigned integer which indicates which local variable to use. The single-word int value held in that local variable is retrieved and placed on the stack. must be a valid local variable number in the current method's frame.

Example

bipush 5        ; push 5 onto the stack
istore 1        ; pop 5 off of the stack and store in local variable 1
iload 1         ; push the int in local variable 1 (the value 5)
                ; back onto the stack

ldc

push single-word constant onto stack

Example

ldc "Hello World"     ; push string "Hello World" onto stack
ldc 10                ; push the integer 10
ldc 1.54              ; push the single-precision float 1.54