3.3 Mnemonic Naming Conventions

The Oolong mnemonics come from The Java Virtual Machine Specification. The Specification follows a naming convention for some of its mnemonics: the first letter of the mnemonic often tells you what type the mnemonic operates on. For example, iconst_1 loads an int 1 onto the stack, while lconst_1 loads a long 1 onto the stack. The letter i indicates an int, and the letter l indicates a long. Table 3.1 summarizes the mnemonic naming conventions.

Table 3.1. Mnemonic type letters
Letter Type
a reference
b byte or boolean
c char
d double
f float
i int
l long
s short

Do not be misled by the naming convention into believing in mnemonics that do not exist. Each mnemonic corresponds to a number between 0 and 256 in the class file. This number is called an opcode. Just because there's an opcode for the mnemonic iand to compute the bitwise and of two ints, it doesn't mean that there's an opcode for the mnemonic dand to compute the bitwise and of two doubles. The complete list of mnemonics can be found in appendix A.



Programming for the Java Virtual Machine
Programming for the Javaв„ў Virtual Machine
ISBN: 0201309726
EAN: 2147483647
Year: 1998
Pages: 158
Authors: Joshua Engel

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net