assume cs:code,ds:data
data segment
org 2000h
series db 12h,11h,09h,05h,23h,99h,86h
count dw 07h
max db 00h
min db 00h
data ends
code segment
start:mov ax,data
mov ds,ax
mov cx,count
lea si,series
mov al,[si]
mov bl,al
go:inc si
cmp [si],al
jl min_val
mov al,[si]
jmp nxtp
min_val:cmp [si],bl
jg nxtp
mov bl,[si]
nxtp:loop go
mov max,al
mov min,bl
mov ah,4ch
int 21h
code ends
end start
data segment
org 2000h
series db 12h,11h,09h,05h,23h,99h,86h
count dw 07h
max db 00h
min db 00h
data ends
code segment
start:mov ax,data
mov ds,ax
mov cx,count
lea si,series
mov al,[si]
mov bl,al
go:inc si
cmp [si],al
jl min_val
mov al,[si]
jmp nxtp
min_val:cmp [si],bl
jg nxtp
mov bl,[si]
nxtp:loop go
mov max,al
mov min,bl
mov ah,4ch
int 21h
code ends
end start
awesome work thanks sir
ReplyDelete