Assembly (AT&T Syntax) Question 1.A: Consider the following assembly code fragme
ID: 3936981 • Letter: A
Question
Assembly (AT&T Syntax) Question 1.A:
Consider the following assembly code fragment:
___________________________________________________________
pushl %ebp
movl %esp, %ebp
subl $0x40, %esp
movl %ebx, 0x14(%esp)
movl $1, %ebx
___________________________________________________________
Which one of the choices is able to undo the effects of the fragment above?
A. movl 0x14(%esp), %ebx
movl %ebp, %esp
popl %ebp
B. movl -0x26(%ebp), %ebx
addl $0x40, %esp
movl %ebp, %esp
popl %ebp
C. popl %ebp
movl %ebp, %esp
addl $0x40, %esp
movl 0x14(%esp), %ebx
D. movl 14(%esp), %ebx
addl $40, %esp
movl %ebp, %esp
popl %ebp
Explanation / Answer
Code :
pushl %ebp
movl %esp, %ebp
subl $0x40, %esp
movl %ebx, 0x14(%esp)
movl $1, %ebx
Undo the effects of the fragment :
movl 14(%esp), %ebx
addl $40, %esp
movl %ebp, %esp
popl %ebp
Option D is correct choice.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.