Java bytecode

This is an old revision of this page, as edited by Jabman (talk | contribs) at 03:28, 11 November 2005 (added some listings to bytecode list). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Java byte-code is the form of instructions that the Java virtual machine executes. Each byte-code instruction is one byte in length (hence the name), thus the number of byte-codes is limited to no more than 256. Not all 256 possible byte-code 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 Envirnoment, have permenently set aside a number of values to be permenently unimplemented. The bytecodes are given below.

The Java byte-codes

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 refernce onto the stack from a local variable
aload_0
2a
loads a refernece from local variable 0
aload_1
2b
loads a refernece from local variable 1
aload_2
2c
loads a refernece from local variable 2
aload_3
2d
loads a refernece 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

more to be added later