What does these every instruction mean in MIPS ? Dump of assembler code for func
ID: 3760516 • Letter: W
Question
What does these every instruction mean in MIPS ? Dump of assembler code for function main: 0x080484f4 : push %ebp 0x080484f5 : mov %esp,%ebp 0x080484f7 : and $0xfffffff0,%esp 0x080484fa : sub $0x220,%esp 0x08048500 : mov %gs:0x14,%eax 0x08048506 : mov %eax,0x21c(%esp) 0x0804850d : xor %eax,%eax 0x0804850f : mov $0x8048690,%eax 0x08048514 : mov %eax,(%esp) 0x08048517 : call 0x80483f0 0x0804851c : mov $0x80486a5,%eax 0x08048521 : lea 0x11d(%esp),%edx 0x08048528 : mov %edx,0x4(%esp) 0x0804852c : mov %eax,(%esp) 0x0804852f : call 0x8048420 0x08048534 : mov $0x80486a8,%eax 0x08048539 : mov %eax,(%esp) 0x0804853c : call 0x80483f0 0x08048541 : mov $0x80486a5,%eax 0x08048546 : lea 0x1e(%esp),%edx 0x0804854a : mov %edx,0x4(%esp) ---Type to continue, or q to quit---
Explanation / Answer
push ebp
saves the base pointer(EBP) and sets it to point to the top of the stack. ebp is used to access arguments.
mov ebp esp
and
sub esp 0x220
reserves 0x220 bytes for space for local variables on the stack.
esp is used to index local varibles
mov gs eax gs is the segment register its use in linux canbe read up on basically used for per process data
mov eax (esp) copies he value from %eax to the location in memory that %esp points to
xor eax eax setting eax to zero. returning zero
mov eax recognized by the system as read move eax 0x08048514
mov eax esp copies he value from %eax to the location in memory that %esp points to
call 0x0804851c
mov eax move the bytes in memory at the address contained
lea esp edx
lea is load effictive address this instruction places the address specified by its second operand into the register specified by its first operand
mov edx esp move the contents of the edx register into esp
mov eax esp copies he value from %eax to the location in memory that %esp points to
call 0x08048534
mov eax move the bytes in memory at the address contained
mov eax esp copies he value from %eax to the location in memory that %esp points to
call 0x08048541
move eax move the bytes in memory at the address contained
lea esp edx
lea is load effictive address this instruction places the address specified by its second operand into the register specified by its first operand
mov edx esp move the contents of the edx register into esp
quit
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.