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

📄 main.ls

📁 STM8s
💻 LS
字号:
   1                     ; C Compiler for STM8 (COSMIC Software)
   2                     ; Parser V4.9.2 - 29 Jun 2010
   3                     ; Generator V4.3.5 - 02 Jul 2010
  15                     	bsct
  16  0000               __10ms:
  17  0000 00000000      	dc.l	0
  83                     .const:	section	.text
  84  0000               L6:
  85  0000 00000032      	dc.l	50
  86                     ; 17 @far @interrupt void TIM2_UPD_IRQHandler (void)
  86                     ; 18 {
  87                     	switch	.text
  88  0000               f_TIM2_UPD_IRQHandler:
  90       00000001      OFST:	set	1
  91  0000 3b0002        	push	c_x+2
  92  0003 be00          	ldw	x,c_x
  93  0005 89            	pushw	x
  94  0006 3b0002        	push	c_y+2
  95  0009 be00          	ldw	x,c_y
  96  000b 89            	pushw	x
  97  000c be02          	ldw	x,c_lreg+2
  98  000e 89            	pushw	x
  99  000f be00          	ldw	x,c_lreg
 100  0011 89            	pushw	x
 101  0012 88            	push	a
 104                     ; 19 	ITStatus ins=RESET;	
 106                     ; 21 	ins=TIM2_GetITStatus(TIM2_IT_UPDATE);
 108  0013 a601          	ld	a,#1
 109  0015 cd0000        	call	_TIM2_GetITStatus
 111  0018 6b01          	ld	(OFST+0,sp),a
 112                     ; 22 	_10ms++;
 114  001a ae0000        	ldw	x,#__10ms
 115  001d a601          	ld	a,#1
 116  001f cd0000        	call	c_lgadc
 118                     ; 24 	TIM2_ClearFlag(TIM2_IT_UPDATE);
 120  0022 ae0001        	ldw	x,#1
 121  0025 cd0000        	call	_TIM2_ClearFlag
 123                     ; 26 	if(ins==SET&&(_10ms%50==0))
 125  0028 7b01          	ld	a,(OFST+0,sp)
 126  002a a101          	cp	a,#1
 127  002c 261a          	jrne	L73
 129  002e ae0000        	ldw	x,#__10ms
 130  0031 cd0000        	call	c_ltor
 132  0034 ae0000        	ldw	x,#L6
 133  0037 cd0000        	call	c_lumd
 135  003a cd0000        	call	c_lrzmp
 137  003d 2609          	jrne	L73
 138                     ; 29 		GPIO_WriteReverse(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3);
 140  003f 4b0d          	push	#13
 141  0041 ae500f        	ldw	x,#20495
 142  0044 cd0000        	call	_GPIO_WriteReverse
 144  0047 84            	pop	a
 145  0048               L73:
 146                     ; 31 }
 149  0048 84            	pop	a
 150  0049 85            	popw	x
 151  004a bf00          	ldw	c_lreg,x
 152  004c 85            	popw	x
 153  004d bf02          	ldw	c_lreg+2,x
 154  004f 85            	popw	x
 155  0050 bf00          	ldw	c_y,x
 156  0052 320002        	pop	c_y+2
 157  0055 85            	popw	x
 158  0056 bf00          	ldw	c_x,x
 159  0058 320002        	pop	c_x+2
 160  005b 80            	iret
 189                     ; 33 main()
 189                     ; 34 {
 191                     	switch	.text
 192  005c               _main:
 196                     ; 36 	GPIO_DeInit(GPIOD);
 198  005c ae500f        	ldw	x,#20495
 199  005f cd0000        	call	_GPIO_DeInit
 201                     ; 38 	GPIO_Init(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3, GPIO_MODE_OUT_PP_LOW_FAST);
 203  0062 4be0          	push	#224
 204  0064 4b0d          	push	#13
 205  0066 ae500f        	ldw	x,#20495
 206  0069 cd0000        	call	_GPIO_Init
 208  006c 85            	popw	x
 209                     ; 40 	TIM2_DeInit();	
 211  006d cd0000        	call	_TIM2_DeInit
 213                     ; 42 	TIM2_TimeBaseInit(0, 20000);
 215  0070 ae4e20        	ldw	x,#20000
 216  0073 89            	pushw	x
 217  0074 4f            	clr	a
 218  0075 cd0000        	call	_TIM2_TimeBaseInit
 220  0078 85            	popw	x
 221                     ; 44 	TIM2_ITConfig(TIM2_IT_UPDATE, ENABLE);
 223  0079 ae0101        	ldw	x,#257
 224  007c cd0000        	call	_TIM2_ITConfig
 226                     ; 46 	TIM2_Cmd(ENABLE);
 228  007f a601          	ld	a,#1
 229  0081 cd0000        	call	_TIM2_Cmd
 231                     ; 48 	enableInterrupts();            
 234  0084 9a            rim
 236  0085               L15:
 237                     ; 49 	while (1);
 239  0085 20fe          	jra	L15
 263                     	xdef	_main
 264                     	xdef	f_TIM2_UPD_IRQHandler
 265                     	xdef	__10ms
 266                     	xref	_TIM2_GetITStatus
 267                     	xref	_TIM2_ClearFlag
 268                     	xref	_TIM2_ITConfig
 269                     	xref	_TIM2_Cmd
 270                     	xref	_TIM2_TimeBaseInit
 271                     	xref	_TIM2_DeInit
 272                     	xref	_GPIO_WriteReverse
 273                     	xref	_GPIO_Init
 274                     	xref	_GPIO_DeInit
 275                     	xref.b	c_lreg
 276                     	xref.b	c_x
 277                     	xref.b	c_y
 296                     	xref	c_lrzmp
 297                     	xref	c_lumd
 298                     	xref	c_ltor
 299                     	xref	c_lgadc
 300                     	end

⌨️ 快捷键说明

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