progs/fib.j
author Christian Urban <urbanc@in.tum.de>
Wed, 28 Nov 2018 23:45:37 +0000
changeset 612 7a12053567d4
parent 609 e33545bb2eba
child 617 f7de0915fff2
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 fib.fib
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 <init>()V
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
     6
   aload_0
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
     7
   invokenonvirtual java/lang/Object/<init>()V
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
     8
   return
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
.end method
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    11
.method public static write(I)V 
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    12
    .limit locals 1 
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    13
    .limit stack 2 
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    14
    getstatic java/lang/System/out Ljava/io/PrintStream; 
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    15
    iload 0
612
7a12053567d4 updated
Christian Urban <urbanc@in.tum.de>
parents: 609
diff changeset
    16
    i2c
7a12053567d4 updated
Christian Urban <urbanc@in.tum.de>
parents: 609
diff changeset
    17
    invokevirtual java/io/PrintStream/print(C)V 
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    18
    return 
207
f824e1331fc6 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    19
.end method
f824e1331fc6 added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 93
diff changeset
    20
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
.method public static main([Ljava/lang/String;)V
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    22
   .limit locals 200
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    23
   .limit stack 200
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
609
e33545bb2eba updated
Christian Urban <urbanc@in.tum.de>
parents: 600
diff changeset
    25
ldc 10
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    26
istore 0
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    27
ldc 0
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    28
istore 1
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    29
ldc 1
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    30
istore 2
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    31
ldc 0
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    32
istore 3
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    33
609
e33545bb2eba updated
Christian Urban <urbanc@in.tum.de>
parents: 600
diff changeset
    34
Loop_begin_0:
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    36
ldc 0
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    37
iload 0
609
e33545bb2eba updated
Christian Urban <urbanc@in.tum.de>
parents: 600
diff changeset
    38
if_icmpge Loop_end_1
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    39
iload 2
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    40
istore 3
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    41
iload 1
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    42
iload 2
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    43
iadd
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    44
istore 2
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    45
iload 3
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    46
istore 1
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    47
iload 0
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    48
ldc 1
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    49
isub
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    50
istore 0
609
e33545bb2eba updated
Christian Urban <urbanc@in.tum.de>
parents: 600
diff changeset
    51
goto Loop_begin_0
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    52
609
e33545bb2eba updated
Christian Urban <urbanc@in.tum.de>
parents: 600
diff changeset
    53
Loop_end_1:
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    54
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    55
iload 1
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    56
invokestatic fib/fib/write(I)V
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    57
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    58
600
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    59
   return
d488a3e7b0ec updated
Christian Urban <urbanc@in.tum.de>
parents: 545
diff changeset
    60
93
4794759139ea better organised
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    61
.end method