.org


Indicate the start of a section at an absolute address to the assembler.

[Syntax]

Symbol field
Mnemonic field
Operand field
Comment field
 
.org
absolute-expression 
[; comment]

[Function]

-

Indicate the start of a section at an absolute address to the assembler.

-

After the .org directive, it is valid until the next section definition directive.

-

The range from the .org directive to the line with the next section definition directive (.cseg, .dseg, .section or .org) is regarded as a section where the code is placed at absolute addresses.

-

The name of each section starting at an absolute address takes the form of "section for which .org was written" + ".AT" + "specified address". The relocation attribute is the same as that of the section for which .org was written.

-

If .org is written prior to a section definition directive at the beginning of a file of source code, the name of the section will be ".text.AT" + "specified address" and the relocation attribute will be "TEXT".

[Example]

If .org is written immediately after a section definition directive, the section is only generated from the absolute address.

.section    "My_text", text
.org        0x12                    ;"My_text.AT12" is allocated to address 0x12
mov         r10, r11
.org        0x30                    ;"My_text.AT30" is allocated to address 0x30
mov         r11, r12

 

If the .org directive does not immediately follow the section definition directive, only the range of code from the .org directive is a section starting at the given absolute address.

.section    "My_text", text
nop                                 ;Allocated in "My_text"
.org        0x50
mov         r10, r11                ;Allocated in "My_text.AT50"

[Caution]

-

The operand value is in accordance with "Absolute expression". An illegal value will lead to an error and cause processing to end.

-

The overall definition of a single section may contain multiple .org directives. Note, however, that an error will occur if an address specified for a section by .org is in an address range to which another section starting at an absolute address has been allocated in the same file.

-

An error will occur in any of the following cases.

-

When the .org directive was written to the TDATA, PCTEXT, PCCONST16, PCCONST23 or PCCONST32 relocation attbibute section.

-

If the .org directive was written to the GP-relative section or EP-relative section when the -pid option has been specified