如果我聲明這些3個陣列陣列和組件
int a[10][10];
int b[10][15];
int c[10][30];
對於這三個陣列,將彙編代碼返回[i] [j]元素?假設數組的起始地址存儲在%ebx中。
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %edx /* index i */
movl 12(%ebp), %ecx /* index j */
movl %edx, %eax
sall $4, %eax
subl %edx, %eax
addl %ecx, %eax
movl (%ebx,%eax,4), %eax
popl %ebp
ret
你怎麼
沒有即時學習爲我的彙編中期 – user1114371 2012-03-31 02:25:21