SlideShare a Scribd company logo
2
Most read
9
Most read
12
Most read
Designing Embedded
System with 8051
Microcontroller
UNIT IV
Factors to be considered in
selecting a controller
(a) Meeting the computing needs of task at hand efficiently and
cost effectively
 Speed of operation
 Feature Set
 Power consumption
 Amount of RAM and ROM on chip
 No. of I/O pins and timers on chip
 Cost
(B) Development Support: Availability of software development
tools such as compiler, assembler and debugger.
(C) How easy it is to develop products around it.
Why 8051 Microcontroller
• Very versatile
• Powerful Boolean processor which supports bit manipulation
• Got 6 interrupts (2: External, 2: Timer, 2: Serial)
• Two 16-bit timers/counters
• 32 I/O Lines and Programmable full duplex serial interface
• Way of handling interrupts: 2 priority levels
• Invented by Intel, today available in market from more than 20
venders
• More than 100 variants of original 8051 flavor.
• supporting USB, SPI, TCP/IP interfaces, integrated ADC/DAC LCD
Converter and extended no. of I/O ports.
• Low cost
8051 Microcontroller Introduction
and History
• Originally, 8051 Microcontrollers were developed using N-MOS
Technology but the use of battery powered devices and their low
power consumption lead to usage of CMOS Technology (which is
famous for its low power consumption).
• Some of the 8051 Microcontrollers produced by different
manufacturers are: Atmel (AT89C51, AT89S51), Phillips (S87C654), STC
Micro (STC89C52), Infineon (SAB-C515, XC800), Siemens (SAB-C501),
Silicon Labs (C8051), NXP (NXP700, NXP900), etc.
• Majority of the modern 8051 Microcontrollers are Silicon IP Cores
(Intellectual Property Cores) but discrete 8051 Microcontroller IC’s are
also available.
• Because of their low power consumption, smaller size and simple
architecture, 8051 IP Cores are used in FPGAs (Field Programmable
Gate Array) and SoCs (System on Chip) instead of Advanced ARM
Architecture based MCUs.
Applications of 8051
Microcontroller
• Consumer Appliances (TV Tuners, Remote controls, Computers,
Sewing Machines, etc.)
• Home Applications (TVs, VCR, Video Games, Camcorder, Music
Instruments, Home Security Systems, Garage Door Openers, etc.)
• Communication Systems (Mobile Phones, Intercoms, Answering
Machines, Paging Devices, etc.)
• Office (Fax Machines, Printers, Copiers, Laser Printers, etc.)
• Automobiles (Air Bags, ABS, Engine Control, Transmission Control,
Temperature Control, Keyless Entry, etc)
• Aeronautical and Space
• Medical Equipment
• Defense Systems
• Robotics
• Industrial Process and Flow Control
• Radio and Networking Equipment
• Remote Sensing
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT IV  Designing Embedded System with 8051 microcontroller
8051 Memory Organization
• The 8051 microcontroller's memory is divided into
• Program Memory and
• Data Memory.
• Program Memory (ROM) is used for permanent saving
program being executed,
• while Data Memory (RAM) is used for temporarily storing and
keeping intermediate results and variables.
Program Memory (ROM)
• Program Memory (ROM) is used for permanent saving program (CODE)
being executed.
• The memory is read only. Depending on the settings made in compiler,
program memory may also used to store a constant variables.
• The 8051 executes programs stored in program memory only. code
memory type specifier is used to refer to program memory.
• 8051 memory organization allows external program memory to be
added.
• How does the microcontroller handle external memory depends on the
pin EA logical state.
Internal Data Memory
• Up to 256 bytes of internal data memory are available depending on
the 8051 derivative.
• Locations available to the user occupy addressing space from 0 to 7Fh,
i.e. first 128 registers and this part of RAM is divided in several blocks.
• The first 128 bytes of internal data memory are both directly and
indirectly addressable.
• The upper 128 bytes of data memory (from 0x80 to 0xFF) can be
addressed only indirectly.
• Since internal data memory is used for CALL stack also and there is only
256 bytes splited over few different memory areas fine utilizing of this
memory is crucial for fast and compact code.
• Memory block in the range of 20h to 2Fh is bit-addressable, which
means that each bit being there has its own address from 0 to 7Fh.
• Since there are 16 such registers, this block contains in total of 128 bits
with separate addresses ( Bit 0 of byte 20h has the bit address 0, and bit
7 of byte 2Fh has the bit address 7Fh).
• Three memory type specifiers can be used to refer to the internal data
memory: data, idata, and bdata.
External Data Memory
• Access to external memory is slower than access to internal
data memory.
• There may be up to 64K Bytes of external data memory.
Several 8051 devices provide on-chip XRAM space that is
accessed with the same instructions as the traditional external
data space.
• This XRAM space is typically enabled via proper setting of SFR
register and overlaps the external memory space.
• Setting of that register must be manually done in code,
before any access to external memory or XRAM space is
made.
• The mikroC PRO for 8051 has two memory type specifiers
that refers to external memory space: xdata and pdata.
SFR Memory
• Special Function Registers
• The 8051 provides 128 bytes of memory for Special Function
Registers (SFRs).
• SFRs are bit, byte, or word-sized registers that are used to
control
• timers,
• counters,
• serial I/O,
• port I/O, and
• peripherals.
Programming embedded
systems
• BLINKING LED PROGRAM AND INFINITE LOOP
• To blink an LED we would require the following hardware:
• LED
• A microcontroller or microprocessor
• The LED can be connected to any available port i.e P1, P2, P3,
P4 on the microprocessor.
• Assuming the LED is connected to port 2,
• i.e. P2 its state is controlled by a bit in a register
called the Port 2 I/O Latch Register, also known the
P2LTCH
The structure of the program
• code is hardware independent hence can be implemented
for any circuit
• It contains two functions namely : toggle() & delay()
• toggle(): This function is used to toggle the state of the LED.
• delay(): This function is used to introduce a delay of 500 ms every
time the LED is toggled
• The implementation of toggle() and delay() is hardware specific.
Infinite Loop
• The code for every embedded program is written in an infinite
loop. This is because the embedded system is supposed to run
every time it is turned on till the time its power goes off or it
stops functioning.
• The code for blinking LED is also enclosed in an infinite loop. The
functions toggle() and delay() run infinite number of times.
• An application of an embedded system has an infinite loop
around its code. It’s just like the program you did to implement
switch case where the program has to run continuously until the
user selects to exit.
BUILD PROCESS IN EMBEDDED
SYSTEM
• Definition: The process which converts source code to executable code
is called as the build process.
• An Embedded system would also use tools such as a Compiler, Linker,
Locater and Debugger to perform the entire build process. These tools
would be a part of a larger IDE.
• A compiler which produces the executable code to be run on a
different platform is called a cross-compiler; else it is called a native
compiler.
• The build process involves three steps:
• 1. Compiling
• 2. Linking
• 3. Locating
Build Process in Embedded
System
Compiling
• The process of compiling is done by the compiler.
• The compiler takes input as source code files and gives
output as multiple object files.
• Compilers for embedded systems are essentially cross-
compilers.
• For example while compiling the programmer has to select the
target processor for which the code has to be generated.
• The contents of the object files depend on its format. Two
• commonly used formats are:
• 1. Common Object file format (COFF)
• 2. Extended file format (ELF)
Compiling
• Object files generally have the following structure
Linking
• The process of linking is carried out by the linker
• The linker takes input as multiple object files and gives output as a
single object file which is also called as the re-locatable code.
• The output of compiler is multiple object files. These files are
incomplete in the sense that they may contain reference to variables
and functions across multiple object files which need to be resolved.
• The job of the linker is to combine these multiple object files and
resolve the unresolved symbols.
• The Linker does this by merging the various sections like text, data,
and bss of the individual object files.
• The output of the linker will be a single file which contains all of the
machine language code from all of the input object files that will be in
the text section of this new file, and all of the initialized and
uninitialized variables will reside in the new data section and bss
section respectively.
Locating
• The process of relocating is carried out by the relocater.
• The relocater takes input as the relocatable code produced by
the linker and gives output as the final executable code.
• This output is a binary executable file which is called hex code.
• The locator needs to be given information about the memory
available on the target processor.
• The locator will use this information to assign physical memory
addresses to each of the code and data sections within the
relocatable program code.
• Finally it produces an output file that contains a binary memory
image that can be loaded into the target processors ROM.
END of UNIT IV
THANKS !

