我写了一些.s程序,女巫必须在显示器上打印一个小字符串。 然后我在Windows 10上打开了linux bash并完成了:
as -o file.o file.s
ld -o file file.o
./file
但它没有打印任何东西 为什么?我在linux虚拟机上尝试了相同的代码并且可以正常工作
这个文件是一个简单的"你好世界"在学校学习集会
.section .data
hello:
.ascii "Hello, World!\n"
hello_len:
.long . - hello
.section .text
.global _start
_start:
movl $4, %eax
movl $1, %ebx
leal hello, %ecx
movl hello_len, %edx
int $0x80
movl $1, %eax
xor %ebx, %ebx
int $0x80