Merge pull request #4 from E-Almqvist/dev

Progress
pull/6/head
E. Almqvist 4 years ago committed by GitHub
commit d77c9e6258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/bootloader.asm
  2. 34
      src/elib/convert.asm
  3. 4
      src/equ/ASCII.asm

@ -17,8 +17,8 @@ jmp $ ; inf loop
%include "elib/io.asm"
;; Data
welcomeString: db "Welcome to e Operating-System (eOS)", ASCII_END
infoString: db "eOS: 2021 v0.0"
welcomeString: db "Welcome to: e Operating-System (eOS)", ASCII_END
infoString: db "Version 2021 0.0", ASCII_END
; Magic BIOS number
times 510-($-$$) db 0

@ -0,0 +1,34 @@
HEX_OUT: db "0x0000", ASCII_END
; SR to convert hex values into ASCII strings
; This SR is going to mess up some registers
; since it fills the register with the desired
; pointer toward the string.
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
mov ax, dx
; mask the hex value in ax so that we get the last "char"
and ax, 0x000f
; convert ax into ASCII (numeric)
add al, ASCII_OFFSET_NUM ; add 0x30
cmp al, 0x39 ; if al (char) > "9"
jle hexloop2
add al, 7 ; 7 distance from "A"
hexloop2:
mov bx, HEX_OUT + 5
return:
mov bx, HEX_OUT
ret

@ -7,3 +7,7 @@ ASCII_VERTICAL_TAB equ 11
ASCII_LINEBREAK equ 10
ASCII_CARRIAGE_RETURN equ 13
ASCII_CLEAR equ 12
; Offsets
ASCII_OFFSET_NUM equ 0x30
ASCII_OFFSET_CHAR equ 0x40

Loading…
Cancel
Save