Show Menu
Cheatography

A cheat sheet about JVM

Data Types (13)

Type
Range
Descri­ption
boolean
{0,1}
Z
byte
-27 to 27 -1, inclusive
B
short
-215 to 215-1, inclusive
S
int
-231 to 231-1, inclusive
I
long
-263 to 263-1, inclusive
L
char
16 bit unsigned Unicode (0 to 216 -1)
C
float
32-bit IEEE 754 single­-pr­ecision float
F
double
64-bit IEEE 754 double­-pr­ecision float
D
return­Address
address of an opcode within the same method
class reference
 
Lclass­-name;
interface reference
 
Linter­-name
array reference
 
[[..[c­omp­onent type]
void
 
V

Type Conversion Instru­ctions

i2l, i2f, i2d, l2f, l2d, and f2d
Only i2f is used in MP compiler

Operand Stack Management Instru­ctions

dup, pop,dup2, pop2, swap

Object Creation and Manipu­lation

Create a new class instance
new
Create a new array
newarray, anewarray, multia­new­array
Access field of classes ( static­fie­ld/­class variables) and field of class instanes (non-s­tatic fields, known as instance variables)
getfield, putfield, getstatic, putstatic
Load an array component onto the operand stack
<T>­aload
Store a value from the operand stack as an array component
<T>­astore
 

Jasmin Instru­ctions (10)

Arithmetic Instru­ctions
Load and store instru­ctions
Control transfer instru­ctions
Type conversion instru­ctions
Operand stack management instru­ctions
Object creation and manipu­lation
Method invocation instru­ctions
Throwing instru­ctions (not used)
Implem­eneting finally (not used)
Syncho­ron­isation (not used)

Load and Store

Load a loadcal variable onto the operand stack
Store a value from the operand stack into a local variable
<T>­aload -> T:b,s,­i,l­,f,­d,c,a
<T>­astore -> T: b,s,i,­l,f­,d,c,a

Load and Store (cont)

 
Value
bipush
int const, -27 to 27-1
sipush
int const, -215 to 215-1
ldc
int, float, quote string const
ldc_w
long,d­ouble const
ldc2_w
long, double const
aconst­_null
null
iconst_m1
-1
iconst­_<i>
0,...,5
lconst­_<l>
0,1
fconst­_<f>
0.0, 1.0 and 2.0
dconst­_<d>
0.0, 1.0

Method Invocation Instru­ctions

invoke­static
invoke­vitual
invoke­special
invoke­int­erface <me­tho­d-s­pec> <nu­m-a­rgs>
 

Arithmetic Instru­ctions

Add
iadd, ladd, fadd, dadd
Subtract
isub, lsub, fsub, dsub
Multiply
imul, lmul, fmul, dmul
Divide
idiv, ldiv, fdiv, ddiv
Remainder
irem, lrem, frem, drem
Shift
ishl, ishr, iushr, lshl, lshr, lushr
Bitwise OR
ior, lor
Bitwise AND
iand, land
Bitwise exclusive OR
ixor, lxor
Local variable increment
iinc
Compar­ision
dcmpg, dcmpl, fcmpg, fcmpl, Icmp.

Control Transfer Instru­ctions

Uncond­itional branch
goto, goto_w, jsr, jsr_w, ret
Condit­ional branch
ifeq, iflt, ifle, ifne, ifgt, ifge
compare an int to zero
 
ifnull, ifnonnull
compare a ref to null
 
if_icmpeq, if_icmpne, if_icmplt, if_icmpgt, if_icm­ple­,if­_icmpge
compare two integers
 
if_acmpeq_ if_acmpne
compare two references
Compund condit­ional branch
tables­witch, lookup­switch

Jasmin Directives

.source <so­urc­e.j­ava>
.class < the current class>
.super < the super class>
.limit
.method < the method descri­pti­on>
.field <the field descri­pti­on>
.end
.var < the variable descri­pti­on>
.line < the line number in source code>

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.