gplink-2.2.23 (Dec 21 2020)
Listing File Generated: 2020-12-28  13:53:17
 
 
Address  Value    Disassembly              Source
-------  -----    -----------              ------
                                           ;TIMER1以HIRC/128作为时钟源
                                           ;计数250溢出共2ms
                                           ;TIMER0以LIRC作为时钟源
                                           ;TIMER1溢出4次读取TIMER0的CNT值是否为ff/00
                                           ;根据T0CNT大小调整LIRCCAL值
                                           ;手调值0x6a/6b
                                           #include       	"mc9941.inc"
                                           		LIST
                                           ;mc9941.inc    Standard Header File, Version 1.00 by Sinomcu
                                           		NOLIST
                                           cblock 	0x00
                                           acc_store
                                           pflag_store
                                           of_cnt
                                           shift_cnt
                                           user_flag
                                           shift_data0
                                           shift_data1
                                           endc
                                           #define	       	adjust_direction_flag  	user_flag,1
                                           #define	       	cal_adjust_finish      	user_flag,7
                                                  	org    	0x00
000000   a01b     goto    0x1b                    	goto   	       	start
                                           
                                                  	org    	0x08
                                           inte:
000008   5600     movra   0                       	movra  	       	acc_store
000009   4587     swapar  0x187                   	swapar 	       	PFLAG
00000a   5601     movra   0x1                     	movra  	       	pflag_store
                                           
00000b   e38b     jbset   0x18b, 0x1              	jbset  	       	T1IF
00000c   a016     goto    0x16                    	goto   	       	inte_return
00000d   a00e     goto    0xe                     	goto   	       	tmr1_inte
                                           
                                           tmr1_inte:
00000e   d38b     bclr    0x18b, 0x1              	bclr   	       	T1IF
00000f   5803     movar   0x3                     	movar  	       	shift_cnt
000010   3a0a     isubai  0xa                     	isubai 	       	0x0a
000011   f587     jbclr   0x187, 0x2              	jbclr  	       	Z
000012   a0cb     goto    0xcb                    	goto   	       	adjust_finish_fun
000013   6a02     djzr    0x2                     	djzr   	       	of_cnt
000014   a016     goto    0x16                    	goto   	       	inte_return
000015   a057     goto    0x57                    	goto   	       	lirc_t0cnt_judge_fun
                                           
                                           inte_return:
000016   4401     swapar  0x1                     	swapar 	       	pflag_store
000017   5787     movra   0x187                   	movra  	       	PFLAG
000018   4600     swapr   0                       	swapr  	       	acc_store
000019   4400     swapar  0                       	swapar 	       	acc_store
00001a   000d     retie                           	retie
                                           
                                           start:
00001b   8036     call    0x36                    	call   	       	io_init
00001c   8040     call    0x40                    	call   	       	tmr0_init
00001d   8046     call    0x46                    	call   	       	tmr1_init
00001e   8050     call    0x50                    	call   	       	inte_init
00001f   3c04     movai   0x4                     	movai  	       	0x04
000020   5602     movra   0x2                     	movra  	       	of_cnt
000021   3c00     movai   0                       	movai  	       	0x00
000022   5603     movra   0x3                     	movra  	       	shift_cnt
000023   3c7f     movai   0x7f                    	movai  	       	0x7f
000024   5605     movra   0x5                     	movra  	       	shift_data0
000025   3c80     movai   0x80                    	movai  	       	0x80
000026   5606     movra   0x6                     	movra  	       	shift_data1
000027   7604     clrr    0x4                     	clrr   	       	user_flag
000028   3c80     movai   0x80                    	movai  	       	0x80
000029   57c7     movra   0x1c7                   	movra  	       	LIRCCAL
00002a   cfa3     bset    0x1a3, 0x7              	bset   	       	T1EN
00002b   cfa0     bset    0x1a0, 0x7              	bset   	       	T0EN
                                                  ;   	bset   	       	CLKS
00002c   a02d     goto    0x2d                    	goto   	       	loop
                                           
                                           loop:
