What is the role of .s files in a C project?

后端 未结 4 1408
猫巷女王i
猫巷女王i 2020-12-23 21:52

I am working with an ARM Cortex M3 chip (STM32F2) and ST provides a \"standard peripheral library\". It has some useful .c and .h files. It also has .s files.

What i

4条回答
  •  萌比男神i
    2020-12-23 22:26

    You've probably got a Keil-based development environment for your ST kit. Depending on the version of your compiler, the project file should have different sections for C, C++, and assembler code. In your IDE, open your project and look for "Project Properties" or something like it.

    You can import and export symbols to and from the assembler code so that it and the C/C++ code will link. With Keil it all integrates reasonably well.

    The EXPORT directive tells the assembler to make the specified symbol public so that your C/C++ code can link to it.

    The IMPORT directive tells the assembler that the specified symbol is defined elsewhere and will be resolved at link time.

提交回复
热议问题