diff --git a/src/bootloader.asm b/src/bootloader.asm index b7f282d..d23bd2b 100644 --- a/src/bootloader.asm +++ b/src/bootloader.asm @@ -6,6 +6,10 @@ call println mov bx, infoString call println +mov dx, 0x002e ; test the conversion +call hexToASCII +call println + jmp $ ; inf loop ;; includes @@ -15,6 +19,7 @@ jmp $ ; inf loop ; eLIB %include "elib/io.asm" +%include "elib/convert.asm" ;; Data welcomeString: db "Welcome to: e Operating-System (eOS)", ASCII_END diff --git a/src/elib/convert.asm b/src/elib/convert.asm index b54f1b4..005a89b 100644 --- a/src/elib/convert.asm +++ b/src/elib/convert.asm @@ -4,13 +4,15 @@ HEX_OUT: db "0x0000", ASCII_END ; This SR is going to mess up some registers ; since it fills the register with the desired ; pointer toward the string. +; +; Disclaimer: use popa if you want to get back your registers!!! + hexToASCII: - ; pusha mov cx, 0 ; incrementor hexloop: cmp cx, 4 ; check if we reached the end - je return ; if so just return our new ASCII string + je hexreturn ; if so just return our new ASCII string mov ax, dx @@ -36,6 +38,6 @@ hexToASCII: inc cx ; increment and go onto next char jmp hexloop - return: + hexreturn: mov bx, HEX_OUT ret