Merge pull request #5 from E-Almqvist/dev

Update
pull/6/head
E. Almqvist 4 years ago committed by GitHub
commit 75762c9577
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      src/bootloader.asm
  2. 13
      src/elib/convert.asm

@ -6,6 +6,13 @@ call println
mov bx, infoString
call println
mov bx, hexTestPrefixString
call print
mov dx, 0x002e ; test the conversion
call hexToASCII
call println
jmp $ ; inf loop
;; includes
@ -15,10 +22,12 @@ jmp $ ; inf loop
; eLIB
%include "elib/io.asm"
%include "elib/convert.asm"
;; Data
welcomeString: db "Welcome to: e Operating-System (eOS)", ASCII_END
infoString: db "Version 2021 0.0", ASCII_END
welcomeString: db "Welcome to: e Operating-System (eOS)", ASCII_END
infoString: db "Version 2021 0.0", ASCII_END
hexTestPrefixString: db "Hex printing test: ", ASCII_END
; Magic BIOS number
times 510-($-$$) db 0

@ -4,13 +4,13 @@ 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.
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
@ -26,9 +26,16 @@ hexToASCII:
add al, 7 ; 7 distance from "A"
hexloop2:
; Write the char into the HEX_OUT string
mov bx, HEX_OUT + 5
sub bx, cx
mov [bx], al ; write the char into the string
ror dx, 4 ; "rotate" the string
inc cx ; increment and go onto next char
jmp hexloop
return:
hexreturn:
mov bx, HEX_OUT
ret

Loading…
Cancel
Save