Practise_Exam_2_Solution.pdf - Practice Exam 2 November 9 2019 1(a If register �x holds a pointer to an integer then executing the cmd p/x $eax in gdb

Practise_Exam_2_Solution.pdf - Practice Exam 2 November 9...

This preview shows page 1 - 2 out of 5 pages.

Practice Exam 2 November 9, 2019 1.(a) If register %eax holds a pointer to an integer, then executing the cmd p/x $eax in gdb printsout the address of the integer. (b) The pushfl places the condition codes into the %ebx register. (c) xorl %eax,%eax sets %eax to 1 if %ebx is odd. (d) The %ebp register points to the current stack frame. (e) Assembly programmer’s view of memory is equivalent to a linear array of bytes in C. (f) %ah register is the higher 8-bits of %eax register. (g) Are the following operations legal: mov 0x80(%eax,%ebx,%ecx),%edx. 2. Assume the following values are stored at the indicated memory addresses and registers. AddressValue0x1000xFF0x1040xAB0x1080x130x10C0x11RegisterValue%eax0x100%ecx0x1%edx0x3Fill in the following table showing the effects of the following instructions, in terms of both theregister or memory location that will be updated and the resulting value.If the destination is amemory location, provide the effective address. If the destination is a register, provide the registername. Instruction Destination Value addl %ecx, (%eax) 0x100 0x100 subl %edx, 4(%eax) 0x104 0xA8 imull $16, (%eax, %edx, 4) 0x10C 0x110 incl 8(%eax) 0x108 0x14 decl %ecx %ecx 0 subl %edx, %eax %eax 0xFD
Image of page 1
Image of page 2

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture