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

#INCLUDE       	<ES7P169C.INC>
#INCLUDE       	<OPERATION.INC>
	PUBLIC         	_timer_cnt
	PUBLIC         	_RAMclear
	PUBLIC         	_GPIOInit
	PUBLIC         	_isr
	PUBLIC         	_main
_isr_#T20403_7	EQU            	_isrDATA + 0X0		; Bank 0
_isr_#T20410_7	EQU            	_isrDATA + 0X0		; Bank 0
#TMP	EQU            	?_TMP+ 0X0		; Bank 0
?_TMP_RET	EQU            	?_TMP		; 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.
; *文件名：timer.c
; *作  者：AE Team
; *版  本：v1.0
; *日  期：2020/07/09
; *描  述：T8N定时器定时模式，PA1输出方波，周期2s
; *备  注：本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
; *******************************************************/
; #include <hic.h>
; #define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
; unsigned char timer_cnt;
; /******************************************************
; 函数名：void RAMclear(void)
; 描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
; 输入值：无
; 输出值：无
; 返回值：无
; *******************************************************/
; void RAMclear(void)
; {
#line 25	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     for (IAAH=0; IAAH<=0x03; IAAH++)
	CLR            	BKSR
;   25:(    ASGN_1,          0 ,            ,      IAAH)

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

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

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

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

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

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

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

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

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

; ITemplate_LABEL
#L20286
#line 29	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;         IAD = 0x00;
;   29:(    ASGN_1,          0 ,            ,       IAD)

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

; ITemplate_INC_1_TMP
	INC            	_IAAH_0
#line 30	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     }
;   30:(       JMP,            ,            ,   #L20268)

; ITemplate_JMP
	GOTO           	#L20268
#line 31	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ; }
;   31:(     LABEL,    #L20345 ,            ,          )

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

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

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

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

; ITemplate_CLR1_4_TMP
	CLR            	_PAT_0
#line 45	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     PBT = 0x00;
;   45:(    ASGN_1,          0 ,            ,       PBT)

; ITemplate_CLR1_4_TMP
	CLR            	_PBT_0
#line 46	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     PCT = 0x00;
;   46:(    ASGN_1,          0 ,            ,       PCT)

; ITemplate_CLR1_4_TMP
	CLR            	_PCT_0
#line 47	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     PA = 0x00;
;   47:(    ASGN_1,          0 ,            ,        PA)

; ITemplate_CLR1_4_TMP
	CLR            	_PA_0
#line 48	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     PB = 0x00;
;   48:(    ASGN_1,          0 ,            ,        PB)

; ITemplate_CLR1_4_TMP
	CLR            	_PB_0
#line 49	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     PC = 0x00;
;   49:(    ASGN_1,          0 ,            ,        PC)

; ITemplate_CLR1_4_TMP
	CLR            	_PC_0
#line 50	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ; }
;   50:(       RET,            ,            ,          )

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

SECTION1isr	UNINTIAL       	0		; Bank 0
	ORG            	0X80		; Bank 0
_isrDATA	RSEG           	0X1		; 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 61	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     if (T8NIE==1 && T8NIF==1)        //定时器溢出中断
;   61:(    CVB_SC,      T8NIE ,            ,   #T20403)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T8NIE_0)/8,	(_T8NIE_0)%8
	MOVI           	0x1
	SECTION        	0x1
	MOVA           	(_isr_#T20403_7) & 0X7F		; Bank 1
;   61:(    JNEQ_1,          1 ,    #T20403 ,   #L20466)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20403_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20466
;   61:(    CVB_SC,      T8NIF ,            ,   #T20410)

; ITemplate_CVB_UC
	MOVI           	0x0
	JBC            	(_T8NIF_0)/8,	(_T8NIF_0)%8
	MOVI           	0x1
	MOVA           	(_isr_#T20410_7) & 0X7F		; Bank 1
;   61:(    JNEQ_1,          1 ,    #T20410 ,   #L20466)

; ITemplate_JNEQ1_4
	MOV            	(_isr_#T20410_7) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20466
;     {
#line 63	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;         T8NIF = 0;        //清标志位
;   63:(    ASGN_0,          0 ,            ,     T8NIF)

; ITemplate_CLR_0_TMP
	BCC            	(_T8NIF_0)/8,	(_T8NIF_0)%8
#line 65	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;         T8N += 6;         //进中断先赋计数器初值
;   65:(     ADD_1,        T8N ,          6 ,       T8N)

; ITemplate_ADD1_4
	MOV            	_T8N_0,	0x0
	ADDI           	0x6
	MOVA           	_T8N_0
#line 66	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;         timer_cnt ++;
;   66:(     ADD_1,  timer_cnt ,          1 , timer_cnt)

; ITemplate_INC_1_TMP
	INC            	(_timer_cnt) & 0X7F		; Bank 1
#line 67	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;         if (timer_cnt >= 250) 
;   67:(    JLT_1U,  timer_cnt ,        250 ,   #L20466)

; ITemplate_JLT1_4U
	MOVI           	0xfa
	SUB            	(_timer_cnt) & 0X7F,	0x0		; Bank 1
	JBS            	PSW,	0x0
	GOTO           	#L20466
;         {
#line 69	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;             timer_cnt = 0;
;   69:(    ASGN_1,          0 ,            , timer_cnt)

; ITemplate_CLR1_4_TMP
	CLR            	(_timer_cnt) & 0X7F		; Bank 1
#line 70	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;             PA1 = ~PA1;
;   70:(    BCOM_0,        PA1 ,            ,       PA1)

; ITemplate_BCOM_0
	BTT            	(_PA1_0)/8,	(_PA1_0)%8
;         }
;     }
#line 73	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ; }
;   73:(     LABEL,    #L20466 ,            ,          )

; ITemplate_LABEL
#L20466
;   73:(     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)
; 描  述：主函数，1s溢出翻转PA1电平
; 输入值
; 输出值：无
; 返回值：无
; *******************************************************/
; void main(void)
; {
#line 84	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     RAMclear();
	CLR            	BKSR
;   84:(      CALL, (RAMclear.0) ,            ,          )

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

; ITemplate_CALL
	SEGMENTSEL     	_GPIOInit
	CALL           	_GPIOInit		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 86	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     timer_cnt = 0;
;   86:(    ASGN_1,          0 ,            , timer_cnt)

; ITemplate_CLR1_4_TMP
	SECTION        	0x1
	CLR            	(_timer_cnt) & 0X7F		; Bank 1
#line 87	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     T8NC = 0x0E;         //定时器模式，预分频1:(Fosc/2)/128
;   87:(    ASGN_1,         14 ,            ,      T8NC)

; ITemplate_ASGN1_4_R
	MOVI           	0xe
	MOVA           	_T8NC_0
#line 88	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     T8N = 6;             //赋计数器初值
;   88:(    ASGN_1,          6 ,            ,       T8N)

; ITemplate_ASGN1_4_R
	MOVI           	0x6
	MOVA           	_T8N_0
#line 89	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     T8NIE = 1;           //打开定时器溢出中断
;   89:(    ASGN_0,          1 ,            ,     T8NIE)

; ITemplate_SET_0_TMP
	BSS            	(_T8NIE_0)/8,	(_T8NIE_0)%8
#line 90	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     T8NIF = 0;           //清溢出标志位
;   90:(    ASGN_0,          0 ,            ,     T8NIF)

; ITemplate_CLR_0_TMP
	BCC            	(_T8NIF_0)/8,	(_T8NIF_0)%8
#line 91	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     GIE = 1;             //开全局中断
;   91:(    ASGN_0,          1 ,            ,       GIE)

; ITemplate_SET_0_TMP
	BSS            	(_GIE_0)/8,	(_GIE_0)%8
#line 92	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     T8NEN = 1;           //使能T8N
;   92:(    ASGN_0,          1 ,            ,     T8NEN)

; ITemplate_SET_0_TMP
	BSS            	(_T8NEN_0)/8,	(_T8NEN_0)%8
#line 93	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     while (1)
;   93:(     LABEL,    #L20517 ,            ,          )

; ITemplate_LABEL
#L20517
;     {
#line 95	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;         CLRWDT();
; ITemplate_LABEL
;-----------Embedded Asm--------------
	CWDT
;-------------------------------------
#line 96	C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\timer\timer.c ;     }
;   96:(       JMP,            ,            ,   #L20517)

; ITemplate_JMP
	GOTO           	#L20517

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

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T8N_timer_timer_c_STATIC1	PSECT	FLAG=0X1088,ADDR=0X7FCC9
_T8NIE_0	RSEG           	0X1		; Bank 0

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T8N_timer_timer_c_STATIC2	PSECT	FLAG=0X1088,ADDR=0X7FCD1
_T8NIF_0	RSEG           	0X1		; Bank 0

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

SECTION8C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T8N_timer_timer_c_STATIC4	PSECT	FLAG=0X1088,ADDR=0X7FDF7
_T8NEN_0	RSEG           	0X1		; Bank 0

SECTION1C__Users_lisq_Desktop_AN135_Examples_ES7P169C_T8N_timer_timer_c_STATIC	UNINTIAL       	0		; Bank 0
	ORG            	0X81		; Bank 0
_timer_cnt	RSEG           	0X1		; 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            	0XFFBD		; Bank 0
_T8N_0	RSEG           	0X1		; Bank 0
	ORG            	0XFFBE		; Bank 0
_T8NC_0	RSEG           	0X1		; Bank 0
	END
