Saturday, September 12, 2009

Add parity bit to 7-bit ASCII characters(8085)


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

No comments:

Post a Comment