Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What does these every instruction mean in MIPS ? Dump of assembler code for func

ID: 3760519 • Letter: W

Question

What does these every instruction mean in MIPS ? Dump of assembler code for function main: 0x080484f4 <+0>push %ebp

0x080484f5 <+1>: mov %esp,%ebp

0x080484f7 <+3>: and $0xfffffff0,%esp

0x080484fa <+6>: sub $0x220,%esp

0x08048500 <+12>: mov %gs:0x14,%eax

0x08048506 <+18>: mov %eax,0x21c(%esp)

0x0804850d <+25>: xor %eax,%eax

0x0804850f <+27>: mov $0x8048690,%eax

0x08048514 <+32>: mov %eax,(%esp)

0x08048517 <+35>: call 0x80483f0 <printf@plt>

0x0804851c <+40>: mov $0x80486a5,%eax

0x08048521 <+45>: lea 0x11d(%esp),%edx

0x08048528 <+52>: mov %edx,0x4(%esp)

0x0804852c <+56>: mov %eax,(%esp)

0x0804852f <+59>: call 0x8048420 <__isoc99_scanf@plt>

0x08048534 <+64>: mov $0x80486a8,%eax

0x08048539 <+69>: mov %eax,(%esp)

0x0804853c <+72>: call 0x80483f0 <printf@plt>

0x08048541 <+77>: mov $0x80486a5,%eax

0x08048546 <+82>: lea 0x1e(%esp),%edx

0x0804854a <+86>: mov %edx,0x4(%esp)

Explanation / Answer

0x080484f4 <+0>push %ebp ------------------> this will push value to ebp
0x080484f5 <+1>: mov %esp,%ebp -----------------> moving value from ebp to esp
0x080484f7 <+3>: and $0xfffffff0,%esp -----------> Logical AND operation between esp and 0xfffffff0
0x080484fa <+6>: sub $0x220,%esp --------------> subtracting 220 from esp
0x08048500 <+12>: mov %gs:0x14,%eax -------------> moving 0x14 to eax
0x08048506 <+18>: mov %eax,0x21c(%esp) ----------> storing address if esp to eax
0x0804850d <+25>: xor %eax,%eax ---> Logical XOR operation
0x0804850f <+27>: mov $0x8048690,%eax -----> moving value to eax
0x08048514 <+32>: mov %eax,(%esp) ----> moving address of esp to eax
0x08048517 <+35>: call 0x80483f0 <printf@plt> ----> printing result
0x0804851c <+40>: mov $0x80486a5,%eax ----------> moving 0x80486a5 to eax
0x08048521 <+45>: lea 0x11d(%esp),%edx ------> loading effective address of edx to esp
0x08048528 <+52>: mov %edx,0x4(%esp) --------> moving address of esp to edx
0x0804852c <+56>: mov %eax,(%esp) -----------> moving address of esp to eax
0x0804852f <+59>: call 0x8048420 <__isoc99_scanf@plt> -->reading value from console
0x08048534 <+64>: mov $0x80486a8,%eax ------------> moving value to eax
0x08048539 <+69>: mov %eax,(%esp) -------------> moving address of esp to eax
0x0804853c <+72>: call 0x80483f0 <printf@plt> ------> printing value
0x08048541 <+77>: mov $0x80486a5,%eax --------> moving 80486a5 to eax
0x08048546 <+82>: lea 0x1e(%esp),%edx -----> loading effective address of edx to esp ....it is like pointer type
0x0804854a <+86>: mov %edx,0x4(%esp) --------> moving address of esp to edx

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote