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

📄 main.ls

📁 STM8s
💻 LS
📖 第 1 页 / 共 5 页
字号:
2239                     ; 223 		    CLK_HSICmd(ENABLE);
2241  0832 a601          	ld	a,#1
2242  0834 cd0000        	call	_CLK_HSICmd
2244                     ; 224 		    CLK_LSICmd(ENABLE);
2246  0837 a601          	ld	a,#1
2247  0839 cd0000        	call	_CLK_LSICmd
2250  083c 2004          	jra	L135
2251  083e               L725:
2252                     ; 229 				 BEEP_Cmd(DISABLE);
2254  083e 4f            	clr	a
2255  083f cd0000        	call	_BEEP_Cmd
2257  0842               L135:
2258                     ; 234 }
2261  0842 85            	popw	x
2262  0843 bf00          	ldw	c_lreg,x
2263  0845 85            	popw	x
2264  0846 bf02          	ldw	c_lreg+2,x
2265  0848 85            	popw	x
2266  0849 bf00          	ldw	c_y,x
2267  084b 320002        	pop	c_y+2
2268  084e 85            	popw	x
2269  084f bf00          	ldw	c_x,x
2270  0851 320002        	pop	c_x+2
2271  0854 80            	iret
2295                     ; 235        @far @interrupt void GPIOE0(void)
2295                     ; 236 	    { 
2296                     	switch	.text
2297  0855               f_GPIOE0:
2299  0855 3b0002        	push	c_x+2
2300  0858 be00          	ldw	x,c_x
2301  085a 89            	pushw	x
2302  085b 3b0002        	push	c_y+2
2303  085e be00          	ldw	x,c_y
2304  0860 89            	pushw	x
2307                     ; 237 		     delay_ms(500);
2309  0861 ae01f4        	ldw	x,#500
2310  0864 cd0000        	call	_delay_ms
2312                     ; 238 			    i++;
2314  0867 3c01          	inc	_i
2315                     ; 239 					if(i==8)
2317  0869 b601          	ld	a,_i
2318  086b a108          	cp	a,#8
2319  086d 2604          	jrne	L345
2320                     ; 241 							i=1;
2322  086f 35010001      	mov	_i,#1
2323  0873               L345:
2324                     ; 244 		  }
2327  0873 85            	popw	x
2328  0874 bf00          	ldw	c_y,x
2329  0876 320002        	pop	c_y+2
2330  0879 85            	popw	x
2331  087a bf00          	ldw	c_x,x
2332  087c 320002        	pop	c_x+2
2333  087f 80            	iret
2357                     ; 245 		    @far @interrupt void GPIOD2(void)
2357                     ; 246 	      { 
2358                     	switch	.text
2359  0880               f_GPIOD2:
2361  0880 3b0002        	push	c_x+2
2362  0883 be00          	ldw	x,c_x
2363  0885 89            	pushw	x
2364  0886 3b0002        	push	c_y+2
2365  0889 be00          	ldw	x,c_y
2366  088b 89            	pushw	x
2369                     ; 247 				  delay_ms(500);
2371  088c ae01f4        	ldw	x,#500
2372  088f cd0000        	call	_delay_ms
2374                     ; 248 					if((i>0)&&(i<8))
2376  0892 3d01          	tnz	_i
2377  0894 2708          	jreq	L555
2379  0896 b601          	ld	a,_i
2380  0898 a108          	cp	a,#8
2381  089a 2402          	jruge	L555
2382                     ; 250 							 i=0;
2384  089c 3f01          	clr	_i
2385  089e               L555:
2386                     ; 254 				}
2389  089e 85            	popw	x
2390  089f bf00          	ldw	c_y,x
2391  08a1 320002        	pop	c_y+2
2392  08a4 85            	popw	x
2393  08a5 bf00          	ldw	c_x,x
2394  08a7 320002        	pop	c_x+2
2395  08aa 80            	iret
2426                     ; 256 		@far @interrupt void GPIOC6(void)           //加
2426                     ; 257 	       {
2427                     	switch	.text
2428  08ab               f_GPIOC6:
2430  08ab 3b0002        	push	c_x+2
2431  08ae be00          	ldw	x,c_x
2432  08b0 89            	pushw	x
2433  08b1 3b0002        	push	c_y+2
2434  08b4 be00          	ldw	x,c_y
2435  08b6 89            	pushw	x
2438                     ; 258 			    delay_ms(500);
2440  08b7 ae01f4        	ldw	x,#500
2441  08ba cd0000        	call	_delay_ms
2443                     ; 259 					if(i==1)
2445  08bd b601          	ld	a,_i
2446  08bf a101          	cp	a,#1
2447  08c1 2608          	jrne	L765
2448                     ; 261 		      nian++;
2450  08c3 ae0000        	ldw	x,#_nian
2451  08c6 a601          	ld	a,#1
2452  08c8 cd0000        	call	c_lgadc
2454  08cb               L765:
2455                     ; 263 					if(i==2)
2457  08cb b601          	ld	a,_i
2458  08cd a102          	cp	a,#2
2459  08cf 260c          	jrne	L175
2460                     ; 265 		      yue++;
2462  08d1 3c04          	inc	_yue
2463                     ; 266 					if(yue==13)
2465  08d3 b604          	ld	a,_yue
2466  08d5 a10d          	cp	a,#13
2467  08d7 2604          	jrne	L175
2468                     ; 268 							 yue=1;
2470  08d9 35010004      	mov	_yue,#1
2471  08dd               L175:
2472                     ; 271 					if(i==3)
2474  08dd b601          	ld	a,_i
2475  08df a103          	cp	a,#3
2476  08e1 260a          	jrne	L575
2477                     ; 273 		      ri++;
2479  08e3 3c05          	inc	_ri
2480                     ; 274 					if(ri==32)
2482  08e5 b605          	ld	a,_ri
2483  08e7 a120          	cp	a,#32
2484  08e9 2602          	jrne	L575
2485                     ; 276 							 ri=0;
2487  08eb 3f05          	clr	_ri
2488  08ed               L575:
2489                     ; 279 					if(i==4)
2491  08ed b601          	ld	a,_i
2492  08ef a104          	cp	a,#4
2493  08f1 260a          	jrne	L106
2494                     ; 281 		      shi++;
2496  08f3 3c06          	inc	_shi
2497                     ; 282 					if(shi==24)
2499  08f5 b606          	ld	a,_shi
2500  08f7 a118          	cp	a,#24
2501  08f9 2602          	jrne	L106
2502                     ; 284 							 shi=0;
2504  08fb 3f06          	clr	_shi
2505  08fd               L106:
2506                     ; 287 					if(i==5)
2508  08fd b601          	ld	a,_i
2509  08ff a105          	cp	a,#5
2510  0901 260a          	jrne	L506
2511                     ; 289 		      fen++;
2513  0903 3c07          	inc	_fen
2514                     ; 290 					if(fen==60)
2516  0905 b607          	ld	a,_fen
2517  0907 a13c          	cp	a,#60
2518  0909 2602          	jrne	L506
2519                     ; 292 							 fen=0;
2521  090b 3f07          	clr	_fen
2522  090d               L506:
2523                     ; 295 					if(i==6)
2525  090d b601          	ld	a,_i
2526  090f a106          	cp	a,#6
2527  0911 260a          	jrne	L116
2528                     ; 297 					   hour++;
2530  0913 3c08          	inc	_hour
2531                     ; 298 						 if(hour==24)
2533  0915 b608          	ld	a,_hour
2534  0917 a118          	cp	a,#24
2535  0919 2602          	jrne	L116
2536                     ; 300 							    hour=0;
2538  091b 3f08          	clr	_hour
2539  091d               L116:
2540                     ; 304 					if(i==7)
2542  091d b601          	ld	a,_i
2543  091f a107          	cp	a,#7
2544  0921 260a          	jrne	L516
2545                     ; 306 							 min++;
2547  0923 3c09          	inc	_min
2548                     ; 308 							 if(min==60)
2550  0925 b609          	ld	a,_min
2551  0927 a13c          	cp	a,#60
2552  0929 2602          	jrne	L516
2553                     ; 310 							    min=0;
2555  092b 3f09          	clr	_min
2556  092d               L516:
2557                     ; 315 				}
2560  092d 85            	popw	x
2561  092e bf00          	ldw	c_y,x
2562  0930 320002        	pop	c_y+2
2563  0933 85            	popw	x
2564  0934 bf00          	ldw	c_x,x
2565  0936 320002        	pop	c_x+2
2566  0939 80            	iret
2597                     ; 317 		@far @interrupt void GPIOA6(void)               //减
2597                     ; 318 	  {
2598                     	switch	.text
2599  093a               f_GPIOA6:
2601  093a 3b0002        	push	c_x+2
2602  093d be00          	ldw	x,c_x
2603  093f 89            	pushw	x
2604  0940 3b0002        	push	c_y+2
2605  0943 be00          	ldw	x,c_y
2606  0945 89            	pushw	x
2609                     ; 319 		   delay_ms(500);
2611  0946 ae01f4        	ldw	x,#500
2612  0949 cd0000        	call	_delay_ms
2614                     ; 320 					if(i==1)
2616  094c b601          	ld	a,_i
2617  094e a101          	cp	a,#1
2618  0950 2608          	jrne	L136
2619                     ; 322 		      nian--;
2621  0952 ae0000        	ldw	x,#_nian
2622  0955 a601          	ld	a,#1
2623  0957 cd0000        	call	c_lgsbc
2625  095a               L136:
2626                     ; 325 					if(i==2)
2628  095a b601          	ld	a,_i
2629  095c a102          	cp	a,#2
2630  095e 260a          	jrne	L336
2631                     ; 327 		      yue--;
2633  0960 3a04          	dec	_yue
2634                     ; 328 					if(yue==0)
2636  0962 3d04          	tnz	_yue
2637  0964 2604          	jrne	L336
2638                     ; 330 							 yue=12;
2640  0966 350c0004      	mov	_yue,#12
2641  096a               L336:
2642                     ; 333 					if(i==3)
2644  096a b601          	ld	a,_i
2645  096c a103          	cp	a,#3
2646  096e 260a          	jrne	L736
2647                     ; 335 		      ri--;
2649  0970 3a05          	dec	_ri
2650                     ; 336 					if(ri==0)
2652  0972 3d05          	tnz	_ri
2653  0974 2604          	jrne	L736
2654                     ; 338 							 ri=31;
2656  0976 351f0005      	mov	_ri,#31
2657  097a               L736:
2658                     ; 341 					if(i==4)
2660  097a b601          	ld	a,_i
2661  097c a104          	cp	a,#4
2662  097e 260a          	jrne	L346
2663                     ; 343 		      shi--;
2665  0980 3a06          	dec	_shi
2666                     ; 344 					if(shi==0)
2668  0982 3d06          	tnz	_shi
2669  0984 2604          	jrne	L346
2670                     ; 346 							 shi=23;
2672  0986 35170006      	mov	_shi,#23
2673  098a               L346:
2674                     ; 349 					if(i==5)
2676  098a b601          	ld	a,_i
2677  098c a105          	cp	a,#5
2678  098e 260a          	jrne	L746
2679                     ; 351 		      fen--;
2681  0990 3a07          	dec	_fen
2682                     ; 352 					if(fen==0)
2684  0992 3d07          	tnz	_fen
2685  0994 2604          	jrne	L746
2686                     ; 354 							 fen=59;
2688  0996 353b0007      	mov	_fen,#59
2689  099a               L746:
2690                     ; 357 					if(i==6)
2692  099a b601          	ld	a,_i
2693  099c a106          	cp	a,#6
2694  099e 260a          	jrne	L356
2695                     ; 359 					   hour--;
2697  09a0 3a08          	dec	_hour
2698                     ; 360 						 if(hour==0)
2700  09a2 3d08          	tnz	_hour
2701  09a4 2604          	jrne	L356
2702                     ; 362 							    hour=23;
2704  09a6 35170008      	mov	_hour,#23
2705  09aa               L356:
2706                     ; 366 					  if(i==7)
2708  09aa b601          	ld	a,_i
2709  09ac a107          	cp	a,#7
2710  09ae 260a          	jrne	L756
2711                     ; 368 						   min--;
2713  09b0 3a09          	dec	_min
2714                     ; 369 							 if(min==0)
2716  09b2 3d09          	tnz	_min
2717  09b4 2604          	jrne	L756
2718                     ; 371 							   min=59;
2720  09b6 353b0009      	mov	_min,#59
2721  09ba               L756:
2722                     ; 376 		}
2725  09ba 85            	popw	x
2726  09bb bf00          	ldw	c_y,x
2727  09bd 320002        	pop	c_y+2
2728  09c0 85            	popw	x
2729  09c1 bf00          	ldw	c_x,x
2730  09c3 320002        	pop	c_x+2
2731  09c6 80            	iret
2760                     ; 378 void main(void)
2760                     ; 379 
2760                     ; 380 { 
2762                     	switch	.text
2763  09c7               _main:
2767                     ; 381 	 GPIO_Init(GPIOE, GPIO_PIN_0, GPIO_MODE_IN_FL_IT );
2769  09c7 4b20          	push	#32
2770  09c9 4b01          	push	#1
2771  09cb ae5014        	ldw	x,#20500
2772  09ce cd0000        	call	_GPIO_Init
2774  09d1 85            	popw	x
2775                     ; 382 	 GPIO_Init(GPIOD, GPIO_PIN_2, GPIO_MODE_IN_FL_IT );
2777  09d2 4b20          	push	#32
2778  09d4 4b04          	push	#4
2779  09d6 ae500f        	ldw	x,#20495
2780  09d9 cd0000        	call	_GPIO_Init
2782  09dc 85            	popw	x
2783                     ; 383 	 GPIO_Init(GPIOC, GPIO_PIN_6, GPIO_MODE_IN_FL_IT );
2785  09dd 4b20          	push	#32
2786  09df 4b40          	push	#64
2787  09e1 ae500a        	ldw	x,#20490
2788  09e4 cd0000        	call	_GPIO_Init
2790  09e7 85            	popw	

⌨️ 快捷键说明

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