Using assembly language for PSoC 3 in PSoC Creator | Cypress Semiconductor
Using assembly language for PSoC 3 in PSoC Creator
There are two options to writing assembly code in PSoC Creator.
Option-1 Create a separate assembly source file
1. Right click on Project name in the Project Explorer and select "Add new item"
2. Select "8051 Keil Assembly File" and provide a name for the file.
3. This will create an assembly source file with a .a51 extension in the Source Files folder in the project.
4. You can add assembly code to this file.
5. The instruction set is standard 8051. Go to Help > documentation > Keil > Ax51 Assembler User Guide for help on instructions, template etc.
Option-2 Inline Assembly in a C source file
1. In the C source file, put the assembly code inside the directive “#pragma asm” and “#pragma endasm”.
2. In the Project explorer, right click on the source file that has the inline assembly and select "Build Settings".
3. Select the Compiler option and set the value for "Inline Assembly" parameter to True.
4. Now, the compiler will process the inline assembly code during compilation.