Home » Codes » Assembly » 8086 » Number to Binary Sum and Value Transformation in Assembly 8086

Number to Binary Sum and Value Transformation in Assembly 8086

Mar 17, 2013 by     No Comments    Placed under: 8086, Assembly
pinit fg en rect gray 28 Number to Binary Sum and Value Transformation in Assembly 8086

8086 Number to Binary Sum and Value Transformation in Assembly 8086

Number to Binary Sum and Value Transformation in Assembly 8086. The Following assembly language code provides Number to Binary Sum and Value Transformation for Intel 8086 Microprocessor.

org 100h

.data

    info1 db "Enter 2 Digits Number For Binary Sum : $"
    info2 db 0dh,0ah, "2 Digits Number Binary Sum : $"
    info3 db 0dh,0ah, "2 Digits Number Binary value : $"
    binary_in db 5 dup(0)
    binary_out db 12 dup(0)

.code

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

    lea dx,binary_in
    mov ah,0ah
    mov binary_in, 3
    int 21h

    mov cx,3
    mov di,2

    l1:

        mov bl,binary_in[di]
        sub bl,30h
        mov binary_in[di],bl
        inc di
        loop l1

    mov cx,3
    mov bx,0
    mov si,2

    mask:

        mov al,binary_in[si]
        and al,00001000b
        shr al,3
        mov binary_out[bx],al
        inc bx

        mov al,binary_in[si]
        and al,00000100b
        shr al,2
        mov binary_out[bx],al
        inc bx

        mov al,binary_in[si]
        and al,00000010b
        shr al,1
        mov binary_out[bx],al
        inc bx

        mov al,binary_in[si]
        and al,00000001b
        mov binary_out[bx],al
        inc bx
        inc si
        loop mask

    mov si,0
    mov cx,12
    mov bh,0

    binary_sum:

        mov bl,binary_out[si]
        add bh,bl
        inc si
        loop  binary_sum

        lea dx,info2
        mov ah,09h
        int 21h
            mov dl,bh
            add dl,30h
            mov ah,02h
            int 21h

        lea dx,info3
        mov ah,09h
        int 21h
        mov cx,12
        mov di,0

    l2:

       mov dl,binary_out[di]
       add dl,30h
       mov ah,02h
       int 21h
       inc di
       loop l2

ret

Written by mfahim

mfahim f Number to Binary Sum and Value Transformation 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 Number to Binary Sum and Value Transformation 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 -0




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!