Changing the number of times it gets called changes

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: a cmp ja jmp shl jmp lea sar jmp lea imul add mov pop ret mov %ebp %esp,%ebp 0x8(%ebp),%eax 0xffffffce(%eax),%edx $0x5,%edx 80483eb <switch_prob+0x2b> *0x8048468(,%edx,4) $0x2,%eax 80483ee <switch_prob+0x2e> 0x0(%esi),%esi $0x2,%eax 80483ee <switch_prob+0x2e> (%eax,%eax,2),%eax %eax,%eax $0xa,%eax %ebp,%esp %ebp %esi,%esi Figure 3.37: Disassembled Code for Problem 3.34. instruction on line 11 is a nop instruction inserted to make the instruction on line 12 start on an address that is a multiple of 16. The jump table resides in a different area of memory. Using the debugger GDB we can examine the six 4-byte words of memory starting at address 0x8048468 with the command x/6w 0x8048468. G DB prints the following: (gdb) x/6w 0x8048468 0x8048468: 0x080483d5 0x8048478: 0x080483e5 (gdb) 0x080483eb 0x080483e8 0x080483d5 0x080483e0 Fill in the body of the switch statement with C code that will have the same behavior as the object code. Homework Problem 3.35 [Category 2]: The code generated by the C compiler for var_pro...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online