The use of C51 for microcontroller programming is something half-level, but many algorithms and compiled issues, often use ASM code more convenient and efficient. But I don't know why, keil is in achieving a C51 inclusion ASM code than SDCC, and the method is as follows:
Pretreatment instruction #pragma ASM starts ASM code pre-processing instruction #pragma endasm end ASM code
If you do this directly, you will have the following error: Error C272: 'ASM / Endasm' Requires SRC-Control to Be Active
Workaround: Select the current C51 file in Files Toolbar, right-click to view the file option, turn the generate assembler src file with the Assemble Src File to become black, even if these two are valid!
At this time, there is no problem, but two warnings occur when LINK: *** Warning L1: Unresolved External Symbol *** Warning L2: Reference Made to Unresolved External EXTERNAL
The solution is to add a lib file to the Source Group. Different from the contents of the item: c51s.lib - Small modelc51c.lib without floating point operations - there is no floating point operation Compact Modelc51l.lib - no floating point operation Large modelc511fps.lib - Small modelc511fpc.lib with floating point operation with floating point compacts, compact modelc51fpl.lib - large model with floating point operations
The liblic is in the / c51 / lib / directory in the KEIL installation directory.