540
Digital Electronics
13.7 Programming Microprocessors
Microprocessors execute programs stored in the memory in the form of a sequence of binary digits.
Programmers do not write the program in binary form but write it either in the form of a text file
containing an assembly-language source code or using a high-level language. Programs such as editor,
assembler, linker and debugger enable the user to write the program in assembly language, convert
it into binary code and debug the binary code. Editor is a program that allows the user to enter,
modify and store a group of instructions or text under a file name. The assembly language source
code is translated into an object code by a program called assembler. Linker converts the output of the
assembler into a format that can be executed by the microprocessor. The debugger is a program that
allows the user to test and debug the object file.
Programming in assembly language produces a code that is fast and takes up little memory.
However, it is difficult to write large programs using assembly language. Another disadvantage of
assembly language programming is that it is specific to a particular microprocessor. High-level language
programming overcomes these problems. Some of the popular high-level languages used include C,
C++, Pascal and so on. Compiler programs are primarily used to translate the source code from a
high-level language to a lower-level language (e.g. assembly language or machine language). Figures
13.10(a) and (b) show the various steps involved in executing assembly language programs and
programs written in high-level languages respectively.
Assembly source file
*.asm
Assembler
Linker/Locator
Library
List file
Object file
Hex file
High level language
source file *.C
Compiler
Assembler
Library
List file
Object file
Hex file
Assembly file
Linker/Locator
(a)
(b)
Figure 13.10 (a) Various steps involved in executing assembly language programs and (b) various steps involved
in executing programs written in high-level languages.
Précédent

- 557/741

Suivant