Okey. Let go with example.
We have class Player with field "gold".
Field stored at 0x140 from object begin.
Then if object have pointer = 0x123000, then gold have address = 0x123140. Pointer + offset.
Now we have one object of player. It created with operator "new" of C. This operator create new or use exists anonymous memory region and allocate on it memory.
Because of ALSR it can be in any place of memory. Because of operator "new" it do not have any concrete name or have common name like "malloc".
Pointer to this memory can be saved in stack of main loop or in .bss or .data segment of memory. This too present some offset from start of memory region.
0x140 not present in memory in most cases. It is hard-coded in assembler operands.
Like "mov r0, [r3, 0x140]"
We can find value of gold in memory. Okey. We find it in some way. It is have address 0x4567890. Now we need find pointer but how?
We do not know need offset in Player object. If we known it we can calculate 0x4567890 - 0x140 and search this value in memory, but we do not know it.
And in next build of game this offset can be different.
And this I only show general problem. Let go deeper.
Assembler. In arm assembler all offset calculated from current point. In x86 we can use on base for all offsets.
Arm. load string look like: get pc register + some offset constant - result put in register. It will pointer to string.
Because offset rely on PC register - then offset for one string in different places is different.
Okey.
X86. Load string look like: get segment address + some offset constant - result put in constant. it will be pointer of string.
Because offset rely to segment address (they stay same in most cases) - then offset to one string in different places will be same.
Okey.
Return to Arm.
Arm have limitations to load big numbers in one instructions. If offset too big it can not be loaded with one instructions. It can be loaded with two instructions:
1. Or as load low part + load high part - data stored in instructions.
2. Or as load small offset to number placed near (usually after function code) and second command used this loaded number as relative offset. both of them rely to PC register. Both of them rely to position of current command.
Nice things?
Tell me what you mean by offset in this case and how we can found it.