.OFFSET


Specifies an offset from the first address of a section.

[Syntax]

Symbol field
Mnemonic field
Operand field
Comment field
[label:]
.OFFSET
absolute-expression
[; comment]

[Function]

-

The .OFFSET directive specifies an offset from the first address of a section that holds instruction code or data for the lines following the .OFFSET directive.

-

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

[Description]

-

If .OFFSET is written prior to any section definition directive at the beginning of a source program, the name of the section will be ".text" 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. Note, however, that an error occurs when the specified value is smaller than that for a preceding .OFFSET directive.

-

The initial value for the area between the address of this directive line and the offset address specified by this directive is "0x0".

-

The .OFFSET directive cannot be used when the relocation attribute for the target section includes BSS. If the directive is specified in this case, an error will occur.

[Example]

.SECTION    My_data, text
.OFFSET     0x12
MOV         A, B            ; The offset is 0x12