📄 main.ls
字号:
1 ; C Compiler for STM8 (COSMIC Software)
2 ; Generator V4.2.4 - 19 Dec 2007
36 ; 19 void CLK_Configuration(void)
36 ; 20 {
38 switch .text
39 0000 _CLK_Configuration:
43 ; 21 CLK_DeInit(); //Deinitializes the CLK peripheral registers to their default reset values
45 0000 cd0000 call _CLK_DeInit
47 ; 22 CLK_HSICmd(ENABLE); //Enables or disables the Internal High Speed oscillator (HSI).
49 0003 a601 ld a,#1
50 0005 cd0000 call _CLK_HSICmd
52 ; 23 CLK_HSIPrescalerConfig(CLK_PRESCALER_CPUDIV8); //Configures the HSI clock dividers.
54 0008 a683 ld a,#131
55 000a cd0000 call _CLK_HSIPrescalerConfig
57 ; 24 CLK_ClockSecuritySystemEnable(); //Enables the Clock Security System.
59 000d cd0000 call _CLK_ClockSecuritySystemEnable
61 ; 25 }
64 0010 81 ret
89 ; 35 void GPIO_Configuration(void)
89 ; 36 {
90 switch .text
91 0011 _GPIO_Configuration:
95 ; 37 GPIO_DeInit(GPIOD);
97 0011 ae500f ldw x,#20495
98 0014 cd0000 call _GPIO_DeInit
100 ; 38 GPIO_Init(GPIOD, GPIO_PIN_ALL , GPIO_MODE_OUT_PP_HIGH_FAST);
102 0017 4bf0 push #240
103 0019 4bff push #255
104 001b ae500f ldw x,#20495
105 001e cd0000 call _GPIO_Init
107 0021 85 popw x
108 ; 39 GPIO_DeInit(GPIOE);
110 0022 ae5014 ldw x,#20500
111 0025 cd0000 call _GPIO_DeInit
113 ; 40 GPIO_Init(GPIOE, GPIO_PIN_ALL , GPIO_MODE_OUT_PP_HIGH_FAST);
115 0028 4bf0 push #240
116 002a 4bff push #255
117 002c ae5014 ldw x,#20500
118 002f cd0000 call _GPIO_Init
120 0032 85 popw x
121 ; 41 }
124 0033 81 ret
158 ; 50 void Delay(u32 i)
158 ; 51 {
159 switch .text
160 0034 _Delay:
162 00000000 OFST: set 0
165 0034 2009 jra L35
166 0036 L74:
167 ; 52 for(;i>0;i--);
170 0036 96 ldw x,sp
171 0037 1c0003 addw x,#OFST+3
172 003a a601 ld a,#1
173 003c cd0000 call c_lgsbc
175 003f L35:
178 003f 96 ldw x,sp
179 0040 1c0003 addw x,#OFST+3
180 0043 cd0000 call c_lzmp
182 0046 26ee jrne L74
183 ; 53 }
186 0048 81 ret
213 ; 56 void main(void)
213 ; 57 {
214 switch .text
215 0049 _main:
219 ; 58 CLK_Configuration();
221 0049 adb5 call _CLK_Configuration
223 ; 59 GPIO_Configuration();
225 004b adc4 call _GPIO_Configuration
227 004d L76:
228 ; 62 GPIO_Write(GPIOD, 0x55);
230 004d 4b55 push #85
231 004f ae500f ldw x,#20495
232 0052 cd0000 call _GPIO_Write
234 0055 84 pop a
235 ; 63 Delay(5000);
237 0056 ae1388 ldw x,#5000
238 0059 89 pushw x
239 005a ae0000 ldw x,#0
240 005d 89 pushw x
241 005e add4 call _Delay
243 0060 5b04 addw sp,#4
244 ; 64 GPIO_Write(GPIOD, 0xaa);
246 0062 4baa push #170
247 0064 ae500f ldw x,#20495
248 0067 cd0000 call _GPIO_Write
250 006a 84 pop a
251 ; 65 Delay(5000);
253 006b ae1388 ldw x,#5000
254 006e 89 pushw x
255 006f ae0000 ldw x,#0
256 0072 89 pushw x
257 0073 adbf call _Delay
259 0075 5b04 addw sp,#4
260 ; 66 GPIO_Write(GPIOE, 0x55);
262 0077 4b55 push #85
263 0079 ae5014 ldw x,#20500
264 007c cd0000 call _GPIO_Write
266 007f 84 pop a
267 ; 67 Delay(5000);
269 0080 ae1388 ldw x,#5000
270 0083 89 pushw x
271 0084 ae0000 ldw x,#0
272 0087 89 pushw x
273 0088 adaa call _Delay
275 008a 5b04 addw sp,#4
276 ; 68 GPIO_Write(GPIOE, 0xaa);
278 008c 4baa push #170
279 008e ae5014 ldw x,#20500
280 0091 cd0000 call _GPIO_Write
282 0094 84 pop a
283 ; 69 Delay(5000);
285 0095 ae1388 ldw x,#5000
286 0098 89 pushw x
287 0099 ae0000 ldw x,#0
288 009c 89 pushw x
289 009d ad95 call _Delay
291 009f 5b04 addw sp,#4
293 00a1 20aa jra L76
306 xdef _main
307 xdef _Delay
308 xdef _GPIO_Configuration
309 xdef _CLK_Configuration
310 xref _GPIO_Write
311 xref _GPIO_Init
312 xref _GPIO_DeInit
313 xref _CLK_ClockSecuritySystemEnable
314 xref _CLK_HSIPrescalerConfig
315 xref _CLK_HSICmd
316 xref _CLK_DeInit
335 xref c_lzmp
336 xref c_lgsbc
337 end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -