MCS-51单片机应用开发实用子程序.zip

源代码在线查看: 6.4.6串的匹配.txt

软件大小: 153 K
上传用户: tengye
关键词: MCS zip 51单片机 应用开发
下载地址: 免注册下载 普通下载 VIP

相关代码

				S		EQU		2000H			
				T		EQU		30H				
				N		DATA	38H				
				M		DATA	39H				
				FIND	BIT		00H				
				TEST:	
				MOV	N,#5BH					
				MOV	P2,#HIGH(S)
				MOV	R0,#LOW(S)
				MOV	DPTR,#LIST
				MOV	R2,N
				LOOP:	
				CLR		A
				MOVC	A,@A+DPTR
				MOVX	@R0,A
				INC		R0
				INC		DPTR
				DJNZ	R2,LOOP
				MOV	M,#6						
				MOV	T,#"8"
				MOV	T+1,#"0"
				MOV	T+2,#"C"
				MOV	T+3,#"5"
				MOV	T+4,#"5"
				MOV	T+5,#"2"
				LCALL	BFSRCH					
				MOV	M,#5					
				MOV	T,#"8"	
				MOV	T+1,#"0"
				MOV	T+2,#"C"
				MOV	T+3,#"5"
				MOV	T+4,#"1"
				LCALL	BFSRCH					
				STOP:	
				LJMP	STOP					
				LIST:	
				DB		"The 80C51 "				
				DB		"two power mode"
				DB		"modes of operation "
				DB		"modes of power down "
				BFSRCH:	
				MOV	DPTR,#S					
				MOV	A,N						
				CLR		C
				SUBB	A,M						
				INC		A		
				MOV	R7,A					
				BF0:	
				MOV	R0,#T
				MOV	R6,M					
				MOV	R4,DPH					
				MOV	R5,DPL
				BF1:	
				MOVX	A,@DPTR					
				XRL		A,@R0					
				JNZ		BF2						
				INC		R0						
				INC		DPTR					
				DJNZ	R6,BF1					
				SETB	FIND					
				MOV	DPH,R4					
				MOV	DPL,R5
				RET								
				BF2:	
				MOV	DPH,R4					
				MOV	DPL,R5	
				INC		DPTR					
				DJNZ	R7,BF0					
				CLR		FIND					
				RET	
							

相关资源