Everything

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

[Description]

-

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 an absolute addressing section will be "the name of the section for which the .ORG directive is written (excluding the "_AT" and the subsequent characters for an absolute addressing section)" + "_AT" + "specified address (hexadecimal notation in uppercase letters without prefix (0x or 0X) or suffix (h or H)". The relocation attribute will be the same as that of the section for which .ORG is 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".

-

The operand value is in accordance with "(a) Absolute expression". If the specified absolute expression is illegal or its value is outside the range from 0x00000 to 0xFFFFF, an error will occur.

-

The overall definition of a single section may contain multiple .ORG directives. However, if a section definition already exists for the section name specified through this directive or the section address specified through this directive is in an address range where another absolute addressing section within the same module is already allocated, an error will occur.

[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
LAB1:   MOV         A, !LABEL
        .ORG        0x30            ;My_text.AT30 is allocated to address 0x30
        MOV         A,!LABEL

 

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         A,!LABEL                ;Allocated in My_text_AT50

 

If .ORG is written in an absolute addressing section, the section name will be "the absolute addressing section name before "_AT" " + "_AT" + "specified address".

.SECTION    My_text, AT     0x20
NOP                                 ;Allocated in My_text_AT20
.ORG        0x50
MOV         A,!LABEL                ;Allocated in My_text_AT50