运行汇编代码时出现分段错误(核心已转储)

时间:2020-03-07 04:54:14

标签: linux assembly x86 windows-subsystem-for-linux att

.data
msg: .string "hello,world\n"
len = . - msg
.text
.global _start
_start:
    movl $len, %edx
    movl $msg, %ecx
    movl $1,   %ebx
    movl $4, %eax
    int $0x80

    movl $0, %ebx
    movl $1, %eax
    int $0x80

我在ubuntu上编译了这段代码

as hello.s -o hello.o
ld hello.o -o hello

当我使用命令“ ./hello”运行程序时 结果表明:分段故障(核心已丢弃)

0 个答案:

没有答案