diff options
Diffstat (limited to 'lisc/test/cprime.ssa')
-rw-r--r-- | lisc/test/cprime.ssa | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lisc/test/cprime.ssa b/lisc/test/cprime.ssa index 9b953c4..1f8e972 100644 --- a/lisc/test/cprime.ssa +++ b/lisc/test/cprime.ssa @@ -2,7 +2,8 @@ # compiler from the C program # following in comments -@start +function $test { + @start %v0 =l alloc8 4 %v1 =l alloc8 4 %v2 =l alloc8 4 @@ -11,71 +12,72 @@ storew 5, %v1 storew 11, %v2 storew 12, %v3 -@L0 + @L0 %v5 =w load %v1 %v6 =w cne %v5, 10001 jnz %v6, @L8, @L1 -@L8 + @L8 storew 1, %v4 %v7 =w load %v3 %v8 =w rem %v7, 2 %v9 =w ceq %v8, 0 jnz %v9, @L9, @L5 -@L9 + @L9 storew 0, %v4 -@L5 + @L5 storew 3, %v0 -@L2 + @L2 %v10 =w load %v0 %v11 =w load %v3 %v12 =w cslt %v10, %v11 jnz %v12, @L10, @L3 -@L10 + @L10 %v13 =w load %v3 %v14 =w load %v0 %v15 =w rem %v13, %v14 %v16 =w ceq %v15, 0 jnz %v16, @L11, @L4 -@L11 + @L11 storew 0, %v4 jmp @L3 -@L4 + @L4 %v17 =w load %v0 %v18 =w add %v17, 2 storew %v18, %v0 jmp @L2 -@L3 + @L3 %v19 =w load %v4 jnz %v19, @L12, @L6 -@L12 + @L12 %v20 =w load %v3 storew %v20, %v2 %v21 =w load %v1 %v22 =w add %v21, 1 storew %v22, %v1 -@L6 + @L6 %v23 =w load %v3 %v24 =w add %v23, 1 storew %v24, %v3 jmp @L0 -@L1 + @L1 %v25 =w load %v2 %v26 =w cne %v25, 104743 jnz %v26, @L13, @L7 -@L13 + @L13 storew 1, $a ret -@L7 + @L7 storew 0, $a ret -@end + @end ret +} # int # main() # { # int i, n, p, next, isprime; -# +# # n = 5; # p = 11; # next = 12; |