aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.s14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.s b/src/main.s
index 4940d01..8a114ba 100644
--- a/src/main.s
+++ b/src/main.s
@@ -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