ECE 5465 group 6 / Mbed 2 deprecated Project_2

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
AkashGutha
Date:
Fri Mar 08 04:51:18 2019 +0000
Parent:
3:b11d25e57ddd
Commit message:
ADD div

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r b11d25e57ddd -r 050482cd9d95 main.cpp
--- a/main.cpp	Wed Mar 06 15:38:30 2019 +0000
+++ b/main.cpp	Fri Mar 08 04:51:18 2019 +0000
@@ -10,6 +10,10 @@
         ADDS d,s;}
 #define Thumb2_add(d,n,s) __asm {\
         ADDS d,n,s;}         
+#define Thumb_div(d,s) __asm {\
+        DIVS d,s;}
+#define Thumb2_div(d,n,s) __asm {\
+        DIVS d,n,s;}         
 
 
 int main() {
@@ -44,9 +48,19 @@
   printf("the answer is %d\n", r2);
   printf("The time taken for thumb2 add was %f seconds\n", t1.read());
   
-  
-
+  r1 = 0xA;
+  printf("\n");
+  t1.start();
+  Thumb_div(r1,r0);
+  t1.stop();
+  printf("the answer is %d\n", r1);
+  printf("The time taken for thumb div was %f seconds\n", t1.read());
   
-  
-  
+  r1=0xA;
+  printf("\n");
+  t1.start();
+  Thumb2_div(r2, r1,r0);
+  t1.stop();
+  printf("the answer is %d\n", r2);
+  printf("The time taken for thumb2 div was %f seconds\n", t1.read());
 }