0x4004ca nopw 0xraxrax1 0x4004d0 retq 0x4004d1 mov edieax 0x4004d3 and 0x19eax

0x4004ca nopw 0xraxrax1 0x4004d0 retq 0x4004d1 mov

This preview shows page 5 - 8 out of 8 pages.

0x4004ca:nopw0x(%rax,%rax,1) 0x4004d0:retq0x4004d1:mov%edi,%eax0x4004d3:and$0x19,%eax0x4004d6:retq0x4004d7:lea(%rdi,%rdi,1),%eax 0x4004da:add%esi,%eax0x4004dc:retqFill in the blank portions of the C code below to reproduce the function corresponding to this object code.int test(int x, int y, int z){int result = 3; switch(z){case ; case case : : :
Image of page 5
; : ; : ; ; 9. Stack Completion from Midterm2 Stacks.
Image of page 6
Given the following function prototypes, and initial lines of IA32 assembly for each function, fill in the stack frame diagram withany arguments to the function foothe return addressAny registers stored on the stack by the asm fragment (register names not values)The location on the stack pointed to by %esp and %ebp after the exection of the sub instruction.int foo(int a, int b, int c, int d); push %ebpmov%esp,%ebp push %ebxsub $0x10,$esp-----------0x1000 | d | <- Start argument build area here| c | b | a | ret addr|ebp -> | %ebp | %ebx | | | esp -> | | | | | | | | | |
Image of page 7
Image of page 8

You've reached the end of your free preview.

Want to read all 8 pages?

  • Fall '12
  • Barrett
  • Byte, Switch statement, X86 assembly language, Locality of reference, Branch table

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture