cis-lclient05:~/2012/system>more hello.s .file "hello.s" .text .global _start #must be declared for linker (ld) _start: #tell linker entry point movl $len, %edx #message length movl $msg, %ecx #message to write movl $1, %ebx #file descriptor (stdout) movl $4, %eax #system call number (sys_write) int $0x80 #call kernel movl $1,%eax #system call number (sys_exit) movl $22,%ebx int $0x80 #call kernel .data msg: .string "Hello, world!\n" #our dear string .set len, .-msg #length of our dear string .size _start, .-main cis-lclient05:~/2012/system>as -o hello.o hello.s cis-lclient05:~/2012/system>ld -o hello hello.o cis-lclient05:~/2012/system>hello Hello, world! cis-lclient05:~/2012/system>echo $? 22 cis-lclient05:~/2012/system> cyclops:~/cis72/syscalls>cat hello.s .file "hello.s" .text .global _start #must be declared for linker (ld) _start: #tell linker entry point movl $len, %edx #message length movl $msg, %ecx #message to write movl $1, %ebx #file descriptor (stdout) movl $4, %eax #system call number (sys_write) int $0x80 #call kernel movl $1,%eax #system call number (sys_exit) movl $22,%ebx int $0x80 #call kernel .data msg: .string "Hello, world!\n" #our dear string .set len, .-msg #length of our dear string .size _start, .-main as -o hello.o hello.s ld -o hello hello.o hello Hello, world! cyclops:~/cis72/syscalls>echo $? 22 cyclops:~/cis72/syscalls>