Some minor improvements

This commit is contained in:
2023-12-26 20:46:02 +01:00
parent af987dea5a
commit 39f7dba229
5 changed files with 36 additions and 10 deletions
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

+8 -1
View File
@@ -68,7 +68,14 @@ start:
mov bl, byte [driveNumber]
; Far jump to the kernel
; Setup video mode
mov ax, 0x0003
int 0x10
mov ah, 0x0b
mov bx, 0x0001
int 0x10
; Far jump to the kernel (never returns)
jmp KERNEL_LOC:0x0000
readFail:
+6 -3
View File
@@ -2,7 +2,7 @@
launch:
pusha
call resetTextMode
call clearText
mov di, 0x0e60 ; Offset in vidmem (2nd to last line)
mov si, statusBarMsg
@@ -36,7 +36,7 @@ getHexCh:
mov [hexByte], al
jmp getHexCh
.putByte:
cmp di, hexCode+256
cmp di, hexCode+256
jge getHexCh ; Max length reached
rol byte [hexByte], 4
or byte [hexByte], al
@@ -60,6 +60,9 @@ getHexCh:
call print
jmp getHexCh
.runInput:
mov si, runMsg
call print
pusha
call hexCode ; Call the code
popa
@@ -101,12 +104,12 @@ return:
jmp 0x2000:0x0000
; - Includes -
%include "./src/lib/screen.asm"
%include "./src/lib/print.asm"
; ------------
statusBarMsg: db " -- HEX -- ", 0
controlsMsg: db "'$' to execute code; '!' to quit", 0
runMsg: db ENDL, ENDL, 0
ranMsg: db ENDL, ENDL, " - Finished Execution - ", ENDL, 0
backChars: db 8,8,8,' ',8,8,0
+4 -3
View File
@@ -9,6 +9,7 @@ start:
xor bx, bx
call resetTextMode
call clearText
; Print start message
mov si, startMsg
@@ -84,7 +85,7 @@ runCommand:
mov di, clearCmd
call .cmp
je clearScreen
je clear
mov di, exitCmd
call .cmp
@@ -239,8 +240,8 @@ help:
;
; Clears the screen
;
clearScreen:
call resetTextMode
clear:
call clearText
jmp input
;
+18 -3
View File
@@ -78,11 +78,26 @@ printHexByte:
hexString: db "0x0000", 0
;
; Clears the screen
; Clears the screen in text mode
; Assumes VGA text 3 - 80x25, 16 color
;
clear:
clearText:
pusha
; TODO: Make this function
push es
mov ax, 0x0b800
mov es, ax
xor di, di ; es:di - b800:0000
mov al, ' ' ; Fill with spaces
mov ah, 0x17 ; White on blue
mov cx, 80*25
rep stosw
mov ah, 2
xor dx, dx ; Set cursor to 0,0
int 0x10
pop es
popa
ret