3 sample definition of sections, 5 conditional assembly instructions – Epson S5U1C63000A User Manual

Page 76

Advertising
background image

CHAPTER 4: ASSEMBLER

62

EPSON

S5U1C63000A MANUAL

(S1C63 FAMILY ASSEMBLER PACKAGE)

4.6.3 Sample Definition of Sections

:

CODE1 (Relocatable program)

:

.data

:

DATA1 (Relocatable data definition)

:

.bss

:

BSS1 (Relocatable RAM area definition)

:

.code

.org 0x0

... If this specification is omitted, a CODE section begins from the address following CODE1.

:

CODE2 (Absolute program)

:

.bss

.org 0x0

... If this specification is omitted, a BSS section begins from the address following BSS1.

:

BSS2 (Absolute RAM area definition)

:

.code

:

CODE3 (Relocatable program)

:

.data

.org 0x8000

... If this specification is omitted, a DATA section begins from the address following DATA1.

:

DATA2 (Absolute data definition)

:

In the section definition shown above, absolute sections and relocatable sections are mixed in one source.
Absolute sections are sections whose absolute addresses are specified with the .org pseudo-instructions.
CODE2, BSS2 and DATA2 are absolute sections. Absolute sections will be located at the place specified.

Other sections are relocatable in the sense that the absolute location addresses are not fixed at the assem-
bly stage and will be fixed later at the linking stage.

Precautions

When there appears in a section a statement which is designed for other section, a warning will be
issued and a new section will be started according to the statement.

Examples:

.code

.comm BUF 16

... Warning; A new bss section begins

.bss

ld %a,%b

... Warning; A new code section begins

Advertising