Home » Embedded Systems

2's Compliment of 8 bits number with carry

Here, we are going to learn how to find 2's compliment of 8 bits number with carry using 8085 microprocessor?
Submitted by Akash Kumar, on November 03, 2018

Problem statement:

To find the 2’s compliment of 8 bits number with carry using 8085 microprocessor.

Algorithm:

  1. Load number in accumulator.
  2. Compliment the content of accumulator.
  3. Add 01 to the content of accumulator.
  4. Store the 2s compliment in memory location 3050.
  5. The carry which is generated during calculating the 2s compliment is stored at memory location 3051.
  6. Terminate the program.

Program:

	LDA     2050
	CMA
	ADI     01
	MOV     L, A
	MVI     A, 00
	ADC     A
	MOV     H, A
	SHLD    2051
	HLT

Observation:

    INPUT: 
    2050:07

    OUTPUT: 
    2051:00
    2052:F9

Hence we successfully calculated 2s compliment of 8 bit number with carry on 8085 microprocessor.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL







Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing » Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.