Strg+D
This commit is contained in:
parent
67a9e37c5c
commit
e7b041ee07
14
src/main.asm
14
src/main.asm
|
@ -105,6 +105,11 @@ loop:
|
||||||
int 19h ;welches man nimmt ist egal
|
int 19h ;welches man nimmt ist egal
|
||||||
;jmp 0xffff:0x0000
|
;jmp 0xffff:0x0000
|
||||||
|
|
||||||
|
|
||||||
|
.halt_d:
|
||||||
|
mov si, msg_strgdhalt
|
||||||
|
call print_string
|
||||||
|
|
||||||
.halt:
|
.halt:
|
||||||
mov si, msg_halt
|
mov si, msg_halt
|
||||||
call print_string
|
call print_string
|
||||||
|
@ -199,6 +204,7 @@ cmd_halt db 'stop', 0
|
||||||
cmd_banner db 'banner', 0
|
cmd_banner db 'banner', 0
|
||||||
|
|
||||||
msg_halt db 'Stopping....', 0
|
msg_halt db 'Stopping....', 0
|
||||||
|
msg_strgdhalt db 'Strg+D pressed! - Stop', 0
|
||||||
msg_reboot db 'Rebooting....',0
|
msg_reboot db 'Rebooting....',0
|
||||||
msg_helloworld db 'Hey, Man!', 0x0D, 0x0A, 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
|
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?
|
cmp al, 0x0D ; enter pressed?
|
||||||
je .done ; yes, we're done
|
je .done ; yes, we're done
|
||||||
|
|
||||||
|
cmp al, 0x04 ; Strg+D pressed?
|
||||||
|
je .d
|
||||||
|
|
||||||
cmp cl, 0x3F ; 63 chars inputted?
|
cmp cl, 0x3F ; 63 chars inputted?
|
||||||
je .loop ; yes, only let in backspace and enter
|
je .loop ; yes, only let in backspace and enter
|
||||||
|
|
||||||
|
@ -263,13 +272,16 @@ get_string:
|
||||||
stosb ; put character in buffer
|
stosb ; put character in buffer
|
||||||
inc cl
|
inc cl
|
||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
|
.d:
|
||||||
|
call loop.halt_d
|
||||||
|
|
||||||
.backspace:
|
.backspace:
|
||||||
cmp cl, 0 ; beginning of string?
|
cmp cl, 0 ; beginning of string?
|
||||||
je .loop ; yes, ignore the key
|
je .loop ; yes, ignore the key
|
||||||
|
|
||||||
dec di
|
dec di
|
||||||
mov byte [di], 0 ; delete character
|
mov byte [di], 0; delete character
|
||||||
dec cl ; decrement counter as well
|
dec cl ; decrement counter as well
|
||||||
|
|
||||||
mov ah, 0x0E
|
mov ah, 0x0E
|
||||||
|
|
Loading…
Reference in New Issue
Block a user