Hello Everyone!
I Am New In Assembly Language, and during Practice i got one problem in Number Division. i make Program Which Take 4 Digit In Input and store in DW Array . but on Output Time Program Give Me Wrong output .
For Example.
If I Enter 1234 The output of the Program is "4321" But i want "1234" in output Result .
Please See the Code and tell me if any one know about this.
.model small
.stack 100h
.data
arr dw 0,0
ten db 10
.code
main proc
mov ax,@data
mov ds,ax
mov ah,1
int 21h
sub al,48
mov al,al
mul ten
mov arr,ax
mov ah,1
int 21h
sub al,48
mov ah,0
add arr,ax
mov ax,arr
mov al,al
mul ten
mov arr,ax
mov ah,1
int 21h
sub al,48
mov ah,0
add arr,ax
mov ax,arr
mov al,al
mul ten
mov arr,ax
mov ah,1
int 21h
sub al,48
mov ah,0
add arr,ax
mov ax,arr
div ten
mov ch,ah
mov cl,al
mov ah,2
mov dl,ch
add dl,48
int 21h
mov ah,0
mov al,cl
div ten
mov ch,ah
mov cl,al
mov ah,2
mov dl,ch
add dl,48
int 21h
mov ah,0
mov al,cl
div ten
mov ch,ah
mov cl,al
mov ah,2
mov dl,ch
add dl,48
int 21h
mov dl,cl
add dl,48
int 21h
mov ah,4ch
int 21h
main endp
end main