.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.

[Use]

-

The .ds directive is mainly described in the data section defined by the .dseg directive.

[Description]

-

The start address of a data section can be specified with the .org directive.

-

A relocation attribute defines a range of location addresses for a data section.
The relocation attributes available for data sections are shown below.

Table 5.8

Relocation Attributes of .dseg

Relocation Attribute

Description Format

Explanation

Default Value of Alignment Condition

SDATA

SDATA

Allocates a memory range (up to 64 Kbytes, combined with SBSS section), referenced with 1 instructions using gp and 16-bit displacement, having an initial value.

4

SBSS

SBSS

Allocates a memory range (up to 64 Kbytes, combined with SDATA section), referenced with 1 instructions using gp and 16-bit displacement, not having an initial value.

4

SDATA23

SDATA23

Allocates a memory range (up to 8MKbytes, combined with SBSS23 section), referenced with 1 instructions using gp and 23-bit displacement, having an initial value.

4

SBSS23

SBSS23

Allocates a memory range (up to 8Mbytes, combined with SDATA23 section), referenced with 1 instructions using gp and 23-bit displacement, not having an initial value.

4

TDATA

TDATA

Allocates a memory range (up to 256 bytes, in the positive direction from ep), referenced with 1 instructions using ep, having an initial value.

4

TDATA4

TDATA4

Allocates a memory range(up to 16 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 4-bit displacement, having an initial value.

4

TBSS4

TBSS4

Allocates a memory range (up to 16 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 4-bit displacement, not having an initial value.

4

TDATA5

TDATA5

Allocates a memory range(up to 32 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 5-bit displacement, having an initial value.

4

TBSS5

TBSS5

Allocates a memory range (up to 32 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 5-bit displacement, not having an initial value.

4

TDATA7

TDATA7

Allocates a memory range(up to 128 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 7-bit displacement, having an initial value.

4

TBSS7

TBSS7

Allocates a memory range (up to 128 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 7-bit displacement, not having an initial value.

4

TDATA8

TDATA8

Allocates a memory range(up to 256 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 8-bit displacement, having an initial value.

4

TBSS8

TBSS8

Allocates a memory range (up to 256 bytes, in the positive direction from ep), referenced with 1 instructions using ep and 8-bit displacement, not having an initial value.

4

EDATA

EDATA

Allocates a memory range (up to 64 Kbytes, combined with EBSS section), referenced with 1 instructions using ep and 16-bit displacement, having an initial value.

4

EBSS

EBSS

Allocates a memory range (up to 64 Kbytes, combined with EDATA section), referenced with 1 instructions using ep and 16-bit displacement, not having an initial value.

4

EDATA23

EDATA23

Allocates a memory range (up to 8 Mbytes, combined with EBSS23 section), referenced with 1 instructions using ep and 16-bit displacement, having an initial value.

4

EBSS23

EBSS23

Allocates a memory range (up to 8 Mbytes, combined with EDATA23 section), referenced with 1 instructions using ep and 16-bit displacement, not having an initial value.

4

ZDATA

ZDATA

Allocates a memory range (up to 32 Kbytes, combined with ZBSS section, in the negative direction from r0), referenced with 1 instructions using r0 and 16-bit displacement, having an initial value.

4

ZBSS

ZBSS

Allocates a memory range (up to 32 Kbytes, combined with ZDATA section, in the negative direction from r0), referenced with 1 instructions using r0 and 16-bit displacement, not having an initial value.

4

ZDATA23

ZDATA23

Allocates a memory range (up to 4 Mbytes, combined with ZBSS23 section, in the negative direction from r0), referenced with 1 instructions using r0 and 23-bit displacement, having an initial value.

4

ZBSS23

ZBSS23

Allocates a memory range (up to 4 Mbytes, combined with ZDATA23 section, in the negative direction from r0), referenced with 1 instructions using r0 and 23-bit displacement, not having an initial value.

4

DATA

DATA

Allocates a memory range (up to 4 Gbytes, combined with BSS section, in the negative direction from r0), referenced with 2 instructions using r0 and 32-bit displacement, having an initial value.

4

BSS

BSS

Allocates a memory range (up to 4 Gbytes, combined with DATA section, in the negative direction from r0), referenced with 2 instructions using r0 and 32-bit displacement, not having an initial value.

4

Note

If a section with the TDATA relocation attribute is defined in multiple files of source code, linkage of the code will lead to an error.

 

-

The assembler will output an error if a relocation attribute other than "Table 5.8 Relocation Attributes of .dseg" is specified.

-

Machine language instructions cannot be described in a data section with BSS relocation attributes. If described, an error is output.

-

By describing a section name in the symbol field of the .dseg directive, the data section can be named. If no section name is specified for a data section, the assembler automatically gives a default section name.
The default section names of the data sections are shown below.

Relocation Atribute

Default Section Name

SDATA

.sdata

SBSS

.sbss

SDATA23

.sdata23

SBSS23

.sbss23

TDATANote

.tdata

TDATA4

.tdata4

TBSS4

.tbss4

TDATA5

.tdata5

TBSS5

.tbss5

TDATA7

.tdata7

TBSS7

.tbss7

TDATA8

.tdata8

TBSS8

.tbss8

EDATA

.edata

EBSS

.ebss

EDATA23

.edata23

EBSS23

.ebss23

ZDATA

.zdata

ZBSS

.zbss

ZDATA23

.zdata23

ZBSS23

.zbss23

DATA

.data

BSS

.bss

Note

A specification possible section name is only a default section name in TDATA relocation attributes. But, it is possible to omit.

 

The default section names have the relocation attributes shown above. Giving them any other attributes is not possible.

 

test        .dseg   data
            .dw     0x1234
            .dw     0x5678

 

-

The following characters are usable in section names.

-

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

-

Special characters (@, _, .)