;The Num of Instruction(Size):176. The Max Address(Begin with 0):176 

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X0  equ  0X0
HRAM_0X1  equ  0X1
HRAM_0X2  equ  0X2
HRAM_0X3  equ  0X3
HRAM_0X4  equ  0X4
HRAM_0X5  equ  0X5
HRAM_0X6  equ  0X6
HRAM_0X7  equ  0X7
HRAM_0X8  equ  0X8
HRAM_0X81  equ  0X81
HRAM_0X82  equ  0X82
HRAM_0X83  equ  0X83
HRAM_0X84  equ  0X84
HRAM_0X87  equ  0X87
HRAM_0X88  equ  0X88
HRAM_0X89  equ  0X89
HRAM_0X9  equ  0X9
HRAM_0X9B  equ  0X9b
HRAM_0X9C  equ  0X9c
HRAM_0XA  equ  0Xa

                ORG             0X00
HADR_0X0:
:0X0  c749f000                  AJMP            HADR_0X49
                                ORG             0X2
:0X2  6800                      GOTO            HADR_0X0
                                ORG             0X4
:0X4  c180                      PUSH
:0X5  e787                      CLR             HRAM_0X87
:0X6  e783                      CLR             HRAM_0X83
:0X7  5081                      MOV             HRAM_0X81,      A
:0X8  e600                      MOVA            (SAVED_FSR)&7f                        ;(SAVED_FSR)&7f: Bank 0    Addr: 0    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X9  5082                      MOV             HRAM_0X82,      A
:0Xa  e601                      MOVA            (SAVED_FSR+1)&7f                      ;(SAVED_FSR+1)&7f: Bank 0    Addr: 1    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0Xb  500f                      MOV             (CSEG_PTR)&7f,  A                     ;(CSEG_PTR)&7f: Bank 0    Addr: 15     
:0Xc  e611                      MOVA            (CSEG_PTR+2)&7f                       ;(CSEG_PTR+2)&7f: Bank 0    Addr: 17     
:0Xd  5010                      MOV             (CSEG_PTR+1)&7f,                A     ;(CSEG_PTR+1)&7f: Bank 0    Addr: 16     
:0Xe  e612                      MOVA            (CSEG_PTR+3)&7f                       ;(CSEG_PTR+3)&7f: Bank 0    Addr: 18     
:0Xf  500b                      MOV             (MUL_TEMP)&7f,  A                     ;(MUL_TEMP)&7f: Bank 0    Addr: 11     
:0X10  e60d                     MOVA            (MUL_TEMP+2)&7f                      ;(MUL_TEMP+2)&7f: Bank 0    Addr: 13     
:0X11  500c                     MOV             (MUL_TEMP+1)&7f,                A    ;(MUL_TEMP+1)&7f: Bank 0    Addr: 12     
:0X12  e60e                     MOVA            (MUL_TEMP+3)&7f                      ;(MUL_TEMP+3)&7f: Bank 0    Addr: 14     
:0X13  5007                     MOV             HRAM_0X7,       A
:0X14  e603                     MOVA            HRAM_0X3
:0X15  5008                     MOV             HRAM_0X8,       A
:0X16  e604                     MOVA            HRAM_0X4
:0X17  5009                     MOV             HRAM_0X9,       A
:0X18  e605                     MOVA            HRAM_0X5
:0X19  500a                     MOV             HRAM_0XA,       A
:0X1a  e606                     MOVA            HRAM_0X6
;
;/**********************************************
;函数名：isr(void) interrupt
;描  述：中断服务程序
;输入值：无
;输出值：无
;返回值：无
;**********************************************/
;void isr(void) interrupt
;{
;    if(PIE1==1 && PIF1==1)
:0X1b  e500                     MOVI            0X0
:0X1c  999b                     JBC             HRAM_0X9B,      1
:0X1d  e501                     MOVI            0X1
:0X1e  ea01                     SECTION         0X1
:0X1f  e604                     MOVA            HRAM_0X4
:0X20  5004                     MOV             HRAM_0X4,       A
:0X21  e301                     XORI            0X1
:0X22  9284                     JBS             HRAM_0X84,      2
:0X23  682d                     GOTO            HADR_0X2D
:0X24  e500                     MOVI            0X0
:0X25  999c                     JBC             HRAM_0X9C,      1
:0X26  e501                     MOVI            0X1
:0X27  e604                     MOVA            HRAM_0X4
:0X28  5004                     MOV             HRAM_0X4,       A
:0X29  e301                     XORI            0X1
:0X2a  9284                     JBS             HRAM_0X84,      2
:0X2b  682d                     GOTO            HADR_0X2D
;    {
;        PIF1 = 0;       //清中断标志位
:0X2c  a99c                     BCC             (_PIF1_0)>>3,   1                    ;(_PIF1_0)>>3: Bank 511    Addr: 65436    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
HADR_0X2D:
;    }
;}
:0X2d  ea00                     SECTION         0X0
:0X2e  682f                     GOTO            HADR_0X2F
HADR_0X2F:
:0X2f  ffff                     NOP
:0X30  ffff                     NOP
:0X31  5003                     MOV             HRAM_0X3,       A
:0X32  e607                     MOVA            HRAM_0X7
:0X33  5004                     MOV             HRAM_0X4,       A
:0X34  e608                     MOVA            HRAM_0X8
:0X35  5005                     MOV             HRAM_0X5,       A
:0X36  e609                     MOVA            HRAM_0X9
:0X37  5006                     MOV             HRAM_0X6,       A
:0X38  e60a                     MOVA            HRAM_0XA
:0X39  5012                     MOV             (CSEG_PTR+3)&7f,                A    ;(CSEG_PTR+3)&7f: Bank 0    Addr: 18     
:0X3a  e610                     MOVA            (CSEG_PTR+1)&7f                      ;(CSEG_PTR+1)&7f: Bank 0    Addr: 16     
:0X3b  5011                     MOV             (CSEG_PTR+2)&7f,                A    ;(CSEG_PTR+2)&7f: Bank 0    Addr: 17     
:0X3c  e60f                     MOVA            (CSEG_PTR)&7f                        ;(CSEG_PTR)&7f: Bank 0    Addr: 15     
:0X3d  500d                     MOV             (MUL_TEMP+2)&7f,                A    ;(MUL_TEMP+2)&7f: Bank 0    Addr: 13     
:0X3e  e60b                     MOVA            (MUL_TEMP)&7f                        ;(MUL_TEMP)&7f: Bank 0    Addr: 11     
:0X3f  e688                     MOVA            HRAM_0X88
:0X40  500e                     MOV             (MUL_TEMP+3)&7f,                A    ;(MUL_TEMP+3)&7f: Bank 0    Addr: 14     
:0X41  e60c                     MOVA            (MUL_TEMP+1)&7f                      ;(MUL_TEMP+1)&7f: Bank 0    Addr: 12     
:0X42  e689                     MOVA            HRAM_0X89
:0X43  5001                     MOV             (SAVED_FSR+1)&7f,               A    ;(SAVED_FSR+1)&7f: Bank 0    Addr: 1    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X44  e682                     MOVA            HRAM_0X82
:0X45  5000                     MOV             (SAVED_FSR)&7f, A                    ;(SAVED_FSR)&7f: Bank 0    Addr: 0    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X46  e681                     MOVA            HRAM_0X81
:0X47  c181                     POP
:0X48  c189                     RETIE
HADR_0X49:
;
;/**********************************************
;函数名：void main(void) 
;描  述：主函数,如果全局中断打开(GIE=1)，则必须要有唤醒源的中断函数，
;        如果不打开全局中断(GIE=0),则不必有唤醒源的中断函数。
;输入值：无
;输出值：无
;返回值：无
;**********************************************/
;void main(void) 
;{
;    uint i,j;       //循环变量
;    RAMclear();
:0X49  e783                     CLR             HRAM_0X83
:0X4a  ec00                     PAGE            (_RAMclear)>>11
:0X4b  608a                     CALL            HADR_0X8A
:0X4c  ec00                     PAGE            (_0)>>11
;    GPIOInit(); 
:0X4d  ec00                     PAGE            (_GPIOInit)>>11
:0X4e  609c                     CALL            HADR_0X9C
:0X4f  ec00                     PAGE            (_1)>>11
;    INTC0 &= 0xFC;      //PINT1下降沿中断
:0X50  5098                     MOV             _INTC0_0,       A                    ;_INTC0_0: Bank 511    Addr: 65432    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X51  e2fc                     ANDI            0XFC
:0X52  e698                     MOVA            _INTC0_0                             ;_INTC0_0: Bank 511    Addr: 65432    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PIE1 = 1;           //打开管脚中断
:0X53  a19b                     BSS             (_PIE1_0)>>3,   1                    ;(_PIE1_0)>>3: Bank 511    Addr: 65435    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
HADR_0X54:
;    //GIE = 1;            //打开全局中断
;    while(1)
:0X54  c18b                     CWDT
;        for(j = 0;j<10;j++)
:0X55  ea01                     SECTION         0X1
:0X56  e702                     CLR             HRAM_0X2
:0X57  e703                     CLR             HRAM_0X3
HADR_0X58:
:0X58  e500                     MOVI            0X0
:0X59  ee03                     SUB             HRAM_0X3,       A
:0X5a  9284                     JBS             HRAM_0X84,      2
:0X5b  685e                     GOTO            HADR_0X5E
:0X5c  e50a                     MOVI            0XA
:0X5d  ee02                     SUB             HRAM_0X2,       A
HADR_0X5E:
:0X5e  9884                     JBC             HRAM_0X84,      0
:0X5f  6885                     GOTO            HADR_0X85
;        {
;            PA1 = 1;
:0X60  a1a8                     BSS             (_PA1_0)>>3,    1                    ;(_PA1_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;            for(i = 0;i<50000;i++);
:0X61  e700                     CLR             HRAM_0X0
:0X62  e701                     CLR             HRAM_0X1
HADR_0X63:
:0X63  e5c3                     MOVI            0XC3
:0X64  ee01                     SUB             HRAM_0X1,       A
:0X65  9284                     JBS             HRAM_0X84,      2
:0X66  6869                     GOTO            HADR_0X69
:0X67  e550                     MOVI            0X50
:0X68  ee00                     SUB             HRAM_0X0,       A
HADR_0X69:
:0X69  9884                     JBC             HRAM_0X84,      0
:0X6a  6870                     GOTO            HADR_0X70
:0X6b  5500                     INC             HRAM_0X0,       R
:0X6c  9284                     JBS             HRAM_0X84,      2
:0X6d  686f                     GOTO            HADR_0X6F
:0X6e  5501                     INC             HRAM_0X1,       R
HADR_0X6F:
:0X6f  6863                     GOTO            HADR_0X63
HADR_0X70:
;            PA1 = 0;
:0X70  a9a8                     BCC             (_PA1_0)>>3,    1                    ;(_PA1_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;            for(i = 0;i<50000;i++);
:0X71  e700                     CLR             HRAM_0X0
:0X72  e701                     CLR             HRAM_0X1
HADR_0X73:
:0X73  e5c3                     MOVI            0XC3
:0X74  ee01                     SUB             HRAM_0X1,       A
:0X75  9284                     JBS             HRAM_0X84,      2
:0X76  6879                     GOTO            HADR_0X79
:0X77  e550                     MOVI            0X50
:0X78  ee00                     SUB             HRAM_0X0,       A
HADR_0X79:
:0X79  9884                     JBC             HRAM_0X84,      0
:0X7a  6880                     GOTO            HADR_0X80
:0X7b  5500                     INC             HRAM_0X0,       R
:0X7c  9284                     JBS             HRAM_0X84,      2
:0X7d  687f                     GOTO            HADR_0X7F
:0X7e  5501                     INC             HRAM_0X1,       R
HADR_0X7F:
:0X7f  6873                     GOTO            HADR_0X73
HADR_0X80:
;        }
:0X80  5502                     INC             HRAM_0X2,       R
:0X81  9284                     JBS             HRAM_0X84,      2
:0X82  6884                     GOTO            HADR_0X84
:0X83  5503                     INC             HRAM_0X3,       R
HADR_0X84:
:0X84  6858                     GOTO            HADR_0X58
HADR_0X85:
;        PIF1 = 0;       //睡眠前清中断标志位
:0X85  a99c                     BCC             (_PIF1_0)>>3,   1                    ;(_PIF1_0)>>3: Bank 511    Addr: 65436    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;        sleep();
:0X86  ec00                     PAGE            (_sleep)>>11
:0X87  60aa                     CALL            HADR_0XAA
:0X88  ec00                     PAGE            (_2)>>11
;    }
:0X89  6854                     GOTO            HADR_0X54
HADR_0X8A:
;/*********************************************************
;*Copyright (C), 2020, Shanghai Eastsoft Microelectronics Co., Ltd
;*文件名:  sleep.c
;*作  者:  AE Team
;*版  本:  v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
;*日  期:  2020/07/08
;*描  述:  睡眠 + 按键中断唤醒演示
;          PA1：管脚翻转输出
;          PA3：外部中断管脚
;          芯片上电复位后PA1管脚翻转10次，然后进入睡眠状态，PA3下降沿唤醒。
;          注意：需要在配置字界面选择MRSTEN(PA3)为数字IO。
;*备  注:  本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;**********************************************************/
;#include <hic.h>
;
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;typedef unsigned char uchar;
;typedef unsigned int uint;
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH=0; IAAH<=0x03; IAAH++)
:0X8a  e783                     CLR             HRAM_0X83
:0X8b  e782                     CLR             _IAAH_0                              ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
HADR_0X8C:
:0X8c  5082                     MOV             _IAAH_0,        A                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X8d  ce03                     SUBI            0X3
:0X8e  9084                     JBS             HRAM_0X84,      0
:0X8f  689b                     GOTO            HADR_0X9B
;    {
;        for (IAAL=0; IAAL<0xFF; IAAL++)
:0X90  e781                     CLR             _IAAL_0                              ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
HADR_0X91:
:0X91  e5ff                     MOVI            0XFF
:0X92  ee81                     SUB             _IAAL_0,        A                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X93  9884                     JBC             HRAM_0X84,      0
:0X94  6898                     GOTO            HADR_0X98
;            IAD = 0x00;
:0X95  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X96  5581                     INC             _IAAL_0,        R                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X97  6891                     GOTO            HADR_0X91
HADR_0X98:
;        IAD = 0x00;
:0X98  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0X99  5582                     INC             _IAAH_0,        R                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    }
:0X9a  688c                     GOTO            HADR_0X8C
HADR_0X9B:
;}
:0X9b  c183                     RET
HADR_0X9C:
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0X9c  e783                     CLR             HRAM_0X83
:0X9d  e5ff                     MOVI            0XFF
:0X9e  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;	ANSH = 0xFF;
:0X9f  e5ff                     MOVI            0XFF
:0Xa0  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0Xa1  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PBT = 0x00;
:0Xa2  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PCT = 0x00;
:0Xa3  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PA = 0x00;
:0Xa4  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PB = 0x00;
:0Xa5  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PC = 0x00;
:0Xa6  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PAT3 = 1;           //外部中断管脚  
:0Xa7  a3ad                     BSS             (_PAT3_0)>>3,   3                    ;(_PAT3_0)>>3: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PAPU3 = 1;          //上拉
:0Xa8  a3b2                     BSS             (_PAPU3_0)>>3,  3                    ;(_PAPU3_0)>>3: Bank 511    Addr: 65458    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;}
:0Xa9  c183                     RET
HADR_0XAA:
;
;/**********************************************
;函数名：void sleep(void)
;描  述：进入IDLE模式
;输入值：无
;输出值：无
;返回值：无
;**********************************************/
;void sleep(void)
;{
;    PWRC &= 0x3F;
:0Xaa  e783                     CLR             HRAM_0X83
:0Xab  50b6                     MOV             _PWRC_0,        A                    ;_PWRC_0: Bank 511    Addr: 65462    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
:0Xac  e23f                     ANDI            0X3F
:0Xad  e6b6                     MOVA            _PWRC_0                              ;_PWRC_0: Bank 511    Addr: 65462    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    PWRC |= 2<<6;        //选择IDLE模式
:0Xae  a7b6                     BSS             _PWRC_0,        7                    ;_PWRC_0: Bank 511    Addr: 65462    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SLEEP\sleep\debug\sleep.obj 
;    __Asm IDLE;     //进入IDLE模式
:0Xaf  c18a                     IDLE
;}
:0Xb0  c183                     RET

                                END
