Homework8 - For each symbol that is defined and referenced...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 8 1. We now have a piece of Y86 code, tell the value of %eax when the program ends; and give a description about what the program has done. 0x000: 0x000: 308400020000 0x006: 308500020000 0x00c: 7058000000 0x011: 0x011: a058 0x013: 2045 0x015: a008 0x017: a018 0x019: 308102000000 0x01f: 6110 0x021: 7631000000 0x026: 308001000000 0x02c: 7051000000 0x031: 0x031: 8011000000 0x036: a028 0x038: 2002 0x03a: 5005fcffffff 0x040: 308101000000 0x046: 6110 0x048: 8011000000 0x04d: 6020 0x04f: b028 0x051: 0x051: b018 0x053: b058 0x055: b058 0x057: 90 0x058: 0x058: 308007000000 0x05e: 8011000000 0x063: 10 0x200: 0x200:
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
%eax: _____ description: _______ 2. Consider the following version of the swap.c function that counts the number of times it has been called.
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: For each symbol that is defined and referenced in swap.o , indicate if it will have a symbol table entry in the .symtab section in module swap.o . If so, indicate the module that defines the symbol( swap.o or main.o ), the symbol type( local , global , or extern ) and the section ( .text , . data , or .bss ) it occupies in that module. Symbol swap.o .symtab entry ? Symbol Type Module where defined Section buf bufp0 bufp1 swap temp incr count 1 extern int buf[]; 2 3 int * bufp0 = &buf[0]; 4 static int *bufp1; 5 6 static void incr(){ 7 static int count = 0; 8 count ++; 9 } 10 11 void swap(){ 12 int temp; 13 incr(); 14 bufp1 = &buf[1]; 15 temp = *bufp0; 16 *bufp0 = *bufp1; 17 *bufp1 = temp; 18 }...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern