You are on page 1of 21

Kh Abdul Qadoos

No: 6520

Registration

Find Out lowest Number from


User Input
.model small
.stack
.data
lowest db ?
lowest1 db ?
a db 10
b db ?
msg1 db 10,13,'Enter 5 Number I will Show You The lowest Number ','$';
msg2 db 10,13,'Enter number=','$';
msg3 db 10,13,'Lowest number=','$';
msg4 db 10,13,'Thank You','$';
Number db ?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg1
int 21h
mov cx,5
mov bx,offset Number
input:
mov ah,09h

Kh Abdul Qadoos
No: 6520
lea dx,msg2
int 21h
mov ah,01h
int 21h
sub al,30h
mul a
mov b,al
mov al,00h
mov ah,01h
int 21h
sub al,30h
add al,b
mov [bx],al
inc bx
loop input
mov cx,5
mov bx,offset Number
mov al,[bx]
again:
CMP [bx],al
JA next
mov al,[bx]
next:
inc bx
loop again
mov ah,00h
div a
mov lowest,al
mov lowest,ah

Registration

Kh Abdul Qadoos
No: 6520
add lowest,30h
add lowest1,30h
mov ah,09h
lea dx,msg3
int 21h
mov ah,02h
mov dl,lowest
int 21h
mov ah,02h
mov dl,lowest1
int 21h
mov ah,09h
lea dx,msg4
int 21h
main endp
end main

Registration

Kh Abdul Qadoos
No: 6520

Registration

Find Out Highest Number


from User Input
.model small
.stack
.data
highest db ?
highest1 db ?
a db 10
b db ?
msg1 db 10,13,'Enter 5 Number I will Show You The Highest Number ','$';
msg2 db 10,13,'Enter number=','$';
msg3 db 10,13,'Highest number=','$';
msg4 db 10,13,'Thank You','$';
Number db ?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg1
int 21h
mov cx,5
mov bx,offset Number
input:
mov ah,09h
lea dx,msg2

Kh Abdul Qadoos
No: 6520
int 21h
mov ah,01h
int 21h
sub al,30h
mul a
mov b,al
mov al,00h
mov ah,01h
int 21h
sub al,30h
add al,b
mov [bx],al
inc bx
loop input
mov cx,5
mov bx,offset Number
mov al,[bx]
again:
CMP al,[bx]
JA next
mov al,[bx]
next:
inc bx
loop again
mov ah,00h
div a
mov highest,al
mov highest1,ah
add highest,30h
add highest1,30h

Registration

Kh Abdul Qadoos
No: 6520
mov ah,09h
lea dx,msg3
int 21h
mov ah,02h
mov dl,highest
int 21h
mov ah,02h
mov dl,highest1
int 21h
mov ah,09h
lea dx,msg4
int 21h
main endp
end main

Registration

Kh Abdul Qadoos
No: 6520

Registration

Find the Factorial of User


Input Number
.model small
.stack
.data
msg1 db 10,13,'Enter Number=','$';
msg2 db 10,13,'Fectorial=','$';
a db 10
b db ?
c db ?
d db ?
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg1
int 21h
mov ah,01h
int 21h
sub al,30h
mov cl,al
dec cl

Kh Abdul Qadoos
No: 6520
input:
mul cl
dec cl
jnz input
mov ah,00
div a
mov d,ah
mov ah,00
div a
mov b,al
mov c ,ah
add b,30h
add c,30h
add d,30h
mov ah,09h
lea dx,msg2
int 21h
mov ah,02h
mov dl,b
int 21h
mov ah,02h
mov dl,c
int 21h
mov ah,02h
mov dl,d
int 21h
mov ah,4ch
main endp
end main

Registration

Kh Abdul Qadoos
No: 6520

Registration

Show Sum of 5 Numbers


21,12,15,19,20
.model small
.stack
.data
msg db 10,13,'Sum is=','$';
number db 21,12,15,19,20
rezult db ?
a db 10
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg
int 21h

Kh Abdul Qadoos
No: 6520
mov cx,05
mov bx,offset number
mov al,0
again: add al,[bx]
inc bx
dec cx
jnz again
mov ah,00h
div a
mov rezult,ah
add rezult,30h
add al,30h

mov ah,02h
mov dl,al
int 21h

mov ah,02h
mov dl,rezult
int 21h
mov ah,4ch
int 21h
main endp
end main

Registration

Kh Abdul Qadoos
No: 6520

Registration

Five Number Subtracted by


