freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

深入理解計(jì)算機(jī)系統(tǒng)_復(fù)習(xí)_清華-預(yù)覽頁

2025-06-12 08:26 上一頁面

下一頁面
 

【正文】 based on case structure Stack Pointer %esp yoo who proc Frame Pointer %ebp Stack ―Top‖ IA32Stack Frames Contents ? Local variables ? Return information ? Temporary space Management ? Space allocated when enter procedure ? “Setup” code ? Deallocated when return ? “Finish” code Pointers ? Stack pointer %esp indicates stack top ? Frame pointer %ebp indicates start of current frame amI IA32/Linux Stack Frame Current Stack Frame (“Top” to Bottom) ? Parameters for function about to call ? “Argument build” ? Local variables ? If can’t keep in registers ? Saved register context ? Old frame pointer Caller Stack Frame ? Return address ? Pushed by call instruction ? Arguments for this call Stack Pointer (%esp) Frame Pointer (%ebp) Return Addr Saved Registers + Local Variables Argument Build Old %ebp Arguments Caller Frame IA32/Linux Register Usage Integer Registers ? Two have special uses %ebp, %esp ? Three managed as calleesave %ebx, %esi, %edi ? Old values saved on stack prior to using ? Three managed as callersave %eax, %edx, %ecx ? Do what you please, but expect any callee to do so, as well ? Register %eax also stores returned value %eax %edx %ecx %ebx %esi %edi %esp %ebp CallerSave Temporaries CalleeSave Temporaries Special %rax %rbx %rcx %rdx %rsi %rdi %rsp %rbp x8664 Register Conventions %r8 %r9 %r10 %r11 %r12 %r13 %r14 %r15 Return Value Callee Saved Argument 4 Argument 3 Argument 2 Argument 1 Stack Pointer Callee Saved Argument 5 Argument 6 Callee Saved Used for linking C: Callee Saved Callee Saved Callee Saved Callee Saved x8664 Registers Arguments passed to functions via registers ? If more than 6 integral parameters, then pass rest on stack ? These registers can be used as callersaved as well All References to Stack Frame via Stack Pointer ? Eliminates need to update %ebp Other Registers ? 6+1 callee saved ? 2 or 3 have special uses x8664 Locals in the Red Zone Avoiding Stack Pointer Change ? Can hold all information within small window beyond stack pointer /* Swap, using local array */ void swap_a(long *xp, long *yp) { volatile long loc[2]。 *yp = loc[0]。a[i], amp。a[i] leaq 8(%rdi), %rsi amp。 a[i+1] */ void swap_ele (long a[], int i) { swap(amp。a[i] leaq 8(%rdi), %rsi amp。 ? Array of data type T and length L ? Contiguously allocated region of L * sizeof(T) bytes ? Identifier A can be used as a pointer to array element 0 Type T* Viewing as Multidimensional Array Declaration T A[R][C]。 A+i*C*4 A+(R1)*C*4 A+(i*C+j)*4 Nested Array Element Access Code Array Elements ? pgh[index][dig] is int ? Address: pgh + 20*index + 4*dig IA32 Code ? Computes address pgh + 4*dig + 4*(index+4*index) ? movl performs memory reference int get_pgh_digit (int index, int dig) { return pgh[index][dig]。 /* Compute element i,k of fixed matrix product */ int fix_prod_ele (fix_matrix a, fix_matrix b, int i, int k) { int j。 j++) result += a[i][j]*b[j][k]。 } movl 12(%ebp),%eax i movl 8(%ebp),%edx a imull 20(%ebp),%eax n*i addl 16(%ebp),%eax n*i+j movl (%edx,%eax,4),%eax Mem[a+4*(i*n+j)] Optimizing Dynamic Array Mult. Optimizations ? Performed when set optimization level to O2 Code Motion ? Expression i*n can be puted outside loop Strength Reduction ? Incrementing j has effect of incrementing j*n+k by n Performance ? Compiler can optimize regular access patterns { int j。 j++) result += a[i*n+j] * b[j*n+k]。 int iTn = i*n。 j++) { result += a[iTn+j] * b[jTnPk]。 int i[2]。 structure length must be multiples of K Example (under Windows or x8664): ? K = 8, due to double element c i[0] i[1] v p+0 p+4 p+8 p+16 p+24 Multiple of 4 Multiple of 8 Multiple of 8 Multiple of 8 Specific Cases of Alignment (IA32) Size of Primitive Data Type: ? 1 byte (., char) ? no restrictions on address ? 2 bytes (., short) ? lowest 1 bit of address must be 02 ? 4 bytes (., int, float, char *, etc.) ? lowest 2 bits of address must be 002 ? 8 bytes (., double) ? Windows (and most other OS’s amp。., treated the same as a 4byte primitive data type ? 12 bytes (long double) ? Windows, Linux: 187。lowest 3 bits of address must be 0002 ? 16 bytes (long double) ? Linux: 187。 double v。 double v。 gets(bu
點(diǎn)擊復(fù)制文檔內(nèi)容
研究報(bào)告相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1