×

Embedded Systems Tutorial

AVR Microcontroller

8051 Microcontroller

8085 Microprocessor

8086 Microprocessor

8255 Microprocessor

Embedded Systems Practice

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

  1. Load number in accumulator.
  2. Complement the content of accumulator.
  3. Add 01 to the content of accumulator.
  4. Store the 2s Complement in memory location 3050.
  5. The carry which is generated during calculating the 2s complement 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



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.