Sunday, September 13, 2009

Receive ASCII character through SID pin (8085)




Statement: An ASCII character is being received on SID pin of 8085. Write a program in assembly language of 8085 to assemble this character and store it in memory. Write comment for each instruction.





Source program:
LXI SP, 27FFH
LXI H, 2000H : Memory pointer
RIM : Read SID
ANI 80H : Check D7 bit of Accumulator
CALL Delay : 1/2 bit time delay for stop bit
MVI B, 08H : Initialize bit counter
MVI D, 00H : Clear data register
UP1: ALL Delay : 1 bit time
RIM : Read SID line
ANI 80H : Mask bits B6 - Bo
ORA D : OR data bit with previous bits
RRC
MOV D, A : Store data bit at appropriate position
DCR B
JNZ UP1
RLC : Shift left to correct result
MOV M, A : Store result
RIM : Read stop bit
ANI 8OH
CZ error : If not stop bit call error
HLT : Terminate program.
Delay subroutine:
Delay: LXI D, Count
Back: DCX D
MOV A, D
ORA E
JNZ Back
RET

No comments:

Post a Comment