aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNavid Samanghoon <nsama24@student.sdu.dk>2025-10-08 13:44:01 +0200
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commit6f71209f637fd18d9a464700ea73e5003889f2e6 (patch)
tree4cf08aeff3fb1e241e6ff789728371b91e42b6a4 /src
parentc6359302b2efae2d0d45c8fbd2e56cceb3b9e85d (diff)
downloadsorter-6f71209f637fd18d9a464700ea73e5003889f2e6.tar.gz
sorter-6f71209f637fd18d9a464700ea73e5003889f2e6.zip
fix(outputGenerator): fixing pointer problem
Diffstat (limited to '')
-rw-r--r--src/outputGenerator.s8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/outputGenerator.s b/src/outputGenerator.s
index d547c59..23caecc 100644
--- a/src/outputGenerator.s
+++ b/src/outputGenerator.s
@@ -59,7 +59,8 @@ print_buffer:
loop:
# print x and tab
- movq (%rdx), %rdi # load x
+ movq (%rdx), %rdi # load the pointer of x
+ movq(%rdi), %rdi # load the number it self
call print_num
push %rdx # save pointer
push %rsi # save n
@@ -68,7 +69,8 @@ loop:
pop %rdx # retrieve pointer
# print y and newline
- movq 8(%rdx), %rdi # load y
+ movq (%rdx), %rdi # load the pointer of y
+ movq 8(%rdi), %rdi # load the number it self
call print_num
push %rdx # save pointer
push %rsi # save n
@@ -77,7 +79,7 @@ loop:
pop %rdx # retrieve pointer
# move to next coordinate and decq n
- addq $16, %rdx
+ addq $8, %rdx
decq %rsi
cmpq $0, %rsi