From 597022b22e0e499a567d29c7248e90b7726e0770 Mon Sep 17 00:00:00 2001 From: mithe24 Date: Thu, 30 Oct 2025 10:28:24 +0100 Subject: consistent names --- src/main.s | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/main.s') diff --git a/src/main.s b/src/main.s index b628d29..036671e 100644 --- a/src/main.s +++ b/src/main.s @@ -10,18 +10,18 @@ _start: cmpq $2, (%rsp) # Check if there are only two arguments - jne algorithm_selected # If not, go to algorithm_selected + jne .algorithm_selected # If not, go to algorithm_selected -default: +.default: 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, %r13 # Save file descriptor in r13 - jmp select_quicksort # Select quicksort + jmp .select_quicksort # Select quicksort -algorithm_selected: +.algorithm_selected: movq 32(%rsp), %rdi # Select third argument as file name movq $0, %rsi # Select read only movq $0, %rdx # Unused mode for read only @@ -34,29 +34,29 @@ algorithm_selected: movq $isort, %rsi # Select "isort" to compare with call strcmp # Compare cmp $1, %rax # If the strings where equal - je select_insertionsort # Select insertionsort + je .select_insertionsort # Select insertionsort .check_quicksort: movq 24(%rsp), %rdi # Select algorithm string movq $qsort, %rsi # Select "qsort" to compare with call strcmp # Compare cmp $1, %rax # If the strings where equal - je select_quicksort # Go to selection_done + je .select_quicksort # Go to selection_done .else_invalid_algorithm: movq $60, %rax # Select exit syscall movq $1, %rdi # Exit code 1 syscall # Exit -select_insertionsort: +.select_insertionsort: movq $insertion_sort, %r14 # Select insertion_sort in r14 - jmp the_rest + jmp .the_rest -select_quicksort: - movq $quicksort, %r14 # Select quicksort in r14 - jmp the_rest +.select_quicksort: + movq $quick_sort, %r14 # Select quicksort in r14 + jmp .the_rest -the_rest: +.the_rest: # Convert to array movq %r13, %rdi # Select file descriptor call make_array_from_file # Convert file to array format -- cgit v1.2.3-70-g09d2