You are currently viewing [PRACTICAL] Implement a program to find minimum and maximum from block data
Microprocessor 8085 programming

[PRACTICAL] Implement a program to find minimum and maximum from block data

5
(1)

[PRACTICAL] IMPLEMENT A PROGRAM TO FIND MINIMUM AND MAXIMUM FROM BLOCK DATA USING SUBROUTINE PROVIDED LENGTH OF BLOCK STORED AT MEMORY LOCATION

Are you looking for a step-by-step guide to Implement a program to find minimum and maximum from block data using subroutine provided length of block stored at memory location? here are the steps to implement a program to find minimum and maximum from block data using subroutine provided length of block stored at memory location.

Theory:

This program used to find minimum and maximum elements of N array, here we are take array of 10 elements and find smallest and largest elements from array. Array location stared from C050. Program create two subroutine for MIN and MAX value are as follow

MIN subroutine

MIN: CMP B
JNC SKIP1
 MOV B,A
SKIP1: RET

MAX subroutine

MAX: CMP D
JC SKIP2
MOV D,A
SKIP2: RET

Program:

LXI H,C050H
MVI C,0AH
MOV B,M
MVI D,00H
NEXT: MOV A,M
CALL MIN
CALL MAX
INX H
DCR C
JNZ NEXT
HLT
MIN: CMP B
JNC SKIP1
 MOV B,A
SKIP1: RET
MAX: CMP D
JC SKIP2
MOV D,A
SKIP2: RET

OUTPUT:

Value of memory location:

Value of Register:

For more practical related to 885 Programming please visit the 8085 Programming link

How useful was this post?

Click on a star to rate it!

Average rating 5 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

As you found this post useful...

Share this post on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?