aboutsummaryrefslogtreecommitdiff
path: root/src/main.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.s')
-rw-r--r--src/main.s5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.s b/src/main.s
index 64d38aa..b628d29 100644
--- a/src/main.s
+++ b/src/main.s
@@ -4,9 +4,11 @@
qsort:
.string "qsort"
+
.section .text
.globl _start
_start:
+
cmpq $2, (%rsp) # Check if there are only two arguments
jne algorithm_selected # If not, go to algorithm_selected
@@ -49,7 +51,7 @@ algorithm_selected:
select_insertionsort:
movq $insertion_sort, %r14 # Select insertion_sort in r14
jmp the_rest
-
+
select_quicksort:
movq $quicksort, %r14 # Select quicksort in r14
jmp the_rest
@@ -78,7 +80,6 @@ the_rest:
movq $1, %rdi
syscall
-end:
# Exit
movq $60, %rax
movq $0, %rdi # Exit code 0