Sunday, September 13, 2009

Program to test RAM (8085)

Statement:To test RAM by writing '1' and reading it back and later writing '0' (zero) and reading it back. RAM addresses to be checked are 40FFH to 40FFH. In case of any error, it is indicated by writing 01H at port 10H


Source Program:
LXI H, 4000H : Initialize memory pointer
BACK: MVI M, FFH : Writing '1' into RAM
MOV A, M : Reading data from RAM
CPI FFH : Check for ERROR
JNZ ERROR : If yes go to ERROR
INX H : Increment memory pointer
MOV A, H
CPI SOH : Check for last check
JNZ BACK : If not last, repeat
LXI H, 4000H : Initialize memory pointer
BACKl: MVI M, OOH : Writing '0' into RAM
MOV A, M : Reading data from RAM
CPI OOH : Check for ERROR
INX H : Increment memory pointer
MOV A, H
CPI SOH : Check for last check
JNZ BACKl : If not last, repeat
HLT : Stop Execution

2 comments: