Home

Add parity bit to 7-bit ASCII characters

Statement: Add even parity to a string of 7-bit ASCII characters. The length of the string is in memory location 2040H and the string itself begins in memory location 2041H. Place even parity in the most significant bit of each character.

Source program :

  • LXI H, 2040H
  • MOV C ,M : Counter for character
  • REPEAT:INX H : Memory pointer to character
  • MOV A,M : Character in accumulator
  • ORA A : ORing with itself to check parity.
  • JPO PAREVEN : If odd parity place 
  • ORI 80H even parity in D7 (80).
  • PAREVEN:MOV M , A : Store converted even parity character.
  • DCR C : Decrement counter.
  • JNZ REPEAT : If not zero go for next character.
  • HLT : Terminate program execution

Flowchart for program

31-Add parity bit to 7-bit ASCII characters 

Related Programs for Beginners: (Click down)

Calculate the sum of series of numbers

Find the square of given number

Arrange in ascending order

Unpack a BCD number