diff options
| author | Andreas Kapp Lindquist <alind24@student.sdu.dk> | 2025-09-30 15:49:12 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | c5b3d2258eee3c71edc440c11c3aa384d38e2803 (patch) | |
| tree | c6b1bc1e342671c693f91d3a2cbd3e504763b836 /src/main.s | |
| parent | 57b0724d2de125a5116f9ac035b0f19c4fc93243 (diff) | |
| download | sorter-c5b3d2258eee3c71edc440c11c3aa384d38e2803.tar.gz sorter-c5b3d2258eee3c71edc440c11c3aa384d38e2803.zip | |
feat(main.s): Created basic main file
Diffstat (limited to 'src/main.s')
| -rw-r--r-- | src/main.s | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main.s b/src/main.s new file mode 100644 index 0000000..4940d01 --- /dev/null +++ b/src/main.s @@ -0,0 +1,17 @@ +.section .text +.globl _start +_start: + + # Open file + movq 16(%rsp), %rdi # Select first argument as file name + movq $0, %rsi # Select read only + movq $0, %rdx # Unused mode for read only + movq $2, %rax # Select open syscall + syscall # Open file, file descriptor returned in rax + + movq %rax, %rdi # Save file descriptor in r15 + call parse_file + + movq $60, %rax # Select exit syscall + movq $0, %rdi # Exit code 0 + syscall |