[Asm2class-usage] [asm2class - asm2class usage] RE: Example of java assembly source
Status: Beta
Brought to you by:
boretti
From: SourceForge.net <no...@so...> - 2004-05-19 14:49:05
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=2577072 By: nobody // // 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 sum all argument of the Main and Divide by the number of argument // // // // Define a class named "org.boretti.asm2class.example.moyenne" // Lorg/boretti/asm2class/example/moyenne; : // // Define a method named "main" with String [] as parameter and no // return value. This method is public and static // * . main ([Ljava/lang/String;)V : fconst_0 // 0.0 fstore_1 // iconst_0 // 0 istore_2 // aload_0 // a arraylength // <t> dup // <t> <t> ifeq FIN // <t> SUM : dup // <t> <t> iload_2 // <t> <t> <2> if_icmple MOYENNE // <t> aload_0 // <t> a iload_2 // <t> a <2> aaload // <t> s invokestatic Ljava/lang/Float; (Ljava/lang/String;)Ljava/lang/Float; valueOf // <t> F invokevirtual Ljava/lang/Float; ()F floatValue // 1 // <t> f fload_1 // <t> f <1> fadd // <t> f fstore_1 // <t> iinc 2 1 // <t> goto SUM // <t> MOYENNE : fload_1 // <t> f swap // f <t> i2f // f f fdiv // f getstatic Ljava/lang/System; out Ljava/io/PrintStream; // f out swap // out f invokevirtual Ljava/io/PrintStream; (F)V println // return // FIN : pop // 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 |