Parity


Write functions, PRTYENC (PaRiTY ENCode) and PRTYDEC (PaRiTYDECode) that will implement an EVEN parity encoding and decoding scheme that take the character in the al register and produce the en(de)coded character in the ah. PRTYDEC returns a 0 in the ah register if the character in the al register is of the wrong parity. Both functions are to make use of a third function call CNTBITS (CouNT BITS) that return the value (in the bx register) of number of bits set to one of the word contained in the ax register.

You must also supply two main programs.

  1. ENCODE: This program will accept any character from the keyboard until EOF is encountered and print the 8-bit even parity character.
  2. DECODE: This program reads characters from the keyboard until EOF is encoutered. The program produces an error message should the character entered be of the wrong parity.

© R. Glass
All Rights Reserved
glassr@ncc.edu