0% found this document useful (0 votes)
4 views2 pages

Prac 10

The document contains assembly code for a program that processes an array of hexadecimal values. It compares elements in the array to find the smallest and largest values, storing them in designated variables. The code includes segments for data and instructions, with specific operations for comparison and looping.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Prac 10

The document contains assembly code for a program that processes an array of hexadecimal values. It compares elements in the array to find the smallest and largest values, storing them in designated variables. The code includes segments for data and instructions, with specific operations for comparison and looping.

Uploaded by

arqamqazi549
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Practical 10

Program:-

assume cs:code assume cs:code


assume ds:data assume ds:data
data segment data segment
arr db 12h,7h,25h,18h,2h arr db 12h,7h,25h,18h,2h
smll db ? lrg db ?
ends data ends data
code segment code segment
start: mov ax,data start: mov ax,data
mov ds,ax mov ds,ax
mov ax,0000h mov ax,0000h
lea si,arr lea si,arr
mov al,[si] mov al,[si]
mov cl,04h mov cl,04h
up:inc si up:inc si
mov bl,[si] mov bl,[si]
cmp al,bl cmp al,bl
jns down js down
up1:loop up up1:loop up
jmp exit jmp exit
down: mov al,bl down: mov al,bl
jmp up1 jmp up1
exit: mov smll,al exit: mov lrg,al
int 3 int 3
code ends code ends
end start end start
Output:-

You might also like