diff options
| author | Andreas Kapp Lindquist <alind24@student.sdu.dk> | 2025-10-08 12:29:24 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | d8003db60fe37c7e3402c8eae12f3c92575c4268 (patch) | |
| tree | 4f49d9134569cb6904d31b07d25b0d32c1574bda /src/main.s | |
| parent | 202a8205a2e726b753ea83f2a65cb1b52cc470c4 (diff) | |
| download | sorter-d8003db60fe37c7e3402c8eae12f3c92575c4268.tar.gz sorter-d8003db60fe37c7e3402c8eae12f3c92575c4268.zip | |
feat(main.s): basic file sorter rutine
Diffstat (limited to '')
| -rw-r--r-- | src/main.s | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -10,7 +10,19 @@ _start: syscall # Open file, file descriptor returned in rax movq %rax, %rdi # Save file descriptor in r15 - call parse_file + call parse_file # Convert file to array format + + movq %rdx, %r15 # Save length of array in r15 + + movq %rax, %rdi # Select address of array + movq %r15, %rsi # Select length of array + movq $0, %rdx # Sort by key 0 + movq insertion_sort, %rcx # Use insertion sort + call sorter # Sort the array + + movq %rax, %rdi # Select the pointer to the array + movq %r15, %rsi # Select length of array + call print_buffer # Print array movq $60, %rax # Select exit syscall movq $0, %rdi # Exit code 0 |