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

📄 main.ls

📁 STM8s
💻 LS
字号:
   1                     ; C Compiler for STM8 (COSMIC Software)
   2                     ; Generator V4.2.8 - 03 Dec 2008
  52                     ; 14 void xwDelay(void)
  52                     ; 15 {
  54                     	switch	.text
  55  0000               _xwDelay:
  57  0000 5204          	subw	sp,#4
  58       00000004      OFST:	set	4
  61                     ; 16 	int i=2;
  63  0002 ae0002        	ldw	x,#2
  64  0005 1f01          	ldw	(OFST-3,sp),x
  65                     ; 17 	int j=200;
  67  0007 ae00c8        	ldw	x,#200
  68  000a 1f03          	ldw	(OFST-1,sp),x
  70  000c 200f          	jra	L73
  71  000e               L54:
  72                     ; 18 	while(i--)while(j--);
  74  000e 1e03          	ldw	x,(OFST-1,sp)
  75  0010 1d0001        	subw	x,#1
  76  0013 1f03          	ldw	(OFST-1,sp),x
  77  0015 1c0001        	addw	x,#1
  78  0018 a30000        	cpw	x,#0
  79  001b 26f1          	jrne	L54
  80  001d               L73:
  83  001d 1e01          	ldw	x,(OFST-3,sp)
  84  001f 1d0001        	subw	x,#1
  85  0022 1f01          	ldw	(OFST-3,sp),x
  86  0024 1c0001        	addw	x,#1
  87  0027 a30000        	cpw	x,#0
  88  002a 26e2          	jrne	L54
  89                     ; 19 }
  92  002c 5b04          	addw	sp,#4
  93  002e 81            	ret
 116                     ; 20 @far @interrupt void Time2YiChu (void)
 116                     ; 21 {
 118                     	switch	.text
 119  002f               f_Time2YiChu:
 123                     ; 23 }
 126  002f 80            	iret
 172                     .const:	section	.text
 173  0000               L21:
 174  0000 00000003      	dc.l	3
 175  0004               L41:
 176  0004 00000001      	dc.l	1
 177  0008               L61:
 178  0008 00000002      	dc.l	2
 179                     ; 25 main()
 179                     ; 26 {
 180                     	scross	off
 181                     	switch	.text
 182  0030               _main:
 184  0030 5204          	subw	sp,#4
 185       00000004      OFST:	set	4
 188                     ; 27 	unsigned long i=0;
 190  0032 ae0000        	ldw	x,#0
 191  0035 1f03          	ldw	(OFST-1,sp),x
 192  0037 ae0000        	ldw	x,#0
 193  003a 1f01          	ldw	(OFST-3,sp),x
 194                     ; 29 	GPIO_DeInit(GPIOD);
 196  003c ae500f        	ldw	x,#20495
 197  003f cd0000        	call	_GPIO_DeInit
 199                     ; 31 	GPIO_Init(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3, GPIO_MODE_OUT_PP_LOW_FAST);
 201  0042 4be0          	push	#224
 202  0044 4b0d          	push	#13
 203  0046 ae500f        	ldw	x,#20495
 204  0049 cd0000        	call	_GPIO_Init
 206  004c 85            	popw	x
 207                     ; 33 	BEEP_DeInit();
 209  004d cd0000        	call	_BEEP_DeInit
 211                     ; 35 	BEEP_Init(BEEP_FREQUENCY_1KHZ);
 213  0050 4f            	clr	a
 214  0051 cd0000        	call	_BEEP_Init
 216                     ; 37 	BEEP_LSICalibrationConfig(2000000);
 218  0054 ae8480        	ldw	x,#33920
 219  0057 89            	pushw	x
 220  0058 ae001e        	ldw	x,#30
 221  005b 89            	pushw	x
 222  005c cd0000        	call	_BEEP_LSICalibrationConfig
 224  005f 5b04          	addw	sp,#4
 225                     ; 39 	BEEP_Cmd(ENABLE);
 227  0061 a601          	ld	a,#1
 228  0063 cd0000        	call	_BEEP_Cmd
 230                     ; 41 	CLK_DeInit();
 232  0066 cd0000        	call	_CLK_DeInit
 234                     ; 43 	CLK_HSECmd(ENABLE);
 236  0069 a601          	ld	a,#1
 237  006b cd0000        	call	_CLK_HSECmd
 239                     ; 44 		CLK_HSICmd(ENABLE);
 241  006e a601          	ld	a,#1
 242  0070 cd0000        	call	_CLK_HSICmd
 244                     ; 45 		CLK_LSICmd(ENABLE);
 246  0073 a601          	ld	a,#1
 247  0075 cd0000        	call	_CLK_LSICmd
 249  0078               L77:
 250                     ; 71 		i++;
 252  0078 96            	ldw	x,sp
 253  0079 1c0001        	addw	x,#OFST-3
 254  007c a601          	ld	a,#1
 255  007e cd0000        	call	c_lgadc
 257                     ; 73 		BEEP_Cmd(i%2);
 259  0081 7b04          	ld	a,(OFST+0,sp)
 260  0083 a401          	and	a,#1
 261  0085 cd0000        	call	_BEEP_Cmd
 263                     ; 75 		if(i%3==0)
 265  0088 96            	ldw	x,sp
 266  0089 1c0001        	addw	x,#OFST-3
 267  008c cd0000        	call	c_ltor
 269  008f ae0000        	ldw	x,#L21
 270  0092 cd0000        	call	c_lumd
 272  0095 cd0000        	call	c_lrzmp
 274  0098 2614          	jrne	L301
 275                     ; 77 		      GPIO_WriteLow(GPIOD, GPIO_PIN_0);
 277  009a 4b01          	push	#1
 278  009c ae500f        	ldw	x,#20495
 279  009f cd0000        	call	_GPIO_WriteLow
 281  00a2 84            	pop	a
 282                     ; 78 		      GPIO_WriteHigh(GPIOD, GPIO_PIN_2|GPIO_PIN_3);
 284  00a3 4b0c          	push	#12
 285  00a5 ae500f        	ldw	x,#20495
 286  00a8 cd0000        	call	_GPIO_WriteHigh
 288  00ab 84            	pop	a
 290  00ac 2050          	jra	L501
 291  00ae               L301:
 292                     ; 82   	else if(i%3==1)
 294  00ae 96            	ldw	x,sp
 295  00af 1c0001        	addw	x,#OFST-3
 296  00b2 cd0000        	call	c_ltor
 298  00b5 ae0000        	ldw	x,#L21
 299  00b8 cd0000        	call	c_lumd
 301  00bb ae0004        	ldw	x,#L41
 302  00be cd0000        	call	c_lcmp
 304  00c1 2614          	jrne	L701
 305                     ; 84 	    GPIO_WriteLow(GPIOD, GPIO_PIN_2);
 307  00c3 4b04          	push	#4
 308  00c5 ae500f        	ldw	x,#20495
 309  00c8 cd0000        	call	_GPIO_WriteLow
 311  00cb 84            	pop	a
 312                     ; 85 		   GPIO_WriteHigh(GPIOD, GPIO_PIN_0|GPIO_PIN_3);
 314  00cc 4b09          	push	#9
 315  00ce ae500f        	ldw	x,#20495
 316  00d1 cd0000        	call	_GPIO_WriteHigh
 318  00d4 84            	pop	a
 320  00d5 2027          	jra	L501
 321  00d7               L701:
 322                     ; 87        else if(i%3==2)
 324  00d7 96            	ldw	x,sp
 325  00d8 1c0001        	addw	x,#OFST-3
 326  00db cd0000        	call	c_ltor
 328  00de ae0000        	ldw	x,#L21
 329  00e1 cd0000        	call	c_lumd
 331  00e4 ae0008        	ldw	x,#L61
 332  00e7 cd0000        	call	c_lcmp
 334  00ea 2612          	jrne	L501
 335                     ; 89 	     GPIO_WriteLow(GPIOD, GPIO_PIN_3);
 337  00ec 4b08          	push	#8
 338  00ee ae500f        	ldw	x,#20495
 339  00f1 cd0000        	call	_GPIO_WriteLow
 341  00f4 84            	pop	a
 342                     ; 90 		   GPIO_WriteHigh(GPIOD, GPIO_PIN_0|GPIO_PIN_2);
 344  00f5 4b05          	push	#5
 345  00f7 ae500f        	ldw	x,#20495
 346  00fa cd0000        	call	_GPIO_WriteHigh
 348  00fd 84            	pop	a
 349  00fe               L501:
 350                     ; 95 		xwDelay();
 352  00fe cd0000        	call	_xwDelay
 355  0101 ac780078      	jpf	L77
 368                     	xdef	_main
 369                     	xdef	f_Time2YiChu
 370                     	xdef	_xwDelay
 371                     	xref	_BEEP_LSICalibrationConfig
 372                     	xref	_BEEP_Cmd
 373                     	xref	_BEEP_Init
 374                     	xref	_BEEP_DeInit
 375                     	xref	_GPIO_WriteLow
 376                     	xref	_GPIO_WriteHigh
 377                     	xref	_GPIO_Init
 378                     	xref	_GPIO_DeInit
 379                     	xref	_CLK_LSICmd
 380                     	xref	_CLK_HSICmd
 381                     	xref	_CLK_HSECmd
 382                     	xref	_CLK_DeInit
 383                     	xref.b	c_x
 402                     	xref	c_lcmp
 403                     	xref	c_lrzmp
 404                     	xref	c_lumd
 405                     	xref	c_ltor
 406                     	xref	c_lgadc
 407                     	end

⌨️ 快捷键说明

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