This commit is contained in:
MrBesen 2019-01-11 11:37:06 +01:00
parent 67a9e37c5c
commit e7b041ee07
Signed by: MrBesen
GPG Key ID: 596B2350DCD67504
1 changed files with 13 additions and 1 deletions

View File

@ -105,6 +105,11 @@ loop:
int 19h ;welches man nimmt ist egal
;jmp 0xffff:0x0000
.halt_d:
mov si, msg_strgdhalt
call print_string
.halt:
mov si, msg_halt
call print_string
@ -199,6 +204,7 @@ cmd_halt db 'stop', 0
cmd_banner db 'banner', 0
msg_halt db 'Stopping....', 0
msg_strgdhalt db 'Strg+D pressed! - Stop', 0
msg_reboot db 'Rebooting....',0
msg_helloworld db 'Hey, Man!', 0x0D, 0x0A, 0
msg_help db 'ThiesyyyOS Commands:', 0x0D, 0x0A ,'hi', 0x0D,0x0A,'help', 0x0D, 0x0A,'credits', 0x0D,0x0A,'beep[WIP]',0x0D,0x0A,'reboot',0x0D,0x0A,'stop', 0x0D, 0x0A, 0
@ -254,6 +260,9 @@ get_string:
cmp al, 0x0D ; enter pressed?
je .done ; yes, we're done
cmp al, 0x04 ; Strg+D pressed?
je .d
cmp cl, 0x3F ; 63 chars inputted?
je .loop ; yes, only let in backspace and enter
@ -263,13 +272,16 @@ get_string:
stosb ; put character in buffer
inc cl
jmp .loop
.d:
call loop.halt_d
.backspace:
cmp cl, 0 ; beginning of string?
je .loop ; yes, ignore the key
dec di
mov byte [di], 0 ; delete character
mov byte [di], 0; delete character
dec cl ; decrement counter as well
mov ah, 0x0E