s5u1c33000c Epson Electronics America, Inc., s5u1c33000c Datasheet - Page 51

no-image

s5u1c33000c

Manufacturer Part Number
s5u1c33000c
Description
Cmos 32-bit Single Chip Microcomputer S5u1c33000c Manual
Manufacturer
Epson Electronics America, Inc.
Datasheet
3.4 Relationship between Program Structure and Memory
This section briefly explains the concept of section management applied to the creation and linkage of source
files. Although it is not specifically have to been concerned about sections in the C source, the assembly source
requires that sections be explicitly be defined so that they can be created and linked.
In addition to programs to control the CPU and peripheral circuits, the source file contains descriptions of data
such as font data which are always fixed and do not require initialization, symbols for the variables placed in
RAM, and I/O memory control registers. Data and symbols that take on different attributes like these finally need
to be relocated into the corresponding physical memory locations by the Linker. For example, programs are
relocated into a program ROM area, fixed data are relocated into a data ROM area. For this reason, the object
code is designed to be classified into sections by attribute.
The following three types of sections exist:
1. CODE section
2. DATA section
3. BSS section
For assembly source
For C source
S5U1C33000C MANUAL
(C COMPILER PACKAGE FOR S1C33 FAMILY) (Ver. 4)
For the assembly source, use the following assembler pseudo-instructions to specify a section:
.code pseudo-instruction
.data pseudo-instruction
.comm/.lcomm pseudo-instructions
The following shows the method of specification (see Chapter 11 for details):
For relocatable assembly sources (including one that is created by compiling a C source), sections of the
same attribute are located together as one continuous section. Consequently, the assembled module
becomes an object that has one CODE section, one DATA section, and one BSS section. (Even undeclared
sections are created as those that do not have any actual data.)
For an assembly source where absolute addresses are specified, sections of the same type cannot be put
together into one section. In this case, therefore, as many sections as specified separately in the source are
created.
For C sources, there is no need to specify sections in the source because sections are declared by the C
Compiler. After the source is compiled, all instructions are located in the CODE section. Data is located in
each corresponding section according to its attribute as follows:
Variables without an initial value (e.g., int i;): BSS section
Variables with an initial value (e.g., int i=l;): DATA section
Constants (e.g., const int i=1;):
Before describing the program and fixed data to be written to the ROM, declare the beginning of a
CODE section by using the .code pseudo-instruction. The source code following this declaration is
assembled as the object of a CODE section. If no section is defined, the Assembler assumes a CODE
section from the beginning of the file.
Before setting RAM data that have initial values, declare the beginning of a DATA section by using
the .data pseudo-instruction. The source code following this declaration is assembled as the object of
a DATA section. However, the initial values in the DATA section have to been copied to the RAM by
program.
If the program requires to secure a variable or work area in the RAM and reference its address with a
symbol, allocate this area and define the symbol by using the .lcomm pseudo-instruction. The
Assembler allocates a specified area in the BSS section. This area is mapped in the RAM or I/O area,
with no object code created there. Symbol information enabling multiple modules to reference this
area is created as a BSS section.
Block for programs and fixed data that have initial values
Block for data that have initial values and can be accessed for read or write
Block that is mapped into RAM
Beginning of a CODE section
Beginning of a DATA section
Symbol definition to a BSS section and area allocation
CODE section
EPSON
CHAPTER 3: SOFTWARE DEVELOPMENT PROCEDURES
35

Related parts for s5u1c33000c