print CRLF instead of just CR

This commit is contained in:
Tibo Ulens 2021-11-09 21:43:55 +01:00
parent 312332cdda
commit cedf9fc1d4

View file

@ -84,19 +84,29 @@ int 0x10
mov dx, 0x00 ; COM1 mov dx, 0x00 ; COM1
int 0x14 int 0x14
cmp al, 0x0D ; enter cmp al, 0x0D ; enter (carriage return)
je .nl je .nl_lf
jmp nonewline ; all other characters jmp nonewline ; all other characters
.nl_reset_state: .nl_reset_state:
mov byte[is_from_virtual_kbd], 0x0 ; reset state variable mov byte[is_from_virtual_kbd], 0x0 ; reset state variable
jmp .nl
;; BIOS keyboard routines read <enter> as CR which is usually not recognized
;; as actually beginning a new line, so anytime a CR is sent a LF is sent with
;; it
.nl_lf:
mov al, 0x0A ; line feed
mov ah, 0x01 ; transmit char
int 0x14
.nl: .nl:
call newline call newline
jmp .loop jmp .loop
.virtual_kbd_loop_init: .virtual_kbd_loop_init:
mov byte[is_from_virtual_kbd], 0x1 ; update state variable mov byte[is_from_virtual_kbd], 0x1 ; update state variable
;; same as regular .loop except nothing is sent to serial
.virtual_kbd_loop: .virtual_kbd_loop:
;; read a character, ASCII in al ;; read a character, ASCII in al
mov ah, 0x00 mov ah, 0x00