From e4748e998453b979af46983a079f2ec3d307ada4 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 2 Mar 2010 19:10:56 +0000 Subject: restored gfcc example (GF C compiler) --- examples/gfcc/runtime.j | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 examples/gfcc/runtime.j (limited to 'examples/gfcc/runtime.j') diff --git a/examples/gfcc/runtime.j b/examples/gfcc/runtime.j new file mode 100644 index 000000000..88db0b9b8 --- /dev/null +++ b/examples/gfcc/runtime.j @@ -0,0 +1,55 @@ +.class public runtime +.super java/lang/Object +; +; standard initializer +.method public ()V + aload_0 + invokenonvirtual java/lang/Object/()V + return +.end method + +.method public static ilt(II)I +.limit locals 2 +.limit stack 2 + iload_0 + iload_1 + if_icmpge Label0 + iconst_1 + ireturn + Label0: + iconst_0 + ireturn +.end method + +.method public static flt(FF)I +.limit locals 2 +.limit stack 2 + fload_0 + fload_1 + fcmpl + ifge Label0 + iconst_1 + ireturn + Label0: + iconst_0 + ireturn +.end method + +.method public static iprintf(I)V +.limit locals 1 +.limit stack 1000 + getstatic java/lang/System/out Ljava/io/PrintStream; + iload_0 + invokevirtual java/io/PrintStream/println(I)V + return +.end method + +.method public static fprintf(F)V +.limit locals 1 +.limit stack 1000 + getstatic java/lang/System/out Ljava/io/PrintStream; + fload_0 + invokevirtual java/io/PrintStream/println(F)V + return +.end method + -- cgit v1.2.3