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

📄 main.ls

📁 STM8s
💻 LS
字号:
   1                     ; C Compiler for STM8 (COSMIC Software)
   2                     ; Generator V4.2.8 - 03 Dec 2008
   4                     	bsct
   5  0000               _ButtonPressed:
   6  0000 00            	dc.b	0
   7  0001               _status:
   8  0001 00            	dc.b	0
  40                     ; 27 @far @interrupt void EXTI_PORTC_IRQHandler (void)
  40                     ; 28 {
  41                     	switch	.text
  42  0000               f_EXTI_PORTC_IRQHandler:
  44  0000 3b0002        	push	c_x+2
  45  0003 be00          	ldw	x,c_x
  46  0005 89            	pushw	x
  47  0006 3b0002        	push	c_y+2
  48  0009 be00          	ldw	x,c_y
  49  000b 89            	pushw	x
  52                     ; 32 	if(ButtonPressed ==FALSE)
  54  000c 3d00          	tnz	_ButtonPressed
  55  000e 260a          	jrne	L12
  56                     ; 34 	CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV1);
  58  0010 4f            	clr	a
  59  0011 cd0000        	call	_CLK_SYSCLKConfig
  61                     ; 35 	ButtonPressed = TRUE;	
  63  0014 35010000      	mov	_ButtonPressed,#1
  65  0018 2007          	jra	L32
  66  001a               L12:
  67                     ; 39 	CLK_SYSCLKConfig(CLK_PRESCALER_HSIDIV8);
  69  001a a618          	ld	a,#24
  70  001c cd0000        	call	_CLK_SYSCLKConfig
  72                     ; 40 	ButtonPressed = FALSE;
  74  001f 3f00          	clr	_ButtonPressed
  75  0021               L32:
  76                     ; 43 }
  79  0021 85            	popw	x
  80  0022 bf00          	ldw	c_y,x
  81  0024 320002        	pop	c_y+2
  82  0027 85            	popw	x
  83  0028 bf00          	ldw	c_x,x
  84  002a 320002        	pop	c_x+2
  85  002d 80            	iret
 118                     ; 45 void Delay(u16 nCount)
 118                     ; 46 {
 120                     	switch	.text
 121  002e               _Delay:
 123  002e 89            	pushw	x
 124       00000000      OFST:	set	0
 127  002f 2007          	jra	L54
 128  0031               L34:
 129                     ; 50         nCount--;
 131  0031 1e01          	ldw	x,(OFST+1,sp)
 132  0033 1d0001        	subw	x,#1
 133  0036 1f01          	ldw	(OFST+1,sp),x
 134  0038               L54:
 135                     ; 48     while (nCount != 0)
 137  0038 1e01          	ldw	x,(OFST+1,sp)
 138  003a 26f5          	jrne	L34
 139                     ; 52 }
 142  003c 85            	popw	x
 143  003d 81            	ret
 185                     ; 55 void main(void)
 185                     ; 56 {
 186                     	switch	.text
 187  003e               _main:
 189  003e 89            	pushw	x
 190       00000002      OFST:	set	2
 193                     ; 60     GPIO_Init(BUTTON_PORT, BUTTON_PIN, GPIO_MODE_IN_FL_IT);
 195  003f 4b20          	push	#32
 196  0041 4b02          	push	#2
 197  0043 ae500a        	ldw	x,#20490
 198  0046 cd0000        	call	_GPIO_Init
 200  0049 85            	popw	x
 201                     ; 61 		GPIO_Init(GPIOD, (LED1_PIN | LED2_PIN | LED3_PIN ), GPIO_MODE_OUT_PP_LOW_FAST );
 203  004a 4be0          	push	#224
 204  004c 4b0d          	push	#13
 205  004e ae500f        	ldw	x,#20495
 206  0051 cd0000        	call	_GPIO_Init
 208  0054 85            	popw	x
 209                     ; 65     EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOC, EXTI_SENSITIVITY_FALL_ONLY);
 211  0055 ae0002        	ldw	x,#2
 212  0058 a602          	ld	a,#2
 213  005a 95            	ld	xh,a
 214  005b cd0000        	call	_EXTI_SetExtIntSensitivity
 216                     ; 68     enableInterrupts();
 219  005e 9a            rim
 221                     ; 70     CLK_DeInit();
 224  005f cd0000        	call	_CLK_DeInit
 226                     ; 79     CLK_CCOConfig(CLK_OUTPUT_CPU);
 228  0062 a608          	ld	a,#8
 229  0064 cd0000        	call	_CLK_CCOConfig
 231                     ; 82    CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTO, CLK_SOURCE_HSI, DISABLE, DISABLE);
 233  0067 4b00          	push	#0
 234  0069 4b00          	push	#0
 235  006b ae00e1        	ldw	x,#225
 236  006e a601          	ld	a,#1
 237  0070 95            	ld	xh,a
 238  0071 cd0000        	call	_CLK_ClockSwitchConfig
 240  0074 85            	popw	x
 241  0075               L76:
 242                     ; 90 		int i=0;
 244  0075 5f            	clrw	x
 245  0076 1f01          	ldw	(OFST-1,sp),x
 246                     ; 91 		 GPIO_WriteReverse(GPIOD, LED1_PIN | LED2_PIN | LED3_PIN);
 248  0078 4b0d          	push	#13
 249  007a ae500f        	ldw	x,#20495
 250  007d cd0000        	call	_GPIO_WriteReverse
 252  0080 84            	pop	a
 253                     ; 92 			  for ( i = 0; i < 2; i++)
 255  0081 5f            	clrw	x
 256  0082 1f01          	ldw	(OFST-1,sp),x
 257  0084               L37:
 258                     ; 94             Delay((u16)60000);
 260  0084 aeea60        	ldw	x,#60000
 261  0087 ada5          	call	_Delay
 263                     ; 92 			  for ( i = 0; i < 2; i++)
 265  0089 1e01          	ldw	x,(OFST-1,sp)
 266  008b 1c0001        	addw	x,#1
 267  008e 1f01          	ldw	(OFST-1,sp),x
 270  0090 9c            	rvf
 271  0091 1e01          	ldw	x,(OFST-1,sp)
 272  0093 a30002        	cpw	x,#2
 273  0096 2fec          	jrslt	L37
 275  0098 20db          	jra	L76
 350                     	xdef	_main
 351                     	xdef	_Delay
 352                     	xdef	f_EXTI_PORTC_IRQHandler
 353                     	xdef	_status
 354                     	xdef	_ButtonPressed
 355                     	xref	_EXTI_SetExtIntSensitivity
 356                     	xref	_GPIO_WriteReverse
 357                     	xref	_GPIO_Init
 358                     	xref	_CLK_SYSCLKConfig
 359                     	xref	_CLK_CCOConfig
 360                     	xref	_CLK_ClockSwitchConfig
 361                     	xref	_CLK_DeInit
 362                     	xref.b	c_x
 363                     	xref.b	c_y
 382                     	end

⌨️ 快捷键说明

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