📄 main.ls
字号:
1 ; C Compiler for STM8 (COSMIC Software)
2 ; Generator V4.2.8 - 03 Dec 2008
48 ; 21 @far @interrupt void GPIOC5(void)
48 ; 22 {
49 switch .text
50 0000 f_GPIOC5:
52 00000002 OFST: set 2
53 0000 3b0002 push c_x+2
54 0003 be00 ldw x,c_x
55 0005 89 pushw x
56 0006 3b0002 push c_y+2
57 0009 be00 ldw x,c_y
58 000b 89 pushw x
59 000c be02 ldw x,c_lreg+2
60 000e 89 pushw x
61 000f be00 ldw x,c_lreg
62 0011 89 pushw x
63 0012 89 pushw x
66 ; 23 u16 Conversion_Value = 0;
68 0013 5f clrw x
69 0014 1f01 ldw (OFST-1,sp),x
70 ; 24 GPIO_WriteReverse(GPIOD, (GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3 ));
72 0016 4b0d push #13
73 0018 ae500f ldw x,#20495
74 001b cd0000 call _GPIO_WriteReverse
76 001e 84 pop a
77 ; 26 Conversion_Value = ADC1_GetConversionValue();
79 001f cd0000 call _ADC1_GetConversionValue
81 0022 1f01 ldw (OFST-1,sp),x
82 ; 27 putStr("yanshan University");
84 0024 ae002f ldw x,#L72
85 0027 cd0000 call _putStr
87 ; 28 Conversion_Value=Conversion_Value*4.83/1024*1000;
89 002a 1e01 ldw x,(OFST-1,sp)
90 002c cd0000 call c_uitof
92 002f ae002b ldw x,#L53
93 0032 cd0000 call c_fmul
95 0035 ae0027 ldw x,#L54
96 0038 cd0000 call c_fdiv
98 003b ae0023 ldw x,#L55
99 003e cd0000 call c_fmul
101 0041 cd0000 call c_ftoi
103 0044 1f01 ldw (OFST-1,sp),x
104 ; 31 putIntLine(Conversion_Value);
106 0046 1e01 ldw x,(OFST-1,sp)
107 0048 cd0000 call c_uitolx
109 004b be02 ldw x,c_lreg+2
110 004d 89 pushw x
111 004e be00 ldw x,c_lreg
112 0050 89 pushw x
113 0051 cd0000 call _putIntLine
115 0054 5b04 addw sp,#4
116 ; 34 ADC1_ClearFlag (ADC1_FLAG_AWS9 );
118 0056 a619 ld a,#25
119 0058 cd0000 call _ADC1_ClearFlag
121 ; 36 }
124 005b 5b02 addw sp,#2
125 005d 85 popw x
126 005e bf00 ldw c_lreg,x
127 0060 85 popw x
128 0061 bf02 ldw c_lreg+2,x
129 0063 85 popw x
130 0064 bf00 ldw c_y,x
131 0066 320002 pop c_y+2
132 0069 85 popw x
133 006a bf00 ldw c_x,x
134 006c 320002 pop c_x+2
135 006f 80 iret
157 ; 39 @far @interrupt void ADC1_IRQHandler(void)
157 ; 40 {
158 switch .text
159 0070 f_ADC1_IRQHandler:
163 ; 43 }
166 0070 80 iret
208 ; 49 void xwDelay(void)
208 ; 50 {
210 switch .text
211 0071 _xwDelay:
213 0071 5204 subw sp,#4
214 00000004 OFST: set 4
217 ; 51 int i=2;
219 0073 ae0002 ldw x,#2
220 0076 1f01 ldw (OFST-3,sp),x
221 ; 52 int j=200;
223 0078 ae00c8 ldw x,#200
224 007b 1f03 ldw (OFST-1,sp),x
226 007d 200f jra L711
227 007f L521:
228 ; 53 while(i--)while(j--);
230 007f 1e03 ldw x,(OFST-1,sp)
231 0081 1d0001 subw x,#1
232 0084 1f03 ldw (OFST-1,sp),x
233 0086 1c0001 addw x,#1
234 0089 a30000 cpw x,#0
235 008c 26f1 jrne L521
236 008e L711:
239 008e 1e01 ldw x,(OFST-3,sp)
240 0090 1d0001 subw x,#1
241 0093 1f01 ldw (OFST-3,sp),x
242 0095 1c0001 addw x,#1
243 0098 a30000 cpw x,#0
244 009b 26e2 jrne L521
245 ; 54 }
248 009d 5b04 addw sp,#4
249 009f 81 ret
280 ; 58 main()
280 ; 59 {
281 switch .text
282 00a0 _main:
286 ; 61 GPIO_Init(GPIOD, (GPIO_PIN_0 | GPIO_PIN_2 | GPIO_PIN_3 ), GPIO_MODE_OUT_PP_LOW_FAST );
288 00a0 4be0 push #224
289 00a2 4b0d push #13
290 00a4 ae500f ldw x,#20495
291 00a7 cd0000 call _GPIO_Init
293 00aa 85 popw x
294 ; 66 UART2_DeInit();
296 00ab cd0000 call _UART2_DeInit
298 ; 68 UART2_Init(38400,UART2_WORDLENGTH_8D,UART2_STOPBITS_1,UART2_PARITY_NO, UART2_SYNCMODE_CLOCK_DISABLE, UART2_MODE_TX_ENABLE);
300 00ae 4b04 push #4
301 00b0 4b80 push #128
302 00b2 4b00 push #0
303 00b4 4b00 push #0
304 00b6 4b00 push #0
305 00b8 ae9600 ldw x,#38400
306 00bb 89 pushw x
307 00bc ae0000 ldw x,#0
308 00bf 89 pushw x
309 00c0 cd0000 call _UART2_Init
311 00c3 5b09 addw sp,#9
312 ; 70 putStrLine("Yes the serialsport is already ok.");
314 00c5 ae0000 ldw x,#L141
315 00c8 cd0000 call _putStrLine
317 ; 72 ADC1_DeInit();
319 00cb cd0000 call _ADC1_DeInit
321 ; 74 ADC1_Init(ADC1_CONVERSIONMODE_CONTINUOUS,ADC1_CHANNEL_9,ADC1_PRESSEL_FCPU_D2,ADC1_EXTTRIG_TIM,DISABLE,ADC1_ALIGN_RIGHT, ADC1_SCHMITTTRIG_CHANNEL9, DISABLE);
323 00ce 4b00 push #0
324 00d0 4b09 push #9
325 00d2 4b08 push #8
326 00d4 4b00 push #0
327 00d6 4b00 push #0
328 00d8 4b00 push #0
329 00da ae0009 ldw x,#9
330 00dd a601 ld a,#1
331 00df 95 ld xh,a
332 00e0 cd0000 call _ADC1_Init
334 00e3 5b06 addw sp,#6
335 ; 76 ADC1_StartConversion();
337 00e5 cd0000 call _ADC1_StartConversion
339 ; 77 EXTI_SetTLISensitivity(EXTI_SENSITIVITY_RISE_ONLY);
341 00e8 a601 ld a,#1
342 00ea cd0000 call _EXTI_SetTLISensitivity
344 ; 79 GPIO_Init(GPIOD,GPIO_PIN_7,GPIO_MODE_IN_FL_IT);
346 00ed 4b20 push #32
347 00ef 4b80 push #128
348 00f1 ae500f ldw x,#20495
349 00f4 cd0000 call _GPIO_Init
351 00f7 85 popw x
352 00f8 L341:
354 00f8 20fe jra L341
367 xdef _main
368 xdef _xwDelay
369 xdef f_ADC1_IRQHandler
370 xdef f_GPIOC5
371 xref _EXTI_SetTLISensitivity
372 xref _ADC1_ClearFlag
373 xref _ADC1_GetConversionValue
374 xref _ADC1_StartConversion
375 xref _ADC1_Init
376 xref _ADC1_DeInit
377 xref _putIntLine
378 xref _putStrLine
379 xref _putStr
380 xref _UART2_Init
381 xref _UART2_DeInit
382 xref _GPIO_WriteReverse
383 xref _GPIO_Init
384 .const: section .text
385 0000 L141:
386 0000 596573207468 dc.b "Yes the serialspor"
387 0012 742069732061 dc.b "t is already ok.",0
388 0023 L55:
389 0023 447a0000 dc.w 17530,0
390 0027 L54:
391 0027 44800000 dc.w 17536,0
392 002b L53:
393 002b 409a8f5c dc.w 16538,-28836
394 002f L72:
395 002f 79616e736861 dc.b "yanshan University",0
396 xref.b c_lreg
397 xref.b c_x
398 xref.b c_y
418 xref c_uitolx
419 xref c_ftoi
420 xref c_fdiv
421 xref c_fmul
422 xref c_uitof
423 end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -