有关数字电压表的设计报告
LP2:PUSH R2
LP3:PUSH R1
INC DPTR
AJMP LP1
LP4:MOV DPTR,#data3 ;data3为校验字所在地址值
CLR A
MOVC A,@A+DPTR
XRL A,B ;B为程序代码异或值,A为校验字值
JNZ LP5
CLR 20H.0
AJMP LP6
LP5:SETB 20H.0
MOV 2CH,#0EH ;将E送入显缓区
MOV 2BH,#01H ;将"1"送入显缓区
LP6: RET
RAM自检:
TRAM:MOV 00H,#55H ;检R0(00H)
MOV A,00H
CJNE A,#55H,LOOP1
MOV 00H,#0AAH
MOV A,00H
CJNE A,#0AAH,LOOP1
MOV R0,#01H
LOOP2: MOV A,#55H
MOV @R0,A
MOV A,@R0
CJNE A, #55H, LOOP1
MOV A, #0AAH
MOV @R0,A
MOV A,@R0