这段代码会在屏幕上输出“Hello”
.data
hello: .string "Hello\n"
format: .string "%s"
.text
.global _start
_start:
push $hello
push $format
call printf
movl $1, %eax #exit
movl $0, %ebx
int $0x80
但是如果我从hello字符串中删除“\n”,就像这样:
.data
hello: .string "Hello"
format: .string "%s"
.text
.global _start
_start:
push $hello
push $format
call printf
movl $1, %eax #exit
movl $0, %ebx
int $0x80
程序不能正常工作。有什么建议吗?
\n
),会发生什么? - Michaelgcc -nostartfiles 文件名
命令编译代码。 - Dima