segmentation fault

Just starting to study assembly. The following code runs but I'm also getting a notice 'Segmentation fault'. I thought it might have to do with the number of bytes but that doesn't seem to be the issue.

the code:

#HelloWorld.s my second assembly program

.data

HelloWorldString: #label
.ascii "Hello World
"

.text

.globl_start

_start:
#load all the arguments for write()

movl $4, %eax
movl $1, %ebx
movl $HelloWorldString, %ecx
movl $12, %edx
int $0x80

Thanks

Comments

  • I think you are missing an exit command, add this to the end:
    [code]
    movl $1, %eax
    int $0x80
    [/code]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion