Logo 
Search:

Assembly Language Articles

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

Program to convert a string into uppercase/lowercase

Posted By: Madeleine Hughes     Category: Assembly Language     Views: 12733

A Program to convert a string into uppercase/lowercase.

Code for Program to convert a string into uppercase/lowercase in Assembly Language

.MODEL SMALL
.DATA
        STR1    DB      10 DUP(' '),'$'
        NEW_LINE DB 0DH,'CONVERTED STRING:$','$'
.CODE

MAIN    PROC
        MOV AX,@DATA
        MOV DS,AX

        LEA SI,STR1
AGAIN:
        MOV AH,01H
        INT 21H
        CMP AL,0DH
        JE  BACK

        CMP AL,41H
        JL  BAK
        CMP AL,5AH
        JG  BAK
        ADD AL,20H
BAK:    MOV [SI],AL
        INC SI
        JMP AGAIN
BACK:
        MOV AL,'$'
        MOV [SI],AL

        MOV AH,09H
        LEA DX,NEW_LINE
        INT 21H

        MOV AH,09H
        LEA DX,STR1
        INT 21H

        MOV AH,4CH
        INT 21H

MAIN    ENDP
        END   MAIN


OUTPUT
************
Z:\assembly\SYSTEM~1\AS1>ex4
CONVERTED STRING: xyz
Z:\assembly\SYSTEM~1\AS1>XYZ
  
Share: 


Didn't find what you were looking for? Find more on Program to convert a string into uppercase/lowercase Or get search suggestion and latest updates.

Madeleine Hughes
Madeleine Hughes author of Program to convert a string into uppercase/lowercase is from London, United Kingdom.
 
View All Articles

 
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!