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.

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

Relocation Attributes of .dseg

Relocation Attribute

Explanation

Default Section Name

Default Value of Alignment Condition

SDATA

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

.sdata

4

SBSS

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

.sbss

4

SDATA23

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

.sdata23

4

SBSS23

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

.sbss23

4

SDATA32

[V1.07.00 or later]

Allocates a memory range, referenced with 2 instructions using gp and 32-bit displacement, having an initial value.

.sdata32

4

SBSS32

[V1.07.00 or later]

Allocates a memory range, referenced with 2 instructions using gp and 32-bit displacement, not having an initial value.

.sbss32

4

TDATA

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

.tdata

4

TDATA4

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

.tdata4

4

TBSS4

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

.tbss4

4

TDATA5

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

.tdata5

4

TBSS5

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

.tbss5

4

TDATA7

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

.tdata7

4

TBSS7

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

.tbss7

4

TDATA8

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

.tdata8

4

TBSS8

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

.tbss8

4

EDATA

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

.edata

4

EBSS

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

.ebss

4

EDATA23

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

.edata23

4

EBSS23

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

.ebss23

4

EDATA32

[V1.07.00 or later]

Allocates a memory range, referenced with 2 instructions using gp and 32-bit displacement, having an initial value.

.edata32

4

EBSS32

[V1.07.00 or later]

Allocates a memory range, referenced with 2 instructions using gp and 32-bit displacement, not having an initial value.

.ebss32

4

ZDATA

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

.zdata

4

ZBSS

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

.zbss

4

ZDATA23

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

.zdata23

4

ZBSS23

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

.zbss23

4

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.

.data

4

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.

.bss

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.

Note

A specifiable section name is only a default section name in a section with the TDATA relocation attributes.

 

-

An error will occur in any of the following cases.

-

When a relocation attribute other than those in "Table 5.9 Relocation Attributes of .dseg" is specified

-

When a machine language instruction or data definition directive is described in a section with BSS relocation

-

If SDATA32, SBSS32, EDATA32, or EBSS32 is specified when the -pid option has not been specified

-

If DATA, BSS, ZDATA, ZBSS, ZDATA23, or ZBSS23 is specified when the -pid option has been specified

-

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.

-

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

 

Example

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 (@, _, .)