doing some set up for when i implement a peephole optimizer

This commit is contained in:
SpookyDervish
2025-09-08 07:49:33 +10:00
parent ae1b9aa43d
commit f78d0e41b0
8 changed files with 38 additions and 46 deletions

12
out.asm
View File

@@ -6,22 +6,22 @@ global _start
_start:
mov rax, 0
push rax
push 1
mov rax, 0
push rax
.loop:
mov rax, 1
mov rbx, [rsp + 8]
add rax, rbx
mov rax, [rsp + 8]
add rax, 1
mov QWORD [rsp + 8], rax
mov rax, 100000000
mov rbx, [rsp + 8]
cmp rax, rbx
setne al
setg al
movzx rax, al
mov QWORD [rsp + 0], rax
mov eax, [rsp + 0]
test eax, eax
jnz .loop
mov rax, 60
mov rdi, [rsp + 8]
mov rdi, [rsp + 0]
syscall