EasyManua.ls Logo

ST ST7 - Development Process in Assembly Language

ST ST7
317 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
46/317
3 - Programming a microcontroller
There are, in almost all applications, parts of the code that still require assembly programming.
These parts are, most of the time, small but have an important impact on the program. Here
are a few such cases:
The initialization part of the program. All high-level languages provide for initialization of the
core and the memory. However, the basic organisation of the memory (address of the ROM
and the RAM, reset and interrupt vectors) and a few other kinds of initialization are supplied
as an assembly-language template, that has to be adapted to suit the actual application.
Some interrupt service routines that require very fast processing.
Some repetitive functions that are frequently invoked and whose optimization in terms of
speed has an important impact on the performance of the whole program.
The third case implies that the programmer carefully reads the implementation chapter of his
compiler's manual. The way arguments and return values are passed back and forth are spe-
cific to each compiler. Failure to comply with these conventions will prevent the assembly
code from working.
3.1.2 Development process in assembly language
The development of a program consists of three main phases:analyzing, writing the code,de-
bugging. In other words, the successive phases can be described as follows:
The first phase is when the programmer defines what the program should do. This is only
paperwork, even if it is done using a computer and a word processor or a spreadsheet. This
phase defines the main program blocks, the data inputs and outputs, the storage, and some
of the algorithms.
The second phase is the translation of the first one into the chosen computer language. The
result of it is the source code and a few files that drive the various programming tools. The
tools used in this phase are the text editor, to type and amend the source code, and the
assembler and the linker to check its syntactic correctness. The Make utility is also a
convenient tool, that helps keeping the program up-to-date, when any of its parts have been
changed, by processing only the changed source files.
The third phase consists of all that is needed to make the source code work. It involves
removing all programming errors, that is, the flaws in the first and second phases related to
logic, coordination, and data management. This third phase is by far the most difficult and
requires the most development time. The tools used, the Simulator and In-Circuit Emulator,
have to be very powerful because many errors are difficult to find.
When the program is fully functional, it is often stored in an EPROM that is either external, or
as in the ST7, internal to the microcontroller. This produces a prototype of the microcontroller
that must be extensively tested before being launched to production, especially if, for large

Table of Contents

Related product manuals