Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Practical No 9:

.model small
.data
num db 88h,99h,44h,67h,33h
c db 00h
sum db ?
.code
mov ax,@data
mov ds,ax
mov si,offset num
mov al,[si]
mov sum,al
mov cx,04h
up:
inc si
mov al,[si]
add al,sum
daa
mov sum,al
jnc exit
inc c
exit:
loop up
int 3
ends
end
Output:
Practical No 10:

.model small
.data
num db 12h,07h,25h,18h,02h
num2 db 00h
.code
mov ax,@data
mov ds,ax
mov si,offset num
mov al,[si]
mov num2,al
mov cx,04h
inc si
up:
mov al,[si]
cmp num2,al
exit:
inc si
loop up
int 3
ends
end
Output:
Practical No 11:
.model small
.data
num db 12h,07h,25h,18h,02h
.code
mov ax,@data
mov ds,ax
mov bx,04h
up:
mov si,offset num
mov cx,04h
up1:
mov al,[si]
cmp al,[si+1]
jnc exit
xchg al,[si+1]
xchg al,[si]
exit:
inc si
loop up1
dec bx
jnz up
int 3
ends
end
Output:

You might also like