	BITS 16

start:

	mov ax,07C0h	; setup data segment
	mov ds,ax

	mov ah,0Eh		; "prompt"
	mov al,'>'
	int 10h

read_kbd:
	in al,64h		; read status byte
	and al,01h		; wait for OBF==1
	jz read_kbd

	in al,60h		; read scancode byte

	cmp al,10h
	je .q			; user inputted Q
	cmp al,11h
	je .w			; user inputted W
	cmp al,12h
	je .e			; user inputted E
	cmp al,13h
	je .r			; user inputted R
	cmp al,14h
	je .t			; user inputted T
	cmp al,15h
	je .y			; user inputted Y

	jmp read_kbd

.q:
	mov ah,0Eh
	mov al,'Q'
	int 10h
	jmp read_kbd

.w:
	mov ah,0Eh
	mov al,'W'
	int 10h
	jmp read_kbd

.e:
	mov ah,0Eh
	mov al,'E'
	int 10h
	jmp read_kbd

.r:
	mov ah,0Eh
	mov al,'R'
	int 10h
	jmp read_kbd

.t:
	mov ah,0Eh
	mov al,'T'
	int 10h
	jmp read_kbd

.y:
	mov ah,0Eh
	mov al,'Y'
	int 10h
	jmp read_kbd

	times 510-($-$$) db 0
	dw 0xAA55