ECE 5465 group 6 / Mbed 2 deprecated Project_2

Dependencies:   mbed

main.cpp

Committer:
zonzon14
Date:
2019-03-02
Revision:
2:83422444c6e5
Parent:
1:4c0da981b35e
Child:
3:b11d25e57ddd

File content as of revision 2:83422444c6e5:

#include "mbed.h"

Timer t1;
Timer t2;
#define Thumb_mult(d,s) __asm {\
        MULS d,s;}
#define Thumb2_mult(d,m,s) __asm {\
        MULS d,m,s;}        



int main() {
 
  register uint32_t r0= 0xA;
  register uint32_t r1= 0x3;
  register uint32_t r2= 0x0;
  t1.start();
  Thumb_mult(r1,r0);
  t1.stop();
  printf("The time taken was %f milliseconds\n", t1.read()/1000);
  t2.start();
  Thumb2_mult(r2,r1,r0);
  t2.stop();
  printf("The time taken was %f milliseconds\n", t2.read()/1000);
  
  
  
}