java assembler?? for Javap utility??

Discussion in 'Java' started by TenderHeart, Apr 29, 2005.

  1. TenderHeart

    TenderHeart Guest

    when a small program like

    class Hello{

    public static void main(String arg[])

    {

    System.out.println("HEllo World");

    }

    }

    was compiled and then the i took the java byte code instruction
    through JAVAP option
    the byte code instructions for the above program was

    Compiled from "Hello.java"
    class Hello extends java.lang.Object{
    Hello();
    Code:
    0: aload_0
    1: invokespecial #1; //Method java/lang/Object."<init>":()V
    4: return

    public static void main(java.lang.String[]);
    Code:
    0: getstatic #2; //Field
    java/lang/System.out:Ljava/io/PrintStream;
    3: ldc #3; //String HEllo World
    5: invokevirtual #4; //Method
    java/io/PrintStream.println:(Ljava/lang/Str
    ing;)V
    8: return

    }
    without giving the program "Hello.java"
    to the JVM how can i run the "Hello" program through JVM by giving the
    above byte code instructions "which was gained by using the javap
    option" to the JVM??


    basicaly I want to get the output of "Hello World" by giving the below
    byte code instructions to the JVM
    (what I need to do is that assemble the byte code which was
    disassembled
    and make it to the .class format so I can run the above programme
    through JVM )

    Compiled from "Hello.java"
    class Hello extends java.lang.Object{
    Hello();
    Code:
    0: aload_0
    1: invokespecial #1; //Method java/lang/Object."<init>":()V
    4: return

    public static void main(java.lang.String[]);
    Code:
    0: getstatic #2; //Field
    java/lang/System.out:Ljava/io/PrintStream;
    3: ldc #3; //String HEllo World
    5: invokevirtual #4; //Method
    java/io/PrintStream.println:(Ljava/lang/Str
    ing;)V
    8: return

    }

    If somebodyt know about a java tool I can use to assemble the code wich
    i disassembled please advice me!!!!

    my e-mail:

    thanks

    - Malinda
    TenderHeart, Apr 29, 2005
    #1
    1. Advertising

  2. TenderHeart wrote:
    > If somebodyt know about a java tool I can use to assemble the code wich
    > i disassembled please advice me!!!!


    I don't think there are any programs that turn /javap/ output into a
    classfile, but there are other java assemblers. See google:
    http://www.google.com/search?hl=en&q=java assembler

    --
    Daniel Sjöblom
    Remove _NOSPAM to reply by mail
    =?ISO-8859-1?Q?Daniel_Sj=F6blom?=, Apr 29, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chandresh Prakash
    Replies:
    1
    Views:
    1,924
    Jeffrey Palm
    Dec 5, 2003
  2. Deshaies
    Replies:
    8
    Views:
    488
    Roedy Green
    Apr 26, 2004
  3. Albretch
    Replies:
    4
    Views:
    897
    Larry Barowski
    Oct 2, 2004
  4. S.Marion

    javap issue

    S.Marion, Feb 28, 2006, in forum: Java
    Replies:
    5
    Views:
    893
    Thomas Hawtin
    Feb 28, 2006
  5. ram
    Replies:
    5
    Views:
    944
Loading...

Share This Page