| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- 1 ; C Compiler for STM8 (COSMIC Software)
- 2 ; Parser V4.8.32 - 23 Mar 2010
- 3 ; Generator V4.3.4 - 23 Mar 2010
- 2696 bsct
- 2697 0000 _version:
- 2698 0000 02 dc.b 2
- 2826 ; 24 void main() {
- 2828 switch .text
- 2829 0000 _main:
- 2831 0000 5206 subw sp,#6
- 2832 00000006 OFST: set 6
- 2835 ; 25 int i = 0,j=0;
- 2837 0002 5f clrw x
- 2838 0003 1f03 ldw (OFST-3,sp),x
- 2841 0005 5f clrw x
- 2842 0006 1f05 ldw (OFST-1,sp),x
- 2843 ; 26 CLK_CKDIVR = 0x08; //设置系统时钟为8MHZ
- 2845 0008 350850c6 mov _CLK_CKDIVR,#8
- 2846 ; 28 CLK_ICKR = 0x08; //打开低速时钟源
- 2848 000c 350850c0 mov _CLK_ICKR,#8
- 2849 ; 29 CFG_GCR |= 0x01; //禁止SWIM,复用PD1
- 2851 0010 72107f60 bset _CFG_GCR,#0
- 2852 ; 30 GPIO_INIT();
- 2854 0014 cd0000 call _GPIO_INIT
- 2856 ; 47 IWDG_INIT();
- 2858 0017 cd0000 call _IWDG_INIT
- 2860 ; 49 TIM1_PWM_INIT();
- 2862 001a cd0000 call _TIM1_PWM_INIT
- 2864 ; 50 TIM4_INIT();
- 2866 001d cd0000 call _TIM4_INIT
- 2868 ; 52 ADC_INIT();
- 2870 0020 cd0000 call _ADC_INIT
- 2872 ; 53 IIC_Init();
- 2874 0023 cd0000 call _IIC_Init
- 2876 ; 54 _asm("rim"); //开总中断
- 2879 0026 9a rim
- 2881 ; 55 stm8_data.version = version;
- 2883 0027 450000 mov _stm8_data,_version
- 2884 ; 56 IIC_Init();
- 2886 002a cd0000 call _IIC_Init
- 2889 002d a605 ld a,#5
- 2890 002f 6b02 ld (OFST-4,sp),a
- 2891 0031 L7771:
- 2892 ; 57 INITTASKS(); //初始化任务函数
- 2894 0031 7b02 ld a,(OFST-4,sp)
- 2895 0033 5f clrw x
- 2896 0034 97 ld xl,a
- 2897 0035 58 sllw x
- 2898 0036 5a decw x
- 2899 0037 5a decw x
- 2900 0038 905f clrw y
- 2901 003a ef00 ldw (_timers,x),y
- 2904 003c 0a02 dec (OFST-4,sp)
- 2907 003e 0d02 tnz (OFST-4,sp)
- 2908 0040 26ef jrne L7771
- 2909 0042 L1102:
- 2910 ; 59 RUNTASK(safeTask,0);
- 2912 0042 be00 ldw x,_timers
- 2913 0044 2611 jrne L7202
- 2916 0046 cd0000 call _safeTask
- 2918 0049 1f01 ldw (OFST-5,sp),x
- 2920 004b 2004 jra L3202
- 2921 004d L7102:
- 2924 004d 1e01 ldw x,(OFST-5,sp)
- 2925 004f bf00 ldw _timers,x
- 2926 0051 L3202:
- 2929 0051 be00 ldw x,_timers
- 2930 0053 1301 cpw x,(OFST-5,sp)
- 2931 0055 26f6 jrne L7102
- 2932 0057 L7202:
- 2933 ; 60 RUNTASK(safeIot,1);
- 2935 0057 be02 ldw x,_timers+2
- 2936 0059 2611 jrne L5402
- 2939 005b cd0000 call _safeIot
- 2941 005e 1f01 ldw (OFST-5,sp),x
- 2943 0060 2004 jra L1402
- 2944 0062 L5302:
- 2947 0062 1e01 ldw x,(OFST-5,sp)
- 2948 0064 bf02 ldw _timers+2,x
- 2949 0066 L1402:
- 2952 0066 be02 ldw x,_timers+2
- 2953 0068 1301 cpw x,(OFST-5,sp)
- 2954 006a 26f6 jrne L5302
- 2955 006c L5402:
- 2956 ; 61 RUNTASK(getvbat,2);
- 2958 006c be04 ldw x,_timers+4
- 2959 006e 2611 jrne L3602
- 2962 0070 cd0000 call _getvbat
- 2964 0073 1f01 ldw (OFST-5,sp),x
- 2966 0075 2004 jra L7502
- 2967 0077 L3502:
- 2970 0077 1e01 ldw x,(OFST-5,sp)
- 2971 0079 bf04 ldw _timers+4,x
- 2972 007b L7502:
- 2975 007b be04 ldw x,_timers+4
- 2976 007d 1301 cpw x,(OFST-5,sp)
- 2977 007f 26f6 jrne L3502
- 2978 0081 L3602:
- 2979 ; 62 RUNTASK(control_task,3);
- 2981 0081 be06 ldw x,_timers+6
- 2982 0083 2611 jrne L1012
- 2985 0085 cd0000 call _control_task
- 2987 0088 1f01 ldw (OFST-5,sp),x
- 2989 008a 2004 jra L5702
- 2990 008c L1702:
- 2993 008c 1e01 ldw x,(OFST-5,sp)
- 2994 008e bf06 ldw _timers+6,x
- 2995 0090 L5702:
- 2998 0090 be06 ldw x,_timers+6
- 2999 0092 1301 cpw x,(OFST-5,sp)
- 3000 0094 26f6 jrne L1702
- 3001 0096 L1012:
- 3002 ; 63 RUNTASK(fsl_task,4);
- 3004 0096 be08 ldw x,_timers+8
- 3005 0098 26a8 jrne L1102
- 3008 009a cd0000 call _fsl_task
- 3010 009d 1f01 ldw (OFST-5,sp),x
- 3012 009f 2004 jra L3112
- 3013 00a1 L7012:
- 3016 00a1 1e01 ldw x,(OFST-5,sp)
- 3017 00a3 bf08 ldw _timers+8,x
- 3018 00a5 L3112:
- 3021 00a5 be08 ldw x,_timers+8
- 3022 00a7 1301 cpw x,(OFST-5,sp)
- 3023 00a9 26f6 jrne L7012
- 3024 00ab 2095 jra L1102
- 3058 xdef _main
- 3059 xref.b _stm8_data
- 3060 xref _ADC_INIT
- 3061 xref _IIC_Init
- 3062 xref _GPIO_INIT
- 3063 xref _TIM4_INIT
- 3064 xref _TIM1_PWM_INIT
- 3065 xref _fsl_task
- 3066 xref _control_task
- 3067 xref _getvbat
- 3068 xref _safeIot
- 3069 xref _safeTask
- 3070 xref _IWDG_INIT
- 3071 xdef _version
- 3072 switch .ubsct
- 3073 0000 _timers:
- 3074 0000 000000000000 ds.b 10
- 3075 xdef _timers
- 3095 end
|