forked from zenware/FizzBuzz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jasmin.j
57 lines (45 loc) · 756 Bytes
/
Jasmin.j
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
.class public Jasmin
.super java/lang/Object
.method public static main([Ljava/lang/String;)V
.limit locals 1
.limit stack 2
iconst_0
istore_0
loop:
iload_0
ldc 15
irem
ifeq fizzbuzz
iload_0
ldc 5
irem
ifeq buzz
iload_0
ldc 3
irem
ifeq fizz
getstatic java/lang/System/out Ljava/io/PrintStream;
iload_0
invokevirtual java/io/PrintStream/println(I)V
goto increment
fizzbuzz:
ldc "FizzBuzz"
goto stringprint
fizz:
ldc "Fizz"
goto stringprint
buzz:
ldc "Buzz"
goto stringprint
stringprint:
getstatic java/lang/System/out Ljava/io/PrintStream;
swap
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
goto increment
increment:
iinc 0 1
iload_0
ldc 100
if_icmple loop
return
.end method