Content deleted Content added
Tag: possible conflict of interest |
→Instructions: suffixes for load_ and store_ only go up to 3 not 4 |
||
Line 19:
There are also a few instructions for a number of more specialized tasks such as exception throwing, synchronization, etc.
Many instructions have prefixes and/or suffixes referring to the types of operands they operate on. These are "i", "l", "s", "b", "c", "f", "d", and "a", standing for, respectively, "integer", "long", "short", "byte", "character", "float", "double", and "reference". For example, "iadd" will add two integers, while "dadd" will add two doubles. The "const", "load", and "store" instructions may also take a suffix of the form "_''n''", where ''n'' is a number from 0-
The "const" instructions push a value of the specified type onto the stack. For example "iconst_5" will push an integer 5, while "dconst_1" will push a double 1. There is also an "aconst_null", which pushes "null". The ''n'' for the "load" and "store" instructions specifies the ___location in the variable table to load from or store to. The "aload_0" instruction pushes the object in variable 0 onto the stack (this is usually the "this" object). "istore_1" stores the integer on the top of the stack into variable 1. For variables with higher numbers the suffix is dropped and operators must be used.
|