Example if capslock is on, A will be a.. and if off a will be A
.model small
.stack 50
.data
msg db "Enter a character: $"
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09
mov dx,offset msg
int 21h
start: mov ah,07
int 21h
cmp al,0dh
je exit
cmp al,41h
je smol
cmp al,41h
ja sa
cmp al,41h
jb start
cmp al,5ah
je smol
cmp al,5ah
jb smol
cmp al,61h
je cap
cmp al,61h
ja cap
cmp al,7ah
je cap
cmp al,7ah
ja start
cmp al,7ah
jb ca
sa: cmp al,5ah
je smol
cmp al,5ah
jb smol
ca: cmp al,61h
je cap
cmp al,61h
ja cap
cmp al,61h
jb start
cap: sub al,20h
jmp disp
smol: add al,20h
jmp disp
disp: mov ah,02
mov dl,al
int 21h
jmp start
exit: mov ax,4c00h
int 21h
main endp
end main
No comments:
Post a Comment