0% found this document useful (0 votes)
32 views

Largest From Array

This document contains a flow chart and program to find the largest number from a series of N numbers in memory locations 3000H through 3004H. The program uses an H-L pair to iterate through the memory locations, loads each number into registers and compares it to the current largest. If larger, it stores the number in 3050H. After running, 3050H contains the largest number, which was E2H.

Uploaded by

Aswathy Achu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Largest From Array

This document contains a flow chart and program to find the largest number from a series of N numbers in memory locations 3000H through 3004H. The program uses an H-L pair to iterate through the memory locations, loads each number into registers and compares it to the current largest. If larger, it stores the number in 3050H. After running, 3050H contains the largest number, which was E2H.

Uploaded by

Aswathy Achu
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

www.eazynotes.

com

Gursharan Singh Tatla

Page No. 1

Flow Chart to Find Largest from a Series of N Numbers

www.eazynotes.com

Gursharan Singh Tatla

Page No. 2

Program to Find Largest from a Series of N Numbers


Address
2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 200A 200B 200C 200D 200E 200F 2010 2011 2012 2013 2014 2015

Mnemonics
LXI

Operand
H, 3000 H

Opcode
21 00 30 4E 23 7E 0D 23 46 B8 D2 0E 20 78 0D C2 07 20 32 50 30 76

Remarks
Load H-L pair with address 3000 H

MOV INX MOV DCR INX MOV CMP JNC

C, M H A, M C H B, M B 200E H

Move data from 3000 H to counter C Increment H-L pair Move data from 3001 H to A Decrement Counter C Increment H-L pair Move next number from memory to B Compare B with A Jump to location 200E H if no carry

MOV DCR JNZ

A, B C 2007 H

Move data from B to A Decrement C Jump to location 2007 H if no zero

STA

3050 H

Store the result at location 3050 H

HLT

Halt

Before Execution: 3000: 3001: 3002: 3003: 3004: 04 H 01 H 65 H E2 H 83 H

After Execution: 3050: E2 H

You might also like