Home »
Embedded Systems
2's Complement of an 8-bit Number with Carry in 8085 Microprocessor
In this tutorial, we will learn how to find the 2's complement of an 8-bit number with carry in 8085 Microprocessor.
By Akash Kumar Last updated : May 13, 2023
Find the 2's Complement of an 8-bit Number with Carry in 8085 Microprocessor
Given an 8-bit number, we have to find its 2's complement with carry in 8085 Microprocessor.
Algorithm
- Load number in accumulator.
- Complement the content of accumulator.
- Add 01 to the content of accumulator.
- Store the 2s Complement in memory location 3050.
- The carry which is generated during calculating the 2s complement is stored at memory location 3051.
- 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