Java bytecode

This is an old revision of this page, as edited by Ds13 (talk | contribs) at 20:59, 17 February 2006 (+ARM9E). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode instruction is one byte in length (hence the name), thus the number of bytecodes is limited to no more than 256. Not all 256 possible bytecode values are used, in fact Sun Microsystems, the original creators of the Java programming language, the Java virtual machine and other components of the Java Runtime Environment, have permanently set aside a number of values to be permanently unimplemented. The bytecodes are given below.

The Java bytecodes

Please see Sun's Java Virtual Machine Specification for more detailed descriptions (link at bottom of page)

Mnemonic    
  Opcode (in hex)   
Description

aaload
32
loads onto the stack a reference to an array
aastore
53
stores into a reference to an array
aconst_null
01
pushes a null reference onto the stack
aload
19
loads a reference onto the stack from a local variable
aload_0
2a
loads a reference from local variable 0
aload_1
2b
loads a reference from local variable 1
aload_2
2c
loads a reference from local variable 2
aload_3
2d
loads a reference from local variable 3
anewarray
bd
creates a new array of references
areturn
b0
returns a reference from a method
arraylength
be
gets the length of an array
astore
3a
stores a reference into a local variable
astore_0
4b
stores a reference into local variable 0
astore_1
4c
stores a reference into local variable 1
astore_2
4d
stores a reference into local variable 2
astore_3
4e
stores a reference into local variable 3
athrow
bf
throws an error or exception

baload
33
loads a byte or boolean value from an array
bastore
54
stores a byte or boolean value into an array
bipush
10
pushes a byte onto the stack

caload
34
loads a char from an array
castore
55
stores a char into an array
checkcast
c0
checks whether an object is of a certain type

d2f
90
converts a double to a float
d2i
8e
converts a double to an int
d2l
8f
dadd
63
daload
31
dastore
52
dcmpg
98
dcmpl
97
dconst_0
0e
dconst_1
0f
ddiv
6f
dload
18
dload_0
26
loads a double from local variable 0
dload_1
27
loads a double from local variable 1
dload_2
28
loads a double from local variable 2
dload_3
29
loads a double from local variable 3
dmul
6b
dneg
77
drem
73
dreturn
af
dstore
39
dstore_0
47
stores a double into local variable 0
dstore_1
48
stores a double into local variable 1
dstore_2
49
stores a double into local variable 2
dstore_3
4a
stores a double into local variable 3
dsub
67
dup
59
dup_x1
5a
dup_x2
5b
dup2
5c
dup2_x1
5d
dup2_x2
5e

f2d
8d
f2i
8b
f2l
8c
fadd
62
faload
30
fastore
51
fcmpg
96
fcmpl
95
fconst_0
0b
fconst_1
0c
fconst_2
0d
fdiv
6e
fload
17
fload_0
22
loads a float from local variable 0
fload_1
23
loads a float from local variable 1
fload_2
24
loads a float from local variable 2
fload_3
25
loads a float from local variable 3
fmul
6a
fneg
76
frem
72
freturn
ae
fstore
38
fstore_0
43
stores a float into local variable 0
fstore_1
44
stores a float into local variable 1
fstore_2
45
stores a float into local variable 2
fstore_3
46
stores a float into local variable 3
fsub
66
getfield
b4
gets a field of an object
getstatic
b2
gets a static field of a class
goto
a7
goes to another instruction
goto_w
c8
goes to another instruction

This list is incomplete.

See also

  • ARM9E, a CPU family with direct Java bytecode execution ability