📄 main.ls
字号:
1 ; C Compiler for STM8 (COSMIC Software)
2 ; Parser V4.9.2 - 29 Jun 2010
3 ; Generator V4.3.5 - 02 Jul 2010
63 ; 15 void xwDelay(void)
63 ; 16 {
65 switch .text
66 0000 _xwDelay:
68 0000 5204 subw sp,#4
69 00000004 OFST: set 4
72 ; 17 int i=2;
74 0002 ae0002 ldw x,#2
75 0005 1f01 ldw (OFST-3,sp),x
76 ; 18 int j=200;
78 0007 ae00c8 ldw x,#200
79 000a 1f03 ldw (OFST-1,sp),x
81 000c 200f jra L73
82 000e L54:
83 ; 19 while(i--)while(j--);
85 000e 1e03 ldw x,(OFST-1,sp)
86 0010 1d0001 subw x,#1
87 0013 1f03 ldw (OFST-1,sp),x
88 0015 1c0001 addw x,#1
89 0018 a30000 cpw x,#0
90 001b 26f1 jrne L54
91 001d L73:
94 001d 1e01 ldw x,(OFST-3,sp)
95 001f 1d0001 subw x,#1
96 0022 1f01 ldw (OFST-3,sp),x
97 0024 1c0001 addw x,#1
98 0027 a30000 cpw x,#0
99 002a 26e2 jrne L54
100 ; 20 }
103 002c 5b04 addw sp,#4
104 002e 81 ret
149 .const: section .text
150 0000 L01:
151 0000 0000000a dc.l 10
152 ; 23 main()
152 ; 24 {
153 switch .text
154 002f _main:
156 002f 5204 subw sp,#4
157 00000004 OFST: set 4
160 ; 25 unsigned long i=0;
162 0031 ae0000 ldw x,#0
163 0034 1f03 ldw (OFST-1,sp),x
164 0036 ae0000 ldw x,#0
165 0039 1f01 ldw (OFST-3,sp),x
166 ; 27 GPIO_DeInit(GPIOD);
168 003b ae500f ldw x,#20495
169 003e cd0000 call _GPIO_DeInit
171 ; 29 GPIO_Init(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3, GPIO_MODE_OUT_PP_LOW_FAST);
173 0041 4be0 push #224
174 0043 4b0d push #13
175 0045 ae500f ldw x,#20495
176 0048 cd0000 call _GPIO_Init
178 004b 85 popw x
179 ; 31 BEEP_DeInit();
181 004c cd0000 call _BEEP_DeInit
183 ; 33 BEEP_Init(BEEP_FREQUENCY_1KHZ);
185 004f 4f clr a
186 0050 cd0000 call _BEEP_Init
188 ; 35 BEEP_LSICalibrationConfig(2000000);
190 0053 ae8480 ldw x,#33920
191 0056 89 pushw x
192 0057 ae001e ldw x,#30
193 005a 89 pushw x
194 005b cd0000 call _BEEP_LSICalibrationConfig
196 005e 5b04 addw sp,#4
197 ; 37 BEEP_Cmd(DISABLE);
199 0060 4f clr a
200 0061 cd0000 call _BEEP_Cmd
202 ; 39 CLK_DeInit();
204 0064 cd0000 call _CLK_DeInit
206 ; 41 CLK_HSECmd(ENABLE);
208 0067 a601 ld a,#1
209 0069 cd0000 call _CLK_HSECmd
211 006c L76:
212 ; 45 i++;
214 006c 96 ldw x,sp
215 006d 1c0001 addw x,#OFST-3
216 0070 a601 ld a,#1
217 0072 cd0000 call c_lgadc
219 ; 47 BEEP_Cmd(i%2);
221 0075 7b04 ld a,(OFST+0,sp)
222 0077 a401 and a,#1
223 0079 cd0000 call _BEEP_Cmd
225 ; 49 GPIO_WriteReverse(GPIOD, GPIO_PIN_0|GPIO_PIN_2|GPIO_PIN_3);
227 007c 4b0d push #13
228 007e ae500f ldw x,#20495
229 0081 cd0000 call _GPIO_WriteReverse
231 0084 84 pop a
232 ; 51 xwDelay();
234 0085 cd0000 call _xwDelay
236 ; 52 if(i==10)
238 0088 96 ldw x,sp
239 0089 1c0001 addw x,#OFST-3
240 008c cd0000 call c_ltor
242 008f ae0000 ldw x,#L01
243 0092 cd0000 call c_lcmp
245 0095 26d5 jrne L76
246 ; 54 CLK_ClockSwitchConfig(CLK_SWITCHMODE_AUTO,CLK_SOURCE_HSE,DISABLE,CLK_CURRENTCLOCKSTATE_DISABLE);
248 0097 4b00 push #0
249 0099 4b00 push #0
250 009b ae01b4 ldw x,#436
251 009e cd0000 call _CLK_ClockSwitchConfig
253 00a1 85 popw x
254 00a2 20c8 jra L76
267 xdef _main
268 xdef _xwDelay
269 xref _BEEP_LSICalibrationConfig
270 xref _BEEP_Cmd
271 xref _BEEP_Init
272 xref _BEEP_DeInit
273 xref _GPIO_WriteReverse
274 xref _GPIO_Init
275 xref _GPIO_DeInit
276 xref _CLK_ClockSwitchConfig
277 xref _CLK_HSECmd
278 xref _CLK_DeInit
297 xref c_lcmp
298 xref c_ltor
299 xref c_lgadc
300 end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -