How to add two nos. using Direct addressing Mode?

Microprocessor 8085 Photo credits: kollewin.com
2000 LDA ,2050h 3A Clear Accumulator.
2001 50
2002 20
2003 MOV C,A 4F Clear Register C.
2004 LDA ,2051h 3A Store the First no. in Accumulator.
2005 51
2006 20
2007 MOV B,A 47 Copy this No. to Register B
2008 LDA, 2052h 3A Sore the second No. in Accumulator.
2009 52
200A 20
200B ADD B 80 Add the two Nos.
200C STA ,2053h 32 Store the result
200D 53
200E 20
200F JNC , 2013h D2 Check for carry
2010 13
2011 20
2012 INR C 0C Increment Register C
2013 MOV A,C 79 Copy the Carry to Accumulator
2014 STA ,2054h 32 Store the Carry
2015 51
2016 20
2017 HLT 76 Program Terminated.

INPUT DATA:

a) 2050-00h 2051-04H(B) 2052-03H(C)
Output: 2053-07H(SUM) 2054-00(CARRY)
b) 2050-00h 2051-FAH(B) 2052-ABH(A)
Output: 2053-A5(sum) 2054-1(carry)

I'm a physicist specializing in theoretical, computational and experimental condensed matter physics. I like to develop Physics related apps and softwares from time to time. Can code in most of the popular languages. Like to share my knowledge in Physics and applications using this Blog and a YouTube channel.



Leave a Reply

Your email address will not be published. Required fields are marked *