In assembly language write a program that uses INT 21h to in

In assembly language

write a program that uses INT 21h to input lowercase letters from the keyboard and convert them to uppercase. Display only the uppercase letters.

Solution

INT 21h to input lowercase letters from the keyboard and convert them to uppercase.

.MODEL SMALL
.STACK 100H

.DATA
    INPUT1 DB \'Enter the Lower Case Letter : $\'
    OUTPUT DB 0DH,0AH,\'The Upper Case Letter is : $\'

.CODE
   MAIN PROC
     MOV AX, @DATA                ; initialize DS
     MOV DS, AX

     LEA DX, INPUT1             ; load and print INPUT1
     MOV AH, 9
     INT 21H

     MOV AH, 1                    ; read a letter
     INT 21H

     MOV BL, AL                   ; save the letter in BL

     LEA DX, OUTPUT             ; load and print OUTPUT
     MOV AH, 9
     INT 21H

     AND BL, 0DFH                 ; convert a lower case letter to upper
                                  ; case letter

     MOV AH, 2                    ; print the Lower case letter
     MOV DL, BL
     INT 21H

     MOV AH, 4CH                  ; return control to DOS
     INT 21H
   MAIN ENDP
END MAIN

In assembly language write a program that uses INT 21h to input lowercase letters from the keyboard and convert them to uppercase. Display only the uppercase le

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site