相关代码 |
|
;FUNCTION NAME: EXTERNAL_DATA_COMPARE ;FUNCTION: COMPARE 2 BLOCKS EXTERNAL DATA MEMORY(R2)TIMES ;BLOCK 1 START AT DPTR ;BLOCK 2 START AT R7,R6 ; EXTERNAL_DATA_COMPARE $1 MOVX A,@DPTR MOV B,A ;BLOCK 1 DATA IN B PUSH DPH PUSH DPL MOV DPH,R7 MOV DPL,R6 MOVX A,@DPTR ;BLOCK 2 DATA IN A INC DPTR MOV R7,DPH MOV R6,DPL ;BLOCK 2 INDEX+1 POP DPL POP DPH INC DPTR ;BLOCK 1 INDEX+1 CJNE A,B,$2 ;COMPARE 1 BYTE DJNZ R2,$1 MOV A,#00H ;NO ERROR SJMP $2+2 $2 MOV A,#01H ;ERROR RET ;