Everything

-smap


< Compile Options / Optimize Options >

[Format]

-smap

[Description]

-

When the smap option is specified, a base address is set for global or static variables defined in the file to be compiled, and a code that uses addresses relative to the base address for accesses to those variables is generated.

[Example]

-

<C source file>

long A,B,C;
void func()
{
    A = 1;
    B = 2;
    C = 3;
}

-

<Output code>

_func:
  MOV.L     #_A,R4     ; Sets the address of A as the base address.
  MOV.L     #1,[R4]
  MOV.L     #2,4[R4]   ; Accesses B using the address of A as the base.
  MOV.L     #3,8[R4]   ; Accesses C using the address of A as the base.

[Remarks]

-

This option is only valid for the compilation of C/C++ source programs. It does not apply to programs that have been compiled with the output=src specification or to programs written in assembly language.

-

When the map option and smap option are specified simultaneously, the map option is valid.