Page 236 - Programming Microcontrollers in C
P. 236

Header File    221

                          EXERCISES
                          1. Write a header file that contains definitions of all vectors shown on
                            page 3 of the HC11 E Series Programming Reference Guide,
                            M68HC11ERG/AD found on the CD-ROM. This file should be in­
                            cluded with any program that is intended to make use of interrupts.
                          2. Create a small program that uses the function vector(a,b).
                            Compile the function and observe the assembly language code gen­
                            erated to accomplish this operation.


            The Cosmic Compiler

                              The Cosmic compiler was originally known as the Whitesmiths
                          compiler. Cosmic retained the maintenance contract on this com­
                          piler through a couple of corporate owners, and now has the rights to
                          the compiler. This compiler used for the MC68HC11 family is some­
                          what more complicated to use than the ByteCraft compiler used with
                          the C68HC05. The compiler should be installed using the install pro­
                          gram that comes with it. You should allow the compiler to modify
                          your autoexec.bat and config.sys files unless you plan to do it your­
                          self. The system path should contain the path to the bin directory in
                          the directory that contains the compiler. There are also two set com­
                          mands that should be inserted into the autoexec.bat file. These
                          changes, once completed, will make compilation of programs rather
                          easy. This compiler creates an intermediate assembly language pro­
                          gram that must be assembled. The result of the assembly is a
                          relocatable object module. This module must be linked with other
                          modules of the program and basic library modules to comprise the
                          final program. The linking phase of the compilation places all of the
                          parts of the program in their proper memory location.
                              Fortunately, the compiler can make use of command files to
                          control the compilation sequence. These files relieve the programmer
                          of the need to remember the dozens of little details that must go into
                          each compilation. We will start with the highest level of the command
                          files and work down into the lower levels. The basic command file to
                          compile a program and create an S Record version of the program
                          is as follows:
   231   232   233   234   235   236   237   238   239   240   241