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
Please see Sun's Java Virtual Machine Specification for more detailed descriptions (link at bottom of page)
Mnemonic | Description | |
aaload | loads onto the stack a reference to an array | |
aastore | stores into a reference to an array | |
aconst_null | pushes a null reference onto the stack | |
aload | loads a reference onto the stack from a local variable | |
aload_0 | loads a reference from local variable 0 | |
aload_1 | loads a reference from local variable 1 | |
aload_2 | loads a reference from local variable 2 | |
aload_3 | loads a reference from local variable 3 | |
anewarray | creates a new array of references | |
areturn | returns a reference from a method | |
arraylength | gets the length of an array | |
astore | stores a reference into a local variable | |
astore_0 | stores a reference into local variable 0 | |
astore_1 | stores a reference into local variable 1 | |
astore_2 | stores a reference into local variable 2 | |
astore_3 | stores a reference into local variable 3 | |
athrow | throws an error or exception | |
baload | loads a byte or boolean value from an array | |
bastore | stores a byte or boolean value into an array | |
bipush | pushes a byte onto the stack | |
caload | loads a char from an array | |
castore | stores a char into an array | |
checkcast | checks whether an object is of a certain type | |
d2f | converts a double to a float | |
d2i | converts a double to an int | |
d2l | ||
dadd | ||
daload | ||
dastore | ||
dcmpg | ||
dcmpl | ||
dconst_0 | ||
dconst_1 | ||
ddiv | ||
dload | ||
dload_0 | loads a double from local variable 0 | |
dload_1 | loads a double from local variable 1 | |
dload_2 | loads a double from local variable 2 | |
dload_3 | loads a double from local variable 3 | |
dmul | ||
dneg | ||
drem | ||
dreturn | ||
dstore | ||
dstore_0 | stores a double into local variable 0 | |
dstore_1 | stores a double into local variable 1 | |
dstore_2 | stores a double into local variable 2 | |
dstore_3 | stores a double into local variable 3 | |
dsub | ||
dup | ||
dup_x1 | ||
dup_x2 | ||
dup2 | ||
dup2_x1 | ||
dup2_x2 | ||
more to be added later