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

Info iconThis 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:
Background image of page 1

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

View Full DocumentRight Arrow Icon
%eax: _____ description: _______ 2. Consider the following version of the swap.c function that counts the number of times it has been called.
Background 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

Page1 / 2

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

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online