From 2532434e58577464242715701d5e2b578c468347 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Sun, 10 Dec 2023 17:24:07 +0100 Subject: [PATCH] it just works, idc anymore --- src/Factorial.jas | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/Factorial.jas b/src/Factorial.jas index 3a9b9f5..41ba15f 100644 --- a/src/Factorial.jas +++ b/src/Factorial.jas @@ -44,25 +44,19 @@ .end method .method public static main([Ljava/lang/String;)V - .limit locals 3 + .limit locals 2 .limit stack 4 ; parse cli args to int aload 0 - aaload 0 + bipush 0 + aaload invokestatic java/lang/Integer/parseInt(Ljava/lang/String;)I istore 1 - ; format - iload 1 - ldc "! = " - iload 1 - invokestatic Factorial/factorial(I)I ; call factorial - invokevirtual java/lang/String/format(ILjava/lang/String;I)I - astore 2 - ; output getstatic java/lang/System/out Ljava/io/PrintStream; - aload 2 ; load formatted str - invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V + iload 1 + invokestatic Factorial/factorial(I)I ; call factorial + invokevirtual java/io/PrintStream/println(I)V return .end method