aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kapp Lindquist <alind24@student.sdu.dk>2025-09-30 09:51:43 +0200
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commitbf9b6ec27e49360bfc29bae5b15d96c9d6c936d8 (patch)
tree44fce415f4897bc99f9418865eee20fec9a1a2dc
parent4e8096421d9aa6fda1a8820aa3712a22bb5b8cc1 (diff)
downloadsorter-bf9b6ec27e49360bfc29bae5b15d96c9d6c936d8.tar.gz
sorter-bf9b6ec27e49360bfc29bae5b15d96c9d6c936d8.zip
feat(test.s): More numbers and printing using printNum
-rw-r--r--src/test.s39
1 files changed, 31 insertions, 8 deletions
diff --git a/src/test.s b/src/test.s
index 0a709e1..30f0e49 100644
--- a/src/test.s
+++ b/src/test.s
@@ -1,28 +1,51 @@
.section .data
+elem0:
+ .8byte 8
elem1:
- .byte 3
+ .8byte 9
elem2:
- .byte 2
+ .8byte 2
elem3:
- .byte 1
+ .8byte 13
+elem4:
+ .8byte 203
+elem5:
+ .8byte 1
array:
- .space 24
+ .space 48
.section .text
.globl _start
_start:
- movq $elem1, array
- movq $elem2, 8+array
- movq $elem3, 16+array
+ movq $elem0, array
+ movq $elem1, array+8
+ movq $elem2, array+16
+ movq $elem3, array+24
+ movq $elem4, array+32
+ movq $elem5, array+40
movq $array, %rdi
- movq $3, %rsi
+ movq $6, %rsi
movq $0, %rdx
movq $insertion_sort, %rcx
call sorter
+ movq $0, %r15
+
+loop:
+ cmp $6, %r15
+ je end
+
+ movq array(,%r15,8), %rbx
+ movq (%rbx), %rdi
+ call printNum
+
+ addq $1, %r15
+ jmp loop
+
+end:
movq $60, %rax
movq $0, %rdx
syscall