MUDRAS - Program to add two number using 8085
  Home
  Lectures in Physics
  Student Projects
  Contact
  Publications
  Hidden pages
  => Program to add two number using 8085
  Students Corner

1.       Write a program to add the two given 16 bit numbers.
  7AB5                      0111       1010       1011       0101
+E52A                      1110       0101       0010       1010

 15FDF                   10101       1111       1101       1111
 

Memory location

Mnemonic

OPCODE

Comment

2000

CLC AX,0000

25

Clear Content of AX register

2001

 

00

 

2002

 

00

 

2003

MOV BX, 2600

BB

Move the memory location 2600 to BX register

2004

 

00

 

2005

 

26

 

2006

MOV SI, 2500

BE

Move the memory location 2500 to SI register

2007

 

00

 

2008

 

25

 

2009

MOV DI, 2550

BF

Move the memory location 2550 to DI register

200A

 

50

 

200B

 

25

 

200C

MOV AX, [SI]

8B

Move the calculated Physical address to AX register

200D

 

04

 

200E

ADD AX, [DI]

03

The content of DI is added with AX

200F

 

05

 

2010

MOV [BX], AX

89

Move AX to BX register

2011

 

07

 

2012

MOV AX, 0000

B8

Clears the AX register

2013

 

00

 

2014

 

00

 

2015

ADC AX, 0000

15

Add the content of AX register with 0000 and store in AX

2016

 

00

 

2017

 

00

 

2018

MOV [BX+2], AX

89

Move AX to BX register by incrementing by 2.

2019

 

47

 

201A

 

02

 

201B

HLT

F4

Stop program

 

Addition with Increment:

INR-->RESET-->0500

INPUT

0500-B5

0501-7A

0550-2A

0551-E5

Running the program:

INR-->RESET-->GO 2000-->INR-->RESET-->0600-->INR

 

OUTPUT:

0600-DF

0601-5F

0602-01

 
Today, there have been 19 visitors (25 hits) on this page!
This website was created for free with Own-Free-Website.com. Would you also like to have your own website?
Sign up for free