jmp location
call address
# calltest.s - An example of using CALL instruction
.section .data
output:
.asciz "This is section %d\\n"
.section .text
.global _start
_start:
pushl $1
pushl $output
call printf
add $8, %esp
call overhere
pushl $3
pushl $output
call printf
add $8, %esp
pushl $0
call exit
overhere:
pushl %ebp
movl %esp, %ebp
pushl $2
pushl $output
call printf
add $8, %esp
movl %ebp, %esp
popl %ebp
ret
080481b8 <_start>:
80481b8: 6a 01 push $0x1
80481ba: 68 ac 92 04 08 push $0x80492ac
80481bf: e8 d4 ff ff ff call 8048198 <printf@plt>
80481c4: 83 c4 08 add $0x8,%esp
80481c7: e8 16 00 00 00 call 80481e2 <overhere>
80481cc: 6a 03 push $0x3
(gdb) info registers
eax 0x12 18
ecx 0x0 0
edx 0xb560f4 11886836
ebx 0x632fc0 6500288
esp 0xbf9d6110 0xbf9d6110
ebp 0xbf9d6118 0xbf9d6118
esi 0xbf9d612c -1080205012
edi 0x80481b8 134513080
eip 0x80481ec 0x80481ec <overhere+10>
eflags 0x200292 [ AF SF IF ID ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
(gdb) x/8x 0xbf9d6110
0xbf9d6110: 0x080492ac 0x00000002 0x00000000 0x080481cc
0xbf9d6120: 0x00000001 0xbf9d78b6 0x00000000 0xbf9d78d4
[beyes@localhost assembly]$ ./calltest
This is section 1
This is section 2
This is section 3
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |