; Asm codes generated by Shanghai Haier C Compiler
; HRCO, Ver: 1.0,0117

#INCLUDE       	<ES7P169C.INC>
#INCLUDE       	<OPERATION.INC>
	PUBLIC         	_Period
	PUBLIC         	_Duty
	PUBLIC         	_RAMclear
	PUBLIC         	_GPIOInit
	PUBLIC         	_isr
	PUBLIC         	_main
_isr_#T20409_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20416_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20450_8	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20453_8	EQU            	_isrDATA + 0X2		; Bank 0
_isr_#T20474_8	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20477_8	EQU            	_isrDATA + 0X2		; Bank 0
#TMP	EQU            	?_TMP+ 0X0		; Bank 0
?_TMP_RET	EQU            	?_TMP		; Bank 0
_T31EN_0#sh	EQU            	0X608		; Bank 0
_MIE1_0#sh	EQU            	0X639		; Bank 0
_MIS1_0#sh	EQU            	0X659		; Bank 0
_MIF1_0#sh	EQU            	0X669		; Bank 0
_MIC1_0#sh	EQU            	0X689		; Bank 0
_CH1E_0#sh	EQU            	0X6C0		; Bank 0
_CH2E_0#sh	EQU            	0X6C4		; Bank 0
_T31C2L_0#sh	EQU            	0XC5		; Bank 0
_T31CH1C_0#sh	EQU            	0XD4		; Bank 0
_T31CH2C_0#sh	EQU            	0XD5		; Bank 0
_T31PINCL_0#sh	EQU            	0XD8		; Bank 0
_T31PRSL_0#sh	EQU            	0XDC		; Bank 0
_T31PRSH_0#sh	EQU            	0XDD		; Bank 0
_T31CH1RL_0#sh	EQU            	0XE1		; Bank 0
_T31CH1RH_0#sh	EQU            	0XE2		; Bank 0
_T31CH2RL_0#sh	EQU            	0XE3		; Bank 0
_T31CH2RH_0#sh	EQU            	0XE4		; Bank 0
_MULA_0#sh	EQU            	(MULA - 0X6080) % 0X40 + 0xC0		; Bank 0
_MULB_0#sh	EQU            	(MULB - 0X6080) % 0X40 + 0xC0		; Bank 0
_MULL_0#sh	EQU            	(MULL - 0X6080) % 0X40 + 0xC0		; Bank 0
_MULH_0#sh	EQU            	(MULH - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVEL_0#sh	EQU            	(DIVEL - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVEM_0#sh	EQU            	(DIVEM - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVSL_0#sh	EQU            	(DIVSL - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVSH_0#sh	EQU            	(DIVSH - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVQL_0#sh	EQU            	(DIVQL - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVQM_0#sh	EQU            	(DIVQM - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVRL_0#sh	EQU            	(DIVRL - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVRH_0#sh	EQU            	(DIVRH - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVC_0#sh	EQU            	(DIVC - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVEU_0#sh	EQU            	(DIVEU - 0X6080) % 0X40 + 0xC0		; Bank 0
_DIVEH_0#sh	EQU            	(DIVEH - 0X6080) % 0X40 + 0xC0		; Bank 0
	_DESC          	RAMclear,0X0,0X0
RAMclear#	CSEG           
_RAMclear
; /*******************************************************
; *Copyright(C),2020,Shanghai Eastsoft Microelectronics Co.,Ltd.
; *文件名：capture_pwm_input.c
; *作  者：AE Team
; *版  本：v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
; *日  期：2020/07/23
; *描  述：多功能定时器pwm输入捕捉模式，T31_CH1(PB5)输入波形，调试状态下全速运行程序后暂停，
;         可以直接查看波形的周期长度和占空比长度
;         注意：若程序在调试状态下暂停运行，由于pwm仍在输入且捕捉功能依然有效，T31CH1R和T31CH2R仍会更新。所以
;         程序暂停时若程序计数器停止在捕捉中断函数中则有可能得到不正确的Period和Duty。用户可尝试将断点打在捕捉1中断
;         函数中的不同语句上实际查看Period、Duty、T31CH1R、T31CH2R的值体验一下。程序全速运行时不受影响。
;         建议：设置合理的预分频，最好保证pwm周期小于计数器溢出周期。
; *备  注：本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
; *******************************************************/
; #include <hic.h>
; #define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
; unsigned int Period,Duty;        //保存pwm输入的波形周期和占空比
; /******************************************************
; 函数名：void RAMclear(void)
; 描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void RAMclear(void)
; {
#line 30	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     for (IAAH=0; IAAH<=0x03; IAAH++)
	CLR            	BKSR
;   30:(    ASGN_1,          0 ,            ,      IAAH)

; ITemplate_CLR1_4_TMP
	CLR            	_IAAH_0
;   30:(     LABEL,    #L20268 ,            ,          )

; ITemplate_LABEL
#L20268
;   30:(    JGT_1U,       IAAH ,          3 ,   #L20345)

; ITemplate_JGT1_4U
	MOV            	_IAAH_0,	0x0
	SUBI           	0x3
	JBS            	PSW,	0x0
	GOTO           	#L20345
;     {
#line 32	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         for (IAAL=0; IAAL<0xFF; IAAL++)
;   32:(    ASGN_1,          0 ,            ,      IAAL)

; ITemplate_CLR1_4_TMP
	CLR            	_IAAL_0
;   32:(     LABEL,    #L20285 ,            ,          )

; ITemplate_LABEL
#L20285
;   32:(    JGE_1U,       IAAL ,        255 ,   #L20286)

; ITemplate_JGE1_4U
	MOVI           	0xff
	SUB            	_IAAL_0,	0x0
	JBC            	PSW,	0x0
	GOTO           	#L20286
#line 33	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;             IAD = 0x00;
;   33:(    ASGN_1,          0 ,            ,       IAD)

; ITemplate_CLR1_4_TMP
	CLR            	_IAD_0
;   32:(     ADD_1,       IAAL ,          1 ,      IAAL)

; ITemplate_INC_1_TMP
	INC            	_IAAL_0
;   33:(       JMP,            ,            ,   #L20285)

; ITemplate_JMP
	GOTO           	#L20285
;   33:(     LABEL,    #L20286 ,            ,          )

; ITemplate_LABEL
#L20286
#line 34	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         IAD = 0x00;
;   34:(    ASGN_1,          0 ,            ,       IAD)

; ITemplate_CLR1_4_TMP
	CLR            	_IAD_0
;   30:(     ADD_1,       IAAH ,          1 ,      IAAH)

; ITemplate_INC_1_TMP
	INC            	_IAAH_0
#line 35	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     }
;   35:(       JMP,            ,            ,   #L20268)

; ITemplate_JMP
	GOTO           	#L20268
#line 36	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ; }
;   36:(     LABEL,    #L20345 ,            ,          )

; ITemplate_LABEL
#L20345
;   36:(       RET,            ,            ,          )

; ITemplate_RET
	RET            			; Bank 0		; ShBank 0
	_DESC          	GPIOInit,0X0,0X0
GPIOInit#	CSEG           
_GPIOInit
; /******************************************************
; 函数名：void GPIOInit(void)
; 描  述：首先初始化所有未用到的IO口为输出低电平
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void GPIOInit(void)
; {
#line 47	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     ANSL = 0xFF;        //选择对应端口为数字IO功能
	CLR            	BKSR
;   47:(    ASGN_1,        255 ,            ,      ANSL)

; ITemplate_ASGN1_4_R
	MOVI           	0xff
	MOVA           	_ANSL_0
#line 48	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     ANSH = 0xFF;
;   48:(    ASGN_1,        255 ,            ,      ANSH)

; ITemplate_ASGN1_4_R
	MOVI           	0xff
	MOVA           	_ANSH_0
#line 49	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PAT = 0x00;         //所有IO设为输出低电平
;   49:(    ASGN_1,          0 ,            ,       PAT)

; ITemplate_CLR1_4_TMP
	CLR            	_PAT_0
#line 50	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PBT = 0x00;
;   50:(    ASGN_1,          0 ,            ,       PBT)

; ITemplate_CLR1_4_TMP
	CLR            	_PBT_0
#line 51	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PCT = 0x00;
;   51:(    ASGN_1,          0 ,            ,       PCT)

; ITemplate_CLR1_4_TMP
	CLR            	_PCT_0
#line 52	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PA = 0x00;
;   52:(    ASGN_1,          0 ,            ,        PA)

; ITemplate_CLR1_4_TMP
	CLR            	_PA_0
#line 53	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PB = 0x00;
;   53:(    ASGN_1,          0 ,            ,        PB)

; ITemplate_CLR1_4_TMP
	CLR            	_PB_0
#line 54	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PC = 0x00;
;   54:(    ASGN_1,          0 ,            ,        PC)

; ITemplate_CLR1_4_TMP
	CLR            	_PC_0
#line 56	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     PBT5 = 1;           //T31_CH1设为输入
;   56:(    ASGN_0,          1 ,            ,      PBT5)

; ITemplate_SET_0_TMP
	BSS            	(_PBT5_0)/8,	(_PBT5_0)%8
;     //PBPU5 = 1;          //使能上拉
#line 58	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ; }
;   58:(       RET,            ,            ,          )

; ITemplate_RET
	RET            			; Bank 0		; ShBank 0
	_DESC          	##isr,0X0,0X0

SECTION1isr	UNINTIAL       	0		; Bank 0
	ORG            	0X80		; Bank 0
_isrDATA	RSEG           	0X4		; Bank 0
; interrupt fun entry
	PUBLIC         	SAVED_TMP
SECTION0_INT_SAVED_00	UNINTIAL       		; Bank 0
SAVED_FSR	RSEG           	0x3
SECTION0_INT_SAVED_3	UNINTIAL       		; Bank 0
SAVED_TMP	RSEG           	0x1
INT_ENTRY	CSEG           	0x04
; ITemplate_InterruptHead
_INT_ENTRY
	PUSH           	
	CLR            	PCRH
	CLR            	BKSR
	MOV            	IAAL,	0x0
	MOVA           	(SAVED_FSR) & 0X7F		; Bank 0
	MOV            	IAAH,	0x0
	MOVA           	(SAVED_FSR+0x1) & 0X7F		; Bank 0
	MOV            	(CSEG_PTR) & 0X7F,	0x0		; Bank 0
	MOVA           	(CSEG_PTR+0x2) & 0X7F		; Bank 0
	MOV            	(CSEG_PTR+0x1) & 0X7F,	0x0		; Bank 0
	MOVA           	(CSEG_PTR+0x3) & 0X7F		; Bank 0
	MOV            	(MUL_TEMP) & 0X7F,	0x0		; Bank 0
	MOVA           	(MUL_TEMP+0x2) & 0X7F		; Bank 0
	MOV            	(MUL_TEMP+0x1) & 0X7F,	0x0		; Bank 0
	MOVA           	(MUL_TEMP+0x3) & 0X7F		; Bank 0
isr#	CSEG           
_isr
; /*******************************************************
; 函数名：void isr(void) interrupt
; 描  述：中断服务程序，两次捕捉1中断表示一个pwm周期的长度
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void isr(void) interrupt
; {
#line 69	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     if (MIS1==1 && MIF1==1)       //捕捉1中断
;   69:(    CVB_SC,       MIS1 ,            ,   #T20409)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_MIS1_0#sh)/8,	(_MIS1_0#sh)%8		; ShBank 0
	MOVI           	0x1
	SECTION        	0x1
	MOVA           	(_isr_#T20409_7) & 0X7F		; Bank 1
;   69:(    JNEQ_1,          1 ,    #T20409 ,   #L20479)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20409_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20479
;   69:(    CVB_SC,       MIF1 ,            ,   #T20416)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_MIF1_0#sh)/8,	(_MIF1_0#sh)%8		; ShBank 0
	MOVI           	0x1
	MOVA           	(_isr_#T20416_7) & 0X7F		; Bank 1
;   69:(    JNEQ_1,          1 ,    #T20416 ,   #L20479)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20416_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20479
;     {
#line 71	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         MIC1 = 1;       //清捕捉1中断标志
;   71:(    ASGN_0,          1 ,            ,      MIC1)

; ITemplate_SET_0_TMP
	BSS            	(_MIC1_0#sh)/8,	(_MIC1_0#sh)%8		; ShBank 0
#line 72	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         T31IF = 0;      //清定时器总标志位
;   72:(    ASGN_0,          0 ,            ,     T31IF)

; ITemplate_CLR_0_TMP
	BCC            	(_T31IF_0)/8,	(_T31IF_0)%8
#line 74	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         Period = T31CH1RH;        //保存捕捉事件时计数器的值
;   74:(   CVUC_UI,   T31CH1RH ,            ,    Period)

; ITemplate_CVTMS_U
	CLR            	(_Period+0x1) & 0X7F		; Bank 1
	MOV            	_T31CH1RH_0#sh,	0x0		; ShBank 0
	MOVA           	(_Period) & 0X7F		; Bank 1
#line 75	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         Period = (Period<<8) | T31CH1RL;
;   75:(    LSH_2U,     Period ,          8 ,   #T20450)

; ITemplate_LSH1_4_8
	MOV            	(_Period) & 0X7F,	0x0		; Bank 1
	MOVA           	(_isr_#T20450_8+0x1) & 0X7F		; Bank 1
	CLR            	(_isr_#T20450_8) & 0X7F		; Bank 1
;   75:(   CVUC_UI,   T31CH1RL ,            ,   #T20453)

; ITemplate_CVTMS_U
	CLR            	(_isr_#T20453_8+0x1) & 0X7F		; Bank 1
	MOV            	_T31CH1RL_0#sh,	0x0		; ShBank 0
	MOVA           	(_isr_#T20453_8) & 0X7F		; Bank 1
;   75:(     BOR_2,    #T20450 ,    #T20453 ,    Period)

; ITemplate_BOR1_4
	MOV            	(_isr_#T20453_8) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20450_8) & 0X7F,	0x0		; Bank 1
	MOVA           	(_Period) & 0X7F		; Bank 1
	MOV            	(_isr_#T20453_8+0x1) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20450_8+0x1) & 0X7F,	0x0		; Bank 1
	MOVA           	(_Period+0x1) & 0X7F		; Bank 1
#line 76	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         Duty = T31CH2RH;          //保存捕捉事件时计数器的值
;   76:(   CVUC_UI,   T31CH2RH ,            ,      Duty)

; ITemplate_CVTMS_U
	CLR            	(_Duty+0x1) & 0X7F		; Bank 1
	MOV            	_T31CH2RH_0#sh,	0x0		; ShBank 0
	MOVA           	(_Duty) & 0X7F		; Bank 1
#line 77	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         Duty = (Duty<<8) | T31CH2RL;
;   77:(    LSH_2U,       Duty ,          8 ,   #T20474)

; ITemplate_LSH1_4_8
	MOV            	(_Duty) & 0X7F,	0x0		; Bank 1
	MOVA           	(_isr_#T20474_8+0x1) & 0X7F		; Bank 1
	CLR            	(_isr_#T20474_8) & 0X7F		; Bank 1
;   77:(   CVUC_UI,   T31CH2RL ,            ,   #T20477)

; ITemplate_CVTMS_U
	CLR            	(_isr_#T20477_8+0x1) & 0X7F		; Bank 1
	MOV            	_T31CH2RL_0#sh,	0x0		; ShBank 0
	MOVA           	(_isr_#T20477_8) & 0X7F		; Bank 1
;   77:(     BOR_2,    #T20474 ,    #T20477 ,      Duty)

; ITemplate_BOR1_4
	MOV            	(_isr_#T20477_8) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20474_8) & 0X7F,	0x0		; Bank 1
	MOVA           	(_Duty) & 0X7F		; Bank 1
	MOV            	(_isr_#T20477_8+0x1) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20474_8+0x1) & 0X7F,	0x0		; Bank 1
	MOVA           	(_Duty+0x1) & 0X7F		; Bank 1
;     }
#line 79	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ; }
;   79:(     LABEL,    #L20479 ,            ,          )

; ITemplate_LABEL
#L20479
;   79:(     RET_I,            ,            ,          )

; ITemplate_RET_I
	SECTION        	0x0
	GOTO           	_INT_RESTORE		; Bank 0		; ShBank 0
; interrupt fun restore
INT_RESTORE	CSEG           
; ITemplate_InterruptTail
_INT_RESTORE
	NOP            	
	NOP            	
	MOV            	(CSEG_PTR+0x3) & 0X7F,	0x0		; Bank 0
	MOVA           	(CSEG_PTR+0x1) & 0X7F		; Bank 0
	MOV            	(CSEG_PTR+0x2) & 0X7F,	0x0		; Bank 0
	MOVA           	(CSEG_PTR) & 0X7F		; Bank 0
	MOV            	(MUL_TEMP+0x2) & 0X7F,	0x0		; Bank 0
	MOVA           	(MUL_TEMP) & 0X7F		; Bank 0
	MOVA           	MULA
	MOV            	(MUL_TEMP+0x3) & 0X7F,	0x0		; Bank 0
	MOVA           	(MUL_TEMP+0x1) & 0X7F		; Bank 0
	MOVA           	MULB
	MOV            	(SAVED_FSR+0x1) & 0X7F,	0x0		; Bank 0
	MOVA           	IAAH
	MOV            	(SAVED_FSR) & 0X7F,	0x0		; Bank 0
	MOVA           	IAAL
	POP            	
	RETIE          	
	_DESC          	main,0X0,0X0,RAMclear,GPIOInit
main#	CSEG           
_main
; /*******************************************************
; 函数名：void main(void)
; 描  述：主函数，pwm输入模式，两个捕捉通道映射到一个输入口T31_CH1(PB5)，由T31_CH1(PB5)输入波形。
;         通道1捕捉上升沿成功时将计数器的值复制到T31CH1R，并复位计数器重新从0开始计数，通道2捕捉
;         下降沿成功时将计数器的值复制到T31CH2R。则在一个pwm周期，T31CH1R保存PWM的长度，T31CH2R保存PWM占空比长度
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void main(void) 
; {
#line 92	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     RAMclear();
	CLR            	BKSR
;   92:(      CALL, (RAMclear.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_RAMclear
	CALL           	_RAMclear		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 93	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     GPIOInit();
;   93:(      CALL, (GPIOInit.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_GPIOInit
	CALL           	_GPIOInit		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 94	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31PRSH = 0x00;       //预分频系数1:16
;   94:(    ASGN_1,          0 ,            ,   T31PRSH)

; ITemplate_CLR1_4_TMP
	CLR            	_T31PRSH_0#sh		; ShBank 0
#line 95	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31PRSL = 0x0F; 
;   95:(    ASGN_1,         15 ,            ,   T31PRSL)

; ITemplate_ASGN1_4_R
	MOVI           	0xf
	MOVA           	_T31PRSL_0#sh		; ShBank 0
#line 96	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31CH2C = 0x02;       //T31_CH1作为通道2的捕捉管脚，无滤波，无预分频
;   96:(    ASGN_1,          2 ,            ,   T31CH2C)

; ITemplate_ASGN1_4_R
	MOVI           	0x2
	MOVA           	_T31CH2C_0#sh		; ShBank 0
#line 97	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31CH1C = 0x01;       //T31_CH1作为通道1的捕捉管脚，无滤波，无预分频
;   97:(    ASGN_1,          1 ,            ,   T31CH1C)

; ITemplate_ASGN1_4_R
	MOVI           	0x1
	MOVA           	_T31CH1C_0#sh		; ShBank 0
#line 98	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31PINCL = 0x20;      //通道2下降沿有效，通道1上升沿有效
;   98:(    ASGN_1,         32 ,            ,  T31PINCL)

; ITemplate_ASGN1_4_R
	MOVI           	0x20
	MOVA           	_T31PINCL_0#sh		; ShBank 0
#line 99	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31C2L = 0x54;        //选择通道1为触发输入(TRGI)，上升沿重新初始化计数器
;   99:(    ASGN_1,         84 ,            ,    T31C2L)

; ITemplate_ASGN1_4_R
	MOVI           	0x54
	MOVA           	_T31C2L_0#sh		; ShBank 0
#line 100	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     CH2E = 1;       //使能通道2捕捉
;  100:(    ASGN_0,          1 ,            ,      CH2E)

; ITemplate_SET_0_TMP
	BSS            	(_CH2E_0#sh)/8,	(_CH2E_0#sh)%8		; ShBank 0
#line 101	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     CH1E = 1;       //使能通道1捕捉
;  101:(    ASGN_0,          1 ,            ,      CH1E)

; ITemplate_SET_0_TMP
	BSS            	(_CH1E_0#sh)/8,	(_CH1E_0#sh)%8		; ShBank 0
#line 102	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     MIE1 = 1;       //使能通道1捕捉中断
;  102:(    ASGN_0,          1 ,            ,      MIE1)

; ITemplate_SET_0_TMP
	BSS            	(_MIE1_0#sh)/8,	(_MIE1_0#sh)%8		; ShBank 0
#line 103	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31IE = 1;      //开启多功能定时器中断
;  103:(    ASGN_0,          1 ,            ,     T31IE)

; ITemplate_SET_0_TMP
	BSS            	(_T31IE_0)/8,	(_T31IE_0)%8
#line 104	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     MIC1 = 1;       //清捕捉1中断标志
;  104:(    ASGN_0,          1 ,            ,      MIC1)

; ITemplate_SET_0_TMP
	BSS            	(_MIC1_0#sh)/8,	(_MIC1_0#sh)%8		; ShBank 0
#line 105	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31IF = 0;      //清定时器总标志位
;  105:(    ASGN_0,          0 ,            ,     T31IF)

; ITemplate_CLR_0_TMP
	BCC            	(_T31IF_0)/8,	(_T31IF_0)%8
#line 106	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     GIE = 1;        //开全局中断
;  106:(    ASGN_0,          1 ,            ,       GIE)

; ITemplate_SET_0_TMP
	BSS            	(_GIE_0)/8,	(_GIE_0)%8
#line 107	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     T31EN = 1;      //使能计数器
;  107:(    ASGN_0,          1 ,            ,     T31EN)

; ITemplate_SET_0_TMP
	BSS            	(_T31EN_0#sh)/8,	(_T31EN_0#sh)%8		; ShBank 0
#line 108	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     while (1)
;  108:(     LABEL,    #L20572 ,            ,          )

; ITemplate_LABEL
#L20572
;     {
#line 110	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;         CLRWDT();
; ITemplate_LABEL
;-----------Embedded Asm--------------
	CWDT
;-------------------------------------
#line 111	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\capture_pwm_input\capture_pwm_input.c ;     }
;  111:(       JMP,            ,            ,   #L20572)

; ITemplate_JMP
	GOTO           	#L20572

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC0	PSECT	FLAG=0X1088,ADDR=0X7FCB7
_GIE_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC1	PSECT	FLAG=0X1088,ADDR=0X7FCCA
_T31IE_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC2	PSECT	FLAG=0X1088,ADDR=0X7FCD2
_T31IF_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC3	PSECT	FLAG=0X1088,ADDR=0X7FD75
_PBT5_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC4	PSECT	FLAG=0X1088,ADDR=0X30408
_T31EN_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC5	PSECT	FLAG=0X1088,ADDR=0X30439
_MIE1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC6	PSECT	FLAG=0X1088,ADDR=0X30459
_MIS1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC7	PSECT	FLAG=0X1088,ADDR=0X30469
_MIF1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC8	PSECT	FLAG=0X1088,ADDR=0X30489
_MIC1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC9	PSECT	FLAG=0X1088,ADDR=0X304C0
_CH1E_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC10	PSECT	FLAG=0X1088,ADDR=0X304C4
_CH2E_0	RSEG           	0X1		; Bank 0

SECTION1C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T31_capture_pwm_input_capture_pwm_input_c_STATIC	UNINTIAL       	0		; Bank 0
	ORG            	0X86		; Bank 0
_Period	RSEG           	0X2		; Bank 0
	ORG            	0X84		; Bank 0
_Duty	RSEG           	0X2		; Bank 0

SECTION8D__Program_Files__x86__iDesigner4_1_tools_INCLUDE_ES7P169C_h_STATIC	UNINTIAL       	0		; Bank 0
	ORG            	0XFF80		; Bank 0
_IAD_0	RSEG           	0X1		; Bank 0
	ORG            	0XFF81		; Bank 0
_IAAL_0	RSEG           	0X1		; Bank 0
	ORG            	0XFF82		; Bank 0
_IAAH_0	RSEG           	0X1		; Bank 0
	ORG            	0XFF8D		; Bank 0
_ANSH_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFA8		; Bank 0
_PA_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFA9		; Bank 0
_PB_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFAA		; Bank 0
_PC_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFAD		; Bank 0
_PAT_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFAE		; Bank 0
_PBT_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFAF		; Bank 0
_PCT_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFBC		; Bank 0
_ANSL_0	RSEG           	0X1		; Bank 0
	ORG            	0X6085		; Bank 0
_T31C2L_0	RSEG           	0X1		; Bank 0
	ORG            	0X6094		; Bank 0
_T31CH1C_0	RSEG           	0X1		; Bank 0
	ORG            	0X6095		; Bank 0
_T31CH2C_0	RSEG           	0X1		; Bank 0
	ORG            	0X6098		; Bank 0
_T31PINCL_0	RSEG           	0X1		; Bank 0
	ORG            	0X609C		; Bank 0
_T31PRSL_0	RSEG           	0X1		; Bank 0
	ORG            	0X609D		; Bank 0
_T31PRSH_0	RSEG           	0X1		; Bank 0
	ORG            	0X60A1		; Bank 0
_T31CH1RL_0	RSEG           	0X1		; Bank 0
	ORG            	0X60A2		; Bank 0
_T31CH1RH_0	RSEG           	0X1		; Bank 0
	ORG            	0X60A3		; Bank 0
_T31CH2RL_0	RSEG           	0X1		; Bank 0
	ORG            	0X60A4		; Bank 0
_T31CH2RH_0	RSEG           	0X1		; Bank 0
	END
