Me 80 heap 08 00 data text 23 not drawn to scale x86

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Elements §༊  Address A + i * (C * K) + j * K §༊  C = n, K = 4 §༊  Must perform integer mul?plica?on /* Get element a[i][j] */ int var_ele(int n, int a[n][n], int i, int j) { return a[i][j]; } movl sall movl imull movl sall addl movl 8(%ebp), %eax $2, %eax %eax, %edx 16(%ebp), %edx 20(%ebp), %eax $2, %eax 12(%ebp), %eax (%eax,%edx), %eax # # # # # # # # n n*4 n*4 i*n*4 j j*4 a + j*4 *(a + j*4 + i*n*4) 20 not drawn to scale IA32 LINUX MEMORY LAYOUT FF Stack 8MB ¢༊  Stack —༉  —༉  Runtime stack (8MB limit) E. g., local variables ¢༊  Heap —༉  —༉  Dynamically allocated storage When call malloc(), calloc(), new() ¢༊  Data —༉  —༉  Statically allocated data E.g., global vars, static vars, strings ¢༊  Text —༉  —༉  Executable machine in...
View Full Document

Ask a homework question - tutors are online