00002d   3c08     movai   0x8                     	movai  	       	0x08
00002e   4390     xorra   0x190                   	xorra  	       	IOP0
00002f   ee04     jbset   0x4, 0x7                	jbset  	       	cal_adjust_finish
000030   a02d     goto    0x2d                    	goto   	       	loop
000031   c58c     bset    0x18c, 0x2              	bset   	       	CLKS
                                                  	
                                           slow_loop:
000032   3c08     movai   0x8                     	movai  	       	0x08
000033   4390     xorra   0x190                   	xorra  	       	IOP0
000034   0000     nop                             	nop
000035   a032     goto    0x32                    	goto   	       	slow_loop
                                           
                                           
                                           io_init:
000036   3cff     movai   0xff                    	movai  	       	0xff
000037   5791     movra   0x191                   	movra  	       	OEP0
000038   5795     movra   0x195                   	movra  	       	OEP1
000039   5799     movra   0x199                   	movra  	       	OEP2
00003a   579d     movra   0x19d                   	movra  	       	OEP3
00003b   7790     clrr    0x190                   	clrr   	       	IOP0
00003c   7794     clrr    0x194                   	clrr   	       	IOP1
00003d   7798     clrr    0x198                   	clrr   	       	IOP2
00003e   779c     clrr    0x19c                   	clrr   	       	IOP3
00003f   000c     return                          	return
                                           
                                           tmr0_init:
000040   3c10     movai   0x10                    	movai  	       	0x10   	       	;Flosc/1
000041   57a0     movra   0x1a0                   	movra  	       	T0CR
000042   3cff     movai   0xff                    	movai  	       	0xff
000043   57a1     movra   0x1a1                   	movra  	       	T0CNT
000044   57a2     movra   0x1a2                   	movra  	       	T0LOAD
000045   000c     return                          	return
                                           
                                           tmr1_init:
000046   3c0f     movai   0xf                     	movai  	       	0x0f   	       	;Fhosc/128
000047   57a3     movra   0x1a3                   	movra  	       	T1CR
000048   3cf9     movai   0xf9                    	movai  	       	0xf9   	       	;cnt=250
000049   57a4     movra   0x1a4                   	movra  	       	T1CNT
00004a   57a5     movra   0x1a5                   	movra  	       	T1LOAD
00004b   3c63     movai   0x63                    	movai  	       	0x63
00004c   57a6     movra   0x1a6                   	movra  	       	T1DATA
00004d   3c01     movai   0x1                     	movai  	       	0x01
00004e   57a7     movra   0x1a7                   	movra  	       	PWM1CR
00004f   000c     return                          	return
                                           
                                           inte_init:
000050   778a     clrr    0x18a                   	clrr   	       	INTE0
000051   778e     clrr    0x18e                   	clrr   	       	INTE1
000052   778b     clrr    0x18b                   	clrr   	       	INTF0
000053   778f     clrr    0x18f                   	clrr   	       	INTF1
000054   c38a     bset    0x18a, 0x1              	bset   	       	T1IE
000055   cf88     bset    0x188, 0x7              	bset   	       	GIE
000056   000c     return                          	return
                                           
                                           lirc_t0cnt_judge_fun:
000057   3c10     movai   0x10                    	movai  	       	0x10
000058   4390     xorra   0x190                   	xorra  	       	IOP0
000059   3c04     movai   0x4                     	movai  	       	0x04
00005a   5602     movra   0x2                     	movra  	       	of_cnt
                                                  ;   	goto   	       	inte_return    	;调试用，确认8ms精度
