// // 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 class sort all argument (integer) and display the result // // // // Define a class named "org.boretti.asm2class.example.tri.tri1" // Lorg/boretti/asm2class/example/tri/tri1; : // // Define a method named "main" with String [] as parameter and no // return value. This method is public and static // * . main ([Ljava/lang/String;)V : iconst_0 // <0> istore_1 // iconst_0 // <0> istore_2 // BOUCLE1 : iload_1 // dup // aload_0 // a arraylength // iconst_m1 // <-1> iadd // if_icmpge FIN1 // iconst_1 // <1> iadd // istore_2 // BOUCLE2 : iload_2 // aload_0 // arraylength // if_icmpge FIN2 // aload_0 // iload_1 // aaload // invokestatic Ljava/lang/Integer; (Ljava/lang/String;)Ljava/lang/Integer; valueOf // invokevirtual Ljava/lang/Integer; ()I intValue // 1 // aload_0 // iload_2 // aaload // invokestatic Ljava/lang/Integer; (Ljava/lang/String;)Ljava/lang/Integer; valueOf // invokevirtual Ljava/lang/Integer; ()I intValue // 1 // if_icmple FINX // aload_0 // dup // iload_1 // aaload // aload_0 // dup // iload_2 // aaload // iload_1 // swap // aastore // iload_2 // swap // aastore // FINX : iinc 2 1 goto BOUCLE2 FIN2 : iinc 1 1 goto BOUCLE1 FIN1 : pop iconst_0 istore_1 LOOP : iload_1 // aload_0 // arraylength // if_icmpge FINLOOP // getstatic Ljava/lang/System; out Ljava/io/PrintStream; // aload_0 // iload_1 // aaload // invokevirtual Ljava/io/PrintStream; (Ljava/lang/String;)V println // iinc 1 1 goto LOOP FINLOOP : FIN : return //