fixing quite a few bugs

This commit is contained in:
SpookyDervish
2025-09-13 07:08:11 +10:00
parent 170272353c
commit 86d59a8177
7 changed files with 70 additions and 19 deletions

38
out.asm
View File

@@ -1,19 +1,47 @@
; ~~~ Auto generated by the GroundPY compiler for Linux x86_64 targets. ~~~
section .data
LC0: db "yep!", 10, 0
LC1: equ $ - LC0
LC2: db "nope...", 10, 0
LC3: equ $ - LC2
section .text
global _start
_start:
mov rdi, 1
mov rsi, 4
call add
mov rdi, rax
mov rsi, 3
call greater
test eax, eax
jnz .yes
jmp .no
.yes:
mov rsi, LC0
mov rdx, LC1
push rdi
mov rax, 1
mov rdi, 1
syscall
pop rdi
mov rdi, 0
mov rax, 60
syscall
add:
.no:
mov rsi, LC2
mov rdx, LC3
push rdi
mov rax, 1
mov rdi, 1
syscall
pop rdi
mov rdi, 0
mov rax, 60
syscall
greater:
push rbp
mov rbp, rsp
mov rax, rdi
add rax, rsi
cmp rax, rsi
setg al
movzx eax, al
pop rbp
ret