+ -
当前位置:首页 → 问答吧 → 为何这个程序输出结果为0.000000?

为何这个程序输出结果为0.000000?

时间:2010-11-06

来源:互联网

该程序将3.24打印出来,但是为何结果是0呢?
.section .data
flt:
  .float 3.24
output:
  .asciz "Result is %f\n"
.section .text
.globl main
main:
  pushl flt
  pushl $output
  call printf
  movl $1, %eax
  movl $0, %ebx
  int $0x80

作者: aaa_aa1   发布时间: 2010-11-06

这是nasm吧,nasm好学吗?

作者: masmaster   发布时间: 2010-11-06

先finit
浮点入栈用flds flt

作者: Applic   发布时间: 2010-11-06