You copied the Doc URL to your clipboard.

Org directive

The .org directive advances the location counter in the current section to new-location.


.org new_location [, fill_value]



The new_location argument must be one of:

  • An absolute integer expression, in which case it is treated as the number of bytes from the start of the section.
  • An expression which evaluates to a location in the current section. This could use a symbol in the current section, or the current location ('.').

This is an optional 1-byte value.


The .org directive can only move the location counter forward, not backward.

By default, the .org directive inserts zero bytes in any locations that it skips over. This can be overridden using the optional fill_value argument, which sets the 1-byte value that will be repeated in each skipped location.


    // Macro to create one AArch64 exception vector table entry. Each entry
    // must be 128 bytes in length. If the code is shorter than that, padding
    // will be inserted. If the code is longer than that, the .org directive
    // will report an error, as this would require the location counter to move
    // backwards.
    .macro exc_tab_entry, num
    mov x0, #\num
    b unhandled_exception
    .org 1b + 0x80

    // Each of these macro instantiations emits 128 bytes of code and padding.
    .section vectors, "ax"
    exc_tab_entry 0
    exc_tab_entry 1
    // More table entries...