Everything

.DSEG


Indicate to the assembler the start of a data section.

[Syntax]

Symbol field
Mnemonic field
Operand field
Comment field
[section-name]
.DSEG
[relocation-attribute]
[; comment]

[Function]

-

The .DSEG directive indicates to the assembler the start of a data section.

-

A memory following the .DSEG directive belongs to the data section until it comes across a section definition directives.

[Description]

-

This directive defines a portion that defines data in a program.
This directive is valid until another section definition directive appears.

-

DSEG directive can specify the start address of a section by specifying DATA_AT nad BSS_AT in the operand field.
The section start address can also be specified through the .ORG directive.
In this case, the section name will be "the specified section name" + "_AT" + "specified address (hexadecimal notation in uppercase letters without prefix (0x or 0X) or suffix (h or H)".

-

The following shows the relocation attributes that can be specified through .DSEG.

Table 5.17

Relocation Attributes of .DSEG

Relocation Attribute

Description Format

Default Section Name

Explanation

Default Value of Alignment ConditionNote 1

SDATA

SDATA

.sdata

Allocates a section for data having initial values in the saddr areaNote 2 with the start address set to an even address.

2

SBSS

SBSS

.sbss

Allocates a section for data having no initial values in the saddr areaNote 2 with the start address set to an even address.

2

DATA

DATA

.data

Allocates a section for data having initial values between addresses 0xF0000 and 0xFFFFF in the RAM areaNote 2 with the start address set to an even address so that it does not extend across a boundary of 64 Kbytes - 1Note 3.

2

BSS

BSS

.bss

Allocates a section for data having no initial values between addresses 0xF0000 and 0xFFFFF in the RAM areaNote 2 with the start address set to an even address so that it does not extend across a boundary of 64 Kbytes - 1Note 3.

2

DATAF

DATAF

.dataf

Allocates a section for data having initial values with the start address set to an even address so that it does not extend across a boundary of 64 Kbytes - 1Note 3.

2

BSSF

BSSF

.bssf

Allocates a section for data having no initial values with the start address set to an even address so that it does not extend across a boundary of 64 Kbytes - 1Note 3.

2

DATA_ATΔaddress

DATA_AT absolute- expressionNote 4

None

Allocates a section for data having initial values at a specified address.

1 (fixed)

BSS_ATΔaddress

BSS_AT absolute- expressionNote 4

None

Allocates a section for data having no initial values at a specified address.

1 (fixed)

Note 1.

The alignment condition can be modified through the .ALIGN directive.

Note 2.

For the code flash area, mirror area, RAM area, and saddr area, see the user's manual of the device. For the RAM area, note that only the on-chip RAM allocated to an address range from 0xF0000 to 0xFFFFF is supported.

Note 3.

Allocation beyond a boundary of 64 Kbytes - 1 is prohibited by default.

Note 4.

If the specified absolute expression is illegal or its value is outside the range from 0x00000 to 0xFFFFF, an error will occur.

 

-

A directive that specifies initial values cannot be written in a section definition for data having no initial values. If described, an error is output.

-

When a section definition does not include a section name, the assembler gives a separate default section name for each relocation attribute.
The following shows the section names given by the assembler

Relocation Attribute

Section Name

SDATA

.sdata

SBSS

.sbss

DATA

.data

BSS

.bss

DATAF

.dataf

BSSF

.bssf

DATA_ATΔaddress

.data_AT start-address

BSS_ATΔaddress

.bss_AT start-address

 

A section having one of the above names has the corresponding relocation attribute shown above and no different relocation attribute can be assigned.

 

-

When a section definition does not include a relocation attribute, relocation attribute "DATA" is assumed.

-

The following characters are usable in section names.

-

Alphanumeric characters (0-9, a-z, A-Z)

-

Special characters (@, _, .)

[Example]

To define section ".data" having the DATA attribute.

.data   .DSEG   DATA
        .DS     4

 

To define section "_S" having the SDATA attribute.

_S      .DSEG   SDATA
        .DS     4

 

To define section "EX" having the DATA_AT attribute with address 0xff000 specified.

The section name will be set to "EX_ATFF000".

EX      .DSEG   DATA_AT 0xff000
        .DS     2