[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