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

                MCU  ES7P169C

A    equ    0
R    equ    1
HRAM_0X10  equ  0X10
HRAM_0X11  equ  0X11
HRAM_0X12  equ  0X12
HRAM_0X13  equ  0X13
HRAM_0X14  equ  0X14
HRAM_0X15  equ  0X15
HRAM_0X16  equ  0X16
HRAM_0X17  equ  0X17
HRAM_0X18  equ  0X18
HRAM_0X19  equ  0X19
HRAM_0X1A  equ  0X1a
HRAM_0X1B  equ  0X1b
HRAM_0X1C  equ  0X1c
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_0X80  equ  0X80
HRAM_0X81  equ  0X81
HRAM_0X82  equ  0X82
HRAM_0X83  equ  0X83
HRAM_0X84  equ  0X84
HRAM_0X86  equ  0X86
HRAM_0X87  equ  0X87
HRAM_0X88  equ  0X88
HRAM_0X89  equ  0X89
HRAM_0X9  equ  0X9
HRAM_0XA  equ  0Xa
HRAM_0XC0  equ  0Xc0
HRAM_0XC1  equ  0Xc1
HRAM_0XC2  equ  0Xc2
HRAM_0XC3  equ  0Xc3
HRAM_0XC4  equ  0Xc4
HRAM_0XC5  equ  0Xc5

                ORG             0X00
HADR_0X0:
:0X0  60bd                      CALL            HADR_0XBD
:0X1  c766f000                  AJMP            HADR_0X66
                                ORG             0X3
