]> git.dujemihanovic.xyz Git - nameless-os.git/commitdiff
Slim down print.s
authorDuje Mihanović <duje.mihanovic@skole.hr>
Sun, 20 Mar 2022 11:43:11 +0000 (12:43 +0100)
committerDuje Mihanović <duje.mihanovic@skole.hr>
Tue, 29 Mar 2022 13:12:29 +0000 (15:12 +0200)
boot/x86/print.s

index bffa2299019d392d6be5eea70a04817c1dfe2a95..7148bc511854ed36c22dadf308a0f182fc7b3312 100644 (file)
@@ -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