some of it

This commit is contained in:
Nikolaj
2021-12-16 16:49:38 +01:00
parent 281b65339c
commit 19ea6644e4
13 changed files with 289 additions and 7 deletions

18
A5/tests/test1.prime Normal file
View File

@ -0,0 +1,18 @@
test:
leaq data,%rsi
movq $0,%rax
movq $0,%rbp
leaq (%rsi, %rax, 8),%r11
movq (%r11),%rdx
addq $1,%rax
addq %rdx,%rbp
leaq (%rsi, %rax, 8), %r11
movq (%r11), %rdx
addq $1, %rax
addq %rdx,%rbp
stop
.align 8
data:
.quad 42
.quad 21

22
A5/tests/test2.prime Normal file
View File

@ -0,0 +1,22 @@
test:
subq $8, %rsp
movq %r11, (%rsp)
leaq (%rdi, %rcx, 8), %r8
jmp .L6
.L7:
movq %rax, (%rdi)
.L8:
addq $8, %rdi
addq $8, %rsi
addq $8, %rdx
.L6:
cbbe %r8, %rdi, .L10
movq (%rsi), %rcx
movq (%rdx), %rax
cbge %rax, %rcx, .L7
movq %rcx, (%rdi)
jmp .L8
.L10:
movq (%rsp), %r11
addq $8, %rsp
ret %r11