Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Updated 24-May-14 3:47am
v2
Comments
Richard MacCutchan 24-May-14 9:53am    
Where did you find this sample code? Are you sure the parameters are corrct for the interrupt calls?

1 solution

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

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900