OK,程序如下:
ORG 0000H
LJMP START
ORG 0100H
START:
CLR EA
MOV SP,#60H
MOV R0,#200
MOV DPTR,#8000H
MOV R1,#0
MOV R2,#0
LOOP:
MOVX A,@DPTR
PUSH ACC
AND A,#0FH
MOV B,A
POP ACC
SWAP A
AND A,#OFH
CJNE A,B,CMPDAT
INC R1
SJMP CMPDAT1
CMPDAT:
INC R2
CMPDAT1:
INC DPTR
DJNZ R0,LOOP
MOV DPTR,#9000H
MOV A,R1
MOVX @DPTR,A
INC DPTR
MOV A,R2
MOVX @DPTR,A
END