Assembling And Linking Multiple Sections - Panasonic PanaXSeries MN1030 Series User Manual

Panasonic microcomputer user's manual
Table of Contents

Advertisement

Chapter 3 Introduction to Operation
3.4

Assembling and Linking Multiple Sections

In section 3.3, "Basic Operation of the Assembler and Linker", source files each comprising one
section were assigned to the same section as a basic example. However, normally a program will be
divided into multiple sections to clearly divide programs by function and type.
The start addresses of a program in section format are set for each section during linking. Therefore,
when a program divided into multiple files is developed, work can proceed without the programmer
staying aware of the code size of each file. The programmer an also freely change the order in which
files are linked.
The following explanation illustrates a simple example dividing two source files into sections for each
routine, allocated to two sections.
Create source files
Using an editor, create the two programs shown below (program3.asm and program4.asm).
The contents of program3.asm are as follows.
_CODE_00
main
_DATA
data1
30 Assembling and Linking Multiple Sections
global
main
global
data_set, time_filler
section
CODE, PUBLIC, 1
mov
0, A0
mov
0xff, D0
mov
0x80, D1
jsr
data_set
jsr
time_filler
bra
main
section
DATA, PUBLIC, 4
ds
4
end

Advertisement

Table of Contents
loading

Table of Contents