cleaning up some stuff and optimising

This commit is contained in:
SpookyDervish
2025-09-02 16:57:56 +10:00
parent ef48978bb5
commit a32598f7f0
4 changed files with 47 additions and 23 deletions

28
out.asm
View File

@@ -1,18 +1,26 @@
global _start
_start:
; InstructionNode(instruction='set', parent=RootNode(statements=[..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, Number])
mov rax, 66
push rax
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), ..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, Number])
mov rax, 69
push rax
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), ..., InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, Number])
; InstructionNode(instruction='set', parent=RootNode(statements=[..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, Number])
mov rax, 123
mov QWORD [rsp + 8], rax
; InstructionNode(instruction='end', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), ...]), arguments=[VariableReference])
mov rax, 60
push rax
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), ..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, VariableReference])
push QWORD [rsp + 0]
pop rax
mov QWORD [rsp + 0], rax
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), ..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, VariableReference])
push QWORD [rsp + 0]
pop rax
push rax
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), ..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, Number])
mov QWORD [rsp + 8], 0
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), ..., InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, VariableReference])
push QWORD [rsp + 8]
pop rax
mov QWORD [rsp + 0], rax
; InstructionNode(instruction='end', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Number]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, VariableReference]), ...]), arguments=[VariableReference])
mov rax, 60
push QWORD [rsp + 0]
pop rdi
syscall