From e0d2d485a3f344edf267df643c9b08b6fa77c899 Mon Sep 17 00:00:00 2001 From: Navid Samanghoon Date: Tue, 21 Oct 2025 13:34:36 +0200 Subject: update: Improved code readability and clarity by refining comments --- src/array_maker.s | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/array_maker.s') 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 -- cgit v1.2.3-70-g09d2