From 47728cb1c7d3ca1af9978fe7eabb1385282505ee Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 15 Jan 2021 09:59:13 +0100 Subject: [PATCH 1/7] Strings fix --- src/bootloader.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bootloader.asm b/src/bootloader.asm index 30ff63b..c167036 100644 --- a/src/bootloader.asm +++ b/src/bootloader.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 From 30171f38cf16e195339550287fff0e4d99be1ed2 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 15 Jan 2021 10:00:02 +0100 Subject: [PATCH 2/7] Super minor tweak --- src/bootloader.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootloader.asm b/src/bootloader.asm index c167036..b7f282d 100644 --- a/src/bootloader.asm +++ b/src/bootloader.asm @@ -18,7 +18,7 @@ jmp $ ; inf loop ;; Data welcomeString: db "Welcome to: e Operating-System (eOS)", ASCII_END -infoString: db "Version: 2021 0.0", ASCII_END +infoString: db "Version 2021 0.0", ASCII_END ; Magic BIOS number times 510-($-$$) db 0 From 5be5aaccfb62dadba287206b8be947688653b1b4 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 15 Jan 2021 11:53:02 +0100 Subject: [PATCH 3/7] BEgan work on hex to ascii --- src/elib/convert.asm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/elib/convert.asm diff --git a/src/elib/convert.asm b/src/elib/convert.asm new file mode 100644 index 0000000..85860e7 --- /dev/null +++ b/src/elib/convert.asm @@ -0,0 +1,15 @@ +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: + mov cx, 0 ; incrementor + + hexloop: + + + return: + mov bx, HEX_OUT + ret From d21dabce7d0a96f92ab1ae27a1fff945c1364743 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 22 Jan 2021 09:41:38 +0100 Subject: [PATCH 4/7] hex to ascii stuff --- src/elib/convert.asm | 12 ++++++++++++ src/equ/ASCII.asm | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/src/elib/convert.asm b/src/elib/convert.asm index 85860e7..af5b421 100644 --- a/src/elib/convert.asm +++ b/src/elib/convert.asm @@ -5,10 +5,22 @@ HEX_OUT: db "0x0000", ASCII_END ; 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 return: mov bx, HEX_OUT diff --git a/src/equ/ASCII.asm b/src/equ/ASCII.asm index e9f1cc9..8ae3828 100644 --- a/src/equ/ASCII.asm +++ b/src/equ/ASCII.asm @@ -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 From 96e0215f6a3e15352f5a922ab68f159f9a2ef4fa Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Fri, 22 Jan 2021 10:18:49 +0100 Subject: [PATCH 5/7] Stuff --- src/elib/convert.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/elib/convert.asm b/src/elib/convert.asm index af5b421..22710e5 100644 --- a/src/elib/convert.asm +++ b/src/elib/convert.asm @@ -20,7 +20,7 @@ hexToASCII: ; convert ax into ASCII (numeric) add al, ASCII_OFFSET_NUM ; add 0x30 - cmp al + cmp al, 0x39 ; if al (char) > 9 return: mov bx, HEX_OUT From 950313be3e85fb3ef4d424034d2fa7442ab5c972 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Mon, 25 Jan 2021 09:15:43 +0100 Subject: [PATCH 6/7] Fix --- src/elib/convert.asm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/elib/convert.asm b/src/elib/convert.asm index 22710e5..757ae4a 100644 --- a/src/elib/convert.asm +++ b/src/elib/convert.asm @@ -20,7 +20,12 @@ hexToASCII: ; convert ax into ASCII (numeric) add al, ASCII_OFFSET_NUM ; add 0x30 - cmp al, 0x39 ; if al (char) > 9 + cmp al, 0x39 ; if al (char) > "9" + jle hexloop2 + + add al, 7 + + hexloop2: return: mov bx, HEX_OUT From 2bcabee61b678ad497459a2c402dd01bd2f1d3b6 Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Mon, 25 Jan 2021 09:47:29 +0100 Subject: [PATCH 7/7] Stuff --- src/elib/convert.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/elib/convert.asm b/src/elib/convert.asm index 757ae4a..7cc347f 100644 --- a/src/elib/convert.asm +++ b/src/elib/convert.asm @@ -23,9 +23,11 @@ hexToASCII: cmp al, 0x39 ; if al (char) > "9" jle hexloop2 - add al, 7 + add al, 7 ; 7 distance from "A" hexloop2: + mov bx, HEX_OUT + 5 + return: mov bx, HEX_OUT