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

#INCLUDE       	<ES7P169C.INC>
#INCLUDE       	<OPERATION.INC>
	PUBLIC         	_capvalue0
	PUBLIC         	_capvalue1
	PUBLIC         	_capvalue2
	PUBLIC         	_RAMclear
	PUBLIC         	_GPIOInit
	PUBLIC         	_isr
	PUBLIC         	_main
_isr_#T20421_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20428_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20456_8	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20459_8	EQU            	_isrDATA + 0X2		; Bank 0
_isr_#T20478_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20485_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20513_9	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20516_9	EQU            	_isrDATA + 0X2		; Bank 0
_isr_#T20535_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20542_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20570_10	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20573_10	EQU            	_isrDATA + 0X2		; Bank 0
_main_#T20669_13	EQU            	_mainDATA + 0X0		; Bank 0
#TMP	EQU            	?_TMP+ 0X0		; Bank 0
?_TMP_RET	EQU            	?_TMP		; Bank 0
_T21EN_0#sh	EQU            	0X797		; Bank 0
_T21OC_0#sh	EQU            	0XE9		; Bank 0
_T21R0L_0#sh	EQU            	0XEE		; Bank 0
_T21R0H_0#sh	EQU            	0XEF		; Bank 0
_T21CL_0#sh	EQU            	0XF0		; Bank 0
_T21CM_0#sh	EQU            	0XF1		; Bank 0
_T21R1L_0#sh	EQU            	0XF3		; Bank 0
_T21R1H_0#sh	EQU            	0XF4		; Bank 0
_T21R2L_0#sh	EQU            	0XF5		; Bank 0
_T21R2H_0#sh	EQU            	0XF6		; 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.c
; *作  者：AE Team
; *版  本：v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
; *日  期：2020/07/08
; *描  述：T21定时器捕捉模式，T21_CH0(PA0)上升沿捕捉，捕捉成功翻转PA1，T21_CH1(PA7)下降沿捕捉，捕捉成功翻转PA6，
;         T21_CH2(PB7)双沿捕捉，捕捉成功翻转PA3（PA3需配置为数字输入输出）。capvalue0、capvalue1、capvalue2保存捕捉时捕捉寄存器的值。
; *备  注：本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
; *******************************************************/
; #include <hic.h>
; #define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
; unsigned int capvalue0,capvalue1,capvalue2;        //变量保存捕捉寄存器的值
; /******************************************************
; 函数名：void RAMclear(void)
; 描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void RAMclear(void)
; {
#line 26	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     for (IAAH=0; IAAH<=0x03; IAAH++)
	CLR            	BKSR
;   26:(    ASGN_1,          0 ,            ,      IAAH)

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

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

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

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

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

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

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

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

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

; ITemplate_LABEL
#L20286
#line 30	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         IAD = 0x00;
;   30:(    ASGN_1,          0 ,            ,       IAD)

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

; ITemplate_INC_1_TMP
	INC            	_IAAH_0
#line 31	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     }
;   31:(       JMP,            ,            ,   #L20268)

; ITemplate_JMP
	GOTO           	#L20268
#line 32	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ; }
;   32:(     LABEL,    #L20345 ,            ,          )

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

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

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

; ITemplate_ASGN1_4_R
	MOVI           	0xff
	MOVA           	_ANSH_0
#line 45	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PAT = 0x00;         //所有IO设为输出
;   45:(    ASGN_1,          0 ,            ,       PAT)

; ITemplate_CLR1_4_TMP
	CLR            	_PAT_0
#line 46	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PBT = 0x00;
;   46:(    ASGN_1,          0 ,            ,       PBT)

; ITemplate_CLR1_4_TMP
	CLR            	_PBT_0
#line 47	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PCT = 0x00;
;   47:(    ASGN_1,          0 ,            ,       PCT)

; ITemplate_CLR1_4_TMP
	CLR            	_PCT_0
#line 48	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PA = 0x00;
;   48:(    ASGN_1,          0 ,            ,        PA)

; ITemplate_CLR1_4_TMP
	CLR            	_PA_0
#line 49	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PB = 0x00;
;   49:(    ASGN_1,          0 ,            ,        PB)

; ITemplate_CLR1_4_TMP
	CLR            	_PB_0
#line 50	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PC = 0x00;
;   50:(    ASGN_1,          0 ,            ,        PC)

; ITemplate_CLR1_4_TMP
	CLR            	_PC_0
#line 52	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PAT0 = 1;           //T21_CH0设为输入
;   52:(    ASGN_0,          1 ,            ,      PAT0)

; ITemplate_SET_0_TMP
	BSS            	(_PAT0_0)/8,	(_PAT0_0)%8
#line 53	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PAT7 = 1;           //T21_CH1设为输入
;   53:(    ASGN_0,          1 ,            ,      PAT7)

; ITemplate_SET_0_TMP
	BSS            	(_PAT7_0)/8,	(_PAT7_0)%8
#line 54	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     PBT7 = 1;           //T21_CH2设为输入
;   54:(    ASGN_0,          1 ,            ,      PBT7)

; ITemplate_SET_0_TMP
	BSS            	(_PBT7_0)/8,	(_PBT7_0)%8
;     //PAPD0 = 1;        //使能下拉
;     //PAPU7 = 1;        //使能上拉
; 	//PBPD7 = 1;        //使能下拉
#line 58	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.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
; 描  述：中断服务程序
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void isr(void) interrupt
; {
#line 69	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     if (T21MIE0==1 && T21MIF0==1)        //定时器捕捉0中断，上升沿捕捉
;   69:(    CVB_SC,    T21MIE0 ,            ,   #T20421)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21MIE0_0)/8,	(_T21MIE0_0)%8
	MOVI           	0x1
	SECTION        	0x1
	MOVA           	(_isr_#T20421_7) & 0X7F		; Bank 1
;   69:(    JNEQ_1,          1 ,    #T20421 ,   #L20415)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20421_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20415
;   69:(    CVB_SC,    T21MIF0 ,            ,   #T20428)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21MIF0_0)/8,	(_T21MIF0_0)%8
	MOVI           	0x1
	MOVA           	(_isr_#T20428_7) & 0X7F		; Bank 1
;   69:(    JNEQ_1,          1 ,    #T20428 ,   #L20415)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20428_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20415
;     { 
#line 71	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         T21MIF0 = 0;        //清标志位
;   71:(    ASGN_0,          0 ,            ,   T21MIF0)

; ITemplate_CLR_0_TMP
	BCC            	(_T21MIF0_0)/8,	(_T21MIF0_0)%8
#line 72	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         capvalue0 = T21R0H;               //保存捕捉寄存器的值
;   72:(   CVUC_UI,     T21R0H ,            , capvalue0)

; ITemplate_CVTMS_U
	CLR            	(_capvalue0+0x1) & 0X7F		; Bank 1
	MOV            	_T21R0H_0#sh,	0x0		; ShBank 0
	MOVA           	(_capvalue0) & 0X7F		; Bank 1
#line 73	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         capvalue0 = (capvalue0<<8) | T21R0L;
;   73:(    LSH_2U,  capvalue0 ,          8 ,   #T20456)

; ITemplate_LSH1_4_8
	MOV            	(_capvalue0) & 0X7F,	0x0		; Bank 1
	MOVA           	(_isr_#T20456_8+0x1) & 0X7F		; Bank 1
	CLR            	(_isr_#T20456_8) & 0X7F		; Bank 1
;   73:(   CVUC_UI,     T21R0L ,            ,   #T20459)

; ITemplate_CVTMS_U
	CLR            	(_isr_#T20459_8+0x1) & 0X7F		; Bank 1
	MOV            	_T21R0L_0#sh,	0x0		; ShBank 0
	MOVA           	(_isr_#T20459_8) & 0X7F		; Bank 1
;   73:(     BOR_2,    #T20456 ,    #T20459 , capvalue0)

; ITemplate_BOR1_4
	MOV            	(_isr_#T20459_8) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20456_8) & 0X7F,	0x0		; Bank 1
	MOVA           	(_capvalue0) & 0X7F		; Bank 1
	MOV            	(_isr_#T20459_8+0x1) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20456_8+0x1) & 0X7F,	0x0		; Bank 1
	MOVA           	(_capvalue0+0x1) & 0X7F		; Bank 1
#line 74	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         PA1 = ~PA1;
;   74:(    BCOM_0,        PA1 ,            ,       PA1)

; ITemplate_BCOM_0
	BTT            	(_PA1_0)/8,	(_PA1_0)%8
#line 75	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     }
;   75:(     LABEL,    #L20415 ,            ,          )

; ITemplate_LABEL
#L20415
#line 77	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     if (T21MIE1==1 && T21MIF1==1)        //定时器捕捉1中断，下降沿捕捉
;   77:(    CVB_SC,    T21MIE1 ,            ,   #T20478)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21MIE1_0)/8,	(_T21MIE1_0)%8
	MOVI           	0x1
	MOVA           	(_isr_#T20478_7) & 0X7F		; Bank 1
;   77:(    JNEQ_1,          1 ,    #T20478 ,   #L20472)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20478_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20472
;   77:(    CVB_SC,    T21MIF1 ,            ,   #T20485)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21MIF1_0)/8,	(_T21MIF1_0)%8
	MOVI           	0x1
	MOVA           	(_isr_#T20485_7) & 0X7F		; Bank 1
;   77:(    JNEQ_1,          1 ,    #T20485 ,   #L20472)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20485_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20472
;     {       
#line 79	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         T21MIF1 = 0;        //清标志位
;   79:(    ASGN_0,          0 ,            ,   T21MIF1)

; ITemplate_CLR_0_TMP
	BCC            	(_T21MIF1_0)/8,	(_T21MIF1_0)%8
#line 80	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         capvalue1 = T21R1H;               //保存捕捉寄存器的值
;   80:(   CVUC_UI,     T21R1H ,            , capvalue1)

; ITemplate_CVTMS_U
	CLR            	(_capvalue1+0x1) & 0X7F		; Bank 1
	MOV            	_T21R1H_0#sh,	0x0		; ShBank 0
	MOVA           	(_capvalue1) & 0X7F		; Bank 1
#line 81	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         capvalue1 = (capvalue1<<8) | T21R1L;
;   81:(    LSH_2U,  capvalue1 ,          8 ,   #T20513)

; ITemplate_LSH1_4_8
	MOV            	(_capvalue1) & 0X7F,	0x0		; Bank 1
	MOVA           	(_isr_#T20513_9+0x1) & 0X7F		; Bank 1
	CLR            	(_isr_#T20513_9) & 0X7F		; Bank 1
;   81:(   CVUC_UI,     T21R1L ,            ,   #T20516)

; ITemplate_CVTMS_U
	CLR            	(_isr_#T20516_9+0x1) & 0X7F		; Bank 1
	MOV            	_T21R1L_0#sh,	0x0		; ShBank 0
	MOVA           	(_isr_#T20516_9) & 0X7F		; Bank 1
;   81:(     BOR_2,    #T20513 ,    #T20516 , capvalue1)

; ITemplate_BOR1_4
	MOV            	(_isr_#T20516_9) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20513_9) & 0X7F,	0x0		; Bank 1
	MOVA           	(_capvalue1) & 0X7F		; Bank 1
	MOV            	(_isr_#T20516_9+0x1) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20513_9+0x1) & 0X7F,	0x0		; Bank 1
	MOVA           	(_capvalue1+0x1) & 0X7F		; Bank 1
#line 82	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         PA6 = ~PA6;
;   82:(    BCOM_0,        PA6 ,            ,       PA6)

; ITemplate_BCOM_0
	BTT            	(_PA6_0)/8,	(_PA6_0)%8
#line 83	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     }
;   83:(     LABEL,    #L20472 ,            ,          )

; ITemplate_LABEL
#L20472
#line 85	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     if (T21MIE2==1 && T21MIF2==1)        //定时器捕捉2中断，双沿捕捉
;   85:(    CVB_SC,    T21MIE2 ,            ,   #T20535)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21MIE2_0)/8,	(_T21MIE2_0)%8
	MOVI           	0x1
	MOVA           	(_isr_#T20535_7) & 0X7F		; Bank 1
;   85:(    JNEQ_1,          1 ,    #T20535 ,   #L20584)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20535_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20584
;   85:(    CVB_SC,    T21MIF2 ,            ,   #T20542)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21MIF2_0)/8,	(_T21MIF2_0)%8
	MOVI           	0x1
	MOVA           	(_isr_#T20542_7) & 0X7F		; Bank 1
;   85:(    JNEQ_1,          1 ,    #T20542 ,   #L20584)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20542_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20584
;     {    
#line 87	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         T21MIF2 = 0;        //清标志位
;   87:(    ASGN_0,          0 ,            ,   T21MIF2)

; ITemplate_CLR_0_TMP
	BCC            	(_T21MIF2_0)/8,	(_T21MIF2_0)%8
#line 88	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         capvalue2 = T21R2H;               //保存捕捉寄存器的值
;   88:(   CVUC_UI,     T21R2H ,            , capvalue2)

; ITemplate_CVTMS_U
	CLR            	(_capvalue2+0x1) & 0X7F		; Bank 1
	MOV            	_T21R2H_0#sh,	0x0		; ShBank 0
	MOVA           	(_capvalue2) & 0X7F		; Bank 1
#line 89	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         capvalue2 = (capvalue2<<8) | T21R2L;
;   89:(    LSH_2U,  capvalue2 ,          8 ,   #T20570)

; ITemplate_LSH1_4_8
	MOV            	(_capvalue2) & 0X7F,	0x0		; Bank 1
	MOVA           	(_isr_#T20570_10+0x1) & 0X7F		; Bank 1
	CLR            	(_isr_#T20570_10) & 0X7F		; Bank 1
;   89:(   CVUC_UI,     T21R2L ,            ,   #T20573)

; ITemplate_CVTMS_U
	CLR            	(_isr_#T20573_10+0x1) & 0X7F		; Bank 1
	MOV            	_T21R2L_0#sh,	0x0		; ShBank 0
	MOVA           	(_isr_#T20573_10) & 0X7F		; Bank 1
;   89:(     BOR_2,    #T20570 ,    #T20573 , capvalue2)

; ITemplate_BOR1_4
	MOV            	(_isr_#T20573_10) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20570_10) & 0X7F,	0x0		; Bank 1
	MOVA           	(_capvalue2) & 0X7F		; Bank 1
	MOV            	(_isr_#T20573_10+0x1) & 0X7F,	0x0		; Bank 1
	IOR            	(_isr_#T20570_10+0x1) & 0X7F,	0x0		; Bank 1
	MOVA           	(_capvalue2+0x1) & 0X7F		; Bank 1
#line 90	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         PA3 = ~PA3;
;   90:(    BCOM_0,        PA3 ,            ,       PA3)

; ITemplate_BCOM_0
	BTT            	(_PA3_0)/8,	(_PA3_0)%8
;     }
#line 92	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ; }
;   92:(     LABEL,    #L20584 ,            ,          )

; ITemplate_LABEL
#L20584
;   92:(     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

SECTION1main	UNINTIAL       	0		; Bank 0
	ORG            	0X84		; Bank 0
_mainDATA	RSEG           	0X1		; Bank 0
main#	CSEG           
_main
; /*******************************************************
; 函数名：void main(void)
; 描  述：主函数，T21_CH0(PA0)和T21_CH1(PA7)输入相同的波形，调试状态下可以直接看到被测波形的周期和占空比
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void main(void) 
; {
#line 103	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     RAMclear();
	CLR            	BKSR
;  103:(      CALL, (RAMclear.0) ,            ,          )

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

; ITemplate_CALL
	SEGMENTSEL     	_GPIOInit
	CALL           	_GPIOInit		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 105	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21CL = 0x46;        //捕捉模式，T21_CH0上升沿捕捉，T21_CH1下降沿捕捉
;  105:(    ASGN_1,         70 ,            ,     T21CL)

; ITemplate_ASGN1_4_R
	MOVI           	0x46
	MOVA           	_T21CL_0#sh		; ShBank 0
#line 106	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21CM = 0xCF;        //T21_CH2双沿捕捉，计数器预分频1:16
;  106:(    ASGN_1,        207 ,            ,     T21CM)

; ITemplate_ASGN1_4_R
	MOVI           	0xcf
	MOVA           	_T21CM_0#sh		; ShBank 0
#line 107	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21OC = 0x25;        //使能T21_CH0(PA0)、T21_CH1(PA7)、T21_CH2(PB7)端口功能
;  107:(    ASGN_1,         37 ,            ,     T21OC)

; ITemplate_ASGN1_4_R
	MOVI           	0x25
	MOVA           	_T21OC_0#sh		; ShBank 0
#line 108	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21MIE0 = 1;         //打开T21捕捉0中断
;  108:(    ASGN_0,          1 ,            ,   T21MIE0)

; ITemplate_SET_0_TMP
	BSS            	(_T21MIE0_0)/8,	(_T21MIE0_0)%8
#line 109	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21MIE1 = 1;         //打开T21捕捉1中断
;  109:(    ASGN_0,          1 ,            ,   T21MIE1)

; ITemplate_SET_0_TMP
	BSS            	(_T21MIE1_0)/8,	(_T21MIE1_0)%8
#line 110	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21MIE2 = 1;         //打开T21捕捉2中断
;  110:(    ASGN_0,          1 ,            ,   T21MIE2)

; ITemplate_SET_0_TMP
	BSS            	(_T21MIE2_0)/8,	(_T21MIE2_0)%8
#line 111	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21MIF0 = 0;         //清标志位
;  111:(    ASGN_0,          0 ,            ,   T21MIF0)

; ITemplate_CLR_0_TMP
	BCC            	(_T21MIF0_0)/8,	(_T21MIF0_0)%8
#line 112	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21MIF1 = 0;         //清标志位
;  112:(    ASGN_0,          0 ,            ,   T21MIF1)

; ITemplate_CLR_0_TMP
	BCC            	(_T21MIF1_0)/8,	(_T21MIF1_0)%8
#line 113	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21MIF2 = 0;         //清标志位
;  113:(    ASGN_0,          0 ,            ,   T21MIF2)

; ITemplate_CLR_0_TMP
	BCC            	(_T21MIF2_0)/8,	(_T21MIF2_0)%8
#line 114	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     GIE = 1;             //开全局中断
;  114:(    ASGN_0,          1 ,            ,       GIE)

; ITemplate_SET_0_TMP
	BSS            	(_GIE_0)/8,	(_GIE_0)%8
#line 115	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     T21EN = 1;           //使能T21
;  115:(    ASGN_0,          1 ,            ,     T21EN)

; ITemplate_SET_0_TMP
	BSS            	(_T21EN_0#sh)/8,	(_T21EN_0#sh)%8		; ShBank 0
#line 116	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     while (1)
;  116:(     LABEL,    #L20659 ,            ,          )

; ITemplate_LABEL
#L20659
;     {
#line 118	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         if (T21VIF == 1)        //计数器溢出
;  118:(    CVB_SC,     T21VIF ,            ,   #T20669)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T21VIF_0)/8,	(_T21VIF_0)%8
	MOVI           	0x1
	SECTION        	0x1
	MOVA           	(_main_#T20669_13) & 0X7F		; Bank 1
;  118:(    JNEQ_1,          1 ,    #T20669 ,   #L20664)

; ITemplate_JNEQ1_4
	MOV            	(_main_#T20669_13) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20664
;         {
#line 120	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;             T21VIF = 0;
;  120:(    ASGN_0,          0 ,            ,    T21VIF)

; ITemplate_CLR_0_TMP
	BCC            	(_T21VIF_0)/8,	(_T21VIF_0)%8
#line 121	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         }
;  121:(     LABEL,    #L20664 ,            ,          )

; ITemplate_LABEL
#L20664
#line 122	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;         CLRWDT();
; ITemplate_LABEL
;-----------Embedded Asm--------------
	CWDT
;-------------------------------------
#line 123	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T21\capture\capture.c ;     }
;  123:(       JMP,            ,            ,   #L20659)

; ITemplate_JMP
	GOTO           	#L20659

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

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC1	PSECT	FLAG=0X1088,ADDR=0X7FCEC
_T21MIE0_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC2	PSECT	FLAG=0X1088,ADDR=0X7FCED
_T21MIE1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC3	PSECT	FLAG=0X1088,ADDR=0X7FCEF
_T21MIE2_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC4	PSECT	FLAG=0X1088,ADDR=0X7FCF2
_T21VIF_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC5	PSECT	FLAG=0X1088,ADDR=0X7FCF4
_T21MIF0_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC6	PSECT	FLAG=0X1088,ADDR=0X7FCF5
_T21MIF1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC7	PSECT	FLAG=0X1088,ADDR=0X7FCF7
_T21MIF2_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC8	PSECT	FLAG=0X1088,ADDR=0X7FD41
_PA1_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC9	PSECT	FLAG=0X1088,ADDR=0X7FD43
_PA3_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC10	PSECT	FLAG=0X1088,ADDR=0X7FD46
_PA6_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC11	PSECT	FLAG=0X1088,ADDR=0X7FD68
_PAT0_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC12	PSECT	FLAG=0X1088,ADDR=0X7FD6F
_PAT7_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC13	PSECT	FLAG=0X1088,ADDR=0X7FD77
_PBT7_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC14	PSECT	FLAG=0X1088,ADDR=0X30597
_T21EN_0	RSEG           	0X1		; Bank 0

SECTION1C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T21_capture_capture_c_STATIC	UNINTIAL       	0		; Bank 0
	ORG            	0X85		; Bank 0
_capvalue0	RSEG           	0X2		; Bank 0
	ORG            	0X87		; Bank 0
_capvalue1	RSEG           	0X2		; Bank 0
	ORG            	0X89		; Bank 0
_capvalue2	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            	0X60A9		; Bank 0
_T21OC_0	RSEG           	0X1		; Bank 0
	ORG            	0X60AE		; Bank 0
_T21R0L_0	RSEG           	0X1		; Bank 0
	ORG            	0X60AF		; Bank 0
_T21R0H_0	RSEG           	0X1		; Bank 0
	ORG            	0X60B0		; Bank 0
_T21CL_0	RSEG           	0X1		; Bank 0
	ORG            	0X60B1		; Bank 0
_T21CM_0	RSEG           	0X1		; Bank 0
	ORG            	0X60B3		; Bank 0
_T21R1L_0	RSEG           	0X1		; Bank 0
	ORG            	0X60B4		; Bank 0
_T21R1H_0	RSEG           	0X1		; Bank 0
	ORG            	0X60B5		; Bank 0
_T21R2L_0	RSEG           	0X1		; Bank 0
	ORG            	0X60B6		; Bank 0
_T21R2H_0	RSEG           	0X1		; Bank 0
	END
