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

#INCLUDE       	<ES7P169C.INC>
#INCLUDE       	<OPERATION.INC>
	PUBLIC         	_#T0
	EXTERN         	_check_empty
	EXTERN         	_check_emptyDATA
	EXTERN         	_Read_Cont
	EXTERN         	_Read_ContDATA
	EXTERN         	_Erase_Page
	EXTERN         	_Erase_PageDATA
	EXTERN         	_Write_Cont
	EXTERN         	_Write_ContDATA
	EXTERN         	_memchr_c
	EXTERN         	_memchr_cDATA
	EXTERN         	_memchr
	EXTERN         	_memchrDATA
	EXTERN         	_memcmp_c
	EXTERN         	_memcmp_cDATA
	EXTERN         	_memcmp
	EXTERN         	_memcmpDATA
	EXTERN         	_memcpy_c
	EXTERN         	_memcpy_cDATA
	EXTERN         	_memcpy
	EXTERN         	_memcpyDATA
	EXTERN         	_memmove_c
	EXTERN         	_memmove_cDATA
	EXTERN         	_memmove
	EXTERN         	_memmoveDATA
	EXTERN         	_memset
	EXTERN         	_memsetDATA
	EXTERN         	_strcat_c
	EXTERN         	_strcat_cDATA
	EXTERN         	_strcat
	EXTERN         	_strcatDATA
	EXTERN         	_strchr_c
	EXTERN         	_strchr_cDATA
	EXTERN         	_strchr
	EXTERN         	_strchrDATA
	EXTERN         	_strcmp_c
	EXTERN         	_strcmp_cDATA
	EXTERN         	_strcmp
	EXTERN         	_strcmpDATA
	EXTERN         	_strcpy_c
	EXTERN         	_strcpy_cDATA
	EXTERN         	_strcpy
	EXTERN         	_strcpyDATA
	EXTERN         	_strichr_c
	EXTERN         	_strichr_cDATA
	EXTERN         	_strichr
	EXTERN         	_strichrDATA
	EXTERN         	_stricmp_c
	EXTERN         	_stricmp_cDATA
	EXTERN         	_stricmp
	EXTERN         	_stricmpDATA
	EXTERN         	_strlen_c
	EXTERN         	_strlen_cDATA
	EXTERN         	_strlen
	EXTERN         	_strlenDATA
	EXTERN         	_strncat_c
	EXTERN         	_strncat_cDATA
	EXTERN         	_strncat
	EXTERN         	_strncatDATA
	EXTERN         	_strncpy_c
	EXTERN         	_strncpy_cDATA
	EXTERN         	_strncpy
	EXTERN         	_strncpyDATA
	EXTERN         	_UartReceive
	EXTERN         	_start_tx
	EXTERN         	_start_txDATA
	EXTERN         	_Transmit
	EXTERN         	_Init_RAM
	EXTERN         	_Init_Uart
	EXTERN         	_Init_Ports
	EXTERN         	_Init_Timer
	EXTERN         	_Init_MCU
	EXTERN         	_Timer_Proc
	EXTERN         	_Reg_reset
	EXTERN         	MUL_TEMP
	EXTERN         	MUL_TEMP
	EXTERN         	_g_isp_data
	EXTERN         	_g_boot_timer
	EXTERN         	_g_boot
	EXTERN         	_uart_proc_fsm
	EXTERN         	_fsm_init
	PUBLIC         	_RAM_clear
	PUBLIC         	_main
#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
_FRAH_0#sh	EQU            	(FRAH - 0X6080) % 0X40 + 0xC0		; Bank 0
_FRAL_0#sh	EQU            	(FRAL - 0X6080) % 0X40 + 0xC0		; Bank 0
	_DESC          	RAM_clear,0X0,0X0
