.offset


Specifies an offset from the first address of a section.

[Syntax]

Symbol field

Mnemonic field

Operand field

Comment field

 
.offset
absolute-expression
[; comment]

[Function]

-

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

-

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

-

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

-

Section names can also be enclosed in double-quotation marks (").

Example

.section    "My_data", data
.offset     0x12
mov         r10, r11            ; The offset is 0x12

[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 occurs when the specified value is smaller than that for a preceding .offset directive.

-

The value specified as an operand of the .offset directive must be an Absolute expression in the range of 0x0 to 0x7fffffff.
The actual value is limited by the memory size of the host machine where the program runs.

-

The initial value for the area that is formed between the location of the .offset directive and the specified offset is 0x0.

-

When the .offset directive is written in a section with relocation attribute "BSS", an error will occur.