To answer the first question, it does not work because assembly is not a high-level language.
An indirect memory operand with 32-bit registers can specify one base and one index register, with a optional scaling factor of 1, 2, 4, or 8 on the index register, and any number of displacements. The LEA instruction can be used to calculate the address of an indirect memory operand, or it can be used to harness the processor’s addressing mechanism to do one shift, two additions, and one move in a single instruction. I originally had a third example in this code, but it made the solution too easy.
;==============================================================================
include \masm32\include\masm32rt.inc
;==============================================================================
.data
array dd 0,1,2,3,4,5,6,7
.code
;==============================================================================
start:
;==============================================================================
mov esi, 4
mov edi, 2
mov eax, array[esi+edi*4-4]
printf("%d\n", eax)
lea eax, [esi+edi*4-4]
printf("%d\n\n", eax)
inkey
exit
;==============================================================================
end start