6-Introduction to microprocessors programming_085041
6-Introduction to microprocessors programming_085041
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
assemblylanguageprogrammingisthatitisspecifictoaparticularmicroprocessor.High-
levellanguage 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 1.10(a) and
(b) show the various steps involved in executing assembly language programs and
programs written in high-level languages respectively.
Figure 1.10 (a) Various steps involved in executing assembly language programs
and (b) various steps involved in executing programs written in high-level
languages.