Hullo guys , I want to write some performance-critical sections in Assembly to be called from the C code , The C compiler in my KEIL is ARMCC and the Assembler is ARMASM . Any help or guide to good documentation or examples ?
THX Westonsupermare Pier , I know there r rules , but im actually speaking of building and linking in the first place . I do not want to use inline assembly (except for passing parameters) The example u gave is like .asm file and .c file , right?
Add the assembler file to the project. The IDE understands what to do with them. And if you aren't happy, then you can modify the rules for individual source files.
When it gets to linking, the linker will not care if the object file came from a *.c file, a *.cpp file or a *.asm file. All it cares about is that the object files are of the proper format and exports meaningful symbols where all the "I require" can be matched with corresponding "I supply".
But note that only add assembler if you need it - like having a teacher that requires you to do it, or using a tool chain that requires the startup file to be in assembler or when you need extra performance and also have the required skills to actually be able to produce faster code. Assembler-written routines are not automatically faster than compiled C/C++ code - todays compilers are much better at optimizing code than they were 20 years ago.
It's a portion of a .s file, describing a function, with comments on how to call it from a .c file.
You could paste it into your existing startup.s file