0% found this document useful (0 votes)
31 views4 pages

Greatest of The Given Numbers

This document contains three assembly language programs that perform different numeric operations: 1. The first program finds the greatest number from a list of given numbers by incrementing a counter and comparing values. 2. The second program sums the values of a series of numbers by incrementing a pointer and adding the numbers without carry. 3. The third program sums the values of a series including carry by incrementing a pointer, adding numbers, and incrementing a separate counter on carry.

Uploaded by

GEZHILMARAN
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)
31 views4 pages

Greatest of The Given Numbers

This document contains three assembly language programs that perform different numeric operations: 1. The first program finds the greatest number from a list of given numbers by incrementing a counter and comparing values. 2. The second program sums the values of a series of numbers by incrementing a pointer and adding the numbers without carry. 3. The third program sums the values of a series including carry by incrementing a pointer, adding numbers, and incrementing a separate counter on carry.

Uploaded by

GEZHILMARAN
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/ 4

GREATEST OF THE GIVEN NUMBERS

ADDRESS

MNEMONIC

HEX CODE

COMMENTS

8000,8001,8002

LXIH,8500

21,01,85

8003

MOV C,M

4E

Load the number in


the given address
Move M to C

8004

INX H

23

Increment H by 1

8005

MOV A,M

7E

Move M to A

8006

DCR C

0D

Decrement C by 1

8007

INX H

23

Increment H by 1

8008

CMD M

BE

Compare with A

8009,800A,800B

JNC 800D

D2,0D,80

800C

MOV A,M

7E

Jump to 800D if
there is no carry
Move M to A

800D

DCR C

0D

Decrement H by 1

800E,800F,8010

JNZ 8007

C2,07,80

8011,8012,8013

STA 8600

32,15,80

8014

HLT

76

Jump to 8007 if
there is no zero
Store the Value from
the accumulator to
address
Stop

SUM OF SERIES WITHOUT CARRY

ADDRESS

MNEMONIC

HEX CODE

COMMENTS

8000,8001,8002

LXIH,8500

21,00,85

8003

MOV C,M

4E

Load the number in


the given address
Move M to C

8004

DCR C

0D

Decrement C by 1

8005

INX H

23

Increment H by 1

8006

MOV A,M

7E

Move M to A

8007

INX H

23

Increment H by 1

8008

ADD M

86

Add M with A

8009

DCR C

0D

Decrement C by 1

800A,800B,800C

JNZ 8007

C2,07,80

800D,800E,800F

STA 8600

32,00,96

8010

HLT

76

Jump to 8007 if
there is no zero
Store value from A
to address
Stop

SUM OF SERIES WITH CARRY

ADDRESS

MNEMONIC

HEX CODE

COMMENTS

8000,8001

MVI B,00

06,00

Initialize B=00

8002

XRA A

AF

Exclusive A

8003,8004,8005

LXIH,8500

21,00,85

8006

MOV C,M

7E

Load the number in


the given address
Move M to C

8007

INX H

23

Increment H by 1

8008

MOV A,M

7E

Move M to A

8009

DCR C

0D

Decrement C by 1

800A

INX H

23

Increment H by 1

800B

ADD M

86

Add M with A

800C,800D,800E

JNC 8010

C2,07,80

800F

INR B

0A

Jump to 8010 if
there is no carry
Increment B by 1

8010

DCR C

0D

Decrement C by 1

8011,8012,8013

JNZ 800A

C2,07,80

8014,8015,8016

STA 8600

32,00,96

8017

MOV A,B

7E

Jump to 800A if
there is no zero
Store value from A
to address
Move B to A

8018,8019,801A

STA 8601

32,00,96

801B

HLT

76

Store value from A


to address
Stop

You might also like