More Related Content

PPTX
Chapter 4 Embedded System: Application and Domain Specific
PPTX
UNIT 2 8086 System Bus Structure.pptx
PPT
Interfacing stepper motor
PDF
Unit 2 mpmc
PPT
Memory & I/O interfacing
PPTX
ARM Processors
PPTX
Microcontroller 8096
PDF
Memory segmentation-of-8086
Chapter 4 Embedded System: Application and Domain Specific
UNIT 2 8086 System Bus Structure.pptx
Interfacing stepper motor
Unit 2 mpmc
Memory & I/O interfacing
ARM Processors
Microcontroller 8096
Memory segmentation-of-8086

What's hot (20)

PDF
Memory interfacing of microcontroller 8051
PPTX
Xilinx 4000 series
PPTX
Architecture of 8051
PPTX
8051 Microcontroller PPT's By Er. Swapnil Kaware
PDF
DAC Interfacing with 8051.pdf
PPTX
Pic microcontroller architecture
PDF
Logic Synthesis
PPTX
8255 PPI
DOCX
Embedded System
PPTX
Architecture of the Intel 8051 Microcontroller
PPTX
Embedded system design process
PPT
Timing diagram 8085 microprocessor
PPT
Embedded system
PPTX
Interrupts in 8051
PPTX
Chapter 8 Embedded Hardware Design and Development (second portion)
PPT
Assembly Language Programming Of 8085
PPTX
Intel 8051 Programming in C
PPTX
8051 Microcontroller ppt
PDF
Unit 3 mpmc
Memory interfacing of microcontroller 8051
Xilinx 4000 series
Architecture of 8051
8051 Microcontroller PPT's By Er. Swapnil Kaware
DAC Interfacing with 8051.pdf
Pic microcontroller architecture
Logic Synthesis
8255 PPI
Embedded System
Architecture of the Intel 8051 Microcontroller
Embedded system design process
Timing diagram 8085 microprocessor
Embedded system
Interrupts in 8051
Chapter 8 Embedded Hardware Design and Development (second portion)
Assembly Language Programming Of 8085
Intel 8051 Programming in C
8051 Microcontroller ppt
Unit 3 mpmc
Ad

