X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=os%2Fuefi.asm;h=16fc85d589fd8f147d0187352fc35cf5cdfe1826;hb=c6c2c1941a030ebda811db613262d317e6041137;hp=4f8ce56ef437f18b34fce4314a9d389a4500ecb2;hpb=bcba0c88f4eaddac8e0d8c0fa68264b2e81ee272;p=rrq%2Fjonasforth.git diff --git a/os/uefi.asm b/os/uefi.asm index 4f8ce56..16fc85d 100644 --- a/os/uefi.asm +++ b/os/uefi.asm @@ -129,7 +129,6 @@ os_print_string: ret os_read_char: - mov r15, rcx .read_key: mov rcx, [system_table] ; EFI_SYSTEM_TABLE* rcx mov rcx, [rcx + EFI_SYSTEM_TABLE.ConIn] ; EFI_SIMPLE_TEXT_INPUT_PROTOCOL* rcx @@ -143,19 +142,21 @@ os_read_char: cmp rax, r8 je .read_key - mov ax, [input_key.UnicodeChar] - mov [r15], al + movzx rax, word [input_key.UnicodeChar] ;; Special handling of enter (UEFI gives us '\r', but we want '\n'.) cmp ax, $D jne .no_enter - mov byte [r15], $A + mov al, $A .no_enter: + push rax ;; Print the character - mov rcx, r15 + mov [char_buffer], al + mov rcx, char_buffer mov rdx, 1 call os_print_string + pop rax ret