Here is the code of loop that I'm trying to understand the disassembly of it:
#include<stdio.h>
#include <iostream>
using namespace std;
int main() {
int i, arr[50], num;
printf("\nEnter no of elements :");
cin >> num;
//Reading values into Array
printf("\nEnter the values :");
for (i = 0; i < num; i++)
cin >> arr[i];
return 0;
}
And this is the disassembly:

Can you explain me the highlighted part? what is Var_D8 is used for? Why compiler shifted left the edx?
arrbeeing a byte array? You could also attach a dynamic debugger (Ollydbg) and see what is happening exactly by stepping trough your code. – Dominik Antal Jun 05 '15 at 09:07leaopcode - eax gets the address, not the content, of that stack variable. This is the start of your array. As an integer has 4 bytes on your machine, counter gets multiplied by 4, which is the same as left shifting it by 2 - but the left shift is faster on many processors, which is why it's chosen over the multiply. – Guntram Blohm Jun 05 '15 at 09:21