Assembly language program to divide two number Static inputs

Code

org 100h
.stack 100                         
.data
.code
main proc
    mov ax,25  ;ax registrer is Dividend
    mov bx,5   ;bx register is Divisor
    
    div bx    ;Quotient will save in ax and remainder save in dx register
    mov cx,dx
    
    mov dx,ax
    add dx,48
    mov ah,02
    int 21h
    
                
    mov dx,10    ;new line
    mov ah,02
    int 21h
    mov dx,13
    mov ah,02
    int 21h
    
    mov dx,cx
    add dx,48
    mov ah,02
    int 21h
   
    main endp
end main

Output

There is 5 is Quotient and 0 is Reminder


Comments

Popular posts from this blog

8085 Program for two digits subtraction input from user

Assembly language program to display sum of all even numbers between 1 to 100

Assembly language program to input an integer from user and display whether the number is even or odd