nearly working, gotta get converting numbers to strings working

This commit is contained in:
SpookyDervish
2025-09-06 21:24:05 +10:00
parent 23ec72e961
commit 85a547780d
4 changed files with 62 additions and 17 deletions

66
out.asm
View File

@@ -1,29 +1,67 @@
; ~~~ Auto generated by the GroundPY compiler for Linux x86_64 targets. ~~~
section .data
.LC0: db "Hello, World!", 10, 0
.LC0: db "123", 0
.LC1: equ $ - .LC0
.LC2: db "", 10, "WE CAN PRINT FUCKING NUMBERS AND SHITT", 10, 0
.LC3: equ $ - .LC2
.LC4: db "LESS GOOOOO", 10, 0
.LC5: equ $ - .LC4
.LC6: db "this was printed using a variable!!!!!", 10, 0
.LC7: equ $ - .LC6
.LC8: db "", 10, 0
.LC9: equ $ - .LC8
section .text
global _start
_start:
; InstructionNode(instruction='set', parent=RootNode(statements=[..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, String])
lea rax, [.LC0]
push rax
mov rax, .LC1
push rax
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), ..., InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariablePointer, Int])
mov rax, 123
push rax
; InstructionNode(instruction='stdout', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), ..., InstructionNode(instruction='end', parent=..., arguments=[VariableReference])]), arguments=[VariableReference])
mov rsi, [rsp + 16]
mov rdx, [rsp + 8]
; InstructionNode(instruction='stdout', parent=RootNode(statements=[..., InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[Int])
mov rsi, .LC0
mov rdx, .LC1
mov rax, 1
mov rdi, 1
syscall
; InstructionNode(instruction='end', parent=RootNode(statements=[InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), ...]), arguments=[VariableReference])
; InstructionNode(instruction='stdout', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), ..., InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[String])
mov rsi, .LC2
mov rdx, .LC3
mov rax, 1
mov rdi, 1
syscall
; InstructionNode(instruction='stdout', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), ..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[String])
mov rsi, .LC4
mov rdx, .LC5
mov rax, 1
mov rdi, 1
syscall
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), ..., InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[VariablePointer, String])
lea rax, [.LC6]
push rax
mov rax, .LC7
push rax
; InstructionNode(instruction='stdout', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), ..., InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[VariableReference])
mov rsi, [rsp + 8]
mov rdx, [rsp + 0]
mov rax, 1
mov rdi, 1
syscall
; InstructionNode(instruction='set', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), ..., InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[VariablePointer, Int])
mov rax, 123
push rax
; InstructionNode(instruction='stdout', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), ..., InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[VariableReference])
mov rsi, [rsp + 0]
mov rdx, [rsp + -8]
mov rax, 1
mov rdi, 1
syscall
; InstructionNode(instruction='stdout', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), ..., InstructionNode(instruction='end', parent=..., arguments=[Int])]), arguments=[String])
mov rsi, .LC8
mov rdx, .LC9
mov rax, 1
mov rdi, 1
syscall
; InstructionNode(instruction='end', parent=RootNode(statements=[InstructionNode(instruction='stdout', parent=..., arguments=[Int]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, String]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='set', parent=..., arguments=[VariablePointer, Int]), InstructionNode(instruction='stdout', parent=..., arguments=[VariableReference]), InstructionNode(instruction='stdout', parent=..., arguments=[String]), ...]), arguments=[Int])
mov rax, 60
mov rdi, [rsp + 0]
mov rdi, 0
syscall