I'm trying to crate a prompt. I can't figure out how to store the typed text somewhere. I'm storing it because i want to make commands. Feel free to compile it :). This is a 8-bit operating system. I use nasm to compile my code. I have an intel cpu. I use QEMU to run my code. I use Linux as my operating system. Here is my code:
[ORG 0x7c00]
xor ax, ax
mov ds, ax
cld
mov si, msg
call bios_print
call keyboard
hang:
jmp hang
msg db "Hello World!", 13, 10, 0
prompt db 0x0a, 0x0d, '> ', 0
bios_print:
lodsb
or al, al
jz done
mov ah, 0x0E
mov bh, 0
int 0x10
jmp bios_print
clear:
int 10h
keyboard:
mov ah, 00h
int 16h
cmp ah, 0x1C
je .enter
mov ah, 0x0e
int 0x10
jmp keyboard
.enter:
hlt
mov si, prompt
call bios_print
jmp keyboard
done:
ret
times 510-($-$$) db 0
db 0x55
db 0xAA