Results 1 to 7 of 7
  1. #1
    ashok_jeev is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default calling Assembly language code from java using JNI

    hi im trying to call assembly language code from java using jni can anyone tell step by step procedure for a helloworld program

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    The most straightforward way would be to use c or c++ JNI bindings to do some trivial thing in c/c++ (like print "hello world"). Once you get that to work, then make the assembly call from c/c++.

  3. #3
    ashok_jeev is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default

    ya thats working but not with JNI with JInvoke anyway now how do i make call from c/c++ to assembly??

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,728
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by ashok_jeev View Post
    ya thats working but not with JNI with JInvoke anyway now how do i make call from c/c++ to assembly??
    You should check your c/c++ manual for that; it isn't a standard feature though so it can (and most likely will) differ per compiler. It definitely isn't a Java question.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    You'll have to check your compiler for specifics, but typically, you embed assembly into c using an "__asm" or "__asm__" block. Here's an example: Calling C Functions in Inline Assembly

  6. #6
    ashok_jeev is offline Member
    Join Date
    Feb 2011
    Posts
    3
    Rep Power
    0

    Default

    hey i need to generate dll from the assemble language code so that it can loaded into java program.. but i dont know how to generate dll from assembly lang code??
    guys any help??

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,728
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by ashok_jeev View Post
    hey i need to generate dll from the assemble language code so that it can loaded into java program.. but i dont know how to generate dll from assembly lang code??
    guys any help??
    All you have to do is assemble your code and use the linker to create a .dll file out of the assembled code; check the relevant manuals.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Calling Java from C++ code
    By franklyn@bellsouth.net in forum New To Java
    Replies: 1
    Last Post: 11-25-2010, 11:06 AM
  2. Inline JVM assembly in Java
    By youngstorm in forum Advanced Java
    Replies: 2
    Last Post: 09-15-2010, 08:14 PM
  3. Forgotten Assembly Language Commands
    By Nicholas Jordan in forum Entertainment
    Replies: 1
    Last Post: 04-06-2010, 06:00 AM
  4. calling c code from java
    By sara12345 in forum New To Java
    Replies: 14
    Last Post: 12-27-2009, 07:12 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •