Memory Offset Annotation

The memory offset annotation .mem.offset provides hints about the address that memory operations address, when the exact address is unknown. The annotation is useful for avoiding false reports of dependency violations. The annotation affects the instruction that follows.

The .mem.offset annotation has the following syntax:

.mem.offset    off_val, base_ind

Where:

off_val

The relative offset for the memory region where the data is stored or retrieved.

base_ind

 A number that identifies the memory region where the information is stored or retrieved. The number is an arbitrary method of distinguishing between different memory regions.

Example Using the Memory Offset Annotation illustrates a .mem.offset annotation.

Example: Using the Memory Offset Annotation

.proc foo
foo::
FOO_STACK_INDEX=0
...                            //code...
.mem.offset 0,FOO_STACK_INDEX  //Suppose r3 contains the stack pointer
st8.spill [r3]=r32,8           //We want to save r32-r34
.mem.offset 8,FOO_STACK_INDEX
st8.spill [r3]=r33,8
.mem.offset 16,FOO_STACK_INDEX
st8.spill [r3]=r34,8
.endp

.proc bar
bar::
.BAR_STACK_INDEX=1
...                            //code...
.mem.offset 0,BAR_STACK_INDEX  //Suppose r3 contains the stack pointer
st8.spill [r3]=r40             //We want to save r40