int array[] = {2,3,4,5};
00A3355E mov dword ptr [array],2
00a33565 mov dword ptr [ebp-10h],3
00A3356C mov dword ptr [ebp-0ch],4
00a33573 mov dword ptr [ebp-8],5
int *p =array;
00a3357a Lea Eax,[array]
00A3357D mov dword ptr [P],eax
printf ("%d\t", array[2]);
00A33580 mov Esi,esp
00a33582 mov eax,dword ptr [ebp-0ch]
00a33585 push EAX
00a33586 Push offset string "%d/t" (0a357a0h)
00a3358b call DWORD ptr [__imp__printf (0a382c0h)]
00a33591 Add esp,8
00a33594 CMP ESI,ESP
00a33596 call @ILT +315 (__RTC_CHECKESP) (0a31140h)
printf ("%d\t", p[2]);
00A3359B mov Esi,esp
00a3359d mov eax,dword ptr [p]
00A335A0 mov ecx,dword ptr [eax+8]
00A335A3 push ECX
00A335A4 Push offset string "%d/t" (0a357a0h)
00a335a9 call DWORD ptr [__imp__printf (0a382c0h)]
00A335AF Add esp,8
00A335B2 CMP ESI,ESP
00A335B4 call @ILT +315 (__RTC_CHECKESP) (0a31140h)
printf ("%d\t", * (p+2));
00A335B9 mov Esi,esp
00A335BB mov eax,dword ptr [p]
00A335BE mov ecx,dword ptr [eax+8]
00A335C1 push ECX
00A335C2 Push offset string "%d/t" (0a357a0h)
00a335c7 call DWORD ptr [__imp__printf (0a382c0h)]
00A335CD Add esp,8
00A335D0 CMP ESI,ESP
00A335D2 call @ILT +315 (__RTC_CHECKESP) (0a31140h)
return 0;
00a335d7 XOR Eax,eax
The array name itself is an address constant
The following table addressing is achieved by (first address + offset)
The pointer itself is a variable whose value is the first address of the array
Pointer addressing takes its value first, plus the offset
Array and pointer array assembly differences