# example of how to do a system call from assembly language # writes "ABC" to the screen, and also calls the exit() system call hi: .string "ABC" .globl _start _start: movl $4, %eax # the write() system call, number 4 obtained # from /usr/include/asm/unistd.h movl $1, %ebx # 1 = file handle for stdout movl $hi, %ecx # write from where movl $3, %edx # write how many bytes int $0x80 # system call movl $1, %eax # the exit() system call int $0x80