summary refs log tree commit diff
path: root/lisc/test
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-08-25 12:10:52 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-09-15 23:01:32 -0400
commit8f2922eb1a9155b0097fb09854f267ddb17ed2dd (patch)
treed509c2422598ee1e29d52d84de8b55fbd8a8ee03 /lisc/test
parent81b25dbe0b11e07c023a76912f72219e34ba9c19 (diff)
downloadroux-8f2922eb1a9155b0097fb09854f267ddb17ed2dd.tar.gz
add source and authorship to cprime.ssa
Diffstat (limited to 'lisc/test')
-rw-r--r--lisc/test/cprime.ssa35
1 files changed, 35 insertions, 0 deletions
diff --git a/lisc/test/cprime.ssa b/lisc/test/cprime.ssa
index dbc2f72..9b953c4 100644
--- a/lisc/test/cprime.ssa
+++ b/lisc/test/cprime.ssa
@@ -1,3 +1,7 @@
+# generated by Andrew Chambers'
+# compiler from the C program
+# following in comments
+
 @start
 	%v0 =l alloc8 4
 	%v1 =l alloc8 4
@@ -66,3 +70,34 @@
 	ret
 @end
 	ret
+
+# int
+# main()
+# {
+#         int i, n, p, next, isprime;
+#        
+#         n = 5;
+#         p = 11;
+#         next = 12;
+#         while(n != 10001) {
+#                 isprime = 1;
+#                 if(next % 2 == 0) {
+#                         isprime = 0;
+#                 } else {
+#                         for(i = 3; i < next; i = i + 2) {
+#                                 if(next % i == 0) {
+#                                         isprime = 0;
+#                                         break;
+#                                 }
+#                         }
+#                 }
+#                 if(isprime) {
+#                         p = next;
+#                         n = n + 1;
+#                 }
+#                 next = next + 1;
+#         }
+#         if(p != 104743)
+#                 return 1;
+#         return 0;
+# }