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

📄 main.s

📁 用AVR atmega16做的一个完整彩色LED控制程序
💻 S
📖 第 1 页 / 共 5 页
字号:
	std z+0,R2
L190:
	.dbline 925
	ldd R0,y+9
	inc R0
	std y+9,R0
L192:
	.dbline 925
	ldd R24,y+9
	cpi R24,6
	brlo L189
	.dbline 927
; 								tempPW[i]=PasswordData[i];
; 							KK=0;
	clr R0
	clr R1
	std y+14,R1
	std y+13,R0
	.dbline 928
; 						}
	.dbline 929
; 			   		    break;
	.dbline 931
; 			       default:
; 			   		    break;
L89:
	.dbline 933
; 			       }
; 				KeyCode=0;   
	clr R2
	sts _KeyCode,R2
	.dbline 934
; 				if(ModeStatus==MODE_LENGHT)
	lds R24,_ModeStatus
	cpi R24,2
	breq X23
	xjmp L195
X23:
	.dbline 935
; 				{
	.dbline 936
; 				   DispBuffer[0]=CharFont[17];
	ldi R30,<_CharFont+17
	ldi R31,>_CharFont+17
	lpm R30,Z
	sts _DispBuffer,R30
	.dbline 937
; 				   loop=val_lenght;
	lds R2,_val_lenght
	lds R3,_val_lenght+1
	std y+7,R3
	std y+6,R2
	.dbline 938
; 			          bit=loop/1000;
	ldi R18,1000
	ldi R19,3
	movw R16,R2
	xcall div16u
	std y+8,R16
	.dbline 939
; 				   DispBuffer[1]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 940
; 				   loop=loop-bit *1000;
	mov R18,R16
	clr R19
	ldi R16,1000
	ldi R17,3
	xcall empy16s
	ldd R0,y+6
	ldd R1,y+7
	sub R0,R16
	sbc R1,R17
	std y+7,R1
	std y+6,R0
	.dbline 941
; 			          bit=loop/100;
	ldi R18,100
	ldi R19,0
	movw R16,R0
	xcall div16u
	std y+8,R16
	.dbline 942
; 				   DispBuffer[2]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+2,R30
	.dbline 943
; 				   loop=loop-bit *100;
	ldi R24,100
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 944
; 			          bit=loop/10;
	ldi R18,10
	ldi R19,0
	xcall div16u
	std y+8,R16
	.dbline 945
; 				   DispBuffer[3]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+3,R30
	.dbline 946
; 				   loop=loop-bit *10;
	ldi R24,10
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 947
; 				   DispBuffer[4]=CharFont[loop];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	movw R30,R16
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+4,R30
	.dbline 949
; 
; 				   BLenghtCount=val_lenght;
	lds R2,_val_lenght
	lds R3,_val_lenght+1
	sts _BLenghtCount+1,R3
	sts _BLenghtCount,R2
	.dbline 951
; 				   
; 				}
	xjmp L196
L195:
	.dbline 952
; 				else if(ModeStatus==MODE_KIND)
	lds R24,_ModeStatus
	cpi R24,3
	breq X24
	xjmp L202
X24:
	.dbline 953
; 				{
	.dbline 954
; 				   DispBuffer[0]=CharFont[0];
	ldi R30,<_CharFont
	ldi R31,>_CharFont
	lpm R30,Z
	sts _DispBuffer,R30
	.dbline 955
; 				   loop=val_kind;
	lds R2,_val_kind
	clr R3
	std y+7,R3
	std y+6,R2
	.dbline 956
; 				   DispBuffer[1]=CharFont[16];
	ldi R30,<_CharFont+16
	ldi R31,>_CharFont+16
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 957
; 			          bit=loop/100;
	ldi R18,100
	ldi R19,0
	movw R16,R2
	xcall div16u
	std y+8,R16
	.dbline 958
; 				   DispBuffer[2]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+2,R30
	.dbline 959
; 				   loop=loop-bit *100;
	ldi R24,100
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 960
; 			          bit=loop/10;
	ldi R18,10
	ldi R19,0
	xcall div16u
	std y+8,R16
	.dbline 961
; 				   DispBuffer[3]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+3,R30
	.dbline 962
; 				   loop=loop-bit *10;
	ldi R24,10
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 963
; 				   DispBuffer[4]=CharFont[loop];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	movw R30,R16
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+4,R30
	.dbline 964
; 				}
	xjmp L203
