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

📄 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
  70                     ; 13 main()
  70                     ; 14 {
  72                     	switch	.text
  73  0000               _main:
  75  0000 89            	pushw	x
  76       00000002      OFST:	set	2
  79                     ; 15 	unsigned char keyOldStatus=1,keyNewStatus=0;
  81  0001 a601          	ld	a,#1
  82  0003 6b01          	ld	(OFST-1,sp),a
  85                     ; 17 	UART2_DeInit();
  87  0005 cd0000        	call	_UART2_DeInit
  89                     ; 19 	UART2_Init(38400,UART2_WORDLENGTH_8D,UART2_STOPBITS_1,UART2_PARITY_NO, UART2_SYNCMODE_CLOCK_DISABLE, UART2_MODE_TX_ENABLE);
  91  0008 4b04          	push	#4
  92  000a 4b80          	push	#128
  93  000c 4b00          	push	#0
  94  000e 4b00          	push	#0
  95  0010 4b00          	push	#0
  96  0012 ae9600        	ldw	x,#38400
  97  0015 89            	pushw	x
  98  0016 ae0000        	ldw	x,#0
  99  0019 89            	pushw	x
 100  001a cd0000        	call	_UART2_Init
 102  001d 5b09          	addw	sp,#9
 103                     ; 21 	putStrLine("串口初始化完成.");
 105  001f ae0031        	ldw	x,#L33
 106  0022 cd0000        	call	_putStrLine
 108                     ; 23 	GPIO_DeInit(GPIOD);
 110  0025 ae500f        	ldw	x,#20495
 111  0028 cd0000        	call	_GPIO_DeInit
 113                     ; 25 	GPIO_Init(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3, GPIO_MODE_OUT_PP_HIGH_FAST);
 115  002b 4bf0          	push	#240
 116  002d 4b0d          	push	#13
 117  002f ae500f        	ldw	x,#20495
 118  0032 cd0000        	call	_GPIO_Init
 120  0035 85            	popw	x
 121                     ; 27 	GPIO_Init(GPIOD,GPIO_PIN_7,GPIO_MODE_IN_FL_NO_IT);
 123  0036 4b00          	push	#0
 124  0038 4b80          	push	#128
 125  003a ae500f        	ldw	x,#20495
 126  003d cd0000        	call	_GPIO_Init
 128  0040 85            	popw	x
 129                     ; 29 	putStrLine("GPIO初始化完成");
 131  0041 ae0022        	ldw	x,#L53
 132  0044 cd0000        	call	_putStrLine
 134  0047               L73:
 135                     ; 34 		keyNewStatus=GPIO_ReadInputPin(GPIOD,GPIO_PIN_7);
 137  0047 4b80          	push	#128
 138  0049 ae500f        	ldw	x,#20495
 139  004c cd0000        	call	_GPIO_ReadInputPin
 141  004f 5b01          	addw	sp,#1
 142  0051 6b02          	ld	(OFST+0,sp),a
 143                     ; 36 		if(keyOldStatus!=keyNewStatus)
 145  0053 7b01          	ld	a,(OFST-1,sp)
 146  0055 1102          	cp	a,(OFST+0,sp)
 147  0057 270f          	jreq	L34
 148                     ; 39 			GPIO_WriteReverse(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3);
 150  0059 4b0d          	push	#13
 151  005b ae500f        	ldw	x,#20495
 152  005e cd0000        	call	_GPIO_WriteReverse
 154  0061 84            	pop	a
 155                     ; 40 			putStrLine("左物理按键状态已变,LED状态已改变.");
 157  0062 ae0000        	ldw	x,#L54
 158  0065 cd0000        	call	_putStrLine
 160  0068               L34:
 161                     ; 43 		keyOldStatus=keyNewStatus;
 163  0068 7b02          	ld	a,(OFST+0,sp)
 164  006a 6b01          	ld	(OFST-1,sp),a
 166  006c 20d9          	jra	L73
 179                     	xdef	_main
 180                     	xref	_putStrLine
 181                     	xref	_UART2_Init
 182                     	xref	_UART2_DeInit
 183                     	xref	_GPIO_ReadInputPin
 184                     	xref	_GPIO_WriteReverse
 185                     	xref	_GPIO_Init
 186                     	xref	_GPIO_DeInit
 187                     .const:	section	.text
 188  0000               L54:
 189  0000 d7f3ceefc0ed  	dc.b	215,243,206,239,192,237
 190  0006 b0b4bcfcd7b4  	dc.b	176,180,188,252,215,180
 191  000c ccacd2d1b1e4  	dc.b	204,172,210,209,177,228
 192  0012 2c4c4544d7    	dc.b	",LED",215
 193  0017 b4ccacd2d1b8  	dc.b	180,204,172,210,209,184
 194  001d c4b1e42e00    	dc.b	196,177,228,46,0
 195  0022               L53:
 196  0022 4750494fb3    	dc.b	"GPIO",179
 197  0027 f5cabcbbafcd  	dc.b	245,202,188,187,175,205
 198  002d eab3c900      	dc.b	234,179,201,0
 199  0031               L33:
 200  0031 b4aebfdab3f5  	dc.b	180,174,191,218,179,245
 201  0037 cabcbbafcdea  	dc.b	202,188,187,175,205,234
 202  003d b3c92e00      	dc.b	179,201,46,0
 222                     	end

⌨️ 快捷键说明

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