summaryrefslogtreecommitdiff
path: root/valid/code-0010.smali
blob: 7517f879d789de36213df592e03d90592d2ed3ea (plain)
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

.class public LSmaliDemo;
.super Ljava/lang/Object;

.method public static main([Ljava/lang/String;)V
    .locals 7

    # Data handling
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
    const-string v1, "Hello, Smali!"
    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    # Arithmetic and logic operations
    const v2, 5
    const v3, 3
    add-int/lit8 v4, v2, 2
    mul-int v5, v2, v3
    rem-int v6, v4, v5

    # Control flow operations
    if-eqz v6, :cond_true
    goto :cond_false

:cond_true
    const-string v7, "Result is zero"
    goto :print_result

:cond_false
    const-string v7, "Result is not zero"

:print_result
    invoke-virtual {v0, v7}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    return-void
.end method