Assembly Source for Algorithms

PRELIMINARY

A.1 Assembly Source for Algorithms

The algorithm source files implement the flows given in Chapter 3. Each algo- rithm is written as an assembly language subroutine, beginning with a label at an entry point and ending with a return instruction. The algorithms share a set of 16 relocatable variables for which pointers are defined in the header file, SVAR20.H.

The variables are defined at the beginning of B1 RAM, and an uninitialized sec- tion should be declared at link time to reserve this space. Also, the data page pointer (DP) should be initialized to point to this space before a call is made to any of the algorithms.

In addition to these variables, each algorithm references parameters that should be declared globally in the calling code. These parameters are listed in the introduction to each of the algorithm source files below.

The source files given are:

-SVAR20.H: header file that defines variables and constants

-SCLR20.ASM: clear algorithm

-SERA20.ASM: erase algorithm

-SFLW20.ASM: flash-write algorithm

-SPGM20.ASM: programming algorithm

-SUTILS20.ASM: subroutines common to all four algorithms

The same algorithm files can be used for the TMS320F206 and the TMS320F240/1/3 devices. A conditional assembly variable is provided in the header file, SVAR20.H, for assembling the algorithms for the correct device. For more details on this conditional assembly variable, see A.1.1.

A.1.1 Header File for Constants and Variables, SVAR20.H

This header file is included in each of the algorithm files using the .include di- rective. All of the constants used for flash programming are defined in this file. Also, the conditional assembly constant, F24x, is defined here to allow reuse of the algorithms for multiple device types. This constant should be modified to select the correct device when the algorithms are assembled. The SVAR20.H header file can also be included in the calling code, to allow visibility to the variable names.

A-2

PRELIMINARY

Page 54
Image 54
Texas Instruments TMS320F20x/F24x DSP Assembly Source for Algorithms, Header File for Constants and Variables, SVAR20.H