Sequential addressing
The default addressing mode for code is sequential addressing, when the instruction pointer (IP) register (IP for 32-bit systems and RIP for 64-bit) contains the address of the instruction following the one being currently executed. There is nothing we need to do in order to put processor into this mode. The instruction pointer is set to the next instruction automatically by the CPU.
For example, when executing the first instruction of the following code, the IP is already set to the address of the next one, labeled as next_instruction. As the first instruction is call, which, as we know, causes the return address to be pushed onto the stack--which, in this particular case, is also the address of next_instruction--the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access