Wednesday, September 24, 2008

Title: Question #:2

Research in the net usual applications done in assembly language. Describe these applications briefly and cite the efficiency and effectiveness of these applications.

Include your reference. REFRAIN FROM COPYING AND PASTING THE ENTIRE TEXTS.


Answer:
Launch Java Applications from Assembly Language Programs

by Biswajit Sarkar

Java Native Interface (JNI) is a mechanism that can be used to establish communication between native language programs and the Java virtual machine. The documentation for JNI and the technical literature on JNI deal extensively with interactions between the JVM and C/C++ code. The Java SDK even provides a utility to generate a header file to facilitate calling C/C++ programs from Java code. However, there is hardly any mention of Java and assembly language code working together. In an earlier article I showed how assembly language programs can be called from Java applications. Here I deal with the technique for invoking Java programs from an ASM process through a demo application that calls a Java method from assembly language code. The Java method brings up a Swing JDialog to show that it has, indeed, been launched.

Note that the technique shown here can also be used to call Java code from languages other than ASM. If JInvoke is rewritten as a .dll, code written in FORTRAN, for instance, can link to it and call a Java method.

I have used JNI with legacy ASM code in two ways:

  • Functional enhancement: Mail-enabling an existing ASM application, as mentioned earlier.
  • Interface enhancement: Adding interactive user interface (mostly AWT, but some Swing as well).

These enhanced applications have run on Windows 2000 and XP. The Java versions used


whttp://blogs.sun.com/CoreJavaTechTips/entry/launch_java_applications_from_assemblyere 1.3, 1.4, and 1.6. In all cases the applications worked smoothly.



Due: Sept. 17, 2008.

No comments: