conversion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mia023
    New Member
    • May 2007
    • 89

    #1

    conversion

    is there any program that convert from java into assembley(ex. MIPS) or vice verca
  • sukatoa
    Contributor
    • Nov 2007
    • 539

    #2
    Just a suggestion,

    Convert Java to C++ -Google knows it,
    Convert C++ to C -Google knows it also,
    You may read this article. -about C to Assembly Language Converter

    better to master specific assembler(the requirement) instructions and its techniques.

    regards,
    sukatoa

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Originally posted by mia023
      is there any program that convert from java into assembley(ex. MIPS) or vice verca
      Sun's (and other) JVMs (Java Virtual Machine) already do that for you: a Java
      compiler compiles Java source code to 'byte code', a machine code for a virtual
      machine. After such code is loaded and executed (interpreted by the JVM) it is
      monitored by a 'hotspot' mechanism.

      After it has decided that a particular code will probably be interpreted frequently
      it fires off a JIT (Just In Time) compiler that translates (compiles) the byte codes
      for the virtual machine to real machine code. This JIT compiler differs per processor
      for obvious reasons.

      From that moment on nothing is interpreted by the JVM anymore: the CPU itself
      executes that piece of code. There are two JVMs: a 'client' version and a 'server'
      version. The first one acts a bit more conservative w.r.t. JIT compilation while the
      second one aggressively uses the JIT compiler so it executes compiled Java code
      faster than the other one. There is no need to play with external compilers anymore:
      the JVM can do the job fine. In fact it can produce more optimized code than a
      static compiler can because it 'knows' more about the code than a static compiler
      does, IOW, the task of compilation has been split in two parts:

      a) compilation from source code to byte code;
      b) translation from byte code to machine code.

      Modern JVMs can easily compete and are even faster than good C or C++ compilers.

      kind regards,

      Jos

      Comment

      Working...