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

#INCLUDE       	<ES7P0693.INC>
#INCLUDE       	<OPERATION.INC>
	PUBLIC         	_RAMclear
	PUBLIC         	_GPIOInit
	PUBLIC         	_main
#TMP	EQU            	?_TMP+ 0X0		; Bank 0
?_TMP_RET	EQU            	?_TMP		; Bank 0
_T31EN_0#sh	EQU            	0X608		; Bank 0
_T31C0L_0#sh	EQU            	0XC1		; Bank 0
_T31C2L_0#sh	EQU            	0XC5		; Bank 0
_T31CH1C_0#sh	EQU            	0XD4		; Bank 0
_T31PINCL_0#sh	EQU            	0XD8		; Bank 0
_T31PRSL_0#sh	EQU            	0XDC		; Bank 0
_T31PRSH_0#sh	EQU            	0XDD		; Bank 0
_T31CNTLDL_0#sh	EQU            	0XDE		; Bank 0
_T31CNTLDH_0#sh	EQU            	0XDF		; Bank 0
_T31CH1RL_0#sh	EQU            	0XE1		; Bank 0
_T31CH1RH_0#sh	EQU            	0XE2		; 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
; /*******************************************************
; *Copytight(C),2017,Shanghai Eastsoft Microelectronics Co.,Ltd.
; *文件名：compare_square_output.c
; *作  者：AE Team
; *版  本：v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
; *日  期：2020/07/07
; *描  述：多功能定时器方波输出模式，T31_CH1N(PB2)输出方波，PB0高电平时T31_CH1N输出低
; *备  注：适用于ES7P0693，本例程仅供参考
; 本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
; *******************************************************/
; #include <hic.h>
; #define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
; /******************************************************
; 函数名：void RAMclear(void)
; 描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void RAMclear(void)
; {
#line 24	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     for (IAAH=0; IAAH<=0x03; IAAH++)
	CLR            	BKSR
;   24:(    ASGN_1,          0 ,            ,      IAAH)

; ITemplate_CLR1_4_TMP
	CLR            	_IAAH_0
;   24:(     LABEL,    #L20416 ,            ,          )

; ITemplate_LABEL
#L20416
;   24:(    JGT_1U,       IAAH ,          3 ,   #L20493)

; ITemplate_JGT1_4U
	MOV            	_IAAH_0,	0x0
	SUBI           	0x3
	JBS            	PSW,	0x0
	GOTO           	#L20493
;     {
#line 26	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;         for (IAAL=0; IAAL<0xFF; IAAL++)
;   26:(    ASGN_1,          0 ,            ,      IAAL)

; ITemplate_CLR1_4_TMP
	CLR            	_IAAL_0
;   26:(     LABEL,    #L20433 ,            ,          )

; ITemplate_LABEL
#L20433
;   26:(    JGE_1U,       IAAL ,        255 ,   #L20434)

; ITemplate_JGE1_4U
	MOVI           	0xff
	SUB            	_IAAL_0,	0x0
	JBC            	PSW,	0x0
	GOTO           	#L20434
#line 27	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;             IAD = 0x00;
;   27:(    ASGN_1,          0 ,            ,       IAD)

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

; ITemplate_INC_1_TMP
	INC            	_IAAL_0
;   27:(       JMP,            ,            ,   #L20433)

; ITemplate_JMP
	GOTO           	#L20433
;   27:(     LABEL,    #L20434 ,            ,          )

; ITemplate_LABEL
#L20434
#line 28	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;         IAD = 0x00;
;   28:(    ASGN_1,          0 ,            ,       IAD)

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

; ITemplate_INC_1_TMP
	INC            	_IAAH_0
#line 29	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     }
;   29:(       JMP,            ,            ,   #L20416)

; ITemplate_JMP
	GOTO           	#L20416
#line 30	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ; }
;   30:(     LABEL,    #L20493 ,            ,          )

; ITemplate_LABEL
#L20493
;   30:(       RET,            ,            ,          )

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

; ITemplate_ASGN1_4_R
	MOVI           	0xff
	MOVA           	_ANSL_0
#line 42	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ; 	ANSH = 0xFF;        //选择对应端口为数字IO功能
;   42:(    ASGN_1,        255 ,            ,      ANSH)

; ITemplate_ASGN1_4_R
	MOVI           	0xff
	MOVA           	_ANSH_0
#line 43	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PAT = 0x00;         //所有IO设为输出低电平
;   43:(    ASGN_1,          0 ,            ,       PAT)

; ITemplate_CLR1_4_TMP
	CLR            	_PAT_0
#line 44	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PBT = 0x00;
;   44:(    ASGN_1,          0 ,            ,       PBT)

; ITemplate_CLR1_4_TMP
	CLR            	_PBT_0
#line 45	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PCT = 0x00;
;   45:(    ASGN_1,          0 ,            ,       PCT)

; ITemplate_CLR1_4_TMP
	CLR            	_PCT_0
#line 46	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PA = 0x00;
;   46:(    ASGN_1,          0 ,            ,        PA)

; ITemplate_CLR1_4_TMP
	CLR            	_PA_0
#line 47	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PB = 0x00;
;   47:(    ASGN_1,          0 ,            ,        PB)

; ITemplate_CLR1_4_TMP
	CLR            	_PB_0
#line 48	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PC = 0x00;
;   48:(    ASGN_1,          0 ,            ,        PC)

; ITemplate_CLR1_4_TMP
	CLR            	_PC_0
#line 50	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PBT0 = 1;           //T31_ETR设为输入
;   50:(    ASGN_0,          1 ,            ,      PBT0)

; ITemplate_SET_0_TMP
	BSS            	(_PBT0_0)/8,	(_PBT0_0)%8
#line 51	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     PBPD0 = 1;          //使能下拉
;   51:(    ASGN_0,          1 ,            ,     PBPD0)

; ITemplate_SET_0_TMP
	BSS            	(_PBPD0_0)/8,	(_PBPD0_0)%8
#line 52	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ; }
;   52:(       RET,            ,            ,          )

; ITemplate_RET
	RET            			; Bank 0		; ShBank 0
	_DESC          	main,0X0,0X0,RAMclear,GPIOInit
main#	CSEG           
_main
; /*******************************************************
; 函数名：void main(void)
; 描  述：主函数，T31_CH1N(PB2)输出方波，PB0高电平时T31_CH1N输出低
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void main(void) 
; {
#line 63	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     RAMclear();
	CLR            	BKSR
;   63:(      CALL, (RAMclear.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_RAMclear
	CALL           	_RAMclear		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 64	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     GPIOInit();
;   64:(      CALL, (GPIOInit.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_GPIOInit
	CALL           	_GPIOInit		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 65	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31C0L = 0x00;        //边沿计数模式，向上计数
;   65:(    ASGN_1,          0 ,            ,    T31C0L)

; ITemplate_CLR1_4_TMP
	CLR            	_T31C0L_0#sh		; ShBank 0
#line 66	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31C2L = 0x08;        //禁止从模式,使能外部事件清除OCnREF
;   66:(    ASGN_1,          8 ,            ,    T31C2L)

; ITemplate_ASGN1_4_R
	MOVI           	0x8
	MOVA           	_T31C2L_0#sh		; ShBank 0
#line 67	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31CH1C = 0xB0;       //使能输出比较1清零，计数器匹配T31CH1R时翻转OC1REF，CC1通道配置为输出 
;   67:(    ASGN_1,        176 ,            ,   T31CH1C)

; ITemplate_ASGN1_4_R
	MOVI           	0xb0
	MOVA           	_T31CH1C_0#sh		; ShBank 0
#line 68	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31PINCL = 0x04;      //OC1N通道高电平有效，使能输出
;   68:(    ASGN_1,          4 ,            ,  T31PINCL)

; ITemplate_ASGN1_4_R
	MOVI           	0x4
	MOVA           	_T31PINCL_0#sh		; ShBank 0
#line 69	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31PRSH = 0x00;       //预分频系数1:16
;   69:(    ASGN_1,          0 ,            ,   T31PRSH)

; ITemplate_CLR1_4_TMP
	CLR            	_T31PRSH_0#sh		; ShBank 0
#line 70	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31PRSL = 0x0F;
;   70:(    ASGN_1,         15 ,            ,   T31PRSL)

; ITemplate_ASGN1_4_R
	MOVI           	0xf
	MOVA           	_T31PRSL_0#sh		; ShBank 0
#line 71	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31CNTLDH = 0x01;     //重装载值，方波周期=T31CNTLD*2*分频后的时钟周期
;   71:(    ASGN_1,          1 ,            , T31CNTLDH)

; ITemplate_ASGN1_4_R
	MOVI           	0x1
	MOVA           	_T31CNTLDH_0#sh		; ShBank 0
#line 72	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31CNTLDL = 0xF4;
;   72:(    ASGN_1,        244 ,            , T31CNTLDL)

; ITemplate_ASGN1_4_R
	MOVI           	0xf4
	MOVA           	_T31CNTLDL_0#sh		; ShBank 0
#line 73	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31CH1RH = 0x00;      //比较寄存器1值
;   73:(    ASGN_1,          0 ,            ,  T31CH1RH)

; ITemplate_CLR1_4_TMP
	CLR            	_T31CH1RH_0#sh		; ShBank 0
#line 74	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31CH1RL = 0x08;
;   74:(    ASGN_1,          8 ,            ,  T31CH1RL)

; ITemplate_ASGN1_4_R
	MOVI           	0x8
	MOVA           	_T31CH1RL_0#sh		; ShBank 0
#line 75	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     CHOE = 1;           //输出使能
;   75:(    ASGN_0,          1 ,            ,      CHOE)

; ITemplate_SET_0_TMP
	BSS            	(_CHOE_0)/8,	(_CHOE_0)%8
#line 76	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     T31EN = 1;          //使能计数器
;   76:(    ASGN_0,          1 ,            ,     T31EN)

; ITemplate_SET_0_TMP
	BSS            	(_T31EN_0#sh)/8,	(_T31EN_0#sh)%8		; ShBank 0
#line 77	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     while (1)
;   77:(     LABEL,    #L20635 ,            ,          )

; ITemplate_LABEL
#L20635
;     {
#line 79	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;         CLRWDT();
; ITemplate_LABEL
;-----------Embedded Asm--------------
	CWDT
;-------------------------------------
#line 80	E:\lisq\public_lisq\Examples_ES7P0693\T31\compare_square_output_0693\compare_square_output.c ;     }
;   80:(       JMP,            ,            ,   #L20635)

; ITemplate_JMP
	GOTO           	#L20635

SECTION8E__lisq_public_lisq_Examples_ES7P0693_T31_compare_square_output_0693_compare_square_output_c_STATIC0	PSECT	FLAG=0X1088,ADDR=0X7FD70
_PBT0_0	RSEG           	0X1		; Bank 0

SECTION8E__lisq_public_lisq_Examples_ES7P0693_T31_compare_square_output_0693_compare_square_output_c_STATIC1	PSECT	FLAG=0X1088,ADDR=0X7FD88
_PBPD0_0	RSEG           	0X1		; Bank 0

SECTION8E__lisq_public_lisq_Examples_ES7P0693_T31_compare_square_output_0693_compare_square_output_c_STATIC2	PSECT	FLAG=0X1088,ADDR=0X7FDFF
_CHOE_0	RSEG           	0X1		; Bank 0

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

SECTION8D__Program_Files__x86__iDesigner4_1_tools_INCLUDE_ES7P0693_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            	0X6081		; Bank 0
_T31C0L_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            	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            	0X609E		; Bank 0
_T31CNTLDL_0	RSEG           	0X1		; Bank 0
	ORG            	0X609F		; Bank 0
_T31CNTLDH_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
	END