another Number
.model small
.stack
.data
msg1 db 10,13,'Enter 5 Numbers:','$';
msg4 db ' ','$';
msg2 db 10,13,'The Number you subtract:','$';
msg3 db 10,13,'Subtraction Ans=:','$';
second db ?
num1 db ?

Kh Abdul Qadoos
No: 6520
num2 db ?
n1 db ?
n2 db ?
n3 db ?
n4 db ?
n5 db ?
a db 10
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg1
int 21h
mov ah,01h
int 21h
sub al,30h
mov n1,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h
int 21h
sub al,30h
mov n2,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h

Registration

Kh Abdul Qadoos
No: 6520
int 21h
sub al,30h
mov n3,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h
int 21h
sub al,30h
mov n4,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h
int 21h
sub al,30h
mov n5,al
mov ah,09h
lea dx,msg2
int 21h
mov ah,01h
int 21h
sub al,30h
mov second,al
mov bx,offset n1
mov cx,05
mov al,0
again: mov al,[bx]
sub al,second

Registration

Kh Abdul Qadoos
No: 6520
mov ah,00h
div a
mov num1,al
mov num2,ah
add num1,30h
add num2,30h
mov ah,09h
lea dx,msg3
int 21h
mov ah,02h
mov dl,num1
int 21h
mov ah,02h
mov dl,num2
int 21h
mov al,0
inc bx
dec cx
jnz again
mov ah,4ch
int 21h
main endp
end main

Registration

Kh Abdul Qadoos
No: 6520

Registration

Five Number Multiply by


another Number
.model small
.stack
.data
msg1 db 10,13,'First 5 Numbers=:','$';
msg4 db ', ','$';
msg2 db 10,13,'the number you Multiplay=:','$';
msg3 db 10,13,'Multiply ans=:','$';
second db ?
num1 db ?
num2 db ?
a db 10
n1 db ?
n2 db ?
n3 db ?
n4 db ?
n5 db ?

Kh Abdul Qadoos
No: 6520
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg1
int 21h
mov ah,01h
int 21h
sub al,30h
mov n1,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h
int 21h
sub al,30h
mov n2,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h
int 21h
sub al,30h
mov n3,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h

Registration

Kh Abdul Qadoos
No: 6520
int 21h
sub al,30h
mov n4,al
mov ah,09h
lea dx,msg4
int 21h
mov ah,01h
int 21h
sub al,30h
mov n5,al
mov ah,09h
lea dx,msg2
int 21h
mov ah,01h
int 21h
sub al,30h
mov second,al
mov bx,offset n1
mov cx,05
mov al,0
normal:
mov al,[bx]
mul second
mov ah,00h
div a
mov num1,al
mov num2,ah
add num1,30h
add num2,30h

Registration

Kh Abdul Qadoos
No: 6520

Registration

mov ah,09h
lea dx,msg3
int 21h
mov ah,02h
mov dl,num1
int 21h
mov ah,02h
mov dl,num2
int 21h
mov al,0
inc bx
dec cx
jnz normal
mov ah,4ch
int 21h
main endp
end main

Five double digit Number divide by


another Number
.model small
.stack

Kh Abdul Qadoos
No: 6520
.data
msg1 db 10,13,'First 5 Number:','$';
msg4 db ', ','$';
msg2 db 10,13,'The number you divide:','$';
msg3 db 10,13,'Division Ans:','$';
second db ?
temp db ?
num1 db ?
num2 db ?

a db 10
n1 db ?
.code
main proc
mov ax,@data
mov ds,ax
mov bx,offset n1
mov cx,05
mov ah,09h
lea dx,msg1
int 21h

FURC:
mov ah,01h
int 21h
sub al,30h
mul a
mov temp,al
mov ah,01h

Registration

Kh Abdul Qadoos
No: 6520
int 21h
sub al,30h
add al,temp
mov [bx],al
mov ah,09h
lea dx,msg4
int 21h
inc bx
dec cx
jnz FURC
mov ah,09h
lea dx,msg2
int 21h
mov ah,01h
int 21h
mov second,al
sub second,30h
mov bx,offset n1
mov cx,05
mov al,0
again:
mov al,[bx]
mov ah,00h
div second
mov num1,al
mov num2,ah
add num1,30h
add num2,30h
mov ah,09h

Registration

Kh Abdul Qadoos
No: 6520
lea dx,msg3
int 21h
mov ah,02h
mov dl,num1
int 21h
mov al,0
inc bx
dec cx
jnz again
mov ah,4ch
int 21h
main endp
end main

Registration