it just works, idc anymore
This commit is contained in:
parent
9edefd8877
commit
2532434e58
|
@ -44,25 +44,19 @@
|
||||||
.end method
|
.end method
|
||||||
|
|
||||||
.method public static main([Ljava/lang/String;)V
|
.method public static main([Ljava/lang/String;)V
|
||||||
.limit locals 3
|
.limit locals 2
|
||||||
.limit stack 4
|
.limit stack 4
|
||||||
; parse cli args to int
|
; parse cli args to int
|
||||||
aload 0
|
aload 0
|
||||||
aaload 0
|
bipush 0
|
||||||
|
aaload
|
||||||
invokestatic java/lang/Integer/parseInt(Ljava/lang/String;)I
|
invokestatic java/lang/Integer/parseInt(Ljava/lang/String;)I
|
||||||
istore 1
|
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
|
; output
|
||||||
getstatic java/lang/System/out Ljava/io/PrintStream;
|
getstatic java/lang/System/out Ljava/io/PrintStream;
|
||||||
aload 2 ; load formatted str
|
iload 1
|
||||||
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
|
invokestatic Factorial/factorial(I)I ; call factorial
|
||||||
|
invokevirtual java/io/PrintStream/println(I)V
|
||||||
return
|
return
|
||||||
.end method
|
.end method
|
||||||
|
|
Loading…
Reference in New Issue