00005b   6603     incr    0x3                     	incr   	       	shift_cnt
00005c   5803     movar   0x3                     	movar  	       	shift_cnt
00005d   7f86     addra   0x186                   	addra  	       	PCL
00005e   0000     nop                             	nop
00005f   a068     goto    0x68                    	goto   	       	cal_bit7_fun
000060   a075     goto    0x75                    	goto   	       	cal_bit6_fun
000061   a082     goto    0x82                    	goto   	       	cal_bit5_fun
000062   a08f     goto    0x8f                    	goto   	       	cal_bit4_fun
000063   a09c     goto    0x9c                    	goto   	       	cal_bit3_fun
000064   a0a9     goto    0xa9                    	goto   	       	cal_bit2_fun
000065   a0b6     goto    0xb6                    	goto   	       	cal_bit1_fun
000066   a0c3     goto    0xc3                    	goto   	       	cal_bit0_fun
000067   a0cb     goto    0xcb                    	goto   	       	adjust_finish_fun
                                           
                                           cal_bit7_fun:
000068   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
000069   a071     goto    0x71                    	goto   	       	bit7_higher_fun
00006a   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
00006b   a06c     goto    0x6c                    	goto   	       	bit7_lower_fun
                                           bit7_lower_fun:
00006c   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
00006d   dfc7     bclr    0x1c7, 0x7              	bclr   	       	LIRCCAL,7
00006e   cdc7     bset    0x1c7, 0x6              	bset   	       	LIRCCAL,6
00006f   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
000070   a016     goto    0x16                    	goto   	       	inte_return
                                           bit7_higher_fun:
000071   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
000072   cdc7     bset    0x1c7, 0x6              	bset   	       	LIRCCAL,6
000073   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
000074   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           cal_bit6_fun:
000075   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
000076   a07e     goto    0x7e                    	goto   	       	bit6_higher_fun
000077   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
000078   a079     goto    0x79                    	goto   	       	bit6_lower_fun
                                           bit6_lower_fun:
000079   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
00007a   ddc7     bclr    0x1c7, 0x6              	bclr   	       	LIRCCAL,6
00007b   cbc7     bset    0x1c7, 0x5              	bset   	       	LIRCCAL,5
00007c   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
00007d   a016     goto    0x16                    	goto   	       	inte_return
                                           bit6_higher_fun:
00007e   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
00007f   cbc7     bset    0x1c7, 0x5              	bset   	       	LIRCCAL,5
000080   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
000081   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           cal_bit5_fun:
000082   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
000083   a08b     goto    0x8b                    	goto   	       	bit5_higher_fun
000084   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
000085   a086     goto    0x86                    	goto   	       	bit5_lower_fun
                                           bit5_lower_fun:
000086   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
000087   dbc7     bclr    0x1c7, 0x5              	bclr   	       	LIRCCAL,5
000088   c9c7     bset    0x1c7, 0x4              	bset   	       	LIRCCAL,4
000089   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
00008a   a016     goto    0x16                    	goto   	       	inte_return
                                           bit5_higher_fun:
00008b   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
00008c   c9c7     bset    0x1c7, 0x4              	bset   	       	LIRCCAL,4
00008d   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
00008e   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           cal_bit4_fun:
00008f   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
000090   a098     goto    0x98                    	goto   	       	bit4_higher_fun
000091   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
000092   a093     goto    0x93                    	goto   	       	bit4_lower_fun
                                           bit4_lower_fun:
000093   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
000094   d9c7     bclr    0x1c7, 0x4              	bclr   	       	LIRCCAL,4
000095   c7c7     bset    0x1c7, 0x3              	bset   	       	LIRCCAL,3
000096   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
000097   a016     goto    0x16                    	goto   	       	inte_return
                                           bit4_higher_fun:
000098   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
000099   c7c7     bset    0x1c7, 0x3              	bset   	       	LIRCCAL,3
00009a   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
00009b   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           cal_bit3_fun:
00009c   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
00009d   a0a5     goto    0xa5                    	goto   	       	bit3_higher_fun
00009e   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
00009f   a0a0     goto    0xa0                    	goto   	       	bit3_lower_fun
                                           bit3_lower_fun:
0000a0   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000a1   d7c7     bclr    0x1c7, 0x3              	bclr   	       	LIRCCAL,3
0000a2   c5c7     bset    0x1c7, 0x2              	bset   	       	LIRCCAL,2
0000a3   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
0000a4   a016     goto    0x16                    	goto   	       	inte_return
                                           bit3_higher_fun:
