Wednesday, January 27, 2010

Letter To Cousin Inviting To

Invoking Java programs from ASM

Several months ago I sent a portal to JavaHispano tutorial which explained how to do to invoke functions written in assembly language from Java. And as I spent more than three months since then, I can use on my blog: D.
Here is the content and the first two parts to give you an idea, also I leave the source code and the PDF of the tutorial. Content




Introduction When to use JNI?


Software Requirements


Programming

Implementation
  1. Conclusion References and readings
  2. 1. Introduction
  3. In the java.net site there is a small tutorial titled Invoking Assembly Language Programs from Java 1
  4. but English is not very easy for some new Java programmers or assembler. In java.net explain how the invocation of an ASM program from Java and what to do to achieve it, but do not explain how to do each step. So I've taken on the task of facilitating the understanding of these techniques for the English speakers who are taking their first steps with JNI, and to know a little JNI operation and invocation of applications in assembly is essential when you have applications require intensive operations and server process need to deploy a small low-level program to execute such operations, and thereby reduce the time as it may sometimes be critical.
  5. Also JNI have the ability to invoke functions and procedures written in other languages \u200b\u200bsuch as C / C + + or in our case ASM, for example, when you have legacy systems and will need to use some function of the legacy code will be necessary to develop applications that can perform these functions. For more information on JNI and capabilities please consult the manual available on your site 2 Sun.
  6. should be noted that this is not an introductory tutorial or API JNI therefore be limited to mention a few concepts necessary. Quickly, begin to determine the software that we use and where to get it, but we will not stop to learn how to operate them. Later add some environment variables and start with programming. For this, we present the programs and how to compile, but will be available the source code used in the tutorial. By following this tutorial the reader should be able to load a DLL into any Java application and use the proceeds of any native library.
  7. 2. When to use JNI?
  8. Occasionally, some developers are touch found in situations where an application made entirely in Java will not cover all requirements for such. Some examples of these situations can be:
  9. When in spite of wanting to write the whole application in Java to allow cross-platform compatibility, exit platform features that are necessary to implement and are not supported by the Java standard library . This is referred to as a dependency of the platform.
If you already have a library written in another language and want to make it accessible to your Java code, for example, having to work with legacy code. in these cases the libraries are loaded within the same process using JNI apliaciones, although other more efficient mechanisms operating in separate processes.
If you want to implement portions of code in a low level language like assembly to reduce processing time. For example, in applications that require 3D graphics rendering requires more processing time, will have to write a graphics library in assembly language for better performance 3.
In cases where you want to load a native library in an existing process to avoid the cost of starting a new process and load the library in the same 4 . Also
JNI will be convenient to use when you want to use some features of a Java program from a native code.


Document Invoking Java programs give yourself ASM step
Source
Javahispano
    The tutorial

0 comments:

Post a Comment