[Back] [Top] [Next]

13 Outputs From C51

13.1 Object Files

Being closely related to the original Intel tools, C51 defaults to the Intel object file format. This is a binary file containing the symbolic information necessary for debugging with in-circuit emulators etc.. It may be linked with object files from either Intel PLM51 or ASM51 using the Keil L51 linker. The final output is Intel OMF51.

Versions >2.3 of the compiler will produce an extended Intel OMF51 object file if the DEBUG OBJECTEXTEND command line switches are used. This passes type and scope information into the OMF51 file which any debugger/in-circuit emulator should be able to use. The extensions to the original Intel format are a proprietary Keil development but have been widely copied by IAR et al.

13.2 HEX Files For EPROM Blowing

To blow EPROMS an additional stage is usually necessary to get a HEX file. This is an ASCII representation of the final program without any symbol information. Almost every EPROM programmer will understand Intel HEX. The OH51/OHS51 utility performs the conversion from the linker's OMF51 file to the standard 8bit Intel HEX format.

13.3 Assembler Output

Optionally, a valid A51 assembler/C source listing file can be produced by C51 if the SRC command line switch is used. This has the original C source lines interleaved with the assembler and is very useful for getting to know how the compiler drives the 8051.

Do not be tempted to try hand-tweaking the compiler's efforts. Whilst you may be able to save the odd instruction here and there, you will create a totally unmaintainable program! It is much better to structure source code so that you write efficient code from the start. Simple, efficient C will produce the best 8051 code.


[Back] [Top] [Next]