Page 238 - Programming Microcontrollers in C
P. 238

Header File    223

                   #
                   # link command file for motorfr program
                   #
                   +h # multi-segment output
                   -o motorfr.h11 # output file name
                   +text -b 0xd000 # program start address
                   +data -b 0x0000 # data start address
                   crtsmot.o # start-up routine
                   motorfr.o # application program
                   libi.h11 # integer library
                   libm.h11 # machine library
                   +text -b 0xffd6 # vectors start address
                   interrup.o # interrupt vectors
                   +def __memory=__bss__ # symbol used by library

                              Comment lines are preceded with a # in this command file. The
                          first executable line of code in the file contains a command +h which
                          notifies the linker that the program will be in multiple memory
                          segments rather than in a single block in memory. The second line

                   -o motorfr.h11
                          tells the linker to write the output file to motorfr.h11. This
                          particular linker file is for a program named motorfr. The +text
                          option places the beginning of the code portion of the next module to
                          be linked at the offset 0xd000. The +data option places the data
                          memory for the next module at the offset 0x0000. Finally, the names
                          of the modules to be linked are next. The module crtsmot.o is a
                          relocatable object module version of a start-up program. This routine
                          will be discussed below. The next module to be linked is motorfr.o
                          which is the output of the compiler. This line is followed by the
                          invocation of two library calls. The first is to the integer library, and
                          the second is to the machine library. These libraries will provide
                          necessary code for function calls that are not contained directly in
                          the program. Another library named libf.h11 contains floating
                          point operations that might be needed in your program.
                              Another +text option will force the beginning of the code linked
                          next to the address 0xffd6. This address is the beginning of the
                          MC68HC11 vector table, and the code linked at this point is the vector
                          function discussed earlier. This entry will create the vector table at
   233   234   235   236   237   238   239   240   241   242   243