Now I am pretty sure this is a basic question but I couldn't find the answer. How many bits at most can offset be ?
There are six addressing modes supporting this format. The assembler will automatically pick the shortest addressing mode into which the displacement fits. The three relevant of these addressing modes are:
It is not possible to encode a greater displacement than what these addressing modes support. If you need a greater displacement, perform arithmetic to load it. For example, do
mov rax, 123456789abcdef0h
lea rax, [rbx+rax]