progs/while/test-small.j
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 24 Sep 2021 23:56:31 +0100
changeset 839 7af70f9b30ab
parent 809 2b9956d29038
child 850 ea320c9427d2
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
808
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
.class public test.test
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     2
.super java/lang/Object
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     3
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     4
.method public static write(I)V 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
    .limit locals 1 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     6
    .limit stack 2
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     7
    getstatic java/lang/System/out Ljava/io/PrintStream; 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     8
    iload 0 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     9
    invokevirtual java/io/PrintStream/println(I)V 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    10
    return 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    11
.end method
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    12
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    13
.method public static main([Ljava/lang/String;)V
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    14
   .limit locals 200
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    15
   .limit stack 200
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    16
809
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    17
   ; 1 + ((2 * 3) + (4 - 3))
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    18
   ldc 1       
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    19
   ldc 2
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    20
   ldc 3
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    21
   imul
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    22
   ldc 4
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    23
   ldc 3
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    24
   isub
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    25
   iadd
2b9956d29038 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 808
diff changeset
    26
   iadd
808
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    27
   invokestatic test/test/write(I)V 
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    28
   return
ba3edaf7dc49 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    29
.end method