# hello.s # instructions to run: # as hello-world.s -o hello-world.o # ld hello-world.o -o hello-world # ./hello-world # define length of string .equ length,0x0f # hard-coded length of string .text .globl _start #Make entry point visible to linker _start: #implement hello world movl $0x04, %eax #4=write movl $0x01, %ebx #1=stdout movl $string, %ecx movl $length, %edx int $0x80 #Call Operating System # exit the program movl %eax, %ebx #Make program return syscall exit status movl $0x01, %eax #1=exit int $0x80 #Call System Again # define the string .data string: .asciz "Hello, world!\n"