aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/outputGenerator.s14
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.