0000a5   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000a6   c5c7     bset    0x1c7, 0x2              	bset   	       	LIRCCAL,2
0000a7   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
0000a8   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           cal_bit2_fun:
0000a9   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
0000aa   a0b2     goto    0xb2                    	goto   	       	bit2_higher_fun
0000ab   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
0000ac   a0ad     goto    0xad                    	goto   	       	bit2_lower_fun
                                           bit2_lower_fun:
0000ad   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000ae   d5c7     bclr    0x1c7, 0x2              	bclr   	       	LIRCCAL,2
0000af   c3c7     bset    0x1c7, 0x1              	bset   	       	LIRCCAL,1
0000b0   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
0000b1   a016     goto    0x16                    	goto   	       	inte_return
                                           bit2_higher_fun:
0000b2   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000b3   c3c7     bset    0x1c7, 0x1              	bset   	       	LIRCCAL,1
0000b4   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
0000b5   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           cal_bit1_fun:
0000b6   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
0000b7   a0bf     goto    0xbf                    	goto   	       	bit1_higher_fun
0000b8   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
0000b9   a0ba     goto    0xba                    	goto   	       	bit1_lower_fun
                                           bit1_lower_fun:
0000ba   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000bb   d3c7     bclr    0x1c7, 0x1              	bclr   	       	LIRCCAL,1
0000bc   c1c7     bset    0x1c7, 0                	bset   	       	LIRCCAL,0
0000bd   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
0000be   a016     goto    0x16                    	goto   	       	inte_return
                                           bit1_higher_fun:
0000bf   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000c0   c1c7     bset    0x1c7, 0                	bset   	       	LIRCCAL,0
0000c1   80d1     call    0xd1                    	call   	       	tmr_cnt_reload
0000c2   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           
                                           cal_bit0_fun:
0000c3   e18b     jbset   0x18b, 0                	jbset  	       	T0IF
0000c4   a0c9     goto    0xc9                    	goto   	       	bit0_higher_fun
0000c5   f18b     jbclr   0x18b, 0                	jbclr  	       	T0IF
0000c6   a0c7     goto    0xc7                    	goto   	       	bit0_lower_fun
                                           bit0_lower_fun:
0000c7   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000c8   a0cb     goto    0xcb                    	goto   	       	adjust_finish_fun
                                           bit0_higher_fun:
0000c9   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000ca   a0cb     goto    0xcb                    	goto   	       	adjust_finish_fun
                                           
                                           
                                           adjust_finish_fun:
0000cb   ce04     bset    0x4, 0x7                	bset   	       	cal_adjust_finish
0000cc   d38a     bclr    0x18a, 0x1              	bclr   	       	T1IE
0000cd   df88     bclr    0x188, 0x7              	bclr   	       	GIE
0000ce   dfa0     bclr    0x1a0, 0x7              	bclr   	       	T0EN
0000cf   dfa3     bclr    0x1a3, 0x7              	bclr   	       	T1EN
0000d0   a016     goto    0x16                    	goto   	       	inte_return
                                           
                                           tmr_cnt_reload:
0000d1   d18b     bclr    0x18b, 0                	bclr   	       	T0IF
0000d2   d38b     bclr    0x18b, 0x1              	bclr   	       	T1IF
0000d3   3cff     movai   0xff                    	movai  	       	0xff
0000d4   57a1     movra   0x1a1                   	movra  	       	T0CNT
0000d5   3cf9     movai   0xf9                    	movai  	       	0xf9   	       	;cnt=250
0000d6   57a4     movra   0x1a4                   	movra  	       	T1CNT
0000d7   000c     return                          	return
                                               end
                                                  	


MEMORY USAGE MAP ('X' = Used,  '-' = Unused)

0000 : XX-------------- XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0040 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0080 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
00C0 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0100 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0140 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX
0180 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXX ----------------

All other memory blocks unused.

Program Memory Words Used:   209

