所以我写了这个简单的汇编程序。我为练习打了个招呼和世界。
.cstring
hello:
.ascii "hello "
.text
world:
.ascii "world\0"
.text
.globl _main
_main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
movl $hello, (%esp)
call _puts
movl $world, (%esp)
call _puts
xorl %eax, %eax
leave
ret
.subsections_via_symbols
我正在使用英特尔处理器运行Mac OS X.每次调用puts时,该程序都会打印换行符。有人可以向我解释为什么会这样做吗?