Find the 1’s complement of a Number in 8085

In this program, we are going to write an assembly language program to Find the 1’s complement of a Number in 8085 microprocessor with a program flow chart and explanation of the program.

1’s complement of a Number in 8085

Program Statement

Find the 1’s complement of the number stored at memory location C200H and store the complemented number at memory location C300H.

Explanation of Program

  • 1’s complement of a number means to invert each bit of that number. So our task is to complement each bit of the number.
  • We will first load the number in the accumulator whose 1’s complement is to be found.
  • Then using CMA instruction we will complement the accumulator. This is 1’s complement of the number.
  • Store the result at memory location C300H.
    • Let A = AAH
    • i.e. A: 10101010
    • 1’s complement of A: 01010101
    • Thus, 1’s complement of A is 55H.

Assembly Language Program

LDA C200HLoad the number in the accumulator from the C200H memory address.A = AA H
CMAComplement the numberA = 55 H
STA C300HStore the 1’s complement of the number at memory location C300H.C300H = H
HLTTerminate program executionStop

Flow Chart of Program

1's complement of a number in 8085 flow chart
Sr. No.Name of the 8085 Programs
1.Write a program to load the data into the accumulator and any register.
2.Write a program to exchange the contents of memory locations.
3.Add two 8-bit numbers.
4.Subtract two 8-bit numbers.
5.Add two 16-bit numbers.
6.Subtract two 16-bit numbers
7.Find the 1’s complement of a Number
8.Find the 2’s complement of a Number
9.8085 Program To Mask The Lower Nibble
10.8085 Program To Mask The Upper Nibble
11.8085 program to pack the two unpacked BCD numbers
12.8085 program to Unpack the two packed BCD numbers
13.8085 program to find the sum of a series of 8-bit numbers
14.8085 Program to sort the numbers in ascending order
15.8085 Program to sort the numbers in Descending order

Hello friends, my name is Trupal Bhavsar, I am the Writer and Founder of this blog. I am Electronics Engineer(2014 pass out), Currently working as Junior Telecom Officer(B.S.N.L.) also I do Project Development, PCB designing and Teaching of Electronics Subjects.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

telegram logo Join Our Telegram Group!