diff options
| author | Andreas Kapp Lindquist <alind24@student.sdu.dk> | 2025-10-09 12:00:22 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | b9e00b286e3ba29bb144cfdba8b6d583eb611ef6 (patch) | |
| tree | 0442af3face43b70797db0e26e90b286770d25f8 /src | |
| parent | f7c6c5b1e769132b381d4625ac3a701bb7c41198 (diff) | |
| download | sorter-b9e00b286e3ba29bb144cfdba8b6d583eb611ef6.tar.gz sorter-b9e00b286e3ba29bb144cfdba8b6d583eb611ef6.zip | |
fix(outputGenerator)
Diffstat (limited to 'src')
| -rw-r--r-- | src/outputGenerator.s | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/outputGenerator.s b/src/outputGenerator.s index 23caecc..34377ba 100644 --- a/src/outputGenerator.s +++ b/src/outputGenerator.s @@ -58,10 +58,11 @@ print_buffer: movq %rdi, %rdx # keep pointer here, rdi will be used for print_num
loop:
+ movq (%rdx), %r15 # Pointer element
+
# print x and tab
- movq (%rdx), %rdi # load the pointer of x
- movq(%rdi), %rdi # load the number it self
- call print_num
+ movq (%r15), %rdi # Get first number from element
+ call print_num # Print it
push %rdx # save pointer
push %rsi # save n
call print_tab
@@ -69,9 +70,8 @@ loop: pop %rdx # retrieve pointer
# print y and newline
- movq (%rdx), %rdi # load the pointer of y
- movq 8(%rdi), %rdi # load the number it self
- call print_num
+ movq 8(%r15), %rdi # Get the second number
+ call print_num # Print it
push %rdx # save pointer
push %rsi # save n
call print_newline
@@ -86,7 +86,7 @@ loop: jg loop
done:
-ret
+ ret
# Print RDI as an unsigned integer without any new line.
|