/* main program calling the kernel hello world from linuxassembly.org in AT&T syntax --- must compile with an option (similar to -notrap in spim) gcc -g -nostartfiles hello.s ddd does not find the source file, however. you might as well debug with gdb */ .data msg: .ascii "Hello world\n" len = . - msg # length of string. # '.' is the location symbol # instead of '$' in nasm .text .global _start _start: # loader starts execution here mov $msg,%ecx # Address of message mov $len, %edx # length of message -- yes, you need $ for all consts. mov $1, %ebx # STDOUT mov $4, %eax # sys_write service int $0x80 # kernel call (interrupt) -- even here a $. mov $1, %eax # sys_exit service int $0x80 # kernel call - program terminated