add를 실행하는 과정을 쪼개서 과정을 표현해보았다(가로가 긴 화면에서 보는 것을 권장한다). 메모리를 한 열이 4바이트인 표로 그렸다. eip는 레지스터 표가 아닌 왼쪽에 어셈블리 코드에 화살표로 나타냈고, esp와 ebp는 메모리 표에 위치를 나타낼 수 있을 때 메모리에 표시했다.
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
esp
0xffffd4fc
Register
Value
ebp
0x0
(gdb) disass main
Dump of assembler code for function main:
-> 0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
esp
0xffffd4f8
0x0
Register
Value
ebp
0x0
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
-> 0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp,esp
0xffffd4f8
0x0
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
-> 0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0xffffd4ec
esp
0xffffd4e8
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
-> 0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0xffffd4ec
0x3
esp
0xffffd4e8
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
-> 0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
esp
0xffffd4e8
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
-> 0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
esp
0xffffd4e4
0x7
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
-> 0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
esp
0xffffd4e0
0x3
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
-> 0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
esp
0xffffd4dc
0x08048417
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
-> 0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
esp
0xffffd4d8
0xffffd4f8
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
-> 0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
ebp,esp
0xffffd4d8
0xffffd4f8
Register
Value
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
-> 0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
ebp,esp
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
-> 0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
ebp,esp
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0x7
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
-> 0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
ebp,esp
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0xa
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
-> 0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
esp
0xffffd4dc
0x08048417
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0xa
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
-> 0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
esp
0xffffd4e0
0x3
0xffffd4dc
0x08048417
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0xa
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
-> 0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xffffd4f0
0x7
0xffffd4ec
0x3
esp
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0xa
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
-> 0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xa
0xffffd4f0
0x7
0xffffd4ec
0x3
esp
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0xa
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
-> 0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp
0xffffd4f8
0x0
0xffffd4f4
0xa
0xffffd4f0
0x7
0xffffd4ec
0x3
esp
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0x0
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
-> 0x08048422 <+42>: leave
0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Address
Value
0xffffd4fc
ebp,esp
0xffffd4f8
0x0
0xffffd4f4
0xa
0xffffd4f0
0x7
0xffffd4ec
0x3
0xffffd4e8
0xffffd4e4
0x7
0xffffd4e0
0x3
0xffffd4dc
0x08048417
0xffffd4d8
0xffffd4f8
Register
Value
edx
0x3
eax
0x0
(gdb) disass main
Dump of assembler code for function main:
0x080483f8 <+0>: push %ebp
0x080483f9 <+1>: mov %esp,%ebp
0x080483fb <+3>: sub $0x10,%esp
0x080483fe <+6>: movl $0x3,-0xc(%ebp)
0x08048405 <+13>: movl $0x7,-0x8(%ebp)
0x0804840c <+20>: pushl -0x8(%ebp)
0x0804840f <+23>: pushl -0xc(%ebp)
0x08048412 <+26>: call 0x80483eb <add>
0x08048417 <+31>: add $0x8,%esp
0x0804841a <+34>: mov %eax,-0x4(%ebp)
0x0804841d <+37>: mov $0x0,%eax
0x08048422 <+42>: leave
-> 0x08048423 <+43>: ret
End of assembler dump.
(gdb) disass add
Dump of assembler code for function add:
0x080483eb <+0>: push %ebp
0x080483ec <+1>: mov %esp,%ebp
0x080483ee <+3>: mov 0x8(%ebp),%edx
0x080483f1 <+6>: mov 0xc(%ebp),%eax
0x080483f4 <+9>: add %edx,%eax
0x080483f6 <+11>: pop %ebp
0x080483f7 <+12>: ret
End of assembler dump.
Leave a comment