:0X3  6800                      GOTO            HADR_0X0
: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\SPI\spi_master\debug\spi_master.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\SPI\spi_master\debug\spi_master.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 (RBIE==1 && RBIF==1)     //SPI接收中断
:0X1b  e500                     MOVI            0X0
:0X1c  a483                     BSS             HRAM_0X83,      4
:0X1d  99c2                     JBC             HRAM_0XC2,      1
:0X1e  e501                     MOVI            0X1
:0X1f  ea01                     SECTION         0X1
:0X20  e61b                     MOVA            HRAM_0X1B
:0X21  501b                     MOV             HRAM_0X1B,      A
:0X22  e301                     XORI            0X1
:0X23  9284                     JBS             HRAM_0X84,      2
:0X24  6848                     GOTO            HADR_0X48
:0X25  e500                     MOVI            0X0
:0X26  99c3                     JBC             HRAM_0XC3,      1
:0X27  e501                     MOVI            0X1
:0X28  e61b                     MOVA            HRAM_0X1B
:0X29  501b                     MOV             HRAM_0X1B,      A
:0X2a  e301                     XORI            0X1
:0X2b  9284                     JBS             HRAM_0X84,      2
:0X2c  6848                     GOTO            HADR_0X48
;    {
;        rxbuf[rxcnt++] = SPIRBR;
:0X2d  e580                     MOVI            _rxbuf
:0X2e  5e1d                     ADD             (_rxcnt)&7f,    A                    ;(_rxcnt)&7f: Bank 0    Addr: 29     
:0X2f  e61b                     MOVA            HRAM_0X1B
:0X30  e500                     MOVI            (_rxbuf)>>8
:0X31  141e                     ADDC            (_rxcnt+1)&7f,  A                    ;(_rxcnt+1)&7f: Bank 0    Addr: 30     
:0X32  e61c                     MOVA            HRAM_0X1C
:0X33  501c                     MOV             HRAM_0X1C,      A
:0X34  e682                     MOVA            HRAM_0X82
:0X35  501b                     MOV             HRAM_0X1B,      A
:0X36  e681                     MOVA            HRAM_0X81
:0X37  50c4                     MOV             HRAM_0XC4,      A
:0X38  e680                     MOVA            HRAM_0X80
:0X39  c201                     ISTEP           0X1
:0X3a  551d                     INC             (_rxcnt)&7f,    R                    ;(_rxcnt)&7f: Bank 0    Addr: 29     
:0X3b  9284                     JBS             HRAM_0X84,      2
:0X3c  683e                     GOTO            HADR_0X3E
:0X3d  551e                     INC             (_rxcnt+1)&7f,  R                    ;(_rxcnt+1)&7f: Bank 0    Addr: 30     
HADR_0X3E:
;        if (rxcnt > RXBUF_SIZE - 1)
:0X3e  501e                     MOV             (_rxcnt+1)&7f,  A                    ;(_rxcnt+1)&7f: Bank 0    Addr: 30     
:0X3f  ce00                     SUBI            0X0
:0X40  9284                     JBS             HRAM_0X84,      2
:0X41  6844                     GOTO            HADR_0X44
:0X42  501d                     MOV             (_rxcnt)&7f,    A                    ;(_rxcnt)&7f: Bank 0    Addr: 29     
:0X43  ce07                     SUBI            0X7
HADR_0X44:
:0X44  9884                     JBC             HRAM_0X84,      0
:0X45  6848                     GOTO            HADR_0X48
;            rxcnt = 0;
:0X46  e71d                     CLR             (_rxcnt)&7f                          ;(_rxcnt)&7f: Bank 0    Addr: 29     
:0X47  e71e                     CLR             (_rxcnt+1)&7f                        ;(_rxcnt+1)&7f: Bank 0    Addr: 30     
HADR_0X48:
;    }
:0X48  af9a                     BCC             (_SPI_GIEIF_0)>>3,              7    ;(_SPI_GIEIF_0)>>3: Bank 511    Addr: 65434    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;}
:0X49  ea00                     SECTION         0X0
:0X4a  ac83                     BCC             HRAM_0X83,      4
:0X4b  684c                     GOTO            HADR_0X4C
HADR_0X4C:
:0X4c  ffff                     NOP
:0X4d  ffff                     NOP
:0X4e  5003                     MOV             HRAM_0X3,       A
:0X4f  e607                     MOVA            HRAM_0X7
:0X50  5004                     MOV             HRAM_0X4,       A
:0X51  e608                     MOVA            HRAM_0X8
:0X52  5005                     MOV             HRAM_0X5,       A
:0X53  e609                     MOVA            HRAM_0X9
:0X54  5006                     MOV             HRAM_0X6,       A
:0X55  e60a                     MOVA            HRAM_0XA
:0X56  5012                     MOV             (CSEG_PTR+3)&7f,                A    ;(CSEG_PTR+3)&7f: Bank 0    Addr: 18     
:0X57  e610                     MOVA            (CSEG_PTR+1)&7f                      ;(CSEG_PTR+1)&7f: Bank 0    Addr: 16     
:0X58  5011                     MOV             (CSEG_PTR+2)&7f,                A    ;(CSEG_PTR+2)&7f: Bank 0    Addr: 17     
:0X59  e60f                     MOVA            (CSEG_PTR)&7f                        ;(CSEG_PTR)&7f: Bank 0    Addr: 15     
:0X5a  500d                     MOV             (MUL_TEMP+2)&7f,                A    ;(MUL_TEMP+2)&7f: Bank 0    Addr: 13     
:0X5b  e60b                     MOVA            (MUL_TEMP)&7f                        ;(MUL_TEMP)&7f: Bank 0    Addr: 11     
:0X5c  e688                     MOVA            HRAM_0X88
:0X5d  500e                     MOV             (MUL_TEMP+3)&7f,                A    ;(MUL_TEMP+3)&7f: Bank 0    Addr: 14     
:0X5e  e60c                     MOVA            (MUL_TEMP+1)&7f                      ;(MUL_TEMP+1)&7f: Bank 0    Addr: 12     
:0X5f  e689                     MOVA            HRAM_0X89
:0X60  5001                     MOV             (SAVED_FSR+1)&7f,               A    ;(SAVED_FSR+1)&7f: Bank 0    Addr: 1    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
:0X61  e682                     MOVA            HRAM_0X82
:0X62  5000                     MOV             (SAVED_FSR)&7f, A                    ;(SAVED_FSR)&7f: Bank 0    Addr: 0    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
:0X63  e681                     MOVA            HRAM_0X81
:0X64  c181                     POP
:0X65  c189                     RETIE
HADR_0X66:
;
;/**********************************************
;函数名：void main(void) 
;描  述：主函数
;输入值：无
;输出值：无
;返回值：无
;**********************************************/
;void main(void) 
;{
;    uint i;
;    GPIOInit();
:0X66  e783                     CLR             HRAM_0X83
:0X67  ec00                     PAGE            (_GPIOInit)>>11
:0X68  60e4                     CALL            HADR_0XE4
:0X69  ec00                     PAGE            (_0)>>11
;    Init_spi();
:0X6a  ec00                     PAGE            (_Init_spi)>>11
:0X6b  60f1                     CALL            HADR_0XF1
:0X6c  ec00                     PAGE            (_1)>>11
;    SPI_GIEIE = 1;  //打开SPI中断
:0X6d  a799                     BSS             (_SPI_GIEIE_0)>>3,              7    ;(_SPI_GIEIE_0)>>3: Bank 511    Addr: 65433    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    GIE = 1;    //打开总中断
:0X6e  a796                     BSS             (_GIE_0)>>3,    7                    ;(_GIE_0)>>3: Bank 511    Addr: 65430    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
HADR_0X6F:
;
;    while(1)
:0X6f  e580                     MOVI            _rxbuf
:0X70  ea01                     SECTION         0X1
:0X71  e612                     MOVA            HRAM_0X12
:0X72  e500                     MOVI            (_rxbuf)>>8
:0X73  e613                     MOVA            HRAM_0X13
:0X74  e508                     MOVI            0X8
:0X75  e614                     MOVA            HRAM_0X14
:0X76  e500                     MOVI            0X0
:0X77  ec00                     PAGE            (_SPIReadData)>>11
:0X78  612f                     CALL            HADR_0X12F
:0X79  ec00                     PAGE            (_2)>>11
;		for(i = 0;i<10000;i++);
:0X7a  ea01                     SECTION         0X1
:0X7b  e710                     CLR             HRAM_0X10
:0X7c  e711                     CLR             HRAM_0X11
HADR_0X7D:
:0X7d  e527                     MOVI            0X27
:0X7e  ee11                     SUB             HRAM_0X11,      A
:0X7f  9284                     JBS             HRAM_0X84,      2
:0X80  6883                     GOTO            HADR_0X83
:0X81  e510                     MOVI            0X10
:0X82  ee10                     SUB             HRAM_0X10,      A
HADR_0X83:
:0X83  9884                     JBC             HRAM_0X84,      0
:0X84  688a                     GOTO            HADR_0X8A
:0X85  5510                     INC             HRAM_0X10,      R
:0X86  9284                     JBS             HRAM_0X84,      2
:0X87  6889                     GOTO            HADR_0X89
:0X88  5511                     INC             HRAM_0X11,      R
HADR_0X89:
:0X89  687d                     GOTO            HADR_0X7D
HADR_0X8A:
;
;		SPIWriteData(txbuf,8);
:0X8a  e588                     MOVI            _txbuf
:0X8b  e612                     MOVA            HRAM_0X12
:0X8c  e500                     MOVI            (_txbuf)>>8
:0X8d  e613                     MOVA            HRAM_0X13
:0X8e  e508                     MOVI            0X8
:0X8f  e614                     MOVA            HRAM_0X14
:0X90  e500                     MOVI            0X0
:0X91  ec00                     PAGE            (_SPIWriteData)>>11
:0X92  60fe                     CALL            HADR_0XFE
:0X93  ec00                     PAGE            (_3)>>11
;		for(i = 0;i<10000;i++);
:0X94  ea01                     SECTION         0X1
:0X95  e710                     CLR             HRAM_0X10
:0X96  e711                     CLR             HRAM_0X11
HADR_0X97:
:0X97  e527                     MOVI            0X27
:0X98  ee11                     SUB             HRAM_0X11,      A
:0X99  9284                     JBS             HRAM_0X84,      2
:0X9a  689d                     GOTO            HADR_0X9D
:0X9b  e510                     MOVI            0X10
:0X9c  ee10                     SUB             HRAM_0X10,      A
HADR_0X9D:
:0X9d  9884                     JBC             HRAM_0X84,      0
:0X9e  68a4                     GOTO            HADR_0XA4
:0X9f  5510                     INC             HRAM_0X10,      R
:0Xa0  9284                     JBS             HRAM_0X84,      2
:0Xa1  68a3                     GOTO            HADR_0XA3
:0Xa2  5511                     INC             HRAM_0X11,      R
HADR_0XA3:
:0Xa3  6897                     GOTO            HADR_0X97
HADR_0XA4:
;
;		CLRWDT();
:0Xa4  c18b                     CWDT
;    }
:0Xa5  686f                     GOTO            HADR_0X6F
HADR_0XA6:
:0Xa6  5f86                     ADD             HRAM_0X86,      R
:0Xa7  e402                     RETIA           0X2
:0Xa8  e488                     RETIA           0X88
:0Xa9  e408                     RETIA           0X8
:0Xaa  e400                     RETIA           0X0
:0Xab  e401                     RETIA           0X1
:0Xac  e402                     RETIA           0X2
:0Xad  e403                     RETIA           0X3
:0Xae  e404                     RETIA           0X4
:0Xaf  e405                     RETIA           0X5
:0Xb0  e406                     RETIA           0X6
:0Xb1  e407                     RETIA           0X7
:0Xb2  e480                     RETIA           0X80
:0Xb3  e408                     RETIA           0X8
:0Xb4  e400                     RETIA           0X0
:0Xb5  e400                     RETIA           0X0
:0Xb6  e400                     RETIA           0X0
:0Xb7  e400                     RETIA           0X0
:0Xb8  e400                     RETIA           0X0
:0Xb9  e400                     RETIA           0X0
:0Xba  e400                     RETIA           0X0
:0Xbb  e400                     RETIA           0X0
:0Xbc  e400                     RETIA           0X0
HADR_0XBD:
:0Xbd  e783                     CLR             HRAM_0X83
:0Xbe  e500                     MOVI            (#_CINIT)>>8
:0Xbf  e687                     MOVA            HRAM_0X87
:0Xc0  e500                     MOVI            0X0
:0Xc1  e607                     MOVA            ?_TMP                                ;?_TMP: Bank 0    Addr: 7     
:0Xc2  5007                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 7     
:0Xc3  ec00                     PAGE            (#_CINIT)>>11
:0Xc4  60a6                     CALL            HADR_0XA6
:0Xc5  e608                     MOVA            ?_TMP+1                              ;?_TMP+1: Bank 0    Addr: 8     
:0Xc6  5108                     MOV             ?_TMP+1,        R                    ;?_TMP+1: Bank 0    Addr: 8     
:0Xc7  9a84                     JBC             HRAM_0X84,      2
:0Xc8  c183                     RET
HADR_0XC9:
:0Xc9  5507                     INC             ?_TMP,          R                    ;?_TMP: Bank 0    Addr: 7     
:0Xca  5007                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 7     
:0Xcb  ec00                     PAGE            (#_CINIT)>>11
:0Xcc  60a6                     CALL            HADR_0XA6
:0Xcd  e609                     MOVA            ?_TMP+2                              ;?_TMP+2: Bank 0    Addr: 9     
:0Xce  5507                     INC             ?_TMP,          R                    ;?_TMP: Bank 0    Addr: 7     
:0Xcf  5007                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 7     
:0Xd0  ec00                     PAGE            (#_CINIT)>>11
:0Xd1  60a6                     CALL            HADR_0XA6
:0Xd2  e60a                     MOVA            ?_TMP+3                              ;?_TMP+3: Bank 0    Addr: 10     
:0Xd3  60d7                     CALL            HADR_0XD7
:0Xd4  5708                     JDEC            HRAM_0X8,       R
:0Xd5  68c9                     GOTO            HADR_0XC9
:0Xd6  c183                     RET
HADR_0XD7:
:0Xd7  5009                     MOV             ?_TMP+2,        A                    ;?_TMP+2: Bank 0    Addr: 9     
:0Xd8  e681                     MOVA            HRAM_0X81
:0Xd9  e500                     MOVI            0X0
:0Xda  e682                     MOVA            HRAM_0X82
:0Xdb  5507                     INC             ?_TMP,          R                    ;?_TMP: Bank 0    Addr: 7     
:0Xdc  5007                     MOV             ?_TMP,          A                    ;?_TMP: Bank 0    Addr: 7     
:0Xdd  ec00                     PAGE            (#_CINIT)>>11
:0Xde  60a6                     CALL            HADR_0XA6
:0Xdf  e680                     MOVA            HRAM_0X80
:0Xe0  5509                     INC             ?_TMP+2,        R                    ;?_TMP+2: Bank 0    Addr: 9     
:0Xe1  570a                     JDEC            HRAM_0XA,       R
:0Xe2  68d7                     GOTO            HADR_0XD7
:0Xe3  c183                     RET
HADR_0XE4:
;/*********************************************************
;*Copyright (C), 2020, Shanghai Eastsoft Microelectronics Co., Ltd
;*文件名:  spi_master.c
;*作  者:  AE Team
;*版  本:  v1.0，编译于iDesigner(v4.2.3.166) + 工具链HRCC(v1.2.0.106)
;*日  期:  2020/07/08
;*描  述:  SPI主机模式演示
;          PA6：NSS
;          PB4：SCK
;          PB5：MOSI
;          PB6：MISO
;*备  注:  本软件仅供学习和演示使用，对用户直接引用代码所带来的风险或后果不承担任何法律责任。
;**********************************************************/
;#include <hic.h>
;
;#define IT_RECEIVE      //将这句注释掉采用查询接收，否则采用中断接收
;#define RXBUF_SIZE 8       //定义接收缓冲区长度
;#define CLRWDT()   {__Asm CWDT;}        //宏定义清狗指令
;
;typedef unsigned char uchar;
;typedef unsigned int uint;
;
;uchar txbuf[8] = {0,1,2,3,4,5,6,7};
;uchar rxbuf[RXBUF_SIZE] = {0};
;uint rxcnt;
;
;/******************************************************
;函数名：void RAMclear(void)
;描  述：RAM区数据清零，RAM区地址0x0000~0x03FF
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void RAMclear(void)
;{
;    for (IAAH=0; IAAH<=0x03; IAAH++)
;    {
;        for (IAAL=0; IAAL<0xFF; IAAL++)
;            IAD = 0x00;
;        IAD = 0x00;
;    }
;}
;
;/******************************************************
;函数名：void GPIOInit(void)
;描  述：首先初始化所有未用到的IO口为输出低电平
;输入值：无
;输出值：无
;返回值：无
;*******************************************************/
;void GPIOInit(void)
;{
;    ANSL = 0xFF;        //选择对应端口为数字IO功能
:0Xe4  e783                     CLR             HRAM_0X83
:0Xe5  e5ff                     MOVI            0XFF
:0Xe6  e6bc                     MOVA            _ANSL_0                              ;_ANSL_0: Bank 511    Addr: 65468    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;	ANSH = 0xFF;
:0Xe7  e5ff                     MOVI            0XFF
:0Xe8  e68d                     MOVA            _ANSH_0                              ;_ANSH_0: Bank 511    Addr: 65421    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PAT = 0x00;         //所有IO设为输出低电平
:0Xe9  e7ad                     CLR             _PAT_0                               ;_PAT_0: Bank 511    Addr: 65453    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PBT = 0x00;
:0Xea  e7ae                     CLR             _PBT_0                               ;_PBT_0: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PCT = 0x00;
:0Xeb  e7af                     CLR             _PCT_0                               ;_PCT_0: Bank 511    Addr: 65455    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PA = 0x00;
:0Xec  e7a8                     CLR             _PA_0                                ;_PA_0: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PB = 0x00;
:0Xed  e7a9                     CLR             _PB_0                                ;_PB_0: Bank 511    Addr: 65449    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PC = 0x00;
:0Xee  e7aa                     CLR             _PC_0                                ;_PC_0: Bank 511    Addr: 65450    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    PBT6 = 1;       //主机MISO设为输入
:0Xef  a6ae                     BSS             (_PBT6_0)>>3,   6                    ;(_PBT6_0)>>3: Bank 511    Addr: 65454    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;}
:0Xf0  c183                     RET
HADR_0XF1:
;
;/**********************************************
;函数名：void Init_spi(void)
;描  述：SPI初始化程序
;输入值：无
;输出值：无
;返回值：无
;**********************************************/
;void Init_spi(void)
;{
;    SPIRST = 1;     //复位SPI
:0Xf1  e783                     CLR             HRAM_0X83
:0Xf2  a483                     BSS             HRAM_0X83,      4
:0Xf3  a1c1                     BSS             HRAM_0XC1,      1
HADR_0XF4:
;    while(SPIRST)
:0Xf4  99c1                     JBC             HRAM_0XC1,      1
:0Xf5  68f4                     GOTO            HADR_0XF4
;        ;
;    SPICON0 = 0xF0;       //CKS = Fosc/16，清空发送器、接收器
:0Xf6  e5f0                     MOVI            0XF0
:0Xf7  e6c0                     MOVA            HRAM_0XC0
;    SPICON1 |= 0<<6;      //0:上升沿发送（先），下降沿接收（后）；
;    MS = 0;               //0：主机模式，1：从机模式
:0Xf8  aac1                     BCC             HRAM_0XC1,      2
;#ifdef IT_RECEIVE
;    RBIE = 1;       //打开接收中断
:0Xf9  a1c2                     BSS             HRAM_0XC2,      1
;#else
;    RBIE = 0;       //关闭接收中断
;#endif
;    REN = 1;        //打开接收
:0Xfa  a3c1                     BSS             HRAM_0XC1,      3
;    SPIEN = 1;      //SPI使能
:0Xfb  a0c1                     BSS             HRAM_0XC1,      0
;}
:0Xfc  ac83                     BCC             HRAM_0X83,      4
:0Xfd  c183                     RET
HADR_0XFE:
:0Xfe  ea01                     SECTION         0X1
:0Xff  e615                     MOVA            HRAM_0X15
;/**********************************************
;函数名：void SPIWriteData(uchar *wbuf,uint n)
;描  述：SPI数据发送程序
;输入值：发送数据起始地址和发送的数据个数
;输出值：无
;返回值：无
;**********************************************/
;void SPIWriteData(uchar *wbuf,uint n)
;{
;    uchar i;
;    PA6 = 0;    //片选拉低
:0X100  aea8                    BCC             (_PA6_0)>>3,    6                   ;(_PA6_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    for (i=0; i<255; i++)     //延时等待从机准备
:0X101  e716                    CLR             HRAM_0X16
HADR_0X102:
:0X102  e5ff                    MOVI            0XFF
:0X103  ee16                    SUB             HRAM_0X16,      A
:0X104  9884                    JBC             HRAM_0X84,      0
:0X105  6908                    GOTO            HADR_0X108
:0X106  5516                    INC             HRAM_0X16,      R
;        ;
:0X107  6902                    GOTO            HADR_0X102
HADR_0X108:
;    for (i=0 ;i<n; i++)
:0X108  e716                    CLR             HRAM_0X16
HADR_0X109:
:0X109  e718                    CLR             HRAM_0X18
:0X10a  5016                    MOV             HRAM_0X16,      A
:0X10b  e617                    MOVA            HRAM_0X17
:0X10c  5015                    MOV             HRAM_0X15,      A
:0X10d  ee18                    SUB             HRAM_0X18,      A
:0X10e  9284                    JBS             HRAM_0X84,      2
:0X10f  6912                    GOTO            HADR_0X112
:0X110  5014                    MOV             HRAM_0X14,      A
:0X111  ee17                    SUB             HRAM_0X17,      A
HADR_0X112:
:0X112  9884                    JBC             HRAM_0X84,      0
:0X113  692b                    GOTO            HADR_0X12B
;    {
;        SPITBW = *(wbuf+i);
:0X114  e718                    CLR             HRAM_0X18
:0X115  5016                    MOV             HRAM_0X16,      A
:0X116  e617                    MOVA            HRAM_0X17
:0X117  5017                    MOV             HRAM_0X17,      A
:0X118  5e12                    ADD             HRAM_0X12,      A
:0X119  e619                    MOVA            HRAM_0X19
:0X11a  5018                    MOV             HRAM_0X18,      A
:0X11b  1413                    ADDC            HRAM_0X13,      A
:0X11c  e61a                    MOVA            HRAM_0X1A
:0X11d  501a                    MOV             HRAM_0X1A,      A
:0X11e  e682                    MOVA            HRAM_0X82
:0X11f  5019                    MOV             HRAM_0X19,      A
:0X120  e681                    MOVA            HRAM_0X81
:0X121  5080                    MOV             HRAM_0X80,      A
:0X122  2007                    MOVAR           ?_TMP                               ;?_TMP: Bank 0    Addr: 7     
:0X123  7807                    MOVRA           ?_TMP                               ;?_TMP: Bank 0    Addr: 7     
:0X124  a483                    BSS             HRAM_0X83,      4
:0X125  e6c5                    MOVA            HRAM_0XC5
HADR_0X126:
;        while(!IDIF);
:0X126  94c3                    JBS             HRAM_0XC3,      4
:0X127  6926                    GOTO            HADR_0X126
;        CLRWDT();
:0X128  c18b                    CWDT
:0X129  5516                    INC             HRAM_0X16,      R
;    }
:0X12a  6909                    GOTO            HADR_0X109
HADR_0X12B:
;    PA6 = 1;
:0X12b  a6a8                    BSS             (_PA6_0)>>3,    6                   ;(_PA6_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;}
:0X12c  ea00                    SECTION         0X0
:0X12d  ac83                    BCC             HRAM_0X83,      4
:0X12e  c183                    RET
HADR_0X12F:
:0X12f  ea01                    SECTION         0X1
:0X130  e615                    MOVA            HRAM_0X15
;
;/**********************************************
;函数名：void SPIReadData(uchar *rbuf,uint n)
;描  述：SPI数据接收程序
;输入值：接收起始地址和发送的数据个数
;输出值：接收到的数据
;返回值：无
;**********************************************/
;void SPIReadData(uchar *rbuf,uint n)
;{
;    uint i;
;    PA6 = 0;        //片选拉低
:0X131  aea8                    BCC             (_PA6_0)>>3,    6                   ;(_PA6_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    for (i = 0;i<1000;i++)    //延时等待从机准备
:0X132  e716                    CLR             HRAM_0X16
:0X133  e717                    CLR             HRAM_0X17
HADR_0X134:
:0X134  e503                    MOVI            0X3
:0X135  ee17                    SUB             HRAM_0X17,      A
:0X136  9284                    JBS             HRAM_0X84,      2
:0X137  693a                    GOTO            HADR_0X13A
:0X138  e5e8                    MOVI            0XE8
:0X139  ee16                    SUB             HRAM_0X16,      A
HADR_0X13A:
:0X13a  9884                    JBC             HRAM_0X84,      0
:0X13b  6941                    GOTO            HADR_0X141
:0X13c  5516                    INC             HRAM_0X16,      R
:0X13d  9284                    JBS             HRAM_0X84,      2
:0X13e  6940                    GOTO            HADR_0X140
:0X13f  5517                    INC             HRAM_0X17,      R
HADR_0X140:
;        ;
:0X140  6934                    GOTO            HADR_0X134
HADR_0X141:
;
;    rxcnt = 0;      //接收计数复位
:0X141  e71d                    CLR             (_rxcnt)&7f                         ;(_rxcnt)&7f: Bank 0    Addr: 29     
:0X142  e71e                    CLR             (_rxcnt+1)&7f                       ;(_rxcnt+1)&7f: Bank 0    Addr: 30     
;    REN = 1;        //读数据时打开接收
:0X143  a483                    BSS             HRAM_0X83,      4
:0X144  a3c1                    BSS             HRAM_0XC1,      3
;
;    for (i=0; i<n; i++)
:0X145  e716                    CLR             HRAM_0X16
:0X146  e717                    CLR             HRAM_0X17
HADR_0X147:
:0X147  5015                    MOV             HRAM_0X15,      A
:0X148  ee17                    SUB             HRAM_0X17,      A
:0X149  9284                    JBS             HRAM_0X84,      2
:0X14a  694d                    GOTO            HADR_0X14D
:0X14b  5014                    MOV             HRAM_0X14,      A
:0X14c  ee16                    SUB             HRAM_0X16,      A
HADR_0X14D:
:0X14d  9884                    JBC             HRAM_0X84,      0
:0X14e  696a                    GOTO            HADR_0X16A
;    {
;		SPITBW = 0xFF;  //写数据
:0X14f  e5ff                    MOVI            0XFF
:0X150  e6c5                    MOVA            HRAM_0XC5
HADR_0X151:
;        while(!IDIF);      //等待发送完成
:0X151  94c3                    JBS             HRAM_0XC3,      4
:0X152  6951                    GOTO            HADR_0X151
;
;        if (RBIE == 0)
:0X153  99c2                    JBC             HRAM_0XC2,      1
:0X154  6964                    GOTO            HADR_0X164
HADR_0X155:
;        {
;            while (!RBIF);          //等待接收完成
:0X155  91c3                    JBS             HRAM_0XC3,      1
:0X156  6955                    GOTO            HADR_0X155
;            *(rbuf+i) = SPIRBR;     //读数据
:0X157  5012                    MOV             HRAM_0X12,      A
:0X158  5e16                    ADD             HRAM_0X16,      A
:0X159  e618                    MOVA            HRAM_0X18
:0X15a  5013                    MOV             HRAM_0X13,      A
:0X15b  1417                    ADDC            HRAM_0X17,      A
:0X15c  e619                    MOVA            HRAM_0X19
:0X15d  5019                    MOV             HRAM_0X19,      A
:0X15e  e682                    MOVA            HRAM_0X82
:0X15f  5018                    MOV             HRAM_0X18,      A
:0X160  e681                    MOVA            HRAM_0X81
:0X161  50c4                    MOV             HRAM_0XC4,      A
:0X162  e680                    MOVA            HRAM_0X80
:0X163  c201                    ISTEP           0X1
HADR_0X164:
;        }
:0X164  c18b                    CWDT
:0X165  5516                    INC             HRAM_0X16,      R
:0X166  9284                    JBS             HRAM_0X84,      2
:0X167  6969                    GOTO            HADR_0X169
:0X168  5517                    INC             HRAM_0X17,      R
HADR_0X169:
;    }
:0X169  6947                    GOTO            HADR_0X147
HADR_0X16A:
;    PA6 = 1;
:0X16a  a6a8                    BSS             (_PA6_0)>>3,    6                   ;(_PA6_0)>>3: Bank 511    Addr: 65448    C:\Users\lisq\Desktop\AN135_Examples_ES7P169C\SPI\spi_master\debug\spi_master.obj 
;    REN = 0;  
:0X16b  abc1                    BCC             HRAM_0XC1,      3
;}
:0X16c  ea00                    SECTION         0X0
:0X16d  ac83                    BCC             HRAM_0X83,      4
:0X16e  c183                    RET

                                END
