Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

UNIT II SOFTWARE DEVELOPMENT

1.Source file
 Microchip provided MS-DOS command-line tools that performed the
task of converting assembly language source files into hex files as well as
simulating the operation of the program files as if they were working in
actual hardware.
 MPLAB IDE also provides the facilities for cross-referencing machine
code and hard addresses back to the source files to allow the editor to
indicate the current line or update the data watch windows.
 The need for the source files should be self-explanatory—the .asm, .bas,
and .c files that are created as the program is run through the
assembler/compiler are entered into the MPLAB IDE editor and then
passed through the build process.
The files that you should be concerned with are

 The source files (.c)


 The object files (.o)
 The compiler listing files (.lst), which provide you with basic information
regarding the results of the compilation
 The hex file (.hex)
 The debugger file (.cod or .coff), which is used to allow source-code-level
simulation and debugging
 The linker file (.lkr), which may have been brought into the build folder to
modify how the code is implemented
 The application map file (.map), which outlines how the application uses
data and program memory
 This file consists of a list of source files and line numbers of the errors
encountered in the assembly/ compile step.
 When a source file has been converted successfully into an object file, the
.err file length should be zero.
 Once all the source files have been assembled or compiled into object
files, the linker combines them all together into a single .hex file, which is
specified by the linker (.lkr) file.
 PICBASIC produces either assembler source files or completed .hex files.
It does not create object files for linking modules together.
 Compiler A program that takes a high level language source file and
converts it to either assembly-language code or object code for a
microcontroller.

2.Object file
 .obj File type produced after assembly or high-level language
compilation containing the hex values (op codes) that make up a
processor’s instructions.
 An object file either can be loaded directly into a microcontroller or
multiple object files can be linked together to form an executable file
that is loaded into a microcontroller’s control store.
 With the program stored in a text file from the editor, it must be
converted or built into an object file that can be loaded into the
processor.
 Linker is a software product that combines object files into a final
program file that can be loaded into a microcontroller.
 Object files are portions of an application that are linked together to
create a complete application.
 Linker programs are very complex and not only put multiple object
files together but also provide address references between the object
files.
 Object files are very similar to hex files except for labels that are
going to be referenced outside the application are flagged and not
deleted.
 References to addresses that are outside the current object file are also
flagged.
 linker is to provide addresses for the various object files.
 In this example, ObjectB or ObjectC can be put in any order after
ObjectA. This means that ObjectB can start at address 100 or address
250 depending on whether or not ObjectC is between it and ObjectA.
 Once the linker has calculated the addresses for each object file, it will
calculate the addresses for the labels that are accessed outside of each
object file and put the addresses into the code.
 Convert object files into libraries.
 A library differs from an object file in its ability to store pieces of the
code within it rather than the entire file.
 Once all the source files have been assembled or compiled into object
files, the linker combines them all together into a single .hex file,
which is specified by the linker (.lkr) file.

3. Linkers
 Object files (which normally end in .obj) can be produced by a compiler
or assembler instead of .hex files (which are complete applications).
 Object files are portions of an application that are linked together to
create a complete application.
 Linker programs are very complex and not only put multiple object files
together but also provide address references between the object files.
 An important function of the linker is to provide address references
between .obj files.
 Another function of the linker is to provide addresses for the various
object files.

 In this example, ObjectB or ObjectC can be put in any order after


ObjectA.
 This means that ObjectB can start at address 100 or address 250
depending on whether or not ObjectC is between it and ObjectA.
 Once the linker has calculated the addresses for each object file, it will
calculate the addresses for the labels that are accessed outside of each
object file and put the addresses into the code.

4. Hex Files
 Object files are very similar to hex files except for labels that are going to
be referenced outside the application are flagged and not deleted.
 PICBASIC produces either assembler source files or completed .hex files.
 It does not create object files for linking modules together.
 IDE files in the same folder as the source code (and hex files) is
important because they specify which files are used in the project.
 Hex files to ensure that the simulator, debugger, or emulator functions of
MPLAB IDE are always available.
 Microchip’s “MPASM” is a full-featured macro assembler that can
produce object and hex files for any PIC microcontroller processor
architecture.
 The assembler can work with macros and defines to simplify
programming along with having the ability to create data structures.
 Errors and messages are passed directly to MPLAB IDE.

5.Libraries
 The libraries are collections of functions and subroutines used to
provide basic functions for compiled code.
 An example of a library subroutine is C’s printf, which formats and
passes data to a console.
 The user simply specifies the include file that has 118 SOFTWARE
DEVELOPMENT TOOLS the printf subroutine prototypes, and
during linking, the necessary library subroutines are added to the final
application.
 The library file differs from an object file containing all the possibly
required subroutines and functions because only the required
subroutines and functions are passed into the linker and included as
part of the final application.
 This keeps the size of the final application as small as possible with
just the required library subroutines and functions included in the
application.

You might also like