Added hex printing test

pull/5/head
E. Almqvist 4 years ago
parent f811dce0eb
commit 3d99d2559d
  1. 5
      src/bootloader.asm
  2. 8
      src/elib/convert.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

@ -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

Loading…
Cancel
Save