Logo 
Search:

Assembly Language Articles

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

Program to enter two 16 bit binary numbers and perform OR operation on it

Posted By: Adelisa Fischer     Category: Assembly Language     Views: 3204

Write an assembly program to enter two 16 bit binary numbers and perform OR operation on it. Display the decimal equivalent of the result obtained by performing the above operations.

Code for Program to enter two 16 bit binary numbers and perform OR operation on it in Assembly Language

.model small

.data
        num1  db  00000111B
        num2  db  00001111B
        
        ans db ?
        v10 db 10
        arr db 10 dup(?)
        cntr db 0

.code
        mov ax,@data
        mov ds,ax

        mov ax,0000
        mov ah,num1
        OR ah,num2

        LEA SI,arr
        mov ans,ah
        mov ax,0000
        mov al,ans

        L1:
                div v10
                mov [SI],ah
                mov ah,00
                add cntr,1
                INC SI
                cmp al,00
                ja L1
                                
        DEC SI
        mov ah,00
        mov cl,cntr

        L2:
                mov dh,00
                mov bl,[SI]
                mov ah,02
                add bl,30h
                mov dl,bl
                int 21h
                DEC SI
                Loop L2

        mov ax,4C00h
        int 21h

end        
  
Share: 



Adelisa Fischer
Adelisa Fischer author of Program to enter two 16 bit binary numbers and perform OR operation on it is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 

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!