Hello World using assembler code
I'm trying to write a program in assembler code. Here it is:
.data
hello: .ascii "Hello, World!\n"
len: .short len - hello
.text
.globl _start
_start:
mov $4,%eax # system call number (sys_write)
mov $1,%ebx # first argument: file handle (stdout)
lea hello,%ecx # second argument: pointer to message to write
mov len,%edx # third argument: message length
int $0x80 # call kernel
mov $1,%eax # system call number (sys_exit)
mov $0,%ebx # first argument: exit code
int $0x80 # call kernel
This program should display a "Hello World!" message. But it produces nothing...
Can anyone tell me what's the matter with this program?
Thanks a lot for any help!
Christophe
iMac Intel Core Duo 17", Mac OS X (10.4.7)