How To Check Parity of a No. using Intel 8085 Microprocessor?

intel 8085 mp programs complete listMem. Addr. Mnemonics         Hex Codes  Comments

2000    XRA, A                           AF         Clear register A
2001     MVI B, 32                      06         Load in Reg. B the no. whose parity is to be checked(32)
2002                                             32
2003     MVI C,00                      0E         Initialize Reg. C
2004                                             00
2005     ADD B                            80         Perform an operation so that the flags are affected
2006     JPO 200A                     E2         Jump if Parity is Odd to Address 200A
2007                                             0A
2008                                             20
2009     INR C                             0C       Increment C if Parity is Even
200A     MOV A, C                      79       Move the content of C in Accumulator
200B     STA 2050                      32       Store the result in Address 2050H
200C                                             50
200D                                             20
200E     HLT                                76

The above Program would store 1 at 2050H mem. Addr. If the Parity is Even and 0 if the parity is odd. In the above case we have taken the no. to be 32 which is (100000) in binary, hence has odd parity. Note: Parity is the number of 1’s in the circuit.
Input: (52)10 =(110100)2
Output: 0 (as it has odd no. of 1’s i.e. Odd Parity)

PhD researcher at Friedrich-Schiller University Jena, Germany. 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.
[wpedon id="7041" align="center"]

2 thoughts on “How To Check Parity of a No. using Intel 8085 Microprocessor?

  1. what is the need to do ex or A initially . and how A is cleared with ex or ? please explain . and is there any other methor to clear a registor ?

Leave a Reply

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