Similar to SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT IV Designing Embedded System with 8051 microcontroller (20)

PPTX
Vinod ppt on es31 08 15
PPT
Lecture 1 (course overview and 8051 architecture) rv01
PPT
Embedded systems, 8051 microcontroller
PPTX
8051 Microcontroller_module_4.1.pptx
PPTX
Microcontroller Electronics Engineering Sem 4MODULE 1.pptx
PPTX
unit-2.pptx
PPTX
Presentation On: "Micro-controller 8051 & Embedded System"
PPT
8051.ppt microcontroller full detail explnation
PDF
Module 5 embedded systems,8051
PPTX
Unit 4.pptx
PPT
Embeded system by Mitesh Kumar
PPTX
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
PPTX
Unit two and unit three pptx for btech ece
PDF
21ECU502_UNIT1.pdf
PDF
002079
PPT
Microcontroller 8051 By Mitesh kumar
PDF
8051_microcontroller_unit4 Presentation.pdf
PPT
8051 microcontroller and it’s interface
PDF
8449972 embedded-systems-and-model-of-metro-train
Vinod ppt on es31 08 15
Lecture 1 (course overview and 8051 architecture) rv01
Embedded systems, 8051 microcontroller
8051 Microcontroller_module_4.1.pptx
Microcontroller Electronics Engineering Sem 4MODULE 1.pptx
unit-2.pptx
Presentation On: "Micro-controller 8051 & Embedded System"
8051.ppt microcontroller full detail explnation
Module 5 embedded systems,8051
Unit 4.pptx
Embeded system by Mitesh Kumar
SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT III The 8051 Microcontrollers
Unit two and unit three pptx for btech ece
21ECU502_UNIT1.pdf
002079
Microcontroller 8051 By Mitesh kumar
8051_microcontroller_unit4 Presentation.pdf
8051 microcontroller and it’s interface
8449972 embedded-systems-and-model-of-metro-train
Ad

