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
Post a Comment