请分段错误 [英] Please Segmentation fault

查看:78
本文介绍了请分段错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行以下代码时,我收到分段错误..





when i run the following code i get a segmentation error..


section .data
	msg: db 'hello, World!',10

section .text
	global _main
_main:
	mov eax, 4
	mov ebx,1
	mov ecx,msg
	int 0x80
	mov eax,1
	mov ebx,0
	int 0x80

nasm -f elf helloworld.asm
ld -s -o hello helloworld.o

推荐答案

你没有设置 edx 到要写入的字节数。

干杯

Andi
You are not setting edx to the number of bytes to write.
Cheers
Andi


这篇关于请分段错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