author | Christian Urban <christian.urban@kcl.ac.uk> |
Tue, 17 Nov 2020 00:36:16 +0000 | |
changeset 806 | 0d3bc1d0d987 |
parent 710 | 183663740fb7 |
permissions | -rw-r--r-- |
93
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
|
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
2 |
.class public loops.loops |
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
.super java/lang/Object |
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
|
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
.method public static write(I)V |
710 | 6 |
.limit locals 1 |
7 |
.limit stack 2 |
|
93
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
getstatic java/lang/System/out Ljava/io/PrintStream; |
710 | 9 |
iload 0 |
10 |
i2c ; Int => Char |
|
11 |
invokevirtual java/io/PrintStream/print(C)V ; println(I)V => print(C)V |
|
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
12 |
return |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
93
diff
changeset
|
13 |
.end method |
93
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
|
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
.method public static main([Ljava/lang/String;)V |
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
.limit locals 200 |
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
.limit stack 200 |
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
|
710 | 19 |
; COMPILED CODE STARTS |
93
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
20 |
|
710 | 21 |
ldc 200000 |
22 |
istore 0 ; start |
|
23 |
iload 0 |
|
24 |
istore 1 ; x1 |
|
25 |
iload 0 |
|
26 |
istore 2 ; x2 |
|
27 |
iload 0 |
|
28 |
istore 3 ; x3 |
|
29 |
Loop_begin_90: |
|
30 |
ldc 0 |
|
31 |
iload 1 |
|
32 |
if_icmpge Loop_end_91 |
|
33 |
Loop_begin_92: |
|
34 |
ldc 0 |
|
35 |
iload 2 |
|
36 |
if_icmpge Loop_end_93 |
|
37 |
Loop_begin_94: |
|
38 |
ldc 0 |
|
39 |
iload 3 |
|
40 |
if_icmpge Loop_end_95 |
|
41 |
iload 3 |
|
42 |
ldc 1 |
|
43 |
isub |
|
44 |
istore 3 ; x3 |
|
45 |
;; test start |
|
46 |
bipush 1 |
|
47 |
bipush 1 |
|
48 |
bipush 1 |
|
49 |
bipush 1 |
|
50 |
pop |
|
51 |
pop |
|
52 |
pop |
|
53 |
pop |
|
54 |
;; test end |
|
55 |
goto Loop_begin_94 |
|
56 |
Loop_end_95: |
|
57 |
iload 0 |
|
58 |
istore 3 ; x3 |
|
59 |
iload 2 |
|
60 |
ldc 1 |
|
61 |
isub |
|
62 |
istore 2 ; x2 |
|
63 |
goto Loop_begin_92 |
|
64 |
Loop_end_93: |
|
65 |
iload 0 |
|
66 |
istore 2 ; x2 |
|
67 |
iload 1 |
|
68 |
ldc 1 |
|
69 |
isub |
|
70 |
istore 1 ; x1 |
|
71 |
goto Loop_begin_90 |
|
72 |
Loop_end_91: |
|
93
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
73 |
|
710 | 74 |
; COMPILED CODE ENDS |
93
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
75 |
return |
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
76 |
|
4794759139ea
better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
77 |
.end method |