USING ARCHIMEDES 'C' CROSS-COMPILER PRODUCTS WITH HUNTSVILLE MICROSYSTEMS' IN-CIRCUIT EMULATOR PRODUCTS For Archimedes cross-compilers v3.00 or later: ============================================== Archimedes cross-compilers starting with v3.00 introduced a new XLINK output file format called "DEBUG". This file format is otherwise known as the IAR UBROF file format and is compatible with the Huntsville Microsystems' IAR2XT IAR Debug file to Extended TEKHEX file converter. 1) For the Archimedes 'C' cross-compiler: We recommend the use of the '-s' (optimize for speed) switch, and the '-rn' (include static and local variables) switch. The '-s' switch will stop the Archimedes compiler from generating subroutine startup code which contains embedded DW statements. The '-rn' switch replaces the old '-j' switch and causes the compiler to generate full source debugging information. 2) For the Archimedes Universal Linker (XLINK): We recommend selecting the "DEBUG" file output format with the '-F' switch. This will cause XLINK to generate an IAR UBROF format debug file which can then be converted to an Extended TEKHEX file with the Huntsville Microsystems' IAR2XT IAR Debug file to Extended TEKHEX file converter. The Extended TEKHEX file made by this process will contain all program code, symbols, and special line number symbols used for Source Level Debugging by the HMI-110 Source Level Debug communications software, and the HMI SourceGate Source Debugger. Example: Compile the program "TEST.C" using the Archimedes Z80 cross- compiler. Produce full Source Debugging information in an Extended TEKHEX file named "TEST.XTK": C-Z80 -rn -s TEST.C XLINK -f test.xcl -Fdebug -o test.dbg IAR2XT test The XLINK option '-f test.xcl' reads a linker response file named "test.xcl" for further options required to complete the link process. The contents of this file are not shown here. See "IAR2XT.DOC" for more information about the IAR2XT file converter. For Archimedes cross-compilers prior to v3.00: ============================================== These notes were compiled using the Archimedes 8051, Z80/64180, and 68HC11 'C' cross-compilers. They should apply, in general, to any Archimedes 'C' cross-compiler product. 1) For the Archimedes 'C' cross-compiler: We recommend use the '-s' (optimize for speed) switch, and the '-j' (include static and local variables) switch: The use of the '-s' switch prevents the Archimedes compiler from generating C subroutine startup code in the following format: CALL startup_code DW 4 The line containing "DW 4" represents a data word embedded in-line with the executable code. The HMI emulator (or any emulator/debugger, for that matter) will try to interpret this data word as one or more microprocessor instructions, resulting in a flawed disassembly. The '-s' switch is only absolutely necessary when using an HMI 200 series emulator with the HMI-110 Source Debug Communications Software package. The source line tracker in this product cannot tolerate flawed disassemblies. The use of the '-j' switch causes the Archimedes compiler to include all static and local variables in its output file(s). This gives the maximum symbolic debug support possible. Once again, the '-j' switch is only absolutely necessary when using an HMI 200 series emulator with the HMI-110 Source Debug Communications Software package. The Source Debugger depends on information relating source code line numbers to assembly language code addresses being present in its symbol table in the form of Source Line Number Symbols. These symbols are local to each object file included in the link stage, and these symbols will not be present in these object files unless specifically included with the '-j' switch. 2) For the Archimedes Universal Linker (XLINK): The Archimedes Universal Linker provides a large number of possible output file formats for both hex codes and data, and symbol tables. For use with HMI in-circuit emulators, and HMI communications software packages, we recommend the AOMF8051 XLINK output format. The AOMF8051 output file format is a variation on the Intel 8051 Object Module Format. This file format can be read by the Huntsville Microsystems' Object Module converter program OBJCNV. OBJCNV will read its input file and produce two output files: An Intel-format HEX file, and a special HMI-format Symbol file. Any HMI emulator can read an Intel-format HEX file. Any HMI communications software product can read the special HMI-format Symbol file. If source debugging is required (using an HMI series 200 emulator with HMI-110 Source Debug Communications Software), use the Archimedes compiler's '-s' and '-j' switches, and the OBJCNV program's '-L' switch. By default, OBJCNV will strip any line number information from its input file, and not write this information to its output Symbol file. The '-L' switch enables the writing of this information. Example: Compile the program "TEST.C", using the Archimedes 8051 'C' cross-compiler. Set up for source debugging using an HMI series 200 8051 In-Circuit emulator, and the HMI-110-8051 Source Debug Communications Software: C-51 -s -j test.c XLINK -f test.lnk -FAOMF8051 -o test OBJCNV test.a03 -L These three line compile, link, and convert the "TEST.C" file into a "TEST.HEX" file and a "TEST.SYM" file. The '-s' and '-j' switches are used for C-51 to properly compile and write source debug information to the test program's relocatable object file. The '-f' switch is used on the XLINK command line, along with a linker control file called "TEST.LNK" to set up segment definitions and other information which we are not concerned with here. The '-FAOMF8051' switch sets up the recommended output file format from the linker. The '-o test' XLINK switch provides a name for the output file (which would otherwise be "AOUT.A03"). OBJCNV is told to convert "TEST.A03" into "TEST.HEX" and "TEST.SYM", and include line number information in the Symbol table ('-L'). In order to properly perform Symbolic or Source Level debugging with HMI Communications Software products, both of these output files will have to be read by the communications software in question. See the documentation provided with the communications software for details. See the OBJCNV.DOC file provided for more information on how the OBJCNV program is used.