aboutsummaryrefslogtreecommitdiff
path: root/src/file_parser.s
diff options
context:
space:
mode:
authorAndreas Kapp Lindquist <alind24@student.sdu.dk>2025-10-08 12:20:01 +0200
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commitd716d7df9657e1f8d9ebd7dd829b0207871970a5 (patch)
treef851e31e3fbddadf86b0eb8fb9453df981936872 /src/file_parser.s
parenteae5db135d3874039fc1ddc8152ba1b0b6c77726 (diff)
downloadsorter-d716d7df9657e1f8d9ebd7dd829b0207871970a5.tar.gz
sorter-d716d7df9657e1f8d9ebd7dd829b0207871970a5.zip
feat(file_parser): return length of array in rdx
Diffstat (limited to 'src/file_parser.s')
-rw-r--r--src/file_parser.s4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/file_parser.s b/src/file_parser.s
index 059dabf..4c5bd44 100644
--- a/src/file_parser.s
+++ b/src/file_parser.s
@@ -3,6 +3,7 @@
# PURPOSE : Parses the file into the array format.
# INPUTS : rdi = File descriptor
# OUTPUTS : rax = address of array
+# rdx = length of array
# CLOBBERS: none
# NOTES : Preserves all registers.
# --------------------------------------------
@@ -45,7 +46,8 @@ parse_file:
movq %r13, %rdi # Select coordinate buffer
movq %r12, %rsi # Select number of coordinates
call build_pointer_buffer # Create final array of pointers
- movq %rax, %r13 # Override r13 with pointer to array
+ movq %rax, %rax # Return pointer to array
+ movq %r12, %rdx # Return line count
# Restore registers
pop %r15