mov array[eax * 4], 0 /* when does multiply happen? */
Posted on 1998-11-17
I know this is not a C question, but maybe some assembly
guys look at this section.
In the assembly statement:
mov dword ptr array[eax * 4], 0
When does the eax register get multiplied by four?
Is the resulting index stored anywhere before it
is added to "array"? I imagine that the result of
"eax * 4" must be stored somewhere, but where?
NOTE: If you want to see this for yourself, compile
this and look at the assembly that results:
int x = 5;
array[x] = 0;