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

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X0  equ  0X0
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_0X99  equ  0X99
HRAM_0X9A  equ  0X9a
HRAM_0XA  equ  0Xa

                ORG             0X00
HADR_0X0:
:0X0  c74af000                  AJMP            HADR_0X4A
                                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\T8N\synchronous counter\debug\synchronous counter.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\T8N\synchronous counter\debug\synchronous counter.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
;
;/*******************************************************
;函数名：void isr(void) interrupt
;描  述：中断服务程序
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void isr(void) interrupt
;{
;    if (T8NIE==1 && T8NIF==1)        //定时器溢出中断
:0X1b  e500                     MOVI            0X0
:0X1c  9999                     JBC             HRAM_0X99,      1
:0X1d  e501                     MOVI            0X1
:0X1e  ea01                     SECTION         0X1
:0X1f  e600                     MOVA            HRAM_0X0
:0X20  5000                     MOV             HRAM_0X0,       A
:0X21  e301                     XORI            0X1
:0X22  9284                     JBS             HRAM_0X84,      2
:0X23  682e                     GOTO            HADR_0X2E
:0X24  e500                     MOVI            0X0
:0X25  999a                     JBC             HRAM_0X9A,      1
:0X26  e501                     MOVI            0X1
:0X27  e600                     MOVA            HRAM_0X0
:0X28  5000                     MOV             HRAM_0X0,       A
:0X29  e301                     XORI            0X1
:0X2a  9284                     JBS             HRAM_0X84,      2
:0X2b  682e                     GOTO            HADR_0X2E
;    {
;        PA1 = ~PA1;
:0X2c  29a8                     BTT             (_PA1_0)>>3,    1                    ;(_PA1_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;        T8NIF = 0;        //清标志位
:0X2d  a99a                     BCC             (_T8NIF_0)>>3,  1                    ;(_T8NIF_0)>>3: Bank 511    Addr: 65434    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
HADR_0X2E:
;    }
;}
:0X2e  ea00                     SECTION         0X0
:0X2f  6830                     GOTO            HADR_0X30
HADR_0X30:
:0X30  ffff                     NOP
:0X31  ffff                     NOP
:0X32  5003                     MOV             HRAM_0X3,       A
:0X33  e607                     MOVA            HRAM_0X7
:0X34  5004                     MOV             HRAM_0X4,       A
:0X35  e608                     MOVA            HRAM_0X8
:0X36  5005                     MOV             HRAM_0X5,       A
:0X37  e609                     MOVA            HRAM_0X9
:0X38  5006                     MOV             HRAM_0X6,       A
:0X39  e60a                     MOVA            HRAM_0XA
:0X3a  5012                     MOV             (CSEG_PTR+3)&7f,                A    ;(CSEG_PTR+3)&7f: Bank 0    Addr: 18     
:0X3b  e610                     MOVA            (CSEG_PTR+1)&7f                      ;(CSEG_PTR+1)&7f: Bank 0    Addr: 16     
:0X3c  5011                     MOV             (CSEG_PTR+2)&7f,                A    ;(CSEG_PTR+2)&7f: Bank 0    Addr: 17     
:0X3d  e60f                     MOVA            (CSEG_PTR)&7f                        ;(CSEG_PTR)&7f: Bank 0    Addr: 15     
:0X3e  500d                     MOV             (MUL_TEMP+2)&7f,                A    ;(MUL_TEMP+2)&7f: Bank 0    Addr: 13     
:0X3f  e60b                     MOVA            (MUL_TEMP)&7f                        ;(MUL_TEMP)&7f: Bank 0    Addr: 11     
:0X40  e688                     MOVA            HRAM_0X88
:0X41  500e                     MOV             (MUL_TEMP+3)&7f,                A    ;(MUL_TEMP+3)&7f: Bank 0    Addr: 14     
:0X42  e60c                     MOVA            (MUL_TEMP+1)&7f                      ;(MUL_TEMP+1)&7f: Bank 0    Addr: 12     
:0X43  e689                     MOVA            HRAM_0X89
:0X44  5001                     MOV             (SAVED_FSR+1)&7f,               A    ;(SAVED_FSR+1)&7f: Bank 0    Addr: 1    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X45  e682                     MOVA            HRAM_0X82
:0X46  5000                     MOV             (SAVED_FSR)&7f, A                    ;(SAVED_FSR)&7f: Bank 0    Addr: 0    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X47  e681                     MOVA            HRAM_0X81
:0X48  c181                     POP
:0X49  c189                     RETIE
HADR_0X4A:
;
;/*******************************************************
;函数名：void main(void)
;描  述：主函数，T8NCKI(PA4)上升沿计数，计数器溢出中断
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void main(void)
;{
;    RAMclear();
:0X4a  e783                     CLR             HRAM_0X83
:0X4b  ec00                     PAGE            (_RAMclear)>>11
:0X4c  6059                     CALL            HADR_0X59
:0X4d  ec00                     PAGE            (_0)>>11
;    GPIOInit();
:0X4e  ec00                     PAGE            (_GPIOInit)>>11
:0X4f  606b                     CALL            HADR_0X6B
:0X50  ec00                     PAGE            (_1)>>11
;    T8NC = 0x20;         //同步计数器模式，T8NCKI上升沿计数
:0X51  e520                     MOVI            0X20
:0X52  e6be                     MOVA            _T8NC_0                              ;_T8NC_0: Bank 511    Addr: 65470    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    T8NIE = 1;           //打开定时器溢出中断
:0X53  a199                     BSS             (_T8NIE_0)>>3,  1                    ;(_T8NIE_0)>>3: Bank 511    Addr: 65433    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    T8NIF = 0;           //清溢出标志位
:0X54  a99a                     BCC             (_T8NIF_0)>>3,  1                    ;(_T8NIF_0)>>3: Bank 511    Addr: 65434    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    GIE = 1;             //开全局中断
:0X55  a796                     BSS             (_GIE_0)>>3,    7                    ;(_GIE_0)>>3: Bank 511    Addr: 65430    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    T8NEN = 1;           //使能T8N
:0X56  a7be                     BSS             (_T8NEN_0)>>3,  7                    ;(_T8NEN_0)>>3: Bank 511    Addr: 65470    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
HADR_0X57:
;    while (1)
:0X57  c18b                     CWDT
;    }
:0X58  6857                     GOTO            HADR_0X57
HADR_0X59:
;/*******************************************************
;*Copyright(C),2020,Shanghai Eastsoft Microelectronics Co.,Ltd.
;*文件名：synchronous counter.c
;*作  者：AE Team
;*版  本：v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
;*日  期：2020/07/09
;*描  述：T8N定时器同步计数模式，时钟输入T8NCKI(PA4)，计数器溢出翻转PA1
;*备  注：本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;*******************************************************/
;#include <hic.h>
;
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH=0; IAAH<=0x03; IAAH++)
:0X59  e783                     CLR             HRAM_0X83
:0X5a  e782                     CLR             _IAAH_0                              ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
HADR_0X5B:
:0X5b  5082                     MOV             _IAAH_0,        A                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X5c  ce03                     SUBI            0X3
:0X5d  9084                     JBS             HRAM_0X84,      0
:0X5e  686a                     GOTO            HADR_0X6A
;    {
;        for (IAAL=0; IAAL<0xFF; IAAL++)
:0X5f  e781                     CLR             _IAAL_0                              ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
HADR_0X60:
:0X60  e5ff                     MOVI            0XFF
:0X61  ee81                     SUB             _IAAL_0,        A                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X62  9884                     JBC             HRAM_0X84,      0
:0X63  6867                     GOTO            HADR_0X67
;            IAD = 0x00;
:0X64  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X65  5581                     INC             _IAAL_0,        R                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X66  6860                     GOTO            HADR_0X60
HADR_0X67:
;        IAD = 0x00;
:0X67  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
:0X68  5582                     INC             _IAAH_0,        R                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    }
:0X69  685b                     GOTO            HADR_0X5B
HADR_0X6A:
;}
:0X6a  c183                     RET
HADR_0X6B:
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0X6b  e783                     CLR             HRAM_0X83
:0X6c  e5ff                     MOVI            0XFF
:0X6d  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    ANSH = 0xFF;        //选择对应端口为数字IO功能
:0X6e  e5ff                     MOVI            0XFF
:0X6f  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0X70  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PBT = 0x00;
:0X71  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PCT = 0x00;
:0X72  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PA = 0x00;
:0X73  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PB = 0x00;
:0X74  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PC = 0x00;
:0X75  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;
;    PAT4 = 1;           //T8NCKI设为输入
:0X76  a4ad                     BSS             (_PAT4_0)>>3,   4                    ;(_PAT4_0)>>3: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;    PAPU4 = 1;          //输入上拉
:0X77  a4b2                     BSS             (_PAPU4_0)>>3,  4                    ;(_PAPU4_0)>>3: Bank 511    Addr: 65458    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T8N\synchronous counter\debug\synchronous counter.obj 
;}
:0X78  c183                     RET

                                END
