// // Copyright (C) 2004 Boretti Mathieu // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // // This file is a simply HelloWorld in java assembly java // // // Define a class named "org.boretti.asm2class.example.HelloWorld" // Lorg/boretti/asm2class/example/HelloWorld; : // // Define a method named "main" with String [] as parameter and no // return value. This method is public and static // * . main ([Ljava/lang/String;)V : // // Push the static field "out" from class java.lang.System // that is of type java.io.PrintStream onto the stack // getstatic Ljava/lang/System; out Ljava/io/PrintStream; // // Push String "HelloWorld" onto the stack // ldc "HelloWorld" // // Invoke virtual method named "println" from class // java.io.PrintStream with parameter java.lang.String // and no return value // invokevirtual Ljava/io/PrintStream; (Ljava/lang/String;)V println // // Return from this method // return