8086 ALP to read letters in Lower case and convert to Upper case

Problem: Program to read a letter in Lower case and print it after converting it in to Upper case letter

Title: 8086 ALP to read letters in Lower case and convert to Upper case

Description: This 8086 ALP allows user to input lower case letter, changes the lower case letters to upper case and than display that upper case letters in the dos screen.

.MODEL SMALL
 .STACK 100H

 .DATA
    PROMPT_1  DB  'Enter the Lower Case Letter : $'
    PROMPT_2  DB  0DH,0AH,'The Upper Case Letter is : $'

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

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

     MOV AH, 1                    ; read a letter
     INT 21H

     MOV BL, AL                   ; save the letter in BL 

     LEA DX, PROMPT_2             ; load and print PROMPT_2
     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

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>