More from Arti Parab Academics (20)

PPTX
COMPUTER APPLICATIONS Module 4.pptx
PPTX
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
PPTX
COMPUTER APPLICATIONS Module 5.pptx
PPTX
COMPUTER APPLICATIONS Module 1 CAH.pptx
PPTX
COMPUTER APPLICATIONS Module 3.pptx
PPTX
COMPUTER APPLICATIONS Module 2.pptx
PPTX
Health Informatics- Module 5-Chapter 2.pptx
PPTX
Health Informatics- Module 5-Chapter 3.pptx
PPTX
Health Informatics- Module 4-Chapter 3.pptx
PPTX
Health Informatics- Module 3-Chapter 2.pptx
PPTX
Health Informatics- Module 4-Chapter 1.pptx
PPTX
Health Informatics- Module 4-Chapter 2.pptx
PPTX
Health Informatics- Module 3-Chapter 3.pptx
PPTX
Health Informatics- Module 5-Chapter 1.pptx
PPTX
Health Informatics- Module 3-Chapter 1.pptx
PPTX
Health Informatics- Module 2-Chapter 2.pptx
PPTX
Health Informatics- Module 1-Chapter 1.pptx
PPTX
Health Informatics- Module 2-Chapter 3.pptx
PPTX
Health Informatics- Module 2-Chapter 1.pptx
PPTX
Health Informatics- Module 1-Chapter 2.pptx
COMPUTER APPLICATIONS Module 4.pptx
COMPUTER APPLICATIONS Module 1 HPSY - Copy.pptx
COMPUTER APPLICATIONS Module 5.pptx
COMPUTER APPLICATIONS Module 1 CAH.pptx
COMPUTER APPLICATIONS Module 3.pptx
COMPUTER APPLICATIONS Module 2.pptx
Health Informatics- Module 5-Chapter 2.pptx
Health Informatics- Module 5-Chapter 3.pptx
Health Informatics- Module 4-Chapter 3.pptx
Health Informatics- Module 3-Chapter 2.pptx
Health Informatics- Module 4-Chapter 1.pptx
Health Informatics- Module 4-Chapter 2.pptx
Health Informatics- Module 3-Chapter 3.pptx
Health Informatics- Module 5-Chapter 1.pptx
Health Informatics- Module 3-Chapter 1.pptx
Health Informatics- Module 2-Chapter 2.pptx
Health Informatics- Module 1-Chapter 1.pptx
Health Informatics- Module 2-Chapter 3.pptx
Health Informatics- Module 2-Chapter 1.pptx
Health Informatics- Module 1-Chapter 2.pptx

Recently uploaded (20)

PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Institutional Correction lecture only . . .
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Basic Mud Logging Guide for educational purpose
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Complications of Minimal Access Surgery at WLH
PDF
01-Introduction-to-Information-Management.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
master seminar digital applications in india
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Institutional Correction lecture only . . .
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
VCE English Exam - Section C Student Revision Booklet
Microbial diseases, their pathogenesis and prophylaxis
Basic Mud Logging Guide for educational purpose
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
O7-L3 Supply Chain Operations - ICLT Program
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Complications of Minimal Access Surgery at WLH
01-Introduction-to-Information-Management.pdf
Pre independence Education in Inndia.pdf
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
Renaissance Architecture: A Journey from Faith to Humanism
master seminar digital applications in india
PPH.pptx obstetrics and gynecology in nursing
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Week 4 Term 3 Study Techniques revisited.pptx

