Logo 
Search:

Assembly Language Articles

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

Program which swaps the case of the given string

Posted By: Alexandra Hughes     Category: Assembly Language     Views: 4541

Write an application which swaps the case of the given string.

Code for Program which swaps the case of the given string in Assembly Language

.model small

.data
        str1 db "SeVe-RiNa"
        len equ $-str1

.code
        mov ax,@data
        mov ds,ax

        LEA SI,str1
        mov cx,len

        L1:
                mov ah,[SI]
                cmp ah,41h
                JB JustInc
                cmp ah,5Ah
                JA Conv
                XOR ah,00100000B
                mov [SI],ah
                INC SI
                Loop L1
                jmp ext

        Conv:
                cmp ah,61h
                JB JustInc
                cmp ah,7Ah
                JA JustInc
                XOR ah,00100000B
                mov[SI],ah
                INC SI
                Loop L1
                jmp ext
                
        JustInc:
                INC SI
                Loop L1
        ext:
                mov ah,09h
                LEA DX,str1
                int 21h

                mov ax,4C00h
                int 21h
end
  
Share: 


Didn't find what you were looking for? Find more on Program which swaps the case of the given string Or get search suggestion and latest updates.

Alexandra Hughes
Alexandra Hughes author of Program which swaps the case of the given string is from London, United Kingdom.
 
View All Articles

 

Other Interesting Articles in Assembly Language:


 
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!