RAM_clear#	CSEG           
_RAM_clear
; /*********************************************************
; *Copyright (C), 2021, Shanghai Eastsoft Microelectronics Co., Ltd
; *文件名:  main.c
; *作  者:  AE Team
; *版  本:  V1.00， 编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.122)
; *日  期:  2021/12/9
; *描  述:  Bootloader示例程序
;           PA0：模拟BootPIN
;           PA1：TX
;           PA2：RX
;           串口配置 波特率：9600  数据位：8位  停止位：1位  校验：无校验
;           演示方法请参考应用笔记《AN112_UserManual_ES-UART-BOOT》
; *备  注:  本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
; **********************************************************/
; #include "typedef.h"
; #include "rw_flash.h"
; #include "string.h"
; #include "uart.h"
; #include  "sysinit.h"
; #include "systick.h"
; #include <hic.h>
; extern isp_data_t g_isp_data;
; extern u32  g_boot_timer;
; extern u8   g_boot;
; void uart_proc_fsm(void);
; void fsm_init(void);
; void UartReceive(void);
; /**********************************************
; 函数名：RAM_clear
; 描  述：RAM区清0
; 输入值：无
; 输出值：无
; 返回值：无
; **********************************************/
; void RAM_clear(void)
; {
#line 39	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;     for (IAAH = 0; IAAH <= 0x03; IAAH++)
	CLR            	BKSR
;   39:(    ASGN_1,          0 ,            ,      IAAH)

; ITemplate_CLR1_4_TMP
	CLR            	_IAAH_0
;   39:(     LABEL,    #L20281 ,            ,          )

; ITemplate_LABEL
#L20281
;   39:(    JGT_1U,       IAAH ,          3 ,   #L20358)

; ITemplate_JGT1_4U
	MOV            	_IAAH_0,	0x0
	SUBI           	0x3
	JBS            	PSW,	0x0
	GOTO           	#L20358
;     {
#line 41	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         for (IAAL = 0; IAAL < 0xFF; IAAL++)IAD = 0;
;   41:(    ASGN_1,          0 ,            ,      IAAL)

; ITemplate_CLR1_4_TMP
	CLR            	_IAAL_0
;   41:(     LABEL,    #L20298 ,            ,          )

; ITemplate_LABEL
#L20298
;   41:(    JGE_1U,       IAAL ,        255 ,   #L20299)

; ITemplate_JGE1_4U
	MOVI           	0xff
	SUB            	_IAAL_0,	0x0
	JBC            	PSW,	0x0
	GOTO           	#L20299
;   41:(    ASGN_1,          0 ,            ,       IAD)

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

; ITemplate_INC_1_TMP
	INC            	_IAAL_0
;   41:(       JMP,            ,            ,   #L20298)

; ITemplate_JMP
	GOTO           	#L20298
;   41:(     LABEL,    #L20299 ,            ,          )

; ITemplate_LABEL
#L20299
#line 43	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         IAD = 0;
;   43:(    ASGN_1,          0 ,            ,       IAD)

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

; ITemplate_INC_1_TMP
	INC            	_IAAH_0
#line 44	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;     }
;   44:(       JMP,            ,            ,   #L20281)

; ITemplate_JMP
	GOTO           	#L20281
#line 45	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ; }
;   45:(     LABEL,    #L20358 ,            ,          )

; ITemplate_LABEL
#L20358
;   45:(       RET,            ,            ,          )

; ITemplate_RET
	RET            			; Bank 0		; ShBank 0
	_DESC          	main,0X0,0X0,Init_MCU,fsm_init,Timer_Proc,UartReceive,uart_proc_fsm,Reg_reset,RAM_clear
main#	CSEG           
_main
; /**********************************************
; 函数名： main
; 描  述：主函数
; 输入值：无
; 输出值：无
; 返回值：无
; **********************************************/
; void main()
; {
#line 55	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;     Init_MCU();
	CLR            	BKSR
;   55:(      CALL, (Init_MCU.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_Init_MCU
	CALL           	_Init_MCU		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 56	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;     fsm_init();
;   56:(      CALL, (fsm_init.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_fsm_init
	CALL           	_fsm_init		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 58	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;     while (1)
;   58:(     LABEL,    #L20367 ,            ,          )

; ITemplate_LABEL
#L20367
;     {
#line 60	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         Timer_Proc();     //4ms节拍处理
;   60:(      CALL, (Timer_Proc.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_Timer_Proc
	CALL           	_Timer_Proc		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 61	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         UartReceive();
;   61:(      CALL, (UartReceive.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_UartReceive
	CALL           	_UartReceive		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 63	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         while (g_isp_data.triger == 1)
;   63:(     LABEL,    #L20378 ,            ,          )

; ITemplate_LABEL
#L20378
;   63:(    JNEQ_1,          1 , *(g_isp_data.3) ,   #L20380)

; ITemplate_JNEQ1_4
	SECTION        	0x1
	MOV            	(_g_isp_data+0x3) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20380
;         {
#line 65	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;             uart_proc_fsm();  //isp命令状态机处理
;   65:(      CALL, (uart_proc_fsm.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_uart_proc_fsm
	CALL           	_uart_proc_fsm		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 66	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         }
;   66:(       JMP,            ,            ,   #L20378)

; ITemplate_JMP
	GOTO           	#L20378
;   66:(     LABEL,    #L20380 ,            ,          )

; ITemplate_LABEL
#L20380
#line 68	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;         if (g_boot == 1) //需要引导程序到flash
;   68:(    JNEQ_1,          1 ,     g_boot ,   #L20367)

; ITemplate_JNEQ1_4
	MOV            	(_g_boot) & 0X7F,	0x0		; Bank 1
	XORI           	0x1
	JBS            	PSW,	0x2
	GOTO           	#L20367
;         {
#line 70	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;             Reg_reset();
;   70:(      CALL, (Reg_reset.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_Reg_reset
	CALL           	_Reg_reset		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 71	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;             RAM_clear();
;   71:(      CALL, (RAM_clear.0) ,            ,          )

; ITemplate_CALL
	SEGMENTSEL     	_RAM_clear
	CALL           	_RAM_clear		; Bank 0		; ShBank 0
	SEGMENTSEL     	$
#line 72	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;             PCRH = 0x08;
;   72:(    ASGN_1,          8 ,            ,      PCRH)

; ITemplate_ASGN1_4_R
	MOVI           	0x8
	MOVA           	_PCRH_0
#line 73	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;             PCRL = 0x00;
;   73:(    ASGN_1,          0 ,            ,      PCRL)

; ITemplate_CLR1_4_TMP
	CLR            	_PCRL_0
;             //ASM_GOTO(USR_APP_ENTER);          //判断是跳到App程序还是进行Bootloader
;         }
#line 76	C:\Lisq\Project\Git\AN135_Examples_ES7P169C_ES7P0693_ES7P0031\_Bootloader_Demo\Uart_Boot_vector_interrupt\Boot\Src\main.c ;     }
;   76:(       JMP,            ,            ,   #L20367)

; ITemplate_JMP
	GOTO           	#L20367

SECTION0C__Lisq_Project_Git_AN135_Examples_ES7P169C_ES7P0693_ES7P0031__Bootloader_Demo_Uart_Boot_vector_interrupt_Boot_Include_typedef_h_STATIC3	UNINTIAL       		; Bank 0
_#T0	RSEG           	0X1		; Bank 0

SECTION8C__Program_Files__x86__HRCC_Tools_HRCC_v1_2_0_136_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            	0XFF86		; Bank 0
_PCRL_0	RSEG           	0X1		; Bank 0
	ORG            	0XFF87		; Bank 0
_PCRH_0	RSEG           	0X1		; Bank 0
	END
