| ||||||||||||
|
.data str2write: .ascii "0wn3d\n" filename: .ascii "test.txt" .text .global _start _start: # This is the file opening part. movl $5,%eax movl $filename,%ebx movl $1,%ecx xorl %edx,%edx int $0x80 # movl the file descriptor to %ebx. movl %eax,%ebx test %eax,%eax js exit # call sys_write, write string. movl $4,%eax movl $str2write,%ecx movl $6,%edx int $0x80 # close file descriptor close: movl $6,%eax int $0x80 # exit exit: movl $1,%eax movl $0,%ebx int $0x80 | |||||||||||