Friday 5 October 2012

65.Java Bytecode


Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode opcode is one byte in length, although some require parameters, resulting in some multi-byte instructions. Not all of the possible 256 opcodes are used. 51 are reserved for future use. Beyond that, Sun Microsystems, the original creators of the Java programming language, the Java virtual machine and other components of the Java Runtime Environment (JRE), have set aside three values to be permanently unimplemented.
A Java programmer does not need to be aware of or understand Java bytecode at all. However, as suggested in the IBM developerWorks journal, "Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembly helps the C or C++ programmer."

As each byte has 256 potential values, there are 256 possible opcodes. Of these, 0x00 through 0xca, 0xfe, and 0xff are assigned values. 0xca is reserved as a breakpoint instruction for debuggers and is not used by the language. Similarly, 0xfe and 0xff are not used by the language, and are reserved for internal use by the virtual machine.
Instructions fall into a number of broad groups:
Load and store (e.g. aload_0,istore)
Arithmetic and logic (e.g. ladd,fcmpl)
Type conversion (e.g. i2b,d2i)
Object creation and manipulation (new,putfield)
Operand stack management (e.g. swap,dup2)
Control transfer (e.g. ifeq,goto)
Method invocation and return (e.g. invokespecial,areturn)
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 as follows:
Prefix/Suffix Operand Type
i integer
l long
s short
b byte
c character
f float
d double
a reference

Er Ratnesh Porwal
Software Engineer
www.AeroSoftCorp.com
www.AeroSoft.in
www.AeroSoft.co.in
www.AeroSoftseo.com
On Line Assistence    :
Gtalk                          :   ratnesh.aerosoft@gmail.com
Y! Messenger                   :   ratnesh.AeroSoft@yahoo.com
Rediff Bol                  ratnesh.AeroSoft@rediffmail.com


Best Study Materials JAVA,
Java Tutorials PDF,
Java SCJP Questions,
Java Material Free Download,
Gate Study Material Free,
Java Tutorial Download,
SCJP Materials
Core Java Programming Questio…
SCJP Certification  



  1. Index of /machaviatrix/contactus/images - AeroSoftSEO

    aerosoftseo.com/machaviatrix/contactus/images/
    25 Jun 2012 – Index of /machaviatrix/contactus/images. Name Last modified Size ...machaviatrix.jpg 25-Jun-2012 15:50 84k [IMG] news.png 25-Jun-2012 ...
  2. Malaysian Flying Academy, Malaysia, Asia, Pilot ... - AeroSoftSEO

    aerosoftseo.com/machaviatrix/country/Malaysia/
    (http://www.dca.gov.my/... Mach Aviatrix provides its Malaysian students a choice of 165 hours and 180 ... What Do You Get If You Enroll With Mach Aviatrix!


No comments:

Post a Comment