Logo 
Search:

Assembly Language Articles

Submit Article
Home » Articles » Assembly Language » Homework HelpRSS Feeds

Program to convert upper case into lower case and vise versa

Posted By: Maya Hughes     Category: Assembly Language     Views: 16768

Write a program to convert upper case into lower case and vise versa.

Code for Program to convert upper case into lower case and vise versa in Assembly Language

DIS MACRO STR
MOV AH,09H
LEA DX,STR
INT 21H
ENDM
DATA SEGMENT
    MSG1 DB "ENTER YOUR STRING : $"
    MSG2 DB "CONVERTED STRING IS : $"
    STR1 DB 20 DUP('$')
    LINE DB 10,13,'$'
DATA ENDS

CODE SEGMENT
          ASSUME DS:DATA,CS:CODE
START:
        MOV AX,DATA
        MOV DS,AX
        DIS MSG1
        MOV AH,0AH
        LEA DX,STR1
        INT 21H
        DIS LINE
        MOV CH,00
        MOV CL,BYTE PTR[STR1+1]
        LEA SI,STR1+2
    L1: MOV AH,BYTE PTR[SI]
        CMP AH,'A'
        JL L4
        CMP AH,'Z'
        JG L2
        ADD BYTE PTR[SI],32
        JMP L3
     L2:CMP AH,'a'
        JL L4
        CMP AH,'z'
        JG L4
        SUB BYTE PTR[SI],32
     L3:INC SI
        LOOP L1
        DIS MSG2
        DIS STR1+2
     L4:MOV AH,4CH
        INT 21H
CODE ENDS
END START

;------
;OUTPUT
;------

    ENTER YOUR STRING : JiNeSh
    CONVERTED STRING IS : jInEsh
  
Share: 



Maya Hughes
Maya Hughes author of Program to convert upper case into lower case and vise versa is from London, United Kingdom.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!