SYBSC IT SEM IV EMBEDDED SYSTEMS UNIT IV Designing Embedded System with 8051 microcontroller

  • 1. Designing Embedded System with 8051 Microcontroller UNIT IV
  • 2. Factors to be considered in selecting a controller (a) Meeting the computing needs of task at hand efficiently and cost effectively  Speed of operation  Feature Set  Power consumption  Amount of RAM and ROM on chip  No. of I/O pins and timers on chip  Cost (B) Development Support: Availability of software development tools such as compiler, assembler and debugger. (C) How easy it is to develop products around it.
  • 3. Why 8051 Microcontroller • Very versatile • Powerful Boolean processor which supports bit manipulation • Got 6 interrupts (2: External, 2: Timer, 2: Serial) • Two 16-bit timers/counters • 32 I/O Lines and Programmable full duplex serial interface • Way of handling interrupts: 2 priority levels • Invented by Intel, today available in market from more than 20 venders • More than 100 variants of original 8051 flavor. • supporting USB, SPI, TCP/IP interfaces, integrated ADC/DAC LCD Converter and extended no. of I/O ports. • Low cost
  • 4. 8051 Microcontroller Introduction and History • Originally, 8051 Microcontrollers were developed using N-MOS Technology but the use of battery powered devices and their low power consumption lead to usage of CMOS Technology (which is famous for its low power consumption). • Some of the 8051 Microcontrollers produced by different manufacturers are: Atmel (AT89C51, AT89S51), Phillips (S87C654), STC Micro (STC89C52), Infineon (SAB-C515, XC800), Siemens (SAB-C501), Silicon Labs (C8051), NXP (NXP700, NXP900), etc. • Majority of the modern 8051 Microcontrollers are Silicon IP Cores (Intellectual Property Cores) but discrete 8051 Microcontroller IC’s are also available. • Because of their low power consumption, smaller size and simple architecture, 8051 IP Cores are used in FPGAs (Field Programmable Gate Array) and SoCs (System on Chip) instead of Advanced ARM Architecture based MCUs.
  • 5. Applications of 8051 Microcontroller • Consumer Appliances (TV Tuners, Remote controls, Computers, Sewing Machines, etc.) • Home Applications (TVs, VCR, Video Games, Camcorder, Music Instruments, Home Security Systems, Garage Door Openers, etc.) • Communication Systems (Mobile Phones, Intercoms, Answering Machines, Paging Devices, etc.) • Office (Fax Machines, Printers, Copiers, Laser Printers, etc.) • Automobiles (Air Bags, ABS, Engine Control, Transmission Control, Temperature Control, Keyless Entry, etc) • Aeronautical and Space • Medical Equipment • Defense Systems • Robotics • Industrial Process and Flow Control • Radio and Networking Equipment • Remote Sensing
  • 7. 8051 Memory Organization • The 8051 microcontroller's memory is divided into • Program Memory and • Data Memory. • Program Memory (ROM) is used for permanent saving program being executed, • while Data Memory (RAM) is used for temporarily storing and keeping intermediate results and variables.
  • 8. Program Memory (ROM) • Program Memory (ROM) is used for permanent saving program (CODE) being executed. • The memory is read only. Depending on the settings made in compiler, program memory may also used to store a constant variables. • The 8051 executes programs stored in program memory only. code memory type specifier is used to refer to program memory. • 8051 memory organization allows external program memory to be added. • How does the microcontroller handle external memory depends on the pin EA logical state.
  • 9. Internal Data Memory • Up to 256 bytes of internal data memory are available depending on the 8051 derivative. • Locations available to the user occupy addressing space from 0 to 7Fh, i.e. first 128 registers and this part of RAM is divided in several blocks. • The first 128 bytes of internal data memory are both directly and indirectly addressable. • The upper 128 bytes of data memory (from 0x80 to 0xFF) can be addressed only indirectly. • Since internal data memory is used for CALL stack also and there is only 256 bytes splited over few different memory areas fine utilizing of this memory is crucial for fast and compact code. • Memory block in the range of 20h to 2Fh is bit-addressable, which means that each bit being there has its own address from 0 to 7Fh. • Since there are 16 such registers, this block contains in total of 128 bits with separate addresses ( Bit 0 of byte 20h has the bit address 0, and bit 7 of byte 2Fh has the bit address 7Fh). • Three memory type specifiers can be used to refer to the internal data memory: data, idata, and bdata.
  • 10. External Data Memory • Access to external memory is slower than access to internal data memory. • There may be up to 64K Bytes of external data memory. Several 8051 devices provide on-chip XRAM space that is accessed with the same instructions as the traditional external data space. • This XRAM space is typically enabled via proper setting of SFR register and overlaps the external memory space. • Setting of that register must be manually done in code, before any access to external memory or XRAM space is made. • The mikroC PRO for 8051 has two memory type specifiers that refers to external memory space: xdata and pdata.
  • 11. SFR Memory • Special Function Registers • The 8051 provides 128 bytes of memory for Special Function Registers (SFRs). • SFRs are bit, byte, or word-sized registers that are used to control • timers, • counters, • serial I/O, • port I/O, and • peripherals.
  • 12. Programming embedded systems • BLINKING LED PROGRAM AND INFINITE LOOP • To blink an LED we would require the following hardware: • LED • A microcontroller or microprocessor • The LED can be connected to any available port i.e P1, P2, P3, P4 on the microprocessor. • Assuming the LED is connected to port 2, • i.e. P2 its state is controlled by a bit in a register called the Port 2 I/O Latch Register, also known the P2LTCH
  • 13. The structure of the program • code is hardware independent hence can be implemented for any circuit • It contains two functions namely : toggle() & delay() • toggle(): This function is used to toggle the state of the LED. • delay(): This function is used to introduce a delay of 500 ms every time the LED is toggled • The implementation of toggle() and delay() is hardware specific.
  • 14. Infinite Loop • The code for every embedded program is written in an infinite loop. This is because the embedded system is supposed to run every time it is turned on till the time its power goes off or it stops functioning. • The code for blinking LED is also enclosed in an infinite loop. The functions toggle() and delay() run infinite number of times. • An application of an embedded system has an infinite loop around its code. It’s just like the program you did to implement switch case where the program has to run continuously until the user selects to exit.
  • 15. BUILD PROCESS IN EMBEDDED SYSTEM • Definition: The process which converts source code to executable code is called as the build process. • An Embedded system would also use tools such as a Compiler, Linker, Locater and Debugger to perform the entire build process. These tools would be a part of a larger IDE. • A compiler which produces the executable code to be run on a different platform is called a cross-compiler; else it is called a native compiler. • The build process involves three steps: • 1. Compiling • 2. Linking • 3. Locating
  • 16. Build Process in Embedded System
  • 17. Compiling • The process of compiling is done by the compiler. • The compiler takes input as source code files and gives output as multiple object files. • Compilers for embedded systems are essentially cross- compilers. • For example while compiling the programmer has to select the target processor for which the code has to be generated. • The contents of the object files depend on its format. Two • commonly used formats are: • 1. Common Object file format (COFF) • 2. Extended file format (ELF)
  • 18. Compiling • Object files generally have the following structure
  • 19. Linking • The process of linking is carried out by the linker • The linker takes input as multiple object files and gives output as a single object file which is also called as the re-locatable code. • The output of compiler is multiple object files. These files are incomplete in the sense that they may contain reference to variables and functions across multiple object files which need to be resolved. • The job of the linker is to combine these multiple object files and resolve the unresolved symbols. • The Linker does this by merging the various sections like text, data, and bss of the individual object files. • The output of the linker will be a single file which contains all of the machine language code from all of the input object files that will be in the text section of this new file, and all of the initialized and uninitialized variables will reside in the new data section and bss section respectively.
  • 20. Locating • The process of relocating is carried out by the relocater. • The relocater takes input as the relocatable code produced by the linker and gives output as the final executable code. • This output is a binary executable file which is called hex code. • The locator needs to be given information about the memory available on the target processor. • The locator will use this information to assign physical memory addresses to each of the code and data sections within the relocatable program code. • Finally it produces an output file that contains a binary memory image that can be loaded into the target processors ROM.
  • 21. END of UNIT IV THANKS !