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

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X83  equ  0X83
HRAM_0X84  equ  0X84
HRAM_0XC1  equ  0Xc1
HRAM_0XC5  equ  0Xc5
HRAM_0XD4  equ  0Xd4
HRAM_0XD8  equ  0Xd8
HRAM_0XDC  equ  0Xdc
HRAM_0XDD  equ  0Xdd
HRAM_0XDE  equ  0Xde
HRAM_0XDF  equ  0Xdf
HRAM_0XE1  equ  0Xe1
HRAM_0XE2  equ  0Xe2

                ORG             0X00
HADR_0X0:
:0X0  c703f000                  AJMP            HADR_0X3
                                ORG             0X2
:0X2  6800                      GOTO            HADR_0X0
HADR_0X3:
;
;/*******************************************************
;函数名：void main(void)
;描  述：主函数，T31_CH1N(PB2)输出方波，PB0高电平时T31_CH1N输出低
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void main(void) 
;{
;    RAMclear();
:0X3  e783                      CLR             HRAM_0X83
:0X4  ec00                      PAGE            (_RAMclear)>>11
:0X5  601f                      CALL            HADR_0X1F
:0X6  ec00                      PAGE            (_0)>>11
;    GPIOInit();
:0X7  ec00                      PAGE            (_GPIOInit)>>11
:0X8  6031                      CALL            HADR_0X31
:0X9  ec00                      PAGE            (_1)>>11
;    T31C0L = 0x00;        //边沿计数模式，向上计数
:0Xa  e7c1                      CLR             HRAM_0XC1
;    T31C2L = 0x08;        //禁止从模式,使能外部事件清除OCnREF
:0Xb  e508                      MOVI            0X8
:0Xc  e6c5                      MOVA            HRAM_0XC5
;    T31CH1C = 0xB0;       //使能输出比较1清零，计数器匹配T31CH1R时翻转OC1REF，CC1通道配置为输出 
:0Xd  e5b0                      MOVI            0XB0
:0Xe  e6d4                      MOVA            HRAM_0XD4
;    T31PINCL = 0x04;      //OC1N通道高电平有效，使能输出
:0Xf  e504                      MOVI            0X4
:0X10  e6d8                     MOVA            HRAM_0XD8
;    T31PRSH = 0x00;       //预分频系数1:16
:0X11  e7dd                     CLR             HRAM_0XDD
;    T31PRSL = 0x0F;
:0X12  e50f                     MOVI            0XF
:0X13  e6dc                     MOVA            HRAM_0XDC
;    T31CNTLDH = 0x01;     //重装载值，方波周期=T31CNTLD*2*分频后的时钟周期
:0X14  e501                     MOVI            0X1
:0X15  e6df                     MOVA            HRAM_0XDF
;    T31CNTLDL = 0xF4;
:0X16  e5f4                     MOVI            0XF4
:0X17  e6de                     MOVA            HRAM_0XDE
;    T31CH1RH = 0x00;      //比较寄存器1值
:0X18  e7e2                     CLR             HRAM_0XE2
;    T31CH1RL = 0x08;
:0X19  e508                     MOVI            0X8
:0X1a  e6e1                     MOVA            HRAM_0XE1
;    CHOE = 1;           //输出使能
:0X1b  a7bf                     BSS             (_CHOE_0)>>3,   7                    ;(_CHOE_0)>>3: Bank 511    Addr: 65471    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    T31EN = 1;          //使能计数器
:0X1c  a0c1                     BSS             HRAM_0XC1,      0
HADR_0X1D:
;    while (1)
:0X1d  c18b                     CWDT
;    }
:0X1e  681d                     GOTO            HADR_0X1D
HADR_0X1F:
;/*******************************************************
;*Copyright(C),2020,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输出低
;*备  注：本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;*******************************************************/
;#include <hic.h>
;
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH=0; IAAH<=0x03; IAAH++)
:0X1f  e783                     CLR             HRAM_0X83
:0X20  e782                     CLR             _IAAH_0                              ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
HADR_0X21:
:0X21  5082                     MOV             _IAAH_0,        A                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
:0X22  ce03                     SUBI            0X3
:0X23  9084                     JBS             HRAM_0X84,      0
:0X24  6830                     GOTO            HADR_0X30
;    {
;        for (IAAL=0; IAAL<0xFF; IAAL++)
:0X25  e781                     CLR             _IAAL_0                              ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
HADR_0X26:
:0X26  e5ff                     MOVI            0XFF
:0X27  ee81                     SUB             _IAAL_0,        A                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
:0X28  9884                     JBC             HRAM_0X84,      0
:0X29  682d                     GOTO            HADR_0X2D
;            IAD = 0x00;
:0X2a  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
:0X2b  5581                     INC             _IAAL_0,        R                    ;_IAAL_0: Bank 511    Addr: 65409    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
:0X2c  6826                     GOTO            HADR_0X26
HADR_0X2D:
;        IAD = 0x00;
:0X2d  e780                     CLR             _IAD_0                               ;_IAD_0: Bank 511    Addr: 65408    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
:0X2e  5582                     INC             _IAAH_0,        R                    ;_IAAH_0: Bank 511    Addr: 65410    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    }
:0X2f  6821                     GOTO            HADR_0X21
HADR_0X30:
;}
:0X30  c183                     RET
HADR_0X31:
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0X31  e783                     CLR             HRAM_0X83
:0X32  e5ff                     MOVI            0XFF
:0X33  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;	ANSH = 0xFF;        //选择对应端口为数字IO功能
:0X34  e5ff                     MOVI            0XFF
:0X35  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0X36  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PBT = 0x00;
:0X37  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PCT = 0x00;
:0X38  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PA = 0x00;
:0X39  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PB = 0x00;
:0X3a  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PC = 0x00;
:0X3b  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;
;    PBT0 = 1;           //T31_ETR设为输入
:0X3c  a0ae                     BSS             (_PBT0_0)>>3,   0                    ;(_PBT0_0)>>3: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;    PBPD0 = 1;          //使能下拉
:0X3d  a0b1                     BSS             (_PBPD0_0)>>3,  0                    ;(_PBPD0_0)>>3: Bank 511    Addr: 65457    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\T31\compare_square_output\debug\compare_square_output.obj 
;}
:0X3e  c183                     RET

                                END
