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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
.class public Lcom/example/BytecodeDemo;
.super Ljava/lang/Object;
.method public constructor <init>()V
.registers 1
# Data handling
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const-string v1, "Hello, World!"
invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
return-void
.end method
.method public static add(I I)I
.registers 2
# Arithmetic and logic operations
add-int v0, p0, p1
return v0
.end method
.method public static multiply(I I)I
.registers 3
# Arithmetic and logic operations
mul-int v0, p0, p1
return v0
.end method
.method public static compare(I I)Z
.registers 3
# Arithmetic and logic operations
cmp-long v0, p0, p1
if-nez v0, :cond_0
const/4 v0, 0x1
return v0
:cond_0
const/4 v0, 0x0
return v0
.end method
.method public static loop(I)V
.registers 3
# Control flow operations
const/16 v0, 0x0
:goto_0
if-gez p0, :cond_0
invoke-static {p0}, Lcom/example/BytecodeDemo;->add(I)I
move-result p0
add-int/lit8 v0, v0, 1
goto :goto_0
:cond_0
return-void
.end method
.method public static printArray([Ljava/lang/String;)V
.registers 3
# Control flow operations
const/4 v0, 0x0
array-length v1, p0
if-gez p0, :cond_0
goto :goto_1
:loop_0
aget-object v2, p0, v0
sget-object v3, Ljava/lang/System;->out:Ljava/io/PrintStream;
invoke-virtual {v3, v2}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
add-int/lit8 v0, v0, 1
goto :loop_0
:cond_0
return-void
:goto_1
return-void
.end method
|