.section .data path: .asciz "numbers" .section .text .global _start _start: // Open a file for writing, having created and truncated it mov $5, %eax mov $path, %ebx // 1 is O_WRONLY mov $01101, %ecx mov $0644, %edx int $0x80 // File descriptor should be in eax now // We'll copy it to ebx too so we can close the file mov %eax, %ebx push $5 push $10 push $0x12345678 mov $4, %eax // File descriptor is already in ebx mov %esp, %ecx mov $12, %edx int $0x80 // Close the file mov $6, %eax // File descriptor needs to be in ebx here int $0x80 mov $1, %eax mov $0, %ebx int $0x80