A really simple solution (which MikeOS itself uses) is the
16h interrupt, function 0. It's simple: you call it, it waits for a keypress and then returns the
ASCII value of that key in the AL register.
Example code:
mov ah, 0 ; We're telling the BIOS that we want to wait for a keypress
int 16h ; Call the BIOS (16h = keyboard routines)
cmp al, 13 ; Has the Enter key been pressed? (13 = Enter ASCII code)
je .enter_pressed ; If it has, jump somewhere
Another fun thing you may try is the following loop, which will print on the screen whatever the user types:
loop:
mov ah, 0 ; Get a keypress, as described above
int 16h
mov ah, 0Eh ; We're telling the BIOS that we want to print the character, which is already in the AL register
mov bh, 0 ; Set screen page 0 (it's good practice)
int 10h ; Call the BIOS (10h = video routines)
jmp loop ; Loop forever
Good luck!