L202:
	.dbline 965
; 				else if(ModeStatus==MODE_PASSWORD)
	lds R24,_ModeStatus
	cpi R24,4
	breq X25
	xjmp L209
X25:
	.dbline 966
; 				{
	.dbline 967
; 		   	   		if(PassDate_flag==PASSWORD_SETUP)
	lds R24,_PassDate_flag
	cpi R24,17
	breq X26
	xjmp L211
X26:
	.dbline 968
; 					{
	.dbline 969
; 				   			DispBuffer[0]=CharFont[18];
	ldi R30,<_CharFont+18
	ldi R31,>_CharFont+18
	lpm R30,Z
	sts _DispBuffer,R30
	.dbline 970
; 				   			DispBuffer[2]=CharFont[0];
	ldi R30,<_CharFont
	ldi R31,>_CharFont
	lpm R30,Z
	sts _DispBuffer+2,R30
	.dbline 971
; 							switch(K4Count)
	lds R10,_K4Count
	clr R11
	movw R24,R10
	cpi R24,1
	ldi R30,0
	cpc R25,R30
	breq L218
	cpi R24,2
	ldi R30,0
	cpc R25,R30
	breq L221
	cpi R24,3
	ldi R30,0
	cpc R25,R30
	breq L224
	cpi R24,4
	ldi R30,0
	cpc R25,R30
	breq L227
	cpi R24,5
	ldi R30,0
	cpc R25,R30
	breq L230
	xjmp L215
X5:
	.dbline 972
; 							{
L218:
	.dbline 974
; 							case	1:   //byte1
; 							   	DispBuffer[1]=CharFont[1];
	ldi R30,<_CharFont+1
	ldi R31,>_CharFont+1
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 975
; 								break;
	xjmp L216
L221:
	.dbline 977
; 							case	2:   //byte2
; 				   				DispBuffer[1]=CharFont[2];
	ldi R30,<_CharFont+2
	ldi R31,>_CharFont+2
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 978
; 								break;
	xjmp L216
L224:
	.dbline 980
; 							case	3:   //byte3
; 				   				DispBuffer[1]=CharFont[3];
	ldi R30,<_CharFont+3
	ldi R31,>_CharFont+3
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 981
; 								break;
	xjmp L216
L227:
	.dbline 983
; 							case	4:   //byte4
; 				   				DispBuffer[1]=CharFont[4];
	ldi R30,<_CharFont+4
	ldi R31,>_CharFont+4
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 984
; 								break;
	xjmp L216
L230:
	.dbline 986
; 							case	5:   //byte5
; 				   				DispBuffer[1]=CharFont[5];
	ldi R30,<_CharFont+5
	ldi R31,>_CharFont+5
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 987
; 								break;
	xjmp L216
L215:
	.dbline 989
; 							default:
; 								if(PwModify_flag==TRUE) //070616 modify
	lds R24,_PwModify_flag
	lds R25,_PwModify_flag+1
	cpi R24,1
	ldi R30,0
	cpc R25,R30
	brne L233
	.dbline 990
; 									DispBuffer[1]=CharFont[18];
	ldi R30,<_CharFont+18
	ldi R31,>_CharFont+18
	lpm R30,Z
	sts _DispBuffer+1,R30
	xjmp L216
L233:
	.dbline 991
; 								else if(PwModify_flag==3)//070616 modify
	lds R24,_PwModify_flag
	lds R25,_PwModify_flag+1
	cpi R24,3
	ldi R30,0
	cpc R25,R30
	brne L237
	.dbline 992
; 				   					DispBuffer[1]=CharFont[16];
	ldi R30,<_CharFont+16
	ldi R31,>_CharFont+16
	lpm R30,Z
	sts _DispBuffer+1,R30
	xjmp L216
L237:
	.dbline 994
; 									else
; 				   					DispBuffer[1]=CharFont[6];
	ldi R30,<_CharFont+6
	ldi R31,>_CharFont+6
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 995
; 								break;
L216:
	.dbline 997
; 							}
; 							   loop=KK;
	ldd R0,y+13
	ldd R1,y+14
	std y+7,R1
	std y+6,R0
	.dbline 998
; 						          bit=loop/10;
	ldi R18,10
	ldi R19,0
	movw R16,R0
	xcall div16u
	std y+8,R16
	.dbline 999
; 							   DispBuffer[3]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+3,R30
	.dbline 1000
; 							   loop=loop-bit *10;
	ldi R24,10
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 1001
; 							   DispBuffer[4]=CharFont[loop];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	movw R30,R16
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+4,R30
	.dbline 1002
; 					}
	xjmp L210
L211:
	.dbline 1003
; 					else if(PassDate_flag==DATE_SETUP)
	lds R24,_PassDate_flag
	cpi R24,34
	breq X27
	xjmp L245
X27:
	.dbline 1004
; 					{
	.dbline 1005
; 				   			DispBuffer[0]=CharFont[19];
	ldi R30,<_CharFont+19
	ldi R31,>_CharFont+19
	lpm R30,Z
	sts _DispBuffer,R30
	.dbline 1006
; 				   			DispBuffer[1]=CharFont[19];
	ldi R30,<_CharFont+19
	ldi R31,>_CharFont+19
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 1007
; 							   loop=KK;
	ldd R0,y+13
	ldd R1,y+14
	std y+7,R1
	std y+6,R0
	.dbline 1008
; 						          bit=loop/100;
	ldi R18,100
	ldi R19,0
	movw R16,R0
	xcall div16u
	std y+8,R16
	.dbline 1009
; 							   DispBuffer[2]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+2,R30
	.dbline 1010
; 							   loop=loop-bit *100;
	ldi R24,100
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 1011
; 						          bit=loop/10;
	ldi R18,10
	ldi R19,0
	xcall div16u
	std y+8,R16
	.dbline 1012
; 							   DispBuffer[3]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+3,R30
	.dbline 1013
; 							   loop=loop-bit *10;
	ldi R24,10
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 1014
; 							   DispBuffer[4]=CharFont[loop];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	movw R30,R16
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+4,R30
	.dbline 1015
; 					}
	xjmp L210
L245:
	.dbline 1017
; 					else
; 					{
	.dbline 1018
; 				   			   DispBuffer[0]=CharFont[18];
	ldi R30,<_CharFont+18
	ldi R31,>_CharFont+18
	lpm R30,Z
	sts _DispBuffer,R30
	.dbline 1019
; 				   			   DispBuffer[1]=CharFont[19];
	ldi R30,<_CharFont+19
	ldi R31,>_CharFont+19
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 1020
; 							   loop=KK;
	ldd R0,y+13
	ldd R1,y+14
	std y+7,R1
	std y+6,R0
	.dbline 1021
; 						          bit=loop/100;
	ldi R18,100
	ldi R19,0
	movw R16,R0
	xcall div16u
	std y+8,R16
	.dbline 1022
; 							   DispBuffer[2]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+2,R30
	.dbline 1023
; 							   loop=loop-bit *100;
	ldi R24,100
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 1024
; 						          bit=loop/10;
	ldi R18,10
	ldi R19,0
	xcall div16u
	std y+8,R16
	.dbline 1025
; 							   DispBuffer[3]=CharFont[bit];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	mov R30,R16
	clr R31
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+3,R30
	.dbline 1026
; 							   loop=loop-bit *10;
	ldi R24,10
	mov R0,R16
	mul R24,R0
	ldd R16,y+6
	ldd R17,y+7
	sub R16,R0
	sbc R17,R1
	std y+7,R17
	std y+6,R16
	.dbline 1027
; 							   DispBuffer[4]=CharFont[loop];
	ldi R24,<_CharFont
	ldi R25,>_CharFont
	movw R30,R16
	add R30,R24
	adc R31,R25
	lpm R30,Z
	sts _DispBuffer+4,R30
	.dbline 1028
; 					}
	.dbline 1029
; 				}
	xjmp L210
L209:
	.dbline 1031
; 				else
; 				{
	.dbline 1032
; 				   DispBuffer[0]=CharFont[16];
	ldi R30,<_CharFont+16
	ldi R31,>_CharFont+16
	lpm R30,Z
	sts _DispBuffer,R30
	.dbline 1033
; 				   DispBuffer[1]=CharFont[16];
	ldi R30,<_CharFont+16
	ldi R31,>_CharFont+16
	lpm R30,Z
	sts _DispBuffer+1,R30
	.dbline 1034
; 				   DispBuffer[2]=CharFont[0];
	ldi R30,<_CharFont
	ldi R31,>_CharFont
	lpm R30,Z
	sts _Disp

⌨️ 快捷键说明

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