From 8c21f378418d982b7d1a2610f53f82853dc57286 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Wed, 13 Jan 2021 12:07:56 +0100 Subject: [PATCH] Println bug fix --- src/bootloader.asm | 7 +++++-- src/elib/io.asm | 10 +++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/bootloader.asm b/src/bootloader.asm index 226de1b..b685912 100644 --- a/src/bootloader.asm +++ b/src/bootloader.asm @@ -1,5 +1,8 @@ [org 0x7c00] ; bootsector +mov bx, welcomeString ; Print the welcome string +call println + jmp $ ; inf loop ;; includes @@ -8,11 +11,11 @@ jmp $ ; inf loop %include "equ/ASCII.asm" ; eLIB -;%include "elib/io.asm" +%include "elib/io.asm" ;; Data welcomeString: - db "Welcome to eOS", ASCII_CARRIAGE_RETURN, ASCII_LINEBREAK + db "Welcome to eOS", ASCII_END ; Magic BIOS number times 510-($-$$) db 0 diff --git a/src/elib/io.asm b/src/elib/io.asm index fa9eb6d..939ec03 100644 --- a/src/elib/io.asm +++ b/src/elib/io.asm @@ -26,9 +26,17 @@ print: ; Subroutine to print a string on a new line newline: - db ASCII_CARRIAGE_RETURN, ASCII_LINEBREAK + db ASCII_CARRIAGE_RETURN, ASCII_LINEBREAK, ASCII_END println: + pusha + + ; Print the input string + call print ; this will print whatever is in [bx], so clear it if you dont want to print anything + ; Print the newline mov bx, newline call print + + popa + ret