[Asm2class-usage] [asm2class - asm2class usage] RE: Example of java assembly source
Status: Beta
Brought to you by:
boretti
From: SourceForge.net <no...@so...> - 2004-11-01 22:43:34
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2832457 By: boretti // // 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 // <i> dup // <i> <i> aload_0 // <i> <i> a arraylength // <i> <i> <Taille> iconst_m1 // <i> <i> <Taille> <-1> iadd // <i> <i> <Taille-1> if_icmpge FIN1 // <i> iconst_1 // <i> <1> iadd // <i+1> istore_2 // BOUCLE2 : iload_2 // <j> aload_0 // <j> <a> arraylength // <j> <Taille> if_icmpge FIN2 // aload_0 // <a> iload_1 // <a> <i> aaload // <a[i]> invokestatic Ljava/lang/Integer; (Ljava/lang/String;)Ljava/lang/Integer; valueOf // <a[i]> invokevirtual Ljava/lang/Integer; ()I intValue // 1 // <a[i]> aload_0 // <a[i]> <a> iload_2 // <a[i]> <a> <j> aaload // <a[i]> <a[j]> invokestatic Ljava/lang/Integer; (Ljava/lang/String;)Ljava/lang/Integer; valueOf // <a[i]> <a[j]> invokevirtual Ljava/lang/Integer; ()I intValue // 1 // <a[i]> <a[j]> if_icmple FINX // aload_0 // <a> dup // <a> iload_1 // <a> <a> <i> aaload // <a> <a[i]> aload_0 // <a> <a[i]> <a> dup // <a> <a[i]> <a> <a> iload_2 // <a> <a[i]> <a> <a> <j> aaload // <a> <a[i]> <a> <a[j]> iload_1 // <a> <a[i]> <a> <a[j]> <i> swap // <a> <a[i]> <a> <i> <a[j]> aastore // <a> <a[i]> iload_2 // <a> <a[i]> <j> swap // <a> <i> <a[i]> aastore // FINX : iinc 2 1 goto BOUCLE2 FIN2 : iinc 1 1 goto BOUCLE1 FIN1 : pop iconst_0 istore_1 LOOP : iload_1 // <j> aload_0 // <j> <a> arraylength // <j> <Taille> if_icmpge FINLOOP // getstatic Ljava/lang/System; out Ljava/io/PrintStream; // <Stream> aload_0 // <Stream> <a> iload_1 // <Stream> <a> <i> aaload // <Stream> <a[i]> invokevirtual Ljava/io/PrintStream; (Ljava/lang/String;)V println // iinc 1 1 goto LOOP FINLOOP : FIN : return // ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=373524 |