diff options
| author | Navid Samanghoon <nsama24@student.sdu.dk> | 2025-10-21 13:34:36 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | e0d2d485a3f344edf267df643c9b08b6fa77c899 (patch) | |
| tree | d7b058467df400feba57bd5b9076343f473c721e /src/array_maker.s | |
| parent | a09bb68366b6953920be493b10397fcba74cdf1d (diff) | |
| download | sorter-e0d2d485a3f344edf267df643c9b08b6fa77c899.tar.gz sorter-e0d2d485a3f344edf267df643c9b08b6fa77c899.zip | |
update: Improved code readability and clarity by refining comments
Diffstat (limited to 'src/array_maker.s')
| -rw-r--r-- | src/array_maker.s | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/array_maker.s b/src/array_maker.s index d4c0afc..7586d84 100644 --- a/src/array_maker.s +++ b/src/array_maker.s @@ -10,6 +10,7 @@ .type make_array_from_file, @function make_array_from_file: + # save push %r15 push %r14 push %r13 @@ -47,6 +48,7 @@ end: movq %r13, %rax # Return pointer to array movq %r14, %rdx # Return the number of elements in the array + # retrieve pop %r12 pop %r13 pop %r14 @@ -67,6 +69,7 @@ end: .globl make_pairwise_data .type make_pairwise_data, @function make_pairwise_data: + # save push %r15 push %r14 push %r13 @@ -82,7 +85,7 @@ end: movq %rax, %r13 # Save number of lines (coordinates) in r13 # Allocate space for the pairwise coordinates after parseData - # The space allocated should be 2*(#coordinates)*8 bytes + # The space allocated = 2*(#coordinates)*8 bytes imulq $16, %r13 # Multiply number of coordinates with 2*8 movq %r13, %rdi # Select the number of coordinates call allocate @@ -105,6 +108,7 @@ end: movq %rax, %rdx # Return number of pairs (the quotient of division) movq %r12, %rax # Return pointer to pairwise data + # retrieve pop %r12 pop %r13 pop %r14 @@ -124,7 +128,7 @@ end: .globl create_file_buffer .type create_file_buffer, @function create_file_buffer: - + # save push %r15 push %r14 push %r13 @@ -147,6 +151,7 @@ end: movq %r13, %rax # Return pointer to start of file movq %r14, %rdx # Return length of file + # retrieve pop %r13 pop %r14 pop %r15 |