⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lab3_1.asm

📁 This is an program for the 8051 for timer subsystem
💻 ASM
字号:
		ORG 0000H
		SJMP MAIN

		ORG 0030H
MAIN:	MOV R4, #0AH		;COUNTER1 for no. of pass required	

BACK11:
		MOV R0, #30H		;ARRAY POINTER1
		MOV R1, #31H		;ARRAY POINTER2
		MOV R3, #09H		;COUNTER2 for no. of comparison required

BACK22:
		MOV 05H,@R0		;Save first position no. in 05h location.
		MOV A,@R1		;Take second position no. in A
		CJNE A, 05H, NEXT11		;Comparison of 1st & 2nd position nos. In this 					;instruction comparison of A & 05h location 						;will be done & if both will not equal then PC 						;will jump to NEXT11 location
		Sjmp NEXT22		;If both A & 05h will equal then PC will 							;execute this instruction
NEXT11:
		JNC NEXT22		;If A(2nd position no.) is greater than 05h (1st  no.) 					;then no need to change their positions.
		XCH A,@R0		;If A(2nd position no.) is less than 05h (1st  no.) 		MOV @R1,05H		;then change their positions.
		MOV @R1,A

NEXT22:
		INC R0			;Increment both pointers
		INC R1
		DJNZ R3,BACK22	;Decrement counter of comparison

		DJNZ R4,BACK11	; Decrement counter of pass

LAST: SJMP LAST
	
		END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -