Try with this :
.att_syntax
.global main
.section .data
txt: .asciz "Hello World"
.section .text
mov $4, %eax
mov $1, %ebx
mov $txt, %ecx
mov $11, %edx
int $0x80
ret
Question
Im trying to write my first asm program. Here's the code of my program so far;
.data
hello: .string "Hello World!!!!\n"
format: .string "%s\n"
.text
.global _start
_start:
push hello
push format
call printf
movl $1, %eax #exit
movl $0, %ebx
int $0x80
Segmentation fault.
No correct solution
OTHER TIPS
Try with this :
.att_syntax
.global main
.section .data
txt: .asciz "Hello World"
.section .text
mov $4, %eax
mov $1, %ebx
mov $txt, %ecx
mov $11, %edx
int $0x80
ret