There are a lot of text books and resources that explain addressing mode of the cpu and categorize the X86 addressing mode into
Immediate
Register
Memory --> direct
--> register indirect
--> base
--> Index
--> Base-Index
Basically, addressing mode tries to answer this question: where is the data for the execution of the instruction? For example, mov ax, 04
is immediate because the value 04
is part of the instruction code which is fetched by the cpu. Therefore, no mode memory access is needed for the execution of the instruction.
As another example, mov ax, [FFH]
is called direct memory mode because the data (operand) is not available in the instruction code. Hence, cpu has to access the memory one more time to obtain the data.
Now, I see a lot of instances in the disassembly code of an X86 code, compiled with visual studio, that looks like
mov dword ptr [ebp-8],0
It is easy to understand that it tries to put 0
in four bytes (dword) of the memory located at [ebp-8]. The instruction code for that is c745f800000000
. The question is what is the addressing mode of this instruction (and other instances)?
This is a data movement instruction, so the concept of the addressing mode should be valid. Isn't that?