Logo 
Search:

Assembly Language Articles

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

An application for reversing the strings

Posted By: Adelhard Fischer     Category: Assembly Language     Views: 7143

Write an application for reversing the strings.

Code for An application for reversing the strings in Assembly Language

data segment
        string1 db 'good', '$'
        str1_len dw $ - string1
        string2 db ?
data ends

code segment
        assume ds:data, cs:code

begin:
        mov ax, data
        mov ds, ax
        mov es, ax

        sub str1_len, 02h

        lea si, string1
        mov ax, si
        add ax, str1_len
        mov si, ax

        lea di, string2
        mov cx, str1_len
        inc cx

        mov ah, 09h
        lea dx, string1
        int 21h

counter:
        mov ax, [si]
        mov [di], ax
        dec si
        inc di
        loop counter
                
        mov [di], '$'

mov ah, 09h
lea dx, string2
int 21h

mov ax, 4c00h
int 21h

code ends
end begin  
  
Share: 


Didn't find what you were looking for? Find more on An application for reversing the strings Or get search suggestion and latest updates.

Adelhard Fischer
Adelhard Fischer author of An application for reversing the strings is from Frankfurt, Germany.
 
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!