The ASM directive signals the beginning of a block of assembler source text to merge into the .SRC file generated using the SRC directive. The ENDASM directive signals the end of the source text block. This source text can be thought of as in-line assembly. However, it is output to the source file generated only when using the SRC directive. The source text is not assembled and output to the object file. In µVision you may set a file specific option for C source files that contain ASM/ENDASM sections as follows: - Right click on the file in the Project Window — Files tab
- Choose Options for... to open Options — Properties page
- Enable Generate Assembler SRC file
- Enable Assemble SRC file.
µVision generates an assembler source file (.SRC) and translates this file with the Assembler which generates an object file (.OBJ). The linker links this object file with other object files from the project and creates the target application program. Note - The ASM and ENDASM directives may occur only in the source file as part of a #pragma.
|