Home » Codes » Assembly » 8086 » Char-by-Char String Concatenation in Assembly 8086

Char-by-Char String Concatenation in Assembly 8086

Mar 18, 2013 by     No Comments    Placed under: 8086, Assembly
pinit fg en rect gray 28 Char by Char String Concatenation in Assembly 8086

8086 Char by Char String Concatenation in Assembly 8086

Char-by-Char String Concatenation in Assembly 8086. The Following assembly language code provides Char-by-Char String Concatenation for Intel 8086 Microprocessor.

org 100h

    .data

        string_1 DB 5 DUP(0)
        string_2 DB 5 DUP(0)
        string_3 DB 10 DUP(0)
        info1 DB "Enter 1st 5-digits String : $"
        info2 DB "Enter 2nd 5-digits String : $"
        info3 DB "Resultant Char-by-Char String Concatenation : $"

    .code

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

        mov cx, 5

        l1:
            mov ah, 01h
            int 21h
            push ax
            loop l1

        mov cx, 5
        mov di, 0

        l2:
            pop ax
            mov string_1[di], al
            inc di
            loop l2

        mov dl, 0ah
        mov ah, 02h
        int 21h

        mov dl, 0dh
        mov ah, 02h
        int 21h

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

        mov cx, 5h

        l3:
            mov ah, 01h
            int 21h
            push ax
            loop l3

        mov cx, 5h
        mov di, 0h

        l4:
            pop ax
            mov string_2[di], al
            inc di
            loop l4

        mov dl, 0ah
        mov ah, 02h
        int 21h

        mov dl, 0dh
        mov ah, 02h
        int 21h

        mov cx, 5h
        mov si, 0h
        mov di, 0h

        l5:
            mov dl, string_1[si]
            mov dh, string_2[si]
            mov string_3[di], dl
            inc di
            mov string_3[di], dh
            inc si
            inc di
            loop l5

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

        mov cx, 9
        lea bx, string_3
        mov si, 9

        l7:
            mov dl, [bx+si]
            mov ah, 02h
            int 21h
            dec si
            loop l7

ret

Written by mfahim

mfahim f Char by Char String Concatenation in Assembly 8086

I am an undergraduate student of computer science. With studies I develop applications for web, desktop and moblie and also contribute to the open source market by building components, plugins and themes for wordpress, joomla and drupal. Provide services for the custom made CMS’s for different business needs.

Having two years of experience in following languages; C, C++, SQL, MySQL, C# ,Java, .Net, PHP, JSP, ASP, XML, HTML, CSS, Javascript, jQuery and ActionScript 3.0. Complete command over Adobe Dreamweaver CS6, Adobe Photoshop CS6, Adobe Flash CS6, Adobe After effect CS6, CorelDraw X6, AutoCAD 2012, Maya 2012, 3D max, Blender and Urdu Inpage.

website Char by Char String Concatenation in Assembly 8086
0saves


If you enjoyed this Article, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.
+0 -2




Related Articles:

Loading Disqus Comments ...
Loading Facebook Comments ...

Subscribe to our Newsletter

To subscribe to our newsletter simply add your email below. A confirmation email will be sent to you!