From: Duje Mihanović <duje.mihanovic@skole.hr>
Date: Sun, 20 Mar 2022 11:43:11 +0000 (+0100)
Subject: Slim down print.s
X-Git-Tag: 0.1.0~13
X-Git-Url: https://git.dujemihanovic.xyz/?a=commitdiff_plain;h=5abfd3ff79ee9a4eb10334ac6729205cc1a35546;p=nameless-os.git

Slim down print.s
---

diff --git a/boot/x86/print.s b/boot/x86/print.s
index bffa229..7148bc5 100644
--- a/boot/x86/print.s
+++ b/boot/x86/print.s
@@ -1,27 +1,21 @@
-; cs:si - pointer to ASCIIZ string
-print
+; ds:si - pointer to ASCIIZ string
+print:
+	pusha
 	pushf
-	push ax
-	push bx
-	push si
+	cld
 	xor bh, bh
 	mov ah, 0Eh
-
-.loop
-	mov al, [cs:si]
+.loop:
+	lodsb
 	cmp al, 0
 	je .done
 	int 10h
-	inc si
 	jmp .loop
-
-.done
+.done:
 	mov al, 0Dh
 	int 10h
 	mov al, 0Ah
 	int 10h
-	pop si
-	pop bx
-	pop ax
 	popf
+	popa
 	ret