144/317
6 - STMicroelectronics Programming Tools
The read-write memory is divided into two areas: a short-addressable area and the
remainder, which is accessible using extended addressing.
The input-output area is organized as a collection of individual registers that each have their
own function, and that are not interchangeable with other registers. The address of this area
is fixed by hardware.
For these reasons, it is necessary to be able to control the allocation mechanism. This is done
through the definition of segments in the source text. A Segment is a range of addresses
within the addressable space that has properties that can be defined. These properties drive
the linker's behaviour related to the placement of these segments in memory.
The main idea of a Segment is that, instead of defining a precise start address for a piece of
code or data, it is declared as belonging to a certain segment. Any number of segments may
be defined; but in practice, it is not necessary to define more segments than the number of
areas in memory where the objects can be placed.
To be used in the program, a segment must first be defined. The definition can involve the fol-
lowing items:
Name
This is necessary if the same segment is used in more than one place; it is optional otherwise.
Alignment type
When the segment is allocated, it must start at addresses that m eet the following require-
ments:
Table 7.
Table of the alignment options
Alignment type
Properties
byte
No special requirement. Any address is valid.
word
The start address must be even, that is, at the beginning of a word.
long
The start address must be a multiple of four, that is, at the beginning of a double word.
para
The start address must be a multiple of 16.
64
The start address must be a multiple of 64
128
The start address must be a multiple of 128
page
The start address must be a multiple of 256
1K
The start address must be a multiple of 1024
4K
The start address must be a multiple of 4096
Содержание ST7 Series
Страница 1: ...ST7 8 BIT MCU FAMILY USER GUIDE JANUARY 1999 1 ...
Страница 238: ...238 317 8 C Language and the C Compiler 08 Burn bmp Then use the EPROMer programmer software as described in Chapter 7 ...
Страница 289: ...289 317 10 Second Application a Sailing Computer 10 befor Bs Rw Vw VMG AlphaR AlphaV Before the wind ...