aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kapp Lindquist <alind24@student.sdu.dk>2025-10-09 12:24:07 +0200
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commit5767efb2e83d3cf0f6543d8f9c2e3966d2ddb9f8 (patch)
treee8e7d5385df2784d12a511589618bedcda1477ba
parentb9e00b286e3ba29bb144cfdba8b6d583eb611ef6 (diff)
downloadsorter-5767efb2e83d3cf0f6543d8f9c2e3966d2ddb9f8.tar.gz
sorter-5767efb2e83d3cf0f6543d8f9c2e3966d2ddb9f8.zip
fix(main): used make_array_from_file
Diffstat (limited to '')
-rw-r--r--src/main.s11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.s b/src/main.s
index 8a114ba..30bbf9b 100644
--- a/src/main.s
+++ b/src/main.s
@@ -1,7 +1,6 @@
.section .text
.globl _start
_start:
-
# Open file
movq 16(%rsp), %rdi # Select first argument as file name
movq $0, %rsi # Select read only
@@ -9,17 +8,17 @@ _start:
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 # Convert file to array format
-
+ # Convert to array
+ movq %rax, %rdi # Select file descriptor
+ call make_array_from_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
+ call insertion_sort # Sort the array
+ # Print array
movq %rax, %rdi # Select the pointer to the array
movq %r15, %rsi # Select length of array
call print_buffer # Print array