|
|||||||||||
|
Technical Support Support Resources
Product Information |
C51: Mixing C and AssemblyInformation in this article applies to:
QUESTIONDo you have any examples of how to mix C and assembly? ANSWERThe following example program shows how to mix C and assembly in your 8051 programs. This example starts with a MAIN C function which calls a routine in assembly which then calls a C function. The MAIN C module appears as follows:
The function a_func is an assembly routine:
Note that this assembly routine calls c_func which is a C function:
The actual code for the assembly module was generated using the SRC pragma and the following C source file:
You may download C2ASM2C.ZIP from the Keil web site. SEE ALSO
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
|||||||||||
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.