fix a minor bug in the fleeterpreter ; add a bubble sort program
[fleet.git] / src / edu / berkeley / fleet / slipway / test.c
index 9f450c9..5d8154a 100644 (file)
@@ -70,6 +70,8 @@ uint64_t inst(int boxname, int tokenin, int datain, int latch, int dataout, int
 int main(int argc, char** argv) {
   char c;
   uint32 i,j;
+  int64_t result;
+  int64_t temp;
   printf("hello.\n");
   fd = open(argv[1], O_RDWR);
   printf("open %s = %d\n", argv[1], fd);
@@ -84,43 +86,16 @@ int main(int argc, char** argv) {
     }
   }
 
-  //send(0x03, 0x101010);
-  //send(0x00, 0x101010);
-  //send(0x01, 0x010101);
-  /*
-  send(0x06, 0x22);
-  send(0x02, 0x22);
-  send(0x04,
-       inst(0x01, 0, 1, 1, 1, 0, 1, 0x00)
-       );
-  */
-  /*
-  if (argc > 3)
-    send(27, atoi(argv[3]));
-  if (argc > 4)
-    send(7, atoi(argv[4]));
-  */
   printf("\n===================================================================\n\n");
-  /*
-  sendc(0x00);
-  sendc(12);
-  sendc(12);
-  sendc(0x06);
-  */
-
-  //  for( j=0; j<16; j++) {
-  i = recvc();
-  printf("result: %d / %x \n", i, i);
-  i = recvc();
-  printf("result: %d / %x \n", i, i);
-  i = recvc();
-  printf("result: %d / %x \n", i, i);
-  i = recvc();
-  printf("result: %d / %x \n", i, i);
-  i = recvc();
-  printf("result: %d / %x \n", i, i);
-  i = recvc();
-  printf("result: %d / %x \n", i, i);
-  //  }
+  while(1) {
+    result = 0;
+    for(j=0; j<6; j++) {
+      temp = recvc();
+      temp = temp << (j * 8);
+      result = result | temp;
+    }
+    printf("%lld = 0x%llx\n", result, result);
+    fflush(stdout);
+  }
   return 0;
 }