- 论坛徽章:
- 0
|
.section .data
dividend:
.quad 8335
divisor:
.int 25
quotient:
.int 0
remainder:
.int
output:
.asciz "The quotient is %d, and the remainder is %d\n"
.section .text
.globl _start
_start:
nop
movl dividend, %eax
movl dividend+4, %edx
divl divisor
movl %eax, quotient
movl %edx, remainder
pushl remainder
pushl quotient
pushl $output
call printf
add $12, %esp
pushl $0
call exit
-----------------------------------------------
无言了,又一个奇怪的问题,用gdb调试,
去到call printf之前寄存器的值均无问题,
---------------------------------
(gdb) info reg
eax 0x14d 333
ecx 0xbf9df194 -1080168044
edx 0xa 10
ebx 0x11dfc0 1171392
esp 0xbf9df184 0xbf9df184
ebp 0x0 0x0
esi 0xbf9df19c -1080168036
edi 0x80481b8 134513080
eip 0x80481e6 0x80481e6 <_start+46>
eflags 0x286 [ PF SF IF ]
cs 0x73 115
ss 0x7b 123
ds 0x7b 123
es 0x7b 123
fs 0x0 0
gs 0x33 51
---------------------------------
程序执行后只出现在个空行! 然后发觉是eax与edx 影响printf输出,但不知原因是什么?
请大虾们指教指教! |
|