Inline assembly for PSoC5 project

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

 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
0 Likes
0 Replies