Write a complete program in real-address mode that:
- Prompts the user to read from the keyboard one uppercase letter between K and P.
- Validates the input and if the character is not in the range prompt the user again and again until a valid character is entered.
- Displays the 5 neighboring letters on each side.
For example, if the user enters a letter ‘M’ then the output would be: HIJKL M NOPQR. i try on solve it but my answer is wrong
include irvine16.inc
.data
M1 byte "Enter one upper case letter between K and P : $"
letter byte 1,?,1
.code
main PROC
mov ax, @data
mov ds, ax
L1: mov ah,9 ;display msg m1
lea dx,M1
int 21h
mov ah,01h ;read a char
lea dx,letter
int 21h
mov bl,letter
CMP bl,'K'
Jb L1
CMP bl, 'P'
Ja L1
mov cx,5
lea si, letter
L3:
dec si
loop L3
mov cx,11
lea si, letter
L2: sub si,5
mov ah,05h
int 21h
LOOP L2
mov ah, 4ch
int 21h
main ENDP
END main