0 Replies Latest reply on Aug 30, 2012 7:11 AM by anush.shet

    Inline assembly for PSoC5 project

    anush.shet

       There was a requirement to write assembly code for PSoC5 project and since the compiler is ARM GCC the inline assemblty code goes as below

         

       

         
      asm( "mov     r0, r0\n\t" "mov     r0, r0\n\t" "mov     r0, r0\n\t" "mov     r0, r0" ); 
         
      The above assembly code is just 4 NOP.  For single NOP it will look like  
      asm( "mov     r0, r0");  I know its hard to learn assembly. So if you need to write assembly instructions, do these steps- Install Notepad++ Write a code in C Build the project In the generated files go to directory Cortex- M3->ARM_GCC_441->Debug Open main.lst using Notepad++- here you can see how each C code is made up of assembly instructions You can optimise the code and